Merge branch 'develop' into adiDev
This commit is contained in:
commit
e59f4f13e2
13 changed files with 535 additions and 70 deletions
|
|
@ -1,8 +1,7 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { MetaStateOperator } from "./MetaStateOperator";
|
||||
import { Workflow } from "./Workflow";
|
||||
import { metaWorkflow } from "./MetaWorkflow";
|
||||
import { MetaWorkflow } from "./MetaWorkflow";
|
||||
|
||||
@Entity("metaState")
|
||||
export class MetaState extends EntityBase {
|
||||
|
|
@ -37,9 +36,9 @@ export class MetaState extends EntityBase {
|
|||
})
|
||||
metaWorkflowId: string;
|
||||
|
||||
@ManyToOne(() => metaWorkflow, (metaWorkflow) => metaWorkflow.metaStates)
|
||||
@ManyToOne(() => MetaWorkflow, (metaWorkflow) => metaWorkflow.metaStates)
|
||||
@JoinColumn({ name: "metaWorkflowId" })
|
||||
metaWorkflow: metaWorkflow;
|
||||
metaWorkflow: MetaWorkflow;
|
||||
|
||||
@OneToMany(() => MetaStateOperator, (metaStateOperator) => metaStateOperator.metaState)
|
||||
metaStateOperators: MetaStateOperator[];
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { EntityBase } from "./base/Base";
|
|||
import { MetaState } from "./MetaState";
|
||||
|
||||
@Entity("metaWorkflow")
|
||||
export class metaWorkflow extends EntityBase {
|
||||
export class MetaWorkflow extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อ flow",
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ import { ProfileDevelopment } from "./ProfileDevelopment";
|
|||
import { PermissionOrg } from "./PermissionOrg";
|
||||
import { CommandSend } from "./CommandSend";
|
||||
import { DevelopmentRequest } from "./DevelopmentRequest";
|
||||
import { StateOperatorUser } from "./StateOperatorUser";
|
||||
import { StateUserComment } from "./StateUserComment";
|
||||
|
||||
@Entity("profile")
|
||||
export class Profile extends EntityBase {
|
||||
|
|
@ -378,6 +380,12 @@ export class Profile extends EntityBase {
|
|||
@OneToMany(() => CommandSend, (v) => v.profile)
|
||||
commandSends: CommandSend[];
|
||||
|
||||
@OneToMany(() => StateOperatorUser, (v) => v.profile)
|
||||
stateOperatorUsers: StateOperatorUser[];
|
||||
|
||||
@OneToMany(() => StateUserComment, (v) => v.profile)
|
||||
stateUserComments: StateUserComment[];
|
||||
|
||||
@ManyToOne(() => PosLevel, (posLevel) => posLevel.profiles)
|
||||
@JoinColumn({ name: "posLevelId" })
|
||||
posLevel: PosLevel;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
|||
import { EntityBase } from "./base/Base";
|
||||
import { StateOperator } from "./StateOperator";
|
||||
import { Workflow } from "./Workflow";
|
||||
import { StateUserComment } from "./StateUserComment";
|
||||
|
||||
@Entity("state")
|
||||
export class State extends EntityBase {
|
||||
|
|
@ -42,4 +43,7 @@ export class State extends EntityBase {
|
|||
|
||||
@OneToMany(() => StateOperator, (stateOperator) => stateOperator.state)
|
||||
stateOperators: StateOperator[];
|
||||
|
||||
@OneToMany(() => StateUserComment, (stateUserComment) => stateUserComment.state)
|
||||
stateUserComments: StateUserComment[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
|||
import { EntityBase } from "./base/Base";
|
||||
import { StateOperator } from "./StateOperator";
|
||||
import { Workflow } from "./Workflow";
|
||||
import { Profile } from "./Profile";
|
||||
|
||||
@Entity("stateOperatorUser")
|
||||
export class StateOperatorUser extends EntityBase {
|
||||
|
|
@ -13,14 +14,6 @@ export class StateOperatorUser extends EntityBase {
|
|||
})
|
||||
operator: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
profile: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ลำดับ",
|
||||
|
|
@ -47,4 +40,17 @@ export class StateOperatorUser extends EntityBase {
|
|||
@ManyToOne(() => Workflow, (workflow) => workflow.stateOperatorUsers)
|
||||
@JoinColumn({ name: "workflowId" })
|
||||
workflow: Workflow;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง profile",
|
||||
type: "uuid",
|
||||
default: null,
|
||||
})
|
||||
profileId: string;
|
||||
|
||||
@ManyToOne(() => Profile, (profile) => profile.stateOperatorUsers)
|
||||
@JoinColumn({ name: "profileId" })
|
||||
profile: Profile;
|
||||
}
|
||||
|
|
|
|||
79
src/entities/StateUserComment.ts
Normal file
79
src/entities/StateUserComment.ts
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { State } from "./State";
|
||||
import { Profile } from "./Profile";
|
||||
|
||||
@Entity("stateUserComment")
|
||||
export class StateUserComment extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เลือกรับทราบ",
|
||||
default: null,
|
||||
})
|
||||
isAccept: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เลือกพิจารณา",
|
||||
default: null,
|
||||
})
|
||||
isApprove: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "แสดงความคิดเห็น",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
reason: string;
|
||||
|
||||
@Column({
|
||||
comment: "เลือกรับทราบ",
|
||||
default: false,
|
||||
})
|
||||
isAcceptSetting: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "เลือกพิจารณา",
|
||||
default: false,
|
||||
})
|
||||
isApproveSetting: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "แสดงความคิดเห็น",
|
||||
default: false,
|
||||
})
|
||||
isReasonSetting: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ลำดับ",
|
||||
default: null,
|
||||
})
|
||||
order: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง state",
|
||||
default: null,
|
||||
})
|
||||
stateId: string;
|
||||
|
||||
@ManyToOne(() => State, (state) => state.stateUserComments)
|
||||
@JoinColumn({ name: "stateId" })
|
||||
state: State;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง profile",
|
||||
type: "uuid",
|
||||
default: null,
|
||||
})
|
||||
profileId: string;
|
||||
|
||||
@ManyToOne(() => Profile, (profile) => profile.stateUserComments)
|
||||
@JoinColumn({ name: "profileId" })
|
||||
profile: Profile;
|
||||
}
|
||||
|
|
@ -5,6 +5,22 @@ import { StateOperatorUser } from "./StateOperatorUser";
|
|||
|
||||
@Entity("workflow")
|
||||
export class Workflow extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "refIdw",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
refId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "system",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
system: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อ flow",
|
||||
|
|
@ -40,6 +56,14 @@ export class Workflow extends EntityBase {
|
|||
})
|
||||
posLevelName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "id state",
|
||||
length: 100,
|
||||
default: null,
|
||||
})
|
||||
stateId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อประเภท",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue