add: change implement enum and distribution

This commit is contained in:
ilham
2021-12-07 20:23:26 +07:00
parent a4cd9d0b92
commit 495ba88ef8
10 changed files with 147 additions and 111 deletions

View File

@@ -1,28 +1,9 @@
import {
Entity,
Column,
PrimaryGeneratedColumn,
UpdateDateColumn,
DeleteDateColumn,
VersionColumn,
CreateDateColumn,
ManyToOne,
ManyToMany,
JoinTable,
} from 'typeorm';
import { Product } from '../../product/entities/product.entity';
import { User } from '../../users/entities/user.entity';
import { BaseModel } from '../../config/basemodel.entity';
enum type {
SYSTEM_BANk,
INCOME,
}
enum balanceType {
DEBIT,
CREDIT,
}
import { coaType, balanceType } from '../../helper/enum-list';
@Entity()
export class COA extends BaseModel {
@@ -30,7 +11,7 @@ export class COA extends BaseModel {
name: string;
@Column('text')
type: type;
type: coaType;
@Column('text')
balanceType: balanceType;
@@ -38,7 +19,6 @@ export class COA extends BaseModel {
@Column()
amount: number;
@ManyToMany(() => User)
@JoinTable()
user: User[];
@Column()
user: string;
}