Skip to content

feat: add Podmiot3, per-row exchange rate, and additional descriptions#37

Merged
samupl merged 1 commit intomasterfrom
feat/podmiot3-exchange-rate-descriptions
Mar 26, 2026
Merged

feat: add Podmiot3, per-row exchange rate, and additional descriptions#37
samupl merged 1 commit intomasterfrom
feat/podmiot3-exchange-rate-descriptions

Conversation

@samupl
Copy link
Copy Markdown
Owner

@samupl samupl commented Mar 26, 2026

Summary

  • Podmiot3 (additional recipients): Added AdditionalRecipient model with identification, name, address, and role. Includes all 10 role constants (ROLE_RECEIVER, ROLE_JST_RECEIVER, etc.). Serialized as Podmiot3 XML elements.
  • Per-row exchange rate: Added exchange_rate field to InvoiceRow, emitted as KursWaluty in FaWiersz for foreign currency invoices.
  • Additional descriptions: Added AdditionalDescription model (key/value pairs) to InvoiceData, emitted as DodatkowyOpis elements. Useful for NBP exchange rate source notes.
  • Refactored XML converter: Extracted _build_additional_descriptions, _build_invoice_rows, and _build_additional_recipients to reduce complexity of _build_invoice_data.

Test plan

  • Verify Podmiot3 is emitted for invoices with additional recipients (government/JST use case)
  • Verify KursWaluty is emitted per row for foreign currency invoices
  • Verify DodatkowyOpis is emitted with correct key/value structure
  • Verify XML element ordering matches FA(3) schema
  • Run existing test suite

…criptions

- Add AdditionalRecipient model (Podmiot3) with role constants for
  government receivers, additional buyers, etc.
- Add per-row exchange_rate field (KursWaluty) for foreign currency invoices
- Add AdditionalDescription model (DodatkowyOpis) for key-value notes
  such as NBP exchange rate source information
- Serialize all new fields in XML converter with correct element ordering
@samupl samupl enabled auto-merge (squash) March 26, 2026 14:26
@samupl samupl disabled auto-merge March 26, 2026 14:26
@samupl samupl merged commit 4811d86 into master Mar 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant