Problem
The Rillet connection's client types declare a card export destination key the server never sends. Policy.ts:1827 types export.companyCard, but the server stores that setting as nonReimbursable with value CREDIT_CARD_CHARGE, and nothing on the backend serializes a companyCard key. The two reads (RilletExportPage.tsx:42 and companyCards/utils.tsx:382) always get undefined and fall back to CONST.RILLET_EXPORT_COMPANY_CARD.CREDIT_CARD, whose value also differs from the server's. Nothing is visibly broken today because the destination row is locked and display-only, but the DualEntry and Campfire client types will be modeled on Rillet's, so the mismatch would spread to them.
Solution
Type the real key and value, no behavior change expected:
- In
Policy.ts, replace companyCard: RilletExportCompanyCard with a nonReimbursable property typed to the server's value, and update the RilletExportCompanyCard alias accordingly
- In
CONST/index.ts, replace RILLET_EXPORT_COMPANY_CARD: {CREDIT_CARD: 'CREDIT_CARD'} with RILLET_EXPORT_NON_REIMBURSABLE: {CREDIT_CARD_CHARGE: 'CREDIT_CARD_CHARGE'}
- Update the two reads and their fallbacks to the new key and constant
The Export page and the company card export row should render exactly as before since there is no setter for this value.
Issue Owner
Current Issue Owner: @s77rt
Problem
The Rillet connection's client types declare a card export destination key the server never sends. Policy.ts:1827 types
export.companyCard, but the server stores that setting asnonReimbursablewith valueCREDIT_CARD_CHARGE, and nothing on the backend serializes acompanyCardkey. The two reads (RilletExportPage.tsx:42 and companyCards/utils.tsx:382) always getundefinedand fall back toCONST.RILLET_EXPORT_COMPANY_CARD.CREDIT_CARD, whose value also differs from the server's. Nothing is visibly broken today because the destination row is locked and display-only, but the DualEntry and Campfire client types will be modeled on Rillet's, so the mismatch would spread to them.Solution
Type the real key and value, no behavior change expected:
Policy.ts, replacecompanyCard: RilletExportCompanyCardwith anonReimbursableproperty typed to the server's value, and update theRilletExportCompanyCardalias accordinglyCONST/index.ts, replaceRILLET_EXPORT_COMPANY_CARD: {CREDIT_CARD: 'CREDIT_CARD'}withRILLET_EXPORT_NON_REIMBURSABLE: {CREDIT_CARD_CHARGE: 'CREDIT_CARD_CHARGE'}The Export page and the company card export row should render exactly as before since there is no setter for this value.
Issue Owner
Current Issue Owner: @s77rt