@accounter/server
Version:
Accounter GraphQL server
15 lines (14 loc) • 991 B
TypeScript
import { SecurityPaymentType, SecurityTradeType, SecurityTransactionType } from '../../../shared/enums.js';
export declare const toSecurityTradeType: (raw: string) => SecurityTradeType;
/**
* The same translation for callers that must not fail on drift.
*
* Throwing is right when an execution is being *served* — the value would otherwise be
* silently dropped from the response. It is wrong while deciding whether a row is even
* relevant: one unknown trade type in the table would take down every charge that looks at
* the same account, including those the row has nothing to do with. Rows that do surface
* still reach `toSecurityTradeType` in the resolver, so the drift stays loud where it counts.
*/
export declare const tryToSecurityTradeType: (raw: string) => SecurityTradeType | null;
export declare const toSecurityTransactionType: (raw: string) => SecurityTransactionType;
export declare const toSecurityPaymentType: (raw: string | null) => SecurityPaymentType | null;