Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ cornamusa types #326

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cuenca_validations/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
'CardIssuer',
'CardNetwork',
'CardQuery',
'CardRequestQuery',
'CardRequestRequest',
'CardRequestUpdateRequest',
'CardStatus',
'CardTransactionQuery',
'CardTransactionType',
Expand All @@ -25,6 +28,8 @@
'CurpField',
'CurpValidationRequest',
'CommissionType',
'DeliveryType',
'DeliveryStatus',
'DepositNetwork',
'DepositQuery',
'EcommerceIndicator',
Expand Down Expand Up @@ -116,6 +121,8 @@
CardType,
CommissionType,
Country,
DeliveryStatus,
DeliveryType,
DepositNetwork,
EcommerceIndicator,
EntryType,
Expand Down Expand Up @@ -169,6 +176,7 @@
BankAccountValidationQuery,
BillPaymentQuery,
CardQuery,
CardRequestQuery,
CardTransactionQuery,
DepositQuery,
EventQuery,
Expand All @@ -187,6 +195,8 @@
from .requests import (
ApiKeyUpdateRequest,
BankAccountValidationRequest,
CardRequestRequest,
CardRequestUpdateRequest,
CurpValidationRequest,
EndpointRequest,
EndpointUpdateRequest,
Expand Down
23 changes: 23 additions & 0 deletions cuenca_validations/types/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,3 +640,26 @@ class BankAccountStatus(str, Enum):
created = 'created'
succeeded = 'succeeded'
failed = 'failed'


class DeliveryType(str, Enum):
# domestic = 'domestic'
# local = 'local'
local_next_day = 'local_next_day'
# domestic_apl = 'domestic_apl'
local_minutes = 'local_99_minutes'
domestic_estafeta = 'estafeta'


class DeliveryStatus(str, Enum):
arriving = 'arriving'
cancelled = 'cancelled'
confirmed = 'confirmed'
created = 'created'
delivered = 'delivered'
in_process = 'in_process'
not_requested = 'not_requested'
on_the_way = 'on_the_way'
ready_to_order = 'ready_to_order'
visited = 'visited'
# unknown = 'unknown'
7 changes: 7 additions & 0 deletions cuenca_validations/types/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
CardIssuer,
CardStatus,
CardType,
DeliveryStatus,
DeliveryType,
EventType,
KYCFileType,
SessionType,
Expand Down Expand Up @@ -184,3 +186,8 @@ class FileQuery(QueryParams):
class BankAccountValidationQuery(QueryParams):
account_number: Optional[str] = None
status: Optional[BankAccountStatus] = None


class CardRequestQuery(QueryParams):
status: Optional[DeliveryStatus] = None
delivery_type: Optional[DeliveryType] = None
24 changes: 24 additions & 0 deletions cuenca_validations/types/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
CardStatus,
CardType,
Country,
DeliveryStatus,
DeliveryType,
EcommerceIndicator,
FileExtension,
Gender,
Expand Down Expand Up @@ -656,3 +658,25 @@ class KYCValidationRequest(BaseRequest):

class BankAccountValidationRequest(BaseModel):
account_number: Union[Clabe, PaymentCardNumber]


class CardRequestRequest(BaseRequest):
user_id: str
delivery_type: DeliveryType
latitude: str
longitude: str
external_number: str
internal_number: Optional[str]
street: str
city: str
colonia: str
postal_code: str
full_address: str
recipient_phone: str
recipient_name: str
recipient_email: str


class CardRequestUpdateRequest(BaseRequest):
status: Optional[DeliveryStatus]
delivery_type: Optional[DeliveryType]
2 changes: 1 addition & 1 deletion cuenca_validations/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.11.16'
__version__ = '0.11.17.dev5'