UNPKG

@accounter/server

Version:
18 lines (17 loc) 1.22 kB
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; export declare const tradeTypeToRaw: Record<SecurityTradeType, string>; export declare const transactionTypeToRaw: Record<SecurityTransactionType, string>; export declare const paymentTypeToRaw: Record<SecurityPaymentType, string>;