import { Amount } from '../../commonStateTypes/amount'; import { ID } from '../../commonStateTypes/common'; import { BillPaymentConfigCodeType, BillPaymentSubConfigCodeType } from '../../view/spendManagement/billPay/billPayConfig/billPayConfigState'; import { ZeniDate } from '../../zeniDayJS'; import { ZeniUrl as Url } from '../../zeniUrl'; import { AccountBase } from '../account/accountState'; import { BillPaymentStatus, BillStage, BillStatus, BulkProcessingDetail, DeletionInfo } from '../billPay/billTransaction/billTransactionState'; import { ClassBase } from '../class/classState'; import { CustomerBase } from '../customer/customerState'; import { MerchantBase } from '../merchant/merchant'; import { Attachment } from '../transaction/stateTypes/attachment'; import { ReimbursementTransactionType } from './reimbursementTypes'; export interface Reimbursement { amount: Amount; attachments: Attachment[]; createdBy: ID; createTime: ZeniDate; deletionInfo: DeletionInfo; documentId: string; entityApprovalId: ID; id: ID; isDeleted: boolean; lastUpdatedBy: ID; provider: string; qboId: ID; reimburseeUserId: ID; reimbursementInfo: ReimbursementInfo; reimbursementTypesIncluded: ReimbursementTypeCode[]; remiDate: ZeniDate; reportTitle: string; syncToken: string; type: ReimbursementTransactionType; updateTime: ZeniDate; bulkProcessingDetail?: BulkProcessingDetail; dueDate?: ZeniDate; lines?: ReimbursementLine[]; logo?: Url; } export type ReimbursementLine = MilageReimbursementLine | OutofPocketReimbursementLine; export interface ReimbursementLineBase extends Amount { description: string; homeCurrencyConversions: Amount; lineDetail: LineDetail; lineId: ID; transactionDate: ZeniDate; type: ReimbursementTypeCode; fileId?: ID; } export interface MilageReimbursementLine extends ReimbursementLineBase { distanceMileage: DistanceMilage; } export interface OutofPocketReimbursementLine extends ReimbursementLineBase { merchant?: MerchantBase; } export interface DistanceMilage { unit: DistanceUnitType; value: number; } export interface LineDetail { account?: AccountBase; class?: ClassBase; customer?: CustomerBase; } export interface ReimbursementInfo { billPaymentMethodType: RemiPaymentMethod; billPaymentStatus: BillPaymentStatus; billStatus: BillStatus; fromAccount: RemiBillAccount; stage: BillStage; stripeInboundTransferId: string; stripeOutboundPaymentId: string; toAccount: RemiBillAccount; actualDepositDate?: ZeniDate; billPaymentStatusUpdateTime?: ZeniDate; billStageUpdateTime?: ZeniDate; expectedDepositDate?: ZeniDate; paymentDate?: ZeniDate; } export interface RemiBillAccount { billAccountType: string; billAccountId?: ID; } export interface ReimbursementState { reimbursementById: Record; } export type ReimbursementTypeCode = 'mileage' | 'out_of_pocket'; export type DistanceUnitType = 'miles' | 'kilometers'; interface RemiPaymentMethod { code: BillPaymentConfigCodeType; name: string; subCode: BillPaymentSubConfigCodeType; } export {};