Parent epic: #47
Context
The current production documentation includes a dedicated contributor guide for emission under administrative or judicial decisions, including RTC/IBS-CBS related cases.
This is not part of the normal LibreCode issuance path but is part of protocol completeness and avoids future raw-XML workarounds.
Goal
Model the official decision-related DPS fields and validations as an opt-in capability.
Scope
- identify exact production XSD/layout fields and business constraints
- add typed DTO fields/value objects only where required
- serialize in correct XSD order
- document that the consumer is responsible for legal eligibility
- expose capability without changing ordinary emission defaults
Constraints
- no legal inference or automatic decision classification
- feature remains opt-in
- do not mix NFS-e Via-only decision fields with normal contributor API fields
Tests
- representative valid decision payloads from official documentation
- required-field validation
- incompatible field combinations rejected
- ordinary DPS byte/semantic regression
Definition of done
- official production examples represented by tests
- XSD validation passes
- migration/API documentation added
Current official contract discovery (2026-10-04)
The current production guide Emissão de NFS-e nos casos de decisão administrativa ou judicial changes the implementation boundary assumed when this issue was opened.
The documented decision flow is not merely an opt-in set of additional DPS fields. It is a dedicated bypass flow where the contributor constructs the complete NFS-e XML and submits it to:
POST /decisao-judicial/nfse
The guide documents contributor-owned fields for this path, including the decision status, NFS-e number/identifier and generated NFS-e metadata, and states that normal query/cancellation operations apply after authorization. Substitution can also be processed through the decision flow.
The existing issqnTipoSuspensao / issqnNumeroProcessoSuspensao support models the regular DPS exigSusp group and must not be treated as implementation of this issue.
Revised implementation direction
- model the decision flow as a first-class protocol operation separate from ordinary DPS issuance;
- create a typed complete-NFS-e decision payload/builder from the exact current production layout;
- submit only through the dedicated decision endpoint;
- validate the generated complete NFS-e XML against the exact supported official schema;
- preserve ordinary emission defaults and APIs unchanged;
- do not infer legal eligibility, decision classification, numbering or values;
- add query/cancel/substitution contract tests proving interoperability after authorization.
Do not implement this issue by adding unrelated decision fields to DpsData.
Parent epic: #47
Context
The current production documentation includes a dedicated contributor guide for emission under administrative or judicial decisions, including RTC/IBS-CBS related cases.
This is not part of the normal LibreCode issuance path but is part of protocol completeness and avoids future raw-XML workarounds.
Goal
Model the official decision-related DPS fields and validations as an opt-in capability.
Scope
Constraints
Tests
Definition of done
Current official contract discovery (2026-10-04)
The current production guide Emissão de NFS-e nos casos de decisão administrativa ou judicial changes the implementation boundary assumed when this issue was opened.
The documented decision flow is not merely an opt-in set of additional DPS fields. It is a dedicated bypass flow where the contributor constructs the complete NFS-e XML and submits it to:
POST /decisao-judicial/nfseThe guide documents contributor-owned fields for this path, including the decision status, NFS-e number/identifier and generated NFS-e metadata, and states that normal query/cancellation operations apply after authorization. Substitution can also be processed through the decision flow.
The existing
issqnTipoSuspensao/issqnNumeroProcessoSuspensaosupport models the regular DPSexigSuspgroup and must not be treated as implementation of this issue.Revised implementation direction
Do not implement this issue by adding unrelated decision fields to
DpsData.