feat(payment_terms): Dual-write to alias and jsonb - #6186
Open
D1353L wants to merge 1 commit into
Open
Conversation
D1353L
force-pushed
the
feat-payment-terms-alias
branch
from
August 19, 2026 11:40
ca564a1 to
3688bd2
Compare
D1353L
force-pushed
the
feat-payment-terms-alias
branch
from
August 19, 2026 11:55
3688bd2 to
a76078d
Compare
D1353L
force-pushed
the
feat-payment-terms-alias
branch
from
August 19, 2026 13:46
a76078d to
99693cb
Compare
D1353L
force-pushed
the
feat-payment-terms-alias
branch
2 times, most recently
from
August 19, 2026 17:16
1fe0cf4 to
aae2f47
Compare
D1353L
force-pushed
the
feat-payment-terms-alias
branch
2 times, most recently
from
August 20, 2026 15:41
03b02e2 to
e8a9387
Compare
D1353L
force-pushed
the
feat-payment-terms-alias
branch
2 times, most recently
from
August 21, 2026 16:02
46c6335 to
63face6
Compare
D1353L
marked this pull request as ready for review
August 24, 2026 13:09
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the alias matrix is not safely integrated into the record update paths.
|
D1353L
force-pushed
the
feat-payment-terms-alias
branch
from
August 25, 2026 13:09
63face6 to
3f3cbed
Compare
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the structured payment-term path is unsafe at the persistence and update boundaries.
|
D1353L
force-pushed
the
feat-payment-terms-alias
branch
from
August 25, 2026 14:21
3f3cbed to
1cc167e
Compare
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — the payment-term compatibility layer is incomplete.
|
D1353L
force-pushed
the
feat-payment-terms-alias
branch
from
August 26, 2026 16:24
1cc167e to
f8f852e
Compare
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — structured payment terms are not persisted consistently through the updated callers.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Payment terms are moving from a single integer (net_payment_term, days) to a structured payment_term jsonb that can express more term types (net N days, due on receipt, day of month, etc.). Both columns already exist on customers and billing entities. This step starts writing them together so they never disagree.
Description
Adds
PaymentTerms::AssignService, the single writer for both payment term columns. Every create/update path for customers and billing entities now goes through it instead of assigningnet_payment_terminline.The service applies the equivalence rules between the two fields:
(
{net, N}→ N,due_on_receipt→ 0, other types → null). null clears both.{term_type: "net", days: N}. null clears both.The service only does assignment; callers still own validation and persistence. The payment_term branch is not reachable from the public API yet. API params for it ship in a later PR - so behavior for existing callers is unchanged: sending net_payment_term works exactly as before, it just also fills the jsonb.
Also adds PaymentTerm.from_net_payment_term to build a net term from a legacy integer.
Stack created with GitHub Stacks CLI • Give Feedback 💬