Skip to content

Rillet client types use companyCard for the card export destination, server stores nonReimbursable #97792

Description

@lakchote

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 OwnerCurrent Issue Owner: @s77rt

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions