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`).