Skip to content

Conversation

@rogelioLpz
Copy link
Member

@rogelioLpz rogelioLpz commented Oct 24, 2025

Summary by CodeRabbit

  • New Features

    • KYCValidation now exposes a status field to track validation state
  • Chores

    • Development version updated to 2.1.14

@rogelioLpz rogelioLpz requested a review from felipao-mx October 24, 2025 20:49
@rogelioLpz rogelioLpz self-assigned this Oct 24, 2025
@rogelioLpz rogelioLpz added the enhancement New feature or request label Oct 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2025

Walkthrough

Adds a new public field status: VerificationStatus = VerificationStatus.created to the KYCValidation model and imports VerificationStatus from cuenca_validations.types. Bumps module __version__ in cuenca/version.py from '2.1.13' to '2.1.14'.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Changes are additive and localized: one model field plus an import and a single-line version bump. Low logic density and small file spread.

Possibly related issues

  • cuenca-mx/identify#395 — Both add a status field to KYC validation models to track validation states (Created/Submitted/Succeeded), addressing the same objective.

Possibly related PRs

  • Update version.py #431 — Also updates __version__ in cuenca/version.py, likely related to the same release/versioning change.

Suggested reviewers

  • alexviquez
  • felipao-mx

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Add status in kyc-validations" directly and accurately describes the main functional change in this changeset. The primary modification is the addition of a new status field with type VerificationStatus to the KYCValidation model in cuenca/resources/kyc_validations.py, which the title clearly communicates. The version bump in cuenca/version.py is a standard secondary change accompanying feature releases and does not represent the primary objective. The title is concise, specific, and conveys meaningful information that a teammate scanning the history would immediately understand.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kyc-status

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f3ea3ed) to head (767b318).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #433   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           54        54           
  Lines         1185      1186    +1     
=========================================
+ Hits          1185      1186    +1     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cuenca/resources/kyc_validations.py 100.00% <100.00%> (ø)
cuenca/version.py 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3ea3ed...767b318. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cuenca/resources/kyc_validations.py (1)

25-39: Add the status field to the example.

The json_schema_extra example is missing the newly added status field, which creates inconsistency between the model definition and its documentation.

Apply this diff to include the status field in the example:

         json_schema_extra={
             'example': {
                 'id': 'KVNEUInh69SuKXXmK95sROwQ',
                 'created_at': '2020-05-24T14:15:22Z',
                 'platform_id': 'PT-1234567890',
                 'user_id': 'US-1234567890',
                 'source_type': 'server',
                 'flow_id': '123e4567-e89b-12d3-a456-426614174000',
+                'status': 'pending',
                 'files_uri': ['cuenca.com/files/id', 'cuenca.com/files/id2'],
                 'verification_id': 'metamap-verification-id',
                 'identity_id': 'metamap-identity-id',
             }
         }

Note: Replace 'pending' with an appropriate example value from the KYCValidationStatus enum once the import issue is resolved.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3ea3ed and 6e67def.

📒 Files selected for processing (2)
  • cuenca/resources/kyc_validations.py (2 hunks)
  • cuenca/version.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

⚙️ CodeRabbit configuration file

**/*.py: Enforce Relative Imports for Internal Modules

Ensure that any imports referencing internal modules use relative paths. However, if modules reside in the main module directories (for example /src or /library_or_app_name) —and relative imports are not feasible—absolute imports are acceptable. Additionally, if a module is located outside the main module structure (for example, in /tests or /scripts at a similar level), absolute imports are also valid.

Examples and Guidelines:

  1. If a module is in the same folder or a subfolder of the current file, use relative imports. For instance: from .some_module import SomeClass
  2. If the module is located under /src or /library_or_app_name and cannot be imported relatively, absolute imports are allowed (e.g., from library_or_app_name.utilities import helper_method).
  3. If a module is outside the main module directories (for example, in /tests, /scripts, or any similarly placed directory), absolute imports are valid.
  4. External (third-party) libraries should be imported absolutely (e.g., import requests).

**/*.py:
Rule: Enforce Snake Case in Python Backend

  1. New or Modified Code: Use snake_case for all variables, functions, methods, and class attributes.
  2. Exceptions (Pydantic models for API responses):
    • Primary fields must be snake_case.
    • If older clients expect camelCase, create a computed or alias field that references the snake_case field.
    • Mark any camelCase fields as deprecated or transitional.

Examples

Invalid:

class CardConfiguration(BaseModel):
    title: str
    subTitle: str  # ❌ Modified or new field in camelCase

Valid:

class CardConfiguration(BaseModel):
    title: str
    subtitle: str  # ✅ snake_case for new/modified field

    @computed_field
    def subTitle(self) -> str:  # camelCase allowed only for compatibility
        return self.subtitle

Any direct use of camelCase in new or updated code outside of these exceptions should be flagged.

`*...

Files:

  • cuenca/version.py
  • cuenca/resources/kyc_validations.py
🪛 GitHub Actions: test
cuenca/resources/kyc_validations.py

[error] 3-3: ImportError: cannot import name 'KYCValidationStatus' from 'cuenca_validations.types'.

🔇 Additional comments (2)
cuenca/resources/kyc_validations.py (1)

20-20: Approve the field addition.

The status field declaration follows proper snake_case naming conventions and uses the appropriate type annotation.

cuenca/version.py (1)

1-1: LGTM! Standard version bump.

The version update to 2.1.14.dev0 follows standard semantic versioning for development releases.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cuenca/resources/kyc_validations.py (1)

27-37: Critical: Example dict is missing the new status field.

The example in json_schema_extra must include the newly added status field to accurately reflect the model structure. This ensures that API documentation and developer examples are complete.

Apply this diff to add the status field to the example:

         json_schema_extra={
             'example': {
                 'id': 'KVNEUInh69SuKXXmK95sROwQ',
                 'created_at': '2020-05-24T14:15:22Z',
                 'platform_id': 'PT-1234567890',
                 'user_id': 'US-1234567890',
                 'source_type': 'server',
                 'flow_id': '123e4567-e89b-12d3-a456-426614174000',
+                'status': 'created',
                 'files_uri': ['cuenca.com/files/id', 'cuenca.com/files/id2'],
                 'verification_id': 'metamap-verification-id',
                 'identity_id': 'metamap-identity-id',
             }
         }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e67def and 767b318.

📒 Files selected for processing (2)
  • cuenca/resources/kyc_validations.py (2 hunks)
  • cuenca/version.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

⚙️ CodeRabbit configuration file

**/*.py: Enforce Relative Imports for Internal Modules

Ensure that any imports referencing internal modules use relative paths. However, if modules reside in the main module directories (for example /src or /library_or_app_name) —and relative imports are not feasible—absolute imports are acceptable. Additionally, if a module is located outside the main module structure (for example, in /tests or /scripts at a similar level), absolute imports are also valid.

Examples and Guidelines:

  1. If a module is in the same folder or a subfolder of the current file, use relative imports. For instance: from .some_module import SomeClass
  2. If the module is located under /src or /library_or_app_name and cannot be imported relatively, absolute imports are allowed (e.g., from library_or_app_name.utilities import helper_method).
  3. If a module is outside the main module directories (for example, in /tests, /scripts, or any similarly placed directory), absolute imports are valid.
  4. External (third-party) libraries should be imported absolutely (e.g., import requests).

**/*.py:
Rule: Enforce Snake Case in Python Backend

  1. New or Modified Code: Use snake_case for all variables, functions, methods, and class attributes.
  2. Exceptions (Pydantic models for API responses):
    • Primary fields must be snake_case.
    • If older clients expect camelCase, create a computed or alias field that references the snake_case field.
    • Mark any camelCase fields as deprecated or transitional.

Examples

Invalid:

class CardConfiguration(BaseModel):
    title: str
    subTitle: str  # ❌ Modified or new field in camelCase

Valid:

class CardConfiguration(BaseModel):
    title: str
    subtitle: str  # ✅ snake_case for new/modified field

    @computed_field
    def subTitle(self) -> str:  # camelCase allowed only for compatibility
        return self.subtitle

Any direct use of camelCase in new or updated code outside of these exceptions should be flagged.

`*...

Files:

  • cuenca/version.py
  • cuenca/resources/kyc_validations.py
🔇 Additional comments (2)
cuenca/version.py (1)

1-1: LGTM! Version bump is appropriate.

The version increment from '2.1.13' to '2.1.14' correctly reflects the addition of the new status field to the KYCValidation model.

cuenca/resources/kyc_validations.py (1)

20-20: LGTM! Status field follows best practices.

The field declaration follows proper Pydantic syntax with snake_case naming and an appropriate default value.

@rogelioLpz rogelioLpz merged commit 7d026af into main Oct 24, 2025
18 checks passed
@rogelioLpz rogelioLpz deleted the kyc-status branch October 24, 2025 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants