From c00754fd002284a762b1fea5a9643ac7fb8326f6 Mon Sep 17 00:00:00 2001 From: Eric Viana Date: Mon, 3 Aug 2026 21:43:39 -0300 Subject: [PATCH] fix(customers): EstimatedAnnualRevenue top band has an extra zero 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 --- src/blindpay/resources/customers/customers.py | 2 +- tests/test_types.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/blindpay/resources/customers/customers.py b/src/blindpay/resources/customers/customers.py index 7456877..1f8c9b2 100644 --- a/src/blindpay/resources/customers/customers.py +++ b/src/blindpay/resources/customers/customers.py @@ -252,7 +252,7 @@ "1000000_9999999", "10000000_49999999", "50000000_249999999", - "2500000000_plus", + "250000000_plus", ] SourceOfWealth = Literal[ diff --git a/tests/test_types.py b/tests/test_types.py index 57e4219..b2f75fd 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -6,6 +6,7 @@ """ from blindpay.resources.custodial_wallets.custodial_wallets import CreateCustodialWalletInput +from blindpay.resources.customers.customers import EstimatedAnnualRevenue from blindpay.resources.payins.payins import BankDetails, CreateEvmPayinResponse, GetPayinTrackResponse, Payin from blindpay.types import BankAccountType, PaginationMetadata @@ -254,3 +255,12 @@ def test_external_id_is_optional(self): "external_id": "your-database-id", } assert with_external_id.get("external_id") == "your-database-id" + + +class TestEstimatedAnnualRevenueTopBandIsCorrect: + def test_250_million_plus_is_a_valid_value(self): + # The band below tops out at 249999999, so 250000000_plus is the only + # coherent top band; the old "2500000000_plus" (2.5 billion, an extra + # zero) is a value the API rejects. + value: EstimatedAnnualRevenue = "250000000_plus" + assert value == "250000000_plus"