ING-84 feat(wallets): Accept billingEntityId on updateCustomerWallet#5516
Merged
Conversation
## Context ING-43 made `Wallets::UpdateService` accept `billing_entity_id` and `billing_entity_code` behind the `multi_entity_billing` feature flag. The GraphQL `updateCustomerWallet` mutation, however, did not yet expose `billingEntityId`, so the frontend could not exercise the new service capability through GraphQL. ## Description Add `argument :billing_entity_id, ID, required: false` to `Types::Wallets::UpdateInput`, mirroring the existing argument on `CreateInput`. The mutation handler already forwards `**args` to `Wallets::UpdateService`, so the argument flows through with no resolver change. Cover the new argument with a type-spec assertion and a mutation spec context that enables `multi_entity_billing` on the organization, calls the mutation with `billingEntityId`, and asserts the wallet row is updated.
aquinofb
approved these changes
May 20, 2026
lovrocolic
approved these changes
May 20, 2026
D1353L
pushed a commit
that referenced
this pull request
May 26, 2026
…5516) ING-43 made `Wallets::UpdateService` accept `billing_entity_id` and `billing_entity_code` behind the `multi_entity_billing` feature flag, but the GraphQL `updateCustomerWallet` mutation did not expose `billingEntityId` as an input argument. That meant REST callers could move a wallet between entities while GraphQL callers could not — the frontend had no way to drive the flow. This PR closes the gap. The change is minimal: a single `argument :billing_entity_id, ID, required: false` added to `Types::Wallets::UpdateInput`, matching the placement that already exists on `CreateInput`. The mutation resolver at `Mutations::Wallets::Update#resolve` forwards `**args` straight to `Wallets::UpdateService`, so no handler change is needed — the new argument flows through automatically and is gated by the same feature flag as the REST path. Behavior is unchanged for any caller that does not supply `billingEntityId`, and the generated `schema.graphql` / `schema.json` are updated to reflect the new input. ## Before and after | | Before | After | | --- | --- | --- | | `updateCustomerWallet` accepts `billingEntityId` | No | Yes, optional | | Frontend can move a wallet between entities | Not without REST | Yes | | Service-layer wiring | Already in place (ING-43) | Unchanged | | Feature gating | n/a | `multi_entity_billing` (inherited from the service) | ## Test plan - [ ] `bundle exec rspec spec/graphql/types/wallets/update_input_spec.rb` — type spec asserts the new argument is accepted as `ID`. - [ ] `bundle exec rspec spec/graphql/mutations/wallets/update_spec.rb` — new context "when updating billing_entity_id with multi_entity_billing enabled" turns the flag on, calls the mutation with `billingEntityId`, and asserts the wallet row is updated. - [ ] Manual: with `multi_entity_billing` enabled on an organization, run the mutation through GraphiQL and confirm the wallet's `billing_entity_id` changes. ## Migration None. The new argument is optional and inherits the existing `multi_entity_billing` feature gate — operators with the flag off see no change; operators with the flag on gain the GraphQL surface automatically. ## Out of scope Only `billing_entity_id` is exposed, mirroring `CreateInput`. The REST API accepts `billing_entity_code` as well, but GraphQL inputs keep to the `id`-only convention.
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.
ING-43 made
Wallets::UpdateServiceacceptbilling_entity_idandbilling_entity_codebehind themulti_entity_billingfeature flag, but the GraphQLupdateCustomerWalletmutation did not exposebillingEntityIdas an input argument. That meant REST callers could move a wallet between entities while GraphQL callers could not — the frontend had no way to drive the flow. This PR closes the gap.The change is minimal: a single
argument :billing_entity_id, ID, required: falseadded toTypes::Wallets::UpdateInput, matching the placement that already exists onCreateInput. The mutation resolver atMutations::Wallets::Update#resolveforwards**argsstraight toWallets::UpdateService, so no handler change is needed — the new argument flows through automatically and is gated by the same feature flag as the REST path. Behavior is unchanged for any caller that does not supplybillingEntityId, and the generatedschema.graphql/schema.jsonare updated to reflect the new input.Before and after
updateCustomerWalletacceptsbillingEntityIdmulti_entity_billing(inherited from the service)Test plan
bundle exec rspec spec/graphql/types/wallets/update_input_spec.rb— type spec asserts the new argument is accepted asID.bundle exec rspec spec/graphql/mutations/wallets/update_spec.rb— new context "when updating billing_entity_id with multi_entity_billing enabled" turns the flag on, calls the mutation withbillingEntityId, and asserts the wallet row is updated.multi_entity_billingenabled on an organization, run the mutation through GraphiQL and confirm the wallet'sbilling_entity_idchanges.Migration
None. The new argument is optional and inherits the existing
multi_entity_billingfeature gate — operators with the flag off see no change; operators with the flag on gain the GraphQL surface automatically.Out of scope
Only
billing_entity_idis exposed, mirroringCreateInput. The REST API acceptsbilling_entity_codeas well, but GraphQL inputs keep to theid-only convention.