Skip to content

Conversation

@glarrain
Copy link
Contributor

glarrain added 19 commits May 31, 2019 19:42
For parsing all the existing alternatives of an RCV CSV file
for "Compra" (purchase), add these functions and their
corresponding schemas:

- `parse_rcv_compra_registro_csv_file`: "Registro"
- `parse_rcv_compra_no_incluir_csv_file`: "No incluir"
- `parse_rcv_compra_reclamado_csv_file`: "Reclamado"
- `parse_rcv_compra_pendiente_csv_file`: "Pendiente"

The implementations are very similar to `parse_rcv_venta_csv_file`
(added in PR #52, commit c4fbfc1) and its interface is very
different to the old `process_rcv_csv_file` (among other things,
instead of calling a given handler on each row it yields the row),
which will be removed.

Tests have not been implemented.
And its related code.

Its name was inappropriate because it supported only an specific kind
of RCV CSV file: RCV "Compra/Registro" CSV file.

Also, the implementation was not very good.
…X_csv_file

rcv.parse_csv: add `parse_rcv_compra_X_csv_file`
Reference it from `base.constants` instead.
Move from `dte.data_models` and rename.

Tests not yet implemented.
Marshmallow field for RCV's "tipo documento".
…nstants

rcv: add data models, constants and more
Include functions:
- `with_mode_binary`
- `with_mode_text`
- `with_encoding_utf8`
- Now they yield dataclass `RcvDetalleEntry` instances instead of
  dataclass `DteDataL2` instances.
- Params `{emisor, receptor}_{rut, razon_social}` renamed to `rut`
  and `razon_social` respectively.
- `parse_rcv_venta_csv_file`: fields `Fecha Acuse Recibo` and
  `Fecha Reclamo` are not ignored anymore.
- Marshmallow schemas' field `tipo_dte` replaced by `tipo_docto`.
- Marshmallow schemas' method `to_dte_data_l2` replaced by
  `to_detalle_entry`.
…ions

rcv.parse_csv: significant changes to parse functions
@glarrain glarrain added the kind: release Release label Jun 13, 2019
@glarrain glarrain requested a review from jtrh June 13, 2019 19:56
@glarrain glarrain self-assigned this Jun 13, 2019
@codecov-io
Copy link

Codecov Report

Merging #64 into master will decrease coverage by 2.78%.
The diff coverage is 55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #64      +/-   ##
==========================================
- Coverage   67.54%   64.75%   -2.79%     
==========================================
  Files          20       22       +2     
  Lines        1026     1413     +387     
  Branches      154      205      +51     
==========================================
+ Hits          693      915     +222     
- Misses        286      450     +164     
- Partials       47       48       +1
Impacted Files Coverage Δ
cl_sii/dte/parse.py 80.15% <ø> (ø) ⬆️
cl_sii/dte/data_models.py 60.58% <100%> (+1.71%) ⬆️
cl_sii/base/constants.py 100% <100%> (ø)
cl_sii/extras/mm_fields.py 100% <100%> (ø) ⬆️
cl_sii/libs/tz_utils.py 50% <23.07%> (-22.73%) ⬇️
cl_sii/rcv/parse_csv.py 38.87% <36.2%> (-5.78%) ⬇️
cl_sii/rcv/data_models.py 46.47% <46.47%> (ø)
cl_sii/libs/io_utils.py 94.28% <94.28%> (ø)
cl_sii/rcv/constants.py 97.36% <97.36%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1781c5e...fc8f3d2. Read the comment docs.

@glarrain glarrain merged commit bcf3f95 into master Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants