แก้ไขสิทธิ์

This commit is contained in:
kittapath 2024-09-13 15:34:01 +07:00
parent 4641362b95
commit 0024ed9414
9 changed files with 154 additions and 27 deletions

View file

@ -1,20 +1,11 @@
import { Entity, Column, JoinColumn, ManyToOne } from "typeorm";
import { Entity, Column, JoinColumn, ManyToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Command } from "./Command";
import { Profile } from "./Profile";
import { CommandSendCC } from "./CommandSendCC";
@Entity("commandSend")
export class CommandSend extends EntityBase {
// EMAIL = อีเมล
// INBOX = กล่องข้อความ
@Column({
nullable: true,
comment: "ช่องทางการส่งสำเนา",
length: 20,
default: null,
})
sendCC: string;
@Column({
nullable: true,
comment: "เลขประจำตัวประชาชน",
@ -82,6 +73,9 @@ export class CommandSend extends EntityBase {
@ManyToOne(() => Profile, (profile) => profile.commandSends)
@JoinColumn({ name: "profileId" })
profile: Profile;
@OneToMany(() => CommandSendCC, (commandSendCC) => commandSendCC.commandSend)
commandSendCCs: CommandSendCC[];
}
export class CreateCommandSend {

View file

@ -0,0 +1,31 @@
import { Entity, Column, JoinColumn, ManyToOne } from "typeorm";
import { EntityBase } from "./base/Base";
import { CommandSend } from "./CommandSend";
@Entity("commandSendCC")
export class CommandSendCC extends EntityBase {
@Column({
nullable: true,
comment: "เพศ",
length: 255,
default: null,
})
name: string;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง commandSend",
})
commandSendId: string;
@ManyToOne(() => CommandSend, (commandSend) => commandSend.commandSendCCs)
@JoinColumn({ name: "commandSendId" })
commandSend: CommandSend;
}
export class CreateCommandSendCC {
@Column()
name: string;
}
export type UpdateCommandSendCC = Partial<CreateCommandSendCC>;

View file

@ -116,6 +116,12 @@ export class OrgChild1 extends EntityBase {
})
responsibility: string;
@Column({
comment: "เป็นสกจ",
default: false,
})
isOfficer: boolean;
@ManyToOne(() => OrgRevision, (orgRevision) => orgRevision.orgChild1s)
@JoinColumn({ name: "orgRevisionId" })
orgRevision: OrgRevision;
@ -167,6 +173,9 @@ export class CreateOrgChild1 {
@Column()
responsibility?: string;
@Column()
isOfficer: boolean;
}
export type UpdateOrgChild1 = Partial<CreateOrgChild1> & { orgChild1Rank?: OrgChild1Rank };