fix(customers): EstimatedAnnualRevenue top band has an extra zero - #66
Merged
Merged
Conversation
Literal ended with "2500000000_plus" (2.5 billion). The spec's enum on CreateCustomerIn, UpdateCustomerIn, CustomerOut and both customer webhook schemas is: ["0_99999", "100000_999999", "1000000_9999999", "10000000_49999999", "50000000_249999999", "250000000_plus"] 250000000_plus (250 million) is the only coherent reading: the band directly below it tops out at 249999999, so the top band has to start at 250000000. A business customer selecting the top revenue band sends a value the API rejects -- the same class of live defect as account_type/BankAccountType (#64). Why .api-sync/sync.py's enum reconciliation did not catch this on its own: it did not compare at all. EstimatedAnnualRevenue was never added to spec-map.json's `enums` list during Phase A (#58) -- that list covers 17 shared, broadly-reused Literals, not the long tail of customer-domain- specific ones customers.py declares (CustomerBusinessType, BusinessIndustry, SourceOfWealth, TaxType, AmlStatus, ProofOfAddressDocType, PurposeOfTransactions, SourceOfFundsDocType, and others -- roughly 15 more Literals with no map entry at all). This is a map-coverage gap, not a comparison-logic flaw: reconcile_enums only ever inspects what spec-map.json lists, so an unmapped Literal is invisible to it regardless of whether it has one extra member, one missing member, or both. Not redesigning or expanding map coverage in this PR -- noting it as a real, separate gap for a future pass. Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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
Fixes a fifth type-surface defect, found by manual review after #64 (which fixed four others) had already been merged and released as 3.2.0 -- this is a separate PR against current
main, not an addition to #64.EstimatedAnnualRevenueinsrc/blindpay/resources/customers/customers.pyended with"2500000000_plus"(2.5 billion, an extra zero). The spec's enum onCreateCustomerIn,UpdateCustomerIn,CustomerOutand both customer webhook schemas is:250000000_plus(250 million) is the only coherent reading: the band directly below it tops out at249999999, so the top band has to start at250000000to avoid a gap. A business customer selecting the top annual-revenue band sends a value the API rejects -- the same class of live defect asBankAccountType/account_typein #64. node, go, php and swift have the identical typo; those are being handled separately.Why
sync.py --audit-types/--checkdid not catch thisThey did not compare
EstimatedAnnualRevenueagainst the spec at all -- it was never added to.api-sync/spec-map.json'senumslist in #58's Phase A bootstrap. That list covers 17 shared, broadly-reused Literals (Network,StablecoinToken,BankAccountType, etc.); it does not cover the long tail of customer-domain-specific enumscustomers.pydeclares on its own (CustomerBusinessType,BusinessIndustry,SourceOfWealth,TaxType,AmlStatus,ProofOfAddressDocType,PurposeOfTransactions,SourceOfFundsDocType, and roughly a dozen more -- none mapped).This is a map-coverage gap, not a comparison-logic flaw:
reconcile_enumsonly ever inspects whatspec-map.jsonlists, so an unmapped Literal is invisible to it regardless of whether it has one extra member, one missing member, or both at once (which is exactly this case: the SDK has2500000000_plus, which the spec lacks, AND lacks250000000_plus, which the spec has). Not redesigning or expanding map coverage in this PR -- flagging it as a real, separate gap worth a dedicated pass (adding the ~16 customer-domain enums to spec-map.json) later.Tests
Added
TestEstimatedAnnualRevenueTopBandIsCorrecttotests/test_types.py(the file #64 introduced): an explicitEstimatedAnnualRevenue-annotated literal proving"250000000_plus"type-checks (pyright/mypy both run overtests/). No existing fixture referenced the old value, so nothing else needed updating.Proof
Version bump
fix:-- a single Literal value correction, patch-level (unlike #64'sfeat:, this doesn't add or restructure any type shape, just corrects one wrong string).Per the working rules: fresh branch off current
main(post #64/3.2.0), not merged, opening for review and stopping here.https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs