-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add operator-related types and requests #425
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
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 |
|---|---|---|
|
|
@@ -153,6 +153,10 @@ class AccountQuery(QueryParams): | |
| account_number: Optional[str] = None | ||
|
|
||
|
|
||
| class OperatorQuery(QueryParams): | ||
| email: Optional[EmailStr] = None | ||
|
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. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Normalize the email filter.
Reuse 🤖 Prompt for AI AgentsThere 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. Query email skips normalizationMedium Severity
Reviewed by Cursor Bugbot for commit db6c36a. 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 |
|---|---|---|
|
|
@@ -36,6 +36,8 @@ | |
| KYCValidationSource, | ||
| MonthlyMovementsType, | ||
| MonthlySpendingType, | ||
| OperatorRole, | ||
| OperatorStatus, | ||
| PlatformType, | ||
| PosCapability, | ||
| Profession, | ||
|
|
@@ -899,5 +901,82 @@ class LegalPersonUpdateRequest(BaseRequest): | |
| legal_representatives: Optional[list[LegalRepresentative]] = None | ||
|
|
||
|
|
||
| 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') | ||
|
Comment on lines
+939
to
+940
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. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Reject updates that serialize to an empty payload.
Require at least one non- 🤖 Prompt for AI Agents |
||
| 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.43' |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deactivateden lugar dedisabledpara ser consistente con users