import { IsNotEmpty } from 'class-validator'; import { statusTransaction, typeTransaction } from 'src/helper/enum-list'; import { EntityManager } from 'typeorm'; import { Transactions } from '../entities/transactions.entity'; interface JournalEntry { coa_id: string; debit?: number; credit?: number; } export class CreateJournalDto { @IsNotEmpty() transactionalEntityManager: EntityManager; @IsNotEmpty() createTransaction?: boolean; @IsNotEmpty() userId?: string; @IsNotEmpty() transaction?: Transactions; @IsNotEmpty() type?: typeTransaction; @IsNotEmpty() amount?: number; @IsNotEmpty() transactionStatus?: statusTransaction; @IsNotEmpty() journals: JournalEntry[] }