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 {
|
2024-01-26 20:25:18 +07:00
|
|
|
// @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: "",
|
2024-01-26 20:25:18 +07:00
|
|
|
default: false,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
2024-01-26 09:56:27 +07:00
|
|
|
orgRevisionIsCurrent: boolean;
|
2024-01-24 16:08:34 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
type: "datetime",
|
|
|
|
|
comment: "",
|
|
|
|
|
})
|
|
|
|
|
orgRevisionCreatedAt: Date;
|
|
|
|
|
|
2024-01-29 14:02:35 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
type: "datetime",
|
|
|
|
|
comment: "เวลาเผยแพร่",
|
|
|
|
|
})
|
|
|
|
|
orgPublishDate: Date;
|
|
|
|
|
|
2024-01-24 16:08:34 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "",
|
2024-01-26 20:25:18 +07:00
|
|
|
default: false,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
2024-01-26 09:56:27 +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
|
|
|
}
|
|
|
|
|
|
2024-01-26 20:25:18 +07:00
|
|
|
export class CreateOrgRevision {
|
|
|
|
|
@Column()
|
|
|
|
|
orgRevisionName: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
typeDraft: string;
|
2024-01-26 15:54:07 +07:00
|
|
|
|
2024-01-26 20:25:18 +07:00
|
|
|
@Column("uuid")
|
|
|
|
|
orgRevisionId?: string;
|
|
|
|
|
}
|
2024-01-24 16:08:34 +07:00
|
|
|
export type UpdateOrgRevision = Partial<OrgRevision>;
|