Conversation
## Context Billing objects need to route themselves to one of a customer's connections. The table, the resolution cascade and the connection codes already shipped; nothing wrote the override rows yet. This adds the first write path, behind the multi_connection flag. ## Description The wallet endpoints and each nested recurring transaction rule accept a connections object keyed by category (payment, tax, accounting, crm). An entry either names a connection code, which pins it, or a behavior: skip never falls back, inherit drops the choice. An omitted category changes nothing. Inherit is never persisted, since resolution reads a missing row as inheritance. An unknown code is a validation error, and connections sent while the flag is off are refused rather than ignored. Validation and persistence are polymorphic in the owner, so the subscription and invoice surfaces can reuse them.
mariohd
marked this pull request as ready for review
September 9, 2026 14:38
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — unresolved connections on a recurring rule are silently accepted during wallet creation.
|
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
ING-466. Billing objects need to route themselves to one of a customer's connections. The override table, the resolution cascade and the connection codes already shipped; nothing wrote the rows yet. This is the first write path (dive-in T18c + T18d), and it is additive — nothing reads
effective_*_connectionin production yet.Description
POST/PATCH /walletsand each nestedrecurring_transaction_rulesentry accept aconnectionsobject keyed by category:A
codepins that connection,skipshort-circuits the category so it never falls back,inheritdrops the override, and an omitted category changes nothing.inheritis params-only: resolution reads a missing row as inheritance, so it destroys the row.Validation and persistence live in two new services, polymorphic in the owner, so ING-462 and the one-off/preview surfaces can reuse them.
Behind the
multi_connectionflag. Connections sent while the flag is off are refused rather than ignored; an unresolvable code is a 422. The existingpayment_methodis untouched. Serializer exposure and OpenAPI are separate dive-in items.Reviewer note: a rule matched by
lago_idkeeps its overrides; a rule sent without one is replaced, so the new rule gets fresh rows while the superseded rule keeps its own — rules are soft-terminated, sodependent: :destroynever fires. Both cases are asserted in the specs.Testing
53 new examples: unit, request (running against both
/walletsand/customers/:external_id/wallets), and the reconciliation cases above. Regression across the wallet suites (640) plus the non-REST callers — GraphQL mutations,Orders::SubscriptionCreation::ExecuteService, wallet metadata (115) — all green. Rubocop clean.