journaling
This commit is contained in:
35
src/transaction/dto/create-journal.dto.ts
Normal file
35
src/transaction/dto/create-journal.dto.ts
Normal 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[]
|
||||
}
|
||||
13
src/transaction/dto/input-coa.dto.ts
Normal file
13
src/transaction/dto/input-coa.dto.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user