[ING-48] feat(wallets): filter by billing entity#5559
Open
mariohd wants to merge 1 commit into
Open
Conversation
## Context Multi-entity customers need to scope the wallets list to a specific billing entity. The /customers and /invoices list endpoints already support a `billing_entity_codes` filter; this brings /wallets in line. ## Description Adds an optional `billing_entity_codes` array filter to GET /api/v1/wallets and its customer-scoped variant. Codes are resolved to IDs against the current organization, and unknown codes return a 404 (billing_entity_not_found). The query matches wallets directly stamped with a billing_entity_id as well as wallets that inherit it from their customer, preserving Wallet#billing_entity's fallback semantics. Wallet filters are also compacted to skip the customer_not_found check when no external_customer_id is provided.
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
Multi-entity customers need to scope the wallets list to a specific
billing entity. The
/customersand/invoiceslist endpoints alreadysupport a
billing_entity_codesfilter; this brings/walletsin line.Description
Adds an optional
billing_entity_codesarray filter to:GET /api/v1/walletsGET /api/v1/customers/:external_id/walletsBehavior:
current_organization.all_billing_entities. Unknown codes return404 billing_entity_not_found— matching the pattern used by/customersand/invoices.billing_entity_idand wallets that inherit it from their customer, preservingWallet#billing_entity's fallback semantics.WalletsQuery, so calling/api/v1/walletswithoutexternal_customer_idno longer trips thecustomer_not_foundvalidation.How to test
Automated: