Skip to content

nest credit postpaid config per credit - #36

Merged
bpapillon merged 2 commits into
mainfrom
bpapillon/schx-778-credit_postpaid_limit-pick-a-wire-shape-that-survives
Sep 11, 2026
Merged

bpapillon merged 2 commits into
mainfrom
bpapillon/schx-778-credit_postpaid_limit-pick-a-wire-shape-that-survives

Conversation

@bpapillon

@bpapillon bpapillon commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Replaces credit_postpaid_limit (credit ID to a nullable number) with credit_postpaid (credit ID to {"overdraft_limit"?: number}). Node, Python and Ruby strip null map values before calling WASM, and typed generators collapse a nullable map value, so an unlimited grant read as off.

A credit's presence in the map turns postpaid on, and a missing or null overdraft_limit means no limit. Null always reads as absent: a null map is empty, a null credit entry is dropped (off, as the null-stripping SDKs already read it), and a null limit is no limit. CreditPostpaidMap.UnmarshalJSON drops the null entries. Evaluation is unchanged. Nothing released reads the old field, so it goes without an alias.

schematic-api needs a v0.1.24 tag of this before its matching PR merges.

A nullable number as the map value does not survive SDKs that strip null
map values or generators that type the value as non-nullable, so an
unbounded grant read as off. Presence of the key is now the opt-in and
the overdraft limit is an optional member of the value.
@bpapillon bpapillon self-assigned this Sep 11, 2026
SDKs that strip null map values already read {"cred_1": null} as off, so
the engine drops the entry too and a malformed payload fails closed.
@bpapillon
bpapillon merged commit 2620b13 into main Sep 11, 2026
2 checks passed
@bpapillon
bpapillon deleted the bpapillon/schx-778-credit_postpaid_limit-pick-a-wire-shape-that-survives branch September 11, 2026 17:43
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.

2 participants