From 4b8532c604e1e5febe2aaf66fa4e08d63eb68b03 Mon Sep 17 00:00:00 2001 From: jonatanritter Date: Sat, 8 Aug 2026 15:37:15 -0300 Subject: [PATCH] docs(emission): fix stale schemas.py docstring re FiscalResultPayload/TributoLinhaPayload MINOR (F2 review): the module docstring claimed FiscalResult/TributoLinha 'are NOT re-mirrored here' but the file defines FiscalResultPayload/ TributoLinhaPayload right below it. Corrects the prose to describe reality: they ARE re-mirrored, deliberately kept separate from the lib's own pydantic classes (this module is the wire contract the service owns), converted via emission.service._to_fiscal_result/_to_tributo. Co-Authored-By: Claude Opus 4.8 --- src/fiscal_svc/emission/schemas.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/fiscal_svc/emission/schemas.py b/src/fiscal_svc/emission/schemas.py index 03129aa..a50975c 100644 --- a/src/fiscal_svc/emission/schemas.py +++ b/src/fiscal_svc/emission/schemas.py @@ -1,9 +1,16 @@ """Task 5: `EmissaoRequest` -- the pydantic mirror of `sowai_fiscal. xml_builder.DadosEmissao` (+ `sowai_fiscal.resolver.FiscalResult`/ `TributoLinha`, which the lib itself already defines as pydantic -`BaseModel`s -- these two are NOT re-mirrored here as separate payload -classes, `emission.service` constructs them straight via `FiscalResult(** -...)`/`TributoLinha(**...)`), adapted per the porte table and design spec: +`BaseModel`s -- FIX 6, F2 review: these two ARE re-mirrored here, as +`FiscalResultPayload`/`TributoLinhaPayload` below, kept SEPARATE from the +lib's own classes on purpose -- this module is the wire contract this +SERVICE owns (a field the lib adds/renames should never silently change +what a caller across the network is allowed to send), while the lib's +`FiscalResult`/`TributoLinha` are what `sowai_fiscal.xml_builder.build_nfe` +actually consumes internally. `emission.service._to_fiscal_result`/ +`_to_tributo` convert Payload -> lib class (`FiscalResult(**payload. +model_dump())`, not the payload objects themselves), adapted per the porte +table and design spec: * `tenant_ref`/`branch_ref` (opaque strings, decision #4) replace what in the auto was implicit (`sale.branch_id`).