Repository navigation
fix(brex): leave a blank spend-limit buffer unset - #10079
Merged
Merged
Conversation
Saved Create Spend Limit workflows can carry null or '' for the optional
buffer and transaction limit. The buffer reached Number(), which turned the
blank into limit_buffer_percentage: 0, and a null transaction limit sent
{ amount: null } although Brex's Money.amount is a required integer. Both
fields are optional and nullable on CreateSpendLimitRequest, so omit them
when blank.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge. SummaryLeaves blank optional Brex spend-limit fields out of the request while preserving explicit values.
Reviews (2) · Last reviewed commit: "test(brex): narrow the spend-limit body ..." · Reviewed by Greptile |
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
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.
Summary
Follow-up to #10074 for
brex_create_spend_limit.limitBufferPercentage !== undefined. A saved canvas value ofnullor''went throughNumber(), became0, and passed the 0–100 check. Saved workflows that left the buffer blank started sendinglimit_buffer_percentage: 0, a value the user never set. Before fix(integrations): validate shopify, brex, ramp, zoom, calendly, cal.com, typeform, webflow and wordpress #10074 the field went out asnull.transaction_limitwas built whenevertransactionLimitAmount !== undefined, so anullsent{ amount: null, currency }. Brex's spec requiresMoney.amountto be an integer.In Brex's Budgets API OpenAPI spec,
CreateAuthorizationSettings.limit_buffer_percentage(int32) andCreateSpendLimitRequest.transaction_limit(Money) are both optional and nullable. Both fields are now left out when the value isundefined,null, or a blank string. Leaving the buffer out means the same thing as thenullthat was sent before #10074, and an explicit0is still sent.Test plan
tools/brex/create_spend_limit.test.ts: the 6 blank-value cases fail on the pre-fix code and pass with the fix. The explicit-0 and set-amount cases pass on both.🤖 Generated with Claude Code