no message

This commit is contained in:
kittapath 2024-09-24 16:42:24 +07:00
parent 317920ad0d
commit b2b97aecf0
6 changed files with 225 additions and 6 deletions

View file

@ -2,6 +2,8 @@ import { Entity, Column, JoinColumn, ManyToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { CommandType } from "./CommandType";
import { CommandSend } from "./CommandSend";
import { CommandSalary } from "./CommandSalary";
import { CommandRecive } from "./CommandRecive";
@Entity("command")
export class Command extends EntityBase {
@ -83,10 +85,12 @@ export class Command extends EntityBase {
detailFooter: string;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง commandType",
nullable: true,
comment: "ตำแหน่ง",
type: "text",
default: null,
})
commandTypeId: string;
positionDetail: string;
@Column({
comment: "สถานะบัญชีแนบท้าย",
@ -112,12 +116,33 @@ export class Command extends EntityBase {
})
isSign: boolean;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง commandType",
})
commandTypeId: string;
@ManyToOne(() => CommandType, (commandType) => commandType.commands)
@JoinColumn({ name: "commandTypeId" })
commandType: CommandType;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง commandSalary",
default: null,
})
commandSalaryId: string;
@ManyToOne(() => CommandSalary, (commandSalary) => commandSalary.commands)
@JoinColumn({ name: "commandSalaryId" })
commandSalary: CommandSalary;
@OneToMany(() => CommandSend, (commandSend) => commandSend.command)
commandSends: CommandSend[];
@OneToMany(() => CommandRecive, (commandRecive) => commandRecive.command)
commandRecives: CommandRecive[];
}
export class CreateCommand {

View file

@ -0,0 +1,89 @@
import { Entity, Column, JoinColumn, ManyToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Command } from "./Command";
import { Profile } from "./Profile";
@Entity("commandRecive")
export class CommandRecive extends EntityBase {
@Column({
nullable: true,
comment: "เลขประจำตัวประชาชน",
length: 255,
default: null,
})
citizenId: string;
@Column({
nullable: true,
comment: "คำนำหน้า",
length: 255,
default: null,
})
prefix: string;
@Column({
nullable: true,
comment: "ชื่อ",
length: 255,
default: null,
})
fristName: string;
@Column({
nullable: true,
comment: "สกุล",
length: 255,
default: null,
})
lastName: string;
@Column({
nullable: true,
comment: "ตำแหน่ง",
length: 255,
default: null,
})
position: string;
@Column({
nullable: true,
comment: "หน่วยงาน",
length: 255,
default: null,
})
org: string;
@Column({
nullable: true,
comment: "ลำดับแสดงผล",
default: null,
})
order: number;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง command",
})
commandId: string;
@ManyToOne(() => Command, (command) => command.commandRecives)
@JoinColumn({ name: "commandId" })
command: Command;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง profile",
})
profileId: string;
@ManyToOne(() => Profile, (profile) => profile.commandRecives)
@JoinColumn({ name: "profileId" })
profile: Profile;
}
export class CreateCommandRecive {
@Column()
name: string;
}
// export type UpdateCommandRecive = Partial<CreateCommandRecive>;

View file

@ -1,6 +1,7 @@
import { Entity, Column, JoinColumn, ManyToOne } from "typeorm";
import { Entity, Column, JoinColumn, ManyToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { CommandSys } from "./CommandSys";
import { Command } from "./Command";
@Entity("commandSalary")
export class CommandSalary extends EntityBase {
@ -29,6 +30,9 @@ export class CommandSalary extends EntityBase {
@ManyToOne(() => CommandSys, (commandSys) => commandSys.commandSalarys)
@JoinColumn({ name: "commandSysId" })
commandSalarySys: CommandSys;
@OneToMany(() => Command, (command) => command.commandSalary)
commands: Command[];
}
export class CreateCommandSalary {

View file

@ -32,6 +32,7 @@ import { ProfileDevelopment } from "./ProfileDevelopment";
import { OrgRoot } from "./OrgRoot";
import { PermissionOrg } from "./PermissionOrg";
import { CommandSend } from "./CommandSend";
import { CommandRecive } from "./CommandRecive";
@Entity("profile")
export class Profile extends EntityBase {
@ -375,6 +376,9 @@ export class Profile extends EntityBase {
@OneToMany(() => CommandSend, (v) => v.profile)
commandSends: CommandSend[];
@OneToMany(() => CommandRecive, (v) => v.profile)
commandRecives: CommandRecive[];
@ManyToOne(() => PosLevel, (posLevel) => posLevel.profiles)
@JoinColumn({ name: "posLevelId" })
posLevel: PosLevel;