journaling

This commit is contained in:
2021-12-08 21:01:31 +07:00
parent 679bb758d8
commit d65af44a52
9 changed files with 220 additions and 9 deletions

View File

@@ -0,0 +1,35 @@
import { IsNotEmpty, IsUUID } from 'class-validator';
import { balanceType, coaType, statusTransaction, typeTransaction } from 'src/helper/enum-list';
import { EntityManager } from 'typeorm';
interface JournalEntry {
coa_id: string;
debit?: number;
credit?: number;
}
export class CreateJournalDto {
@IsNotEmpty()
transactionalEntityManager: EntityManager;
@IsNotEmpty()
createTransaction?: boolean;
@IsNotEmpty()
userId?: string;
@IsNotEmpty()
transactionId?: string;
@IsNotEmpty()
type?: typeTransaction;
@IsNotEmpty()
amount?: number;
@IsNotEmpty()
transactionStatus?: statusTransaction;
@IsNotEmpty()
journals: JournalEntry[]
}

View File

@@ -0,0 +1,13 @@
import { IsNotEmpty, IsUUID } from 'class-validator';
import { balanceType, coaType } from 'src/helper/enum-list';
export class InputCoaDto {
@IsUUID()
userId: string;
@IsNotEmpty()
type: coaType;
@IsNotEmpty()
balanceType: balanceType;
}