migrate db
This commit is contained in:
parent
12b2a2f1fd
commit
9d8e14b393
7 changed files with 248 additions and 0 deletions
74
src/entities/StateOperator.ts
Normal file
74
src/entities/StateOperator.ts
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { State } from "./State";
|
||||
|
||||
@Entity("stateOperator")
|
||||
export class StateOperator extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ผู้ดำเนินการ",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
operator: string;
|
||||
|
||||
@Column({
|
||||
comment: "ดูเอกสาร",
|
||||
default: false,
|
||||
})
|
||||
canView: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "แก้ไขเอกสาร",
|
||||
default: false,
|
||||
})
|
||||
canUpdate: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "ลบเอกสาร",
|
||||
default: false,
|
||||
})
|
||||
canDelete: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "ยกเลิกเอกสาร",
|
||||
default: false,
|
||||
})
|
||||
canCancel: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "ดำเนินการเอกสาร",
|
||||
default: false,
|
||||
})
|
||||
canOperate: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "เปลี่ยนสถานะเอกสาร",
|
||||
default: false,
|
||||
})
|
||||
canChangeState: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "แสดงความเห็นเอกสาร",
|
||||
default: false,
|
||||
})
|
||||
canComment: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "ลงนามอนุมัติ",
|
||||
default: false,
|
||||
})
|
||||
canSign: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง state",
|
||||
default: null,
|
||||
})
|
||||
stateId: string;
|
||||
|
||||
@ManyToOne(() => State, (state) => state.stateOperators)
|
||||
@JoinColumn({ name: "stateId" })
|
||||
state: State;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue