import type { AccountReceivableDocument, AccountReceivableDueScheduleLine, AccountReceivableSettlement, IncomingPayment, Schema, } from "../lib/types"; import type { Account, Company, Currency, CustomerAccountReference } from "./moduleMocks"; const createdAt = new Date("2024-01-01T00:00:00.000Z"); export const baseCompany = { id: "company-1", status: "ACTIVE", legalName: "Test Corp", baseCurrencyId: "currency-1", taxId: null, registrationNumber: null, street: "123 Main St", city: "New York", state: "NY", postalCode: "10001", country: "US", createdAt, updatedAt: createdAt, } as const satisfies Company; export const baseCustomerAccount = { id: "customer-account-1", companyId: "company-1", accountStatus: "ACTIVE", partnerStatus: "ACTIVE", partnerId: "partner-1", code: "ACCOUNT-001", accountName: "Customer account", partnerName: "Customer One", preferredCurrencyId: null, } satisfies CustomerAccountReference; export const baseCurrency = { id: "currency-1", code: "USD", status: "ACTIVE", symbol: "$", name: "US Dollar", decimalPlaces: 2, isBaseCurrency: true, createdAt, updatedAt: createdAt, } as const satisfies Currency; export const receivableAccount = { id: "account-receivable", code: "1200", name: "Accounts Receivable Control", accountType: "ASSET", companyId: baseCompany.id, status: "ACTIVE", createdAt, updatedAt: createdAt, } as const satisfies Account; export const paymentAccount = { id: "account-payment", code: "1100", name: "Incoming Payment Clearing", accountType: "ASSET", companyId: baseCompany.id, status: "ACTIVE", createdAt, updatedAt: createdAt, } as const satisfies Account; export const postedAccountReceivableDocument = { id: "ar-document-1", companyId: baseCompany.id, customerAccountId: baseCustomerAccount.id, currencyId: baseCurrency.id, receivableControlAccountId: receivableAccount.id, documentType: "INVOICE", correctionOfId: null, documentNumber: "AR-10000001", externalDocumentNumber: "CUST-1001", documentDate: new Date("2024-01-10"), postingDate: new Date("2024-01-15"), totalAmount: "1000", description: "Customer invoice", status: "POSTED", registeredAt: createdAt, postedAt: createdAt, cancelledAt: null, createdAt, updatedAt: createdAt, } as const satisfies AccountReceivableDocument; export const baseAccountReceivableDueScheduleLine = { id: "ar-due-schedule-line-1", accountReceivableDocumentId: postedAccountReceivableDocument.id, dueDate: new Date("2024-02-15"), amount: "1000", createdAt, updatedAt: createdAt, } as const satisfies AccountReceivableDueScheduleLine; export const baseIncomingPayment = { id: "incoming-payment-1", companyId: baseCompany.id, customerAccountId: baseCustomerAccount.id, currencyId: baseCurrency.id, paymentAccountId: paymentAccount.id, paymentDate: new Date("2024-01-20"), totalAmount: "1000", status: "DRAFT", postedAt: null, reversalDate: null, reversedAt: null, cancelledAt: null, createdAt, updatedAt: createdAt, } as const satisfies IncomingPayment; export const postedIncomingPayment = { ...baseIncomingPayment, status: "POSTED", postedAt: createdAt, } as const satisfies IncomingPayment; export const cancelledIncomingPayment = { ...baseIncomingPayment, status: "CANCELLED", cancelledAt: createdAt, } as const satisfies IncomingPayment; export const baseAccountReceivableSettlement = { id: "account-receivable-settlement-1", sourceType: "INCOMING_PAYMENT", incomingPaymentId: baseIncomingPayment.id, accountReceivableDueScheduleLineId: baseAccountReceivableDueScheduleLine.id, settledAmount: "1000", reversalOfSettlementId: null, createdAt, updatedAt: createdAt, } as const satisfies AccountReceivableSettlement;