1.6.0¶
Released: TBD
Highlights¶
legal_statuson invoices and credit notes is now a first-classLegalStatusenum, consistent with every other enumerated field in the system.
Added¶
- New
LegalStatusIntEnum (app/graphql/common/models/legal_status.py) with afrom_pac()helper that maps Alanube wire strings to enum members. See Legal Status as IntEnum.
Changed¶
- GraphQL —
legalStatusonInvoice,InvoiceLite,InvoiceLandingPage,Credit, andCreditLandingPagechanges fromStringto theLegalStatusenum. AdminpacDocumentsReport/pacDocumentsReportAllCompanieslegalStatusfilter args change fromStringtoLegalStatus. Output JSON is unchanged — Strawberry serializes enum members by name, so clients still receive the same"PAC_AUTHORIZED"/"DGI_AUTHORIZED"strings (ornull). - Storage —
invoices.legal_statusandcredits.legal_statusare nowSMALLINTcolumns backing the enum instead ofVARCHAR(50). - Internal — the redundant
PacLegalStatus(str, Enum)is removed; webhook payloads now parse the wire string directly intoLegalStatus.
Fixed¶
- (none)
Migrations¶
legal_status_int_invoices—20260603_convert_invoices_legal_status_to_int_enum.py(convertsinvoices.legal_statusVARCHAR(50)→SMALLINT).legal_status_int_credits—20260603_convert_credits_legal_status_to_int_enum.py(convertscredits.legal_statusVARCHAR(50)→SMALLINT).
Both migrations map the wire strings in place (PAC_AUTHORIZED→1, PAC_REJECTED→2,
DGI_AUTHORIZED→3, DGI_REJECTED→4, anything else / NULL→NULL) and implement a
reversible downgrade. No one-off scripts.
Frontend impact¶
No runtime change is required. The legalStatus field still returns the same string values
and null. The only difference is the SDL now types it as the LegalStatus enum, so clients
that generate typed bindings should regenerate, and admin report filters must pass one of the
enum members rather than an arbitrary string.