35 lines
660 B
TypeScript
35 lines
660 B
TypeScript
import { Column, Entity, ManyToOne } from 'typeorm';
|
|
import { BaseModel } from '../../config/basemodel.entity';
|
|
import { COA } from './coa.entity';
|
|
import { Transactions } from './transactions.entity';
|
|
import { balanceType } from '../../helper/enum-list';
|
|
|
|
@Entity()
|
|
export class TransactionJournal extends BaseModel {
|
|
@Column('text')
|
|
type: balanceType;
|
|
|
|
@Column()
|
|
amount: number;
|
|
|
|
@ManyToOne(
|
|
() => {
|
|
return Transactions;
|
|
},
|
|
(transaction) => {
|
|
return transaction.id;
|
|
},
|
|
)
|
|
transaction_head: Transactions;
|
|
|
|
@ManyToOne(
|
|
() => {
|
|
return COA;
|
|
},
|
|
(coa) => {
|
|
return coa.id;
|
|
},
|
|
)
|
|
coa: COA;
|
|
}
|