Skip to content

Conversation

@svillegas-cdd
Copy link
Contributor

  • Updated iva_retenido_total, iva_retenido_parcial, iva_no_retenido, iva_propio, iva_terceros.
  • Discovered that the fields iva_retenido_total and iva_retenido_parcialcan be null in some cases, so all iva* fields are now nullable.

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

- Updated `iva_retenido_total`, `iva_retenido_parcial`, `iva_no_retenido`, `iva_propio`, `iva_terceros`.
- Discovered that the fields `iva_retenido_total` and `iva_retenido_parcial`can be `null` in some cases,
so all `iva*` fields are now nullable.

Ref: https://app.shortcut.com/cordada/story/17456/
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.79%. Comparing base (da737dd) to head (c394a35).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #941   +/-   ##
========================================
  Coverage    88.79%   88.79%           
========================================
  Files           40       40           
  Lines         3767     3767           
  Branches       390      390           
========================================
  Hits          3345     3345           
  Misses         267      267           
  Partials       155      155           

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

Copilot finished reviewing on behalf of svillegas-cdd November 20, 2025 18:39
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 makes five IVA-related fields optional in the RCV (Registro de Compras y Ventas - Chilean tax document) venta (sales) records parsing system. The changes were motivated by discovering that iva_retenido_total and iva_retenido_parcial can be null in real-world data.

Key Changes:

  • Updated data model type annotations from int to Optional[int] for 5 IVA fields
  • Updated marshmallow schema fields from required=True to required=False, allow_none=True
  • Added test case demonstrating nullable behavior with iva_retenido_parcial=None and iva_retenido_total=2020

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/cl_sii/rcv/data_models.py Updated type annotations to Optional[int] for all 5 IVA fields in RvDetalleEntry class
src/cl_sii/rcv/parse_csv.py Updated marshmallow field definitions to required=False, allow_none=True for all 5 IVA fields in RcvVentaCsvRowSchema
src/tests/test_rcv_parse_csv.py Updated test expectations to include a case with iva_retenido_total=2020 and iva_retenido_parcial=None
src/tests/test_data/sii-rcv/RCV-venta-extra-empty-impuestos-rows.csv Added test data row with non-zero iva_retenido_total and empty iva_retenido_parcial field

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@svillegas-cdd svillegas-cdd merged commit ff413a6 into develop Nov 20, 2025
33 checks passed
@svillegas-cdd svillegas-cdd deleted the task/sc-17456-errors-parsing-rcv branch November 20, 2025 19:46
@svillegas-cdd svillegas-cdd mentioned this pull request Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working component: rcv

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants