import { Amount } from '../../../commonStateTypes/amount'; import { ID } from '../../../commonStateTypes/common'; import { Recommendation, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase'; import { ZeniDate } from '../../../zeniDayJS'; import { ZeniUrl as Url } from '../../../zeniUrl'; import { AccountBase } from '../../account/accountState'; import { Attachment } from './attachment'; import { TransactionID } from './transactionID'; import Line from './transactionLine'; import { TypeOfTransactionType } from './transactionType'; export type RecommendationByLineId = Record; export type RecommendationWithCOTByLineId = Record; export interface BaseTransaction extends TransactionID { amount: Amount; date: ZeniDate; memo: string; typeOfTransaction: TypeOfTransactionType; account?: AccountBase; typeName?: string; } export interface Transaction extends BaseTransaction { createTime: ZeniDate; description: string; isUpdatingTransaction: boolean; accountingProviderProjectId?: ID; accountIntegrationId?: string; attachments?: Attachment[]; bookCloseDate?: ZeniDate; categoryId?: ID; categoryIntegrationId?: string; categoryName?: string; classId?: ID; className?: string; companyIncDate?: ZeniDate; customerId?: ID; customerName?: string; documentId?: string; isRecommendedTransaction?: boolean; lines?: Line[]; linkedTransactions?: TransactionID[]; logo?: Url; paymentType?: string; paymentTypeName?: string; projectId?: ID; projectName?: string; qboAccountId?: string; qboAccountName?: string; qboId?: string; recommendations?: RecommendationByLineId; syncToken?: string; targetAccountId?: ID; targetAccountIntegrationId?: string; targetAccountName?: string; toFromAccountId?: ID; toFromAccountIntegrationId?: string; toFromAccountName?: string; /** Count of categorizable lines across all statuses (transactions list API); used to gate single-line-only flows */ totalLinesCount?: number; updateTime?: ZeniDate; vendorId?: ID; vendorName?: string; } export interface TransactionWithCOT extends Omit { recommendationsWithCOT?: RecommendationWithCOTByLineId; }