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