import { ObjectId } from 'mongodb'; import { Account } from './account'; import { Attachment } from './attachment'; import { BaseModel } from './baseModel'; import { Credit } from './credit'; import { Customer } from './customer'; import { Invoice } from './invoice'; import { JournalEntryItem } from './journalEntry'; import { PaymentMode } from './paymentMode'; import { Vehicle } from './vehicle'; import { WalkInSalePayment } from './walkInSale'; export interface Payment extends BaseModel { date: Date; status: string; paymentNumber?: string; realisedDate?: Date; customer: Customer | ObjectId; customerRemarks?: string; amount?: number; paymentMode?: PaymentMode | ObjectId; creditedAccount?: Account | ObjectId; paymentReferenceNumber?: string; invoices?: InvoicePayment[]; credits?: CreditPayment[]; journalEntries?: JournalEntryItemPayment[]; attachments?: Attachment[]; comments?: string; walkInSalePayment?: WalkInSalePayment | ObjectId; collectedVehicle?: Vehicle | ObjectId; collectedPerson?: string; disableQuickbooks?: boolean; used?: number; remaining?: number; } export interface InvoicePayment extends BaseModel { payment: Payment | ObjectId; date: Date; customer: Customer | ObjectId; invoice: Invoice | ObjectId; invoiceCustomer: Customer | ObjectId; amount: number; } export interface CreditPayment extends BaseModel { payment: Payment | ObjectId; date: Date; customer: Customer | ObjectId; credit: Credit | ObjectId; creditCustomer: Customer | ObjectId; amount: number; } export interface JournalEntryItemPayment extends BaseModel { payment: Payment | ObjectId; date: Date; customer: Customer | ObjectId; journalEntryItem: JournalEntryItem | ObjectId; journalEntryItemCustomer: Customer | ObjectId; amount: number; }