Skip to content

Conversation

@svillegas-cdd
Copy link
Contributor

  • 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/

@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 91.48936% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.27%. Comparing base (09daad2) to head (f5e710d).

Files with missing lines Patch % Lines
src/cl_sii/rcv/data_models.py 82.60% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copilot AI left a 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 DocumentoReferencias TypedDict to encapsulate document reference data
  • Replaced two separate fields with a single documento_referencias list field in RvDetalleEntry
  • 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.

@svillegas-cdd svillegas-cdd force-pushed the task/sc-17694-errors-parsing-rcv-mas-de-una-referencia branch 4 times, most recently from 85a5e52 to cf8519d Compare December 24, 2025 12:18
@svillegas-cdd svillegas-cdd force-pushed the task/sc-17694-errors-parsing-rcv-mas-de-una-referencia branch from cf8519d to b2a2c88 Compare December 29, 2025 11:52
@svillegas-cdd svillegas-cdd force-pushed the task/sc-17694-errors-parsing-rcv-mas-de-una-referencia branch from b2a2c88 to dd5d663 Compare December 29, 2025 15:56
@svillegas-cdd
Copy link
Contributor Author

@jtrobles-cdd I updated the function get_documento_referencia_dte_natural_key to get_documento_referencia_dte_natural_keys to handle multiple references

Copy link

Copilot AI left a 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/
@svillegas-cdd svillegas-cdd force-pushed the task/sc-17694-errors-parsing-rcv-mas-de-una-referencia branch from dd5d663 to f5e710d Compare December 29, 2025 16:12
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
14.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@svillegas-cdd svillegas-cdd merged commit 691a1c9 into develop Dec 29, 2025
26 of 27 checks passed
@svillegas-cdd svillegas-cdd deleted the task/sc-17694-errors-parsing-rcv-mas-de-una-referencia branch December 29, 2025 16:20
@svillegas-cdd svillegas-cdd mentioned this pull request Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants