Skip to content

Conversation

@svillegas-cdd
Copy link
Contributor

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

- 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/
@sonarqubecloud
Copy link

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 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 int to Optional[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
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.19%. Comparing base (f737dbf) to head (4e2784f).

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.
📢 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.

@svillegas-cdd svillegas-cdd marked this pull request as ready for review December 24, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: rcv enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants