-
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
rcv: Introduce DocumentoReferencias for improved data handling #961
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #961 +/- ##
===========================================
+ Coverage 88.19% 88.27% +0.08%
===========================================
Files 40 40
Lines 3819 3846 +27
Branches 399 407 +8
===========================================
+ Hits 3368 3395 +27
Misses 292 292
Partials 159 159 ☔ 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.
85a5e52 to
cf8519d
Compare
cf8519d to
b2a2c88
Compare
b2a2c88 to
dd5d663
Compare
|
@jtrobles-cdd I updated the function |
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
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- 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. - Updated function `get_documento_referencia_dte_natural_key` to handle retrieve keys of multiple referencias Ref: https://app.shortcut.com/cordada/story/17694/
dd5d663 to
f5e710d
Compare
|


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