-
Notifications
You must be signed in to change notification settings - Fork 12
rcv: Update RV fields optional in schemas and data models #962
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: develop
Are you sure you want to change the base?
rcv: Update RV fields optional in schemas and data models #962
Conversation
- Some valid RCV files were missing previously required fields - Updated various monetary and other fields (e.g., `monto_neto`, `monto_iva`) to be nullable. - Adjusted test cases and test data to reflect schema changes. Ref: https://app.shortcut.com/cordada/story/17695/
|
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.
Pull request overview
This PR updates the RCV (Registro de Compras y Ventas) parsing logic to make certain monetary and other fields optional, addressing cases where valid RCV files were missing previously required fields. The changes ensure the parser can handle real-world RCV files that have empty values for fields like monto_exento, monto_neto, and monto_iva.
Key Changes:
- Made 13 fields optional in the RCV Venta schema (including monetary fields like
monto_neto,monto_iva, and indicator fields) - Updated corresponding data model type hints from
inttoOptional[int] - Enhanced test coverage with a new test case row that validates parsing behavior when optional fields are empty
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/cl_sii/rcv/parse_csv.py |
Updated 13 fields in RcvVentaCsvRowSchema to be optional (required=False, allow_none=True) |
src/cl_sii/rcv/data_models.py |
Changed type hints for 13 fields in RvDetalleEntry from int to Optional[int] to match schema changes |
src/tests/test_rcv_parse_csv.py |
Expanded test expectations to validate three scenarios: missing required fields with errors, valid entry with all fields, and valid entry with many optional fields as None |
src/tests/test_data/sii-rcv/RCV-venta-missing-required-fields.csv |
Added new test row (row 4) demonstrating valid RCV entry with multiple empty optional fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #962 +/- ##
========================================
Coverage 88.19% 88.19%
========================================
Files 40 40
Lines 3819 3819
Branches 399 399
========================================
Hits 3368 3368
Misses 292 292
Partials 159 159 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



monto_neto,monto_iva) to be nullable.Ref: https://app.shortcut.com/cordada/story/17695/