-
Notifications
You must be signed in to change notification settings - Fork 0
feat: webapp PM portal types #420
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
base: main
Are you sure you want to change the base?
Changes from all commits
05bbaaf
8d27d6c
d09f50e
125d880
96c53cb
9534eb7
9d8d3c7
f0477bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| CardType, | ||
| EventType, | ||
| KYCFileType, | ||
| OperationalEventAction, | ||
| SessionType, | ||
| TermsOfService, | ||
| TransferNetwork, | ||
|
|
@@ -153,6 +154,15 @@ class AccountQuery(QueryParams): | |
| account_number: Optional[str] = None | ||
|
|
||
|
|
||
| class OperationalEventQuery(QueryParams): | ||
| actor_id: Optional[str] = None | ||
| action: Optional[OperationalEventAction] = None | ||
|
Comment on lines
+157
to
+159
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Add The new public query model has no examples for 🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| class OperatorQuery(QueryParams): | ||
| email: Optional[EmailStr] = None | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Operator query skips email normalizationMedium Severity
Reviewed by Cursor Bugbot for commit fb872e5. Configure here. |
||
|
|
||
|
|
||
| class BalanceEntryQuery(QueryParams): | ||
| funding_instrument_uri: Optional[str] = None | ||
| wallet_id: str = 'default' | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |||||||||
|
|
||||||||||
| from ..types.enums import ( | ||||||||||
| AccountUseType, | ||||||||||
| AccountValidationStatus, | ||||||||||
| AuthorizerTransaction, | ||||||||||
| CardDesign, | ||||||||||
| CardFundingType, | ||||||||||
|
|
@@ -36,6 +37,8 @@ | |||||||||
| KYCValidationSource, | ||||||||||
| MonthlyMovementsType, | ||||||||||
| MonthlySpendingType, | ||||||||||
| OperatorRole, | ||||||||||
| OperatorStatus, | ||||||||||
| PlatformType, | ||||||||||
| PosCapability, | ||||||||||
| Profession, | ||||||||||
|
|
@@ -629,11 +632,29 @@ class UserLoginRequest(BaseRequest): | |||||||||
| ) | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class SessionMetadata(BaseModel): | ||||||||||
| operator_id: Optional[str] = None | ||||||||||
| model_config = ConfigDict(extra='forbid') | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class SessionResponse(BaseModel): | ||||||||||
| id: str | ||||||||||
| created_at: dt.datetime | ||||||||||
| user_id: str | ||||||||||
| platform_id: str | ||||||||||
| expires_at: dt.datetime | ||||||||||
| type: SessionType | ||||||||||
| success_url: Optional[SerializableAnyUrl] = None | ||||||||||
| failure_url: Optional[SerializableAnyUrl] = None | ||||||||||
| metadata: Optional[SessionMetadata] = None | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class SessionRequest(BaseRequest): | ||||||||||
| user_id: str | ||||||||||
| type: SessionType | ||||||||||
| success_url: Optional[SerializableAnyUrl] = None | ||||||||||
| failure_url: Optional[SerializableAnyUrl] = None | ||||||||||
| metadata: Optional[SessionMetadata] = None | ||||||||||
| model_config = ConfigDict( | ||||||||||
| json_schema_extra={ | ||||||||||
| 'example': { | ||||||||||
|
|
@@ -735,6 +756,39 @@ class LimitedWalletRequest(BaseRequest): | |||||||||
| allowed_rfc: Optional[Rfc] = None | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class AccountRequest(BaseRequest): | ||||||||||
| name: StrictStr | ||||||||||
| account_number: Clabe | ||||||||||
| alias: Optional[StrictStr] = None | ||||||||||
| curp: Optional[Curp] = None | ||||||||||
| rfc: Optional[Rfc] = None | ||||||||||
|
|
||||||||||
| model_config = ConfigDict( | ||||||||||
| json_schema_extra={ | ||||||||||
| 'example': { | ||||||||||
| 'name': 'Aceros del Norte SA de CV', | ||||||||||
| 'account_number': '072691004495711499', | ||||||||||
| 'alias': 'Proveedor acero', | ||||||||||
| } | ||||||||||
| }, | ||||||||||
| ) | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class AccountUpdateRequest(BaseRequest): | ||||||||||
| name: Optional[StrictStr] = None | ||||||||||
| alias: Optional[StrictStr] = None | ||||||||||
| validation_status: Optional[AccountValidationStatus] = None | ||||||||||
|
|
||||||||||
| model_config = ConfigDict( | ||||||||||
| json_schema_extra={ | ||||||||||
| 'example': { | ||||||||||
| 'alias': 'Fletes', | ||||||||||
| 'validation_status': 'verified', | ||||||||||
| } | ||||||||||
| }, | ||||||||||
| ) | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class PlatformRequest(BaseModel): | ||||||||||
| name: str | ||||||||||
| rfc: Optional[str] = None | ||||||||||
|
|
@@ -891,13 +945,111 @@ class LegalPersonRequest(BaseRequest): | |||||||||
| }, | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| @field_validator('rfc') | ||||||||||
| @classmethod | ||||||||||
| def validate_legal_rfc(cls, rfc: Rfc) -> Rfc: | ||||||||||
| if len(rfc) != 12: | ||||||||||
| raise ValueError('RFC must be 12 characters for legal persons') | ||||||||||
| return rfc | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class LegalPersonUpdateRequest(BaseRequest): | ||||||||||
| legal_name: Optional[str] = None | ||||||||||
| rfc: Optional[Rfc] = None | ||||||||||
| address: Optional[AddressRequest] = None | ||||||||||
| legal_representatives: Optional[list[LegalRepresentative]] = None | ||||||||||
|
|
||||||||||
| @model_validator(mode="before") | ||||||||||
| @classmethod | ||||||||||
| def check_at_least_one_param(cls, values: DictStrAny) -> DictStrAny: | ||||||||||
| if not values: | ||||||||||
| raise ValueError('At least one parameter must be provided') | ||||||||||
|
Comment on lines
+965
to
+966
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Reject update requests that contain only
Proposed fix- if not values:
+ if not values or all(value is None for value in values.values()):
raise ValueError('At least one parameter must be provided')📝 Committable suggestion
Suggested change
📍 Affects 1 file
🤖 Prompt for AI Agents |
||||||||||
| return values | ||||||||||
|
|
||||||||||
| @field_validator('rfc') | ||||||||||
| @classmethod | ||||||||||
| def validate_legal_rfc(cls, rfc: Optional[Rfc]) -> Optional[Rfc]: | ||||||||||
| if rfc is not None and len(rfc) != 12: | ||||||||||
| raise ValueError('RFC must be 12 characters for legal persons') | ||||||||||
| return rfc | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class OperatorRequest(BaseRequest): | ||||||||||
| name: str | ||||||||||
| email: EmailStr | ||||||||||
| phone: PhoneNumber | ||||||||||
| company_user_id: str | ||||||||||
| role: OperatorRole | ||||||||||
| status: OperatorStatus = OperatorStatus.active | ||||||||||
|
|
||||||||||
| model_config = ConfigDict( | ||||||||||
| json_schema_extra={ | ||||||||||
| 'example': { | ||||||||||
| 'name': 'Maria Lopez', | ||||||||||
| 'email': 'maria.lopez@aceros.com', | ||||||||||
| 'phone': '+525512345678', | ||||||||||
| 'company_user_id': 'USWqY5cvkISJOxHyEKjAKf8w', | ||||||||||
| 'role': 'operator', | ||||||||||
| } | ||||||||||
| }, | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| @field_validator('email', mode='before') | ||||||||||
| @classmethod | ||||||||||
| def validate_email(cls, email: str) -> str: | ||||||||||
| return normalize_email(email) | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class OperatorUpdateRequest(BaseRequest): | ||||||||||
| name: Optional[str] = None | ||||||||||
| phone: Optional[PhoneNumber] = None | ||||||||||
| role: Optional[OperatorRole] = None | ||||||||||
| status: Optional[OperatorStatus] = None | ||||||||||
|
|
||||||||||
| @model_validator(mode="before") | ||||||||||
| @classmethod | ||||||||||
| def check_at_least_one_param(cls, values: DictStrAny) -> DictStrAny: | ||||||||||
| if not values: | ||||||||||
| raise ValueError('At least one parameter must be provided') | ||||||||||
| return values | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class OperatorLoginRequest(BaseRequest): | ||||||||||
| email: EmailStr | ||||||||||
| password: Annotated[Password, LogConfig(masked=True)] | ||||||||||
|
|
||||||||||
| model_config = ConfigDict( | ||||||||||
| json_schema_extra={ | ||||||||||
| 'example': { | ||||||||||
| 'email': 'maria.lopez@aceros.com', | ||||||||||
| 'password': 'supersecret', | ||||||||||
| } | ||||||||||
| }, | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| @field_validator('email', mode='before') | ||||||||||
| @classmethod | ||||||||||
| def validate_email(cls, email: str) -> str: | ||||||||||
| return normalize_email(email) | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class OperatorLoginResponse(BaseModel): | ||||||||||
| session_token: str | ||||||||||
| operator_id: str | ||||||||||
| role: OperatorRole | ||||||||||
| company_user_id: str | ||||||||||
|
|
||||||||||
| model_config = ConfigDict( | ||||||||||
| json_schema_extra={ | ||||||||||
| 'example': { | ||||||||||
| 'session_token': 'SEWqY5cvkISJOxHyEKjAKf8w', | ||||||||||
| 'operator_id': 'OPWqY5cvkISJOxHyEKjAKf8w', | ||||||||||
| 'role': 'authorizer', | ||||||||||
| 'company_user_id': 'USWqY5cvkISJOxHyEKjAKf8w', | ||||||||||
| } | ||||||||||
| }, | ||||||||||
| ) | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class PhoneVerificationAssociationRequest(BaseRequest): | ||||||||||
| verification_id: str | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| __version__ = '2.1.42' | ||
| __version__ = '2.1.41.dev5' |


Uh oh!
There was an error while loading. Please reload this page.