hrms-api-org/src/entities/OrgRevision.ts

64 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-01-26 15:54:07 +07:00
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
2024-01-24 16:08:34 +07:00
import { EntityBase } from "./base/Base";
2024-01-26 15:54:07 +07:00
import { OrgRoot } from "./OrgRoot";
2024-01-24 16:08:34 +07:00
@Entity("orgRevision")
export class OrgRevision extends EntityBase {
// @Column({
// comment: "",
// length: 40,
// default: "00000000-0000-0000-0000-000000000000",
// })
// orgRevisionId: string;
2024-01-24 16:08:34 +07:00
@Column({
comment: "",
length: 255,
default: "string",
})
orgRevisionName: string;
@Column({
nullable: true,
comment: "",
default: false,
2024-01-24 16:08:34 +07:00
})
orgRevisionIsCurrent: boolean;
2024-01-24 16:08:34 +07:00
@Column({
nullable: true,
type: "datetime",
comment: "",
})
orgRevisionCreatedAt: Date;
@Column({
nullable: true,
type: "datetime",
comment: "เวลาเผยแพร่",
})
orgPublishDate: Date;
2024-01-24 16:08:34 +07:00
@Column({
nullable: true,
comment: "",
default: false,
2024-01-24 16:08:34 +07:00
})
orgRevisionIsDraft: boolean;
2024-01-26 10:13:07 +07:00
2024-01-26 15:54:07 +07:00
@OneToMany(() => OrgRoot, (orgRoot) => orgRoot.orgRevision)
orgRoots: OrgRoot[];
2024-01-24 16:08:34 +07:00
}
export class CreateOrgRevision {
@Column()
orgRevisionName: string;
@Column()
typeDraft: string;
2024-01-26 15:54:07 +07:00
@Column("uuid")
orgRevisionId?: string;
}
2024-01-24 16:08:34 +07:00
export type UpdateOrgRevision = Partial<OrgRevision>;