-
Notifications
You must be signed in to change notification settings - Fork 12
rcv: Introduce DocumentoReferencias for improved data handling #961
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: Introduce DocumentoReferencias for improved data handling #961
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #961 +/- ##
===========================================
+ Coverage 88.79% 88.86% +0.06%
===========================================
Files 40 40
Lines 3767 3789 +22
Branches 390 397 +7
===========================================
+ Hits 3345 3367 +22
Misses 267 267
Partials 155 155 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 refactors the data model for RCV (Registro de Compra y Venta) to improve handling of document references. Instead of storing document reference information in two separate fields (tipo_documento_referencia and folio_documento_referencia), the code now uses a single structured field that can hold multiple references.
Key changes:
- Introduced a new
DocumentoReferenciasTypedDict to encapsulate document reference data - Replaced two separate fields with a single
documento_referenciaslist field inRvDetalleEntry - Added parsing logic to handle multiple document references from hyphen-separated folio values (e.g., "10370-10371")
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cl_sii/rcv/data_models.py | Added DocumentoReferencias TypedDict and updated RvDetalleEntry to use documento_referencias field instead of separate tipo/folio fields |
| src/cl_sii/rcv/parse_csv.py | Updated CSV schema and added _parse_rv_documento_referencias function to parse and transform document references during CSV parsing |
| src/tests/test_rcv_parse_csv.py | Updated test expectations to use new documento_referencias field structure and added new test case for multiple document references |
| src/tests/test_rcv_data_models.py | Updated test fixture to use new documento_referencias field |
| src/tests/test_data/sii-rcv/RCV-venta-multiple-dte-referencias.csv | Added test data file with examples of multiple document references in hyphen-separated format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9af700e to
85a5e52
Compare
- Add a new DocumentoReferencias type to encapsulate the tipo_documento_referencia and folio_documento_referencia fields. - This change enhances the data model by allowing multiple references to be stored in a structured format, improving the parsing and validation processes. Ref: https://app.shortcut.com/cordada/story/17694/
85a5e52 to
cf8519d
Compare
|


Ref: https://app.shortcut.com/cordada/story/17694/