import { ObjectId } from 'mongodb'; import { Attachment } from './attachment'; import { BaseModel } from './baseModel'; import { Customer } from './customer'; import { Invoice } from './invoice'; import { SKU } from './sku'; export interface Credit extends BaseModel { date: Date; status: string; code: string; customer: Customer | ObjectId; customerRemarks?: string; items: CreditItem[]; amount: number; attachments?: Attachment[]; comments?: string; invoice?: Invoice | ObjectId; disableQuickBooks?: boolean; account?: string; payments?: (BaseModel & { [key: string]: any; })[]; used?: number; remaining?: number; } export interface CreditItem extends BaseModel { credit: Credit | ObjectId; date: Date; customer: Customer | ObjectId; sku: SKU | ObjectId; quantity: number; unitPrice: number; amount: number; }