-
Notifications
You must be signed in to change notification settings - Fork 14
Bugfix/release issues #429
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
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 |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| from cuenca_validations.types import ( | ||
| Address, | ||
| Beneficiary, | ||
| BeneficiaryRequest, | ||
| KYCFile, | ||
| PhoneNumber, | ||
| SATRegimeCode, | ||
|
|
@@ -101,14 +102,16 @@ def balance(self) -> int: | |
| 'phone_number': '+525511223344', | ||
| 'email_address': 'user@example.com', | ||
| 'profession': 'engineer', | ||
| 'terms_of_service': TOSAgreement.schema().get('example'), | ||
| 'terms_of_service': TOSAgreement.model_json_schema().get( | ||
| 'example' | ||
| ), | ||
| 'status': 'active', | ||
| 'address': Address.schema().get('example'), | ||
| 'govt_id': KYCFile.schema().get('example'), | ||
| 'address': Address.model_json_schema().get('example'), | ||
| 'govt_id': KYCFile.model_json_schema().get('example'), | ||
| 'proof_of_address': None, | ||
| 'proof_of_life': None, | ||
| 'beneficiaries': [ | ||
| Beneficiary.schema().get('example'), | ||
| Beneficiary.model_json_schema().get('example'), | ||
| ], | ||
| 'platform_id': 'PT8UEv02zBTcymd4Kd3MO6pg', | ||
| } | ||
|
|
@@ -139,6 +142,7 @@ def create( | |
| account_use_type=account_use_type, | ||
| monthly_spending_type=monthly_spending_type, | ||
| monthly_movements_type=monthly_movements_type, | ||
| income_type=income_type, | ||
| ) | ||
| return cls._create(session=session, **req.model_dump()) | ||
|
|
||
|
|
@@ -148,14 +152,14 @@ def update( | |
| user_id: str, | ||
| profession: Optional[str] = None, | ||
| address: Optional[AddressRequest] = None, | ||
| beneficiaries: Optional[list[Beneficiary]] = None, | ||
| beneficiaries: Optional[list[BeneficiaryRequest]] = None, | ||
| govt_id: Optional[KYCFile] = None, | ||
| proof_of_address: Optional[KYCFile] = None, | ||
| proof_of_life: Optional[KYCFile] = None, | ||
| status: Optional[UserStatus] = None, | ||
| email_verification_id: Optional[str] = None, | ||
| phone_verification_id: Optional[str] = None, | ||
| curp_document: Optional[SerializableHttpUrl] = None, | ||
| curp_document_uri: Optional[SerializableHttpUrl] = 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. 🛠️ Refactor suggestion Rename to curp_document_uri: preserve backward compatibility. Apply: - curp_document_uri: Optional[SerializableHttpUrl] = None,
+ curp_document_uri: Optional[SerializableHttpUrl] = None,
+ curp_document: Optional[SerializableHttpUrl] = None, # deprecatedThen coalesce before creating the request (see insertion below at Lines 173-173). Also applies to: 183-183 |
||
| fiscal_regime_code: Optional[SATRegimeCode] = None, | ||
| fiscal_address: Optional[AddressRequest] = None, | ||
| account_use_type: Optional[AccountUseType] = None, | ||
|
|
@@ -176,7 +180,7 @@ def update( | |
| status=status, | ||
| email_verification_id=email_verification_id, | ||
| phone_verification_id=phone_verification_id, | ||
| curp_document=curp_document, | ||
| curp_document_uri=curp_document_uri, | ||
| fiscal_regime_code=fiscal_regime_code, | ||
| fiscal_address=fiscal_address, | ||
| account_use_type=account_use_type, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| __version__ = '2.1.10' | ||
| __version__ = '2.1.11' | ||
| CLIENT_VERSION = __version__ | ||
| API_VERSION = '2020-03-19' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| requests==2.32.3 | ||
| cuenca-validations==2.1.16 | ||
| cuenca-validations==2.1.17 | ||
| pydantic-extra-types==2.10.2 |
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.
🛠️ Refactor suggestion
Beneficiaries type change is a breaking API for callers. Add a compat path.
Accept both BeneficiaryRequest and Beneficiary, coercing Beneficiary → BeneficiaryRequest, to avoid breaking existing code.
Apply:
And normalize before building the request (see insertion below at Lines 173-173).
🤖 Prompt for AI Agents