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