From 8c28ccf13fecf11bfeef0967b0d3bcc4500fd978 Mon Sep 17 00:00:00 2001 From: asansal Date: Wed, 22 Oct 2025 11:17:17 +0700 Subject: [PATCH] new earchive Doc Type --- .../{earchive_mails.ts => earchive_doc.ts} | 4 +- src/entity/earchive_doctype.ts | 39 +++++++++++++++++++ src/schema/earchive.ts | 3 +- src/types/earchive.ts | 8 ++++ 4 files changed, 51 insertions(+), 3 deletions(-) rename src/entity/{earchive_mails.ts => earchive_doc.ts} (87%) create mode 100644 src/entity/earchive_doctype.ts create mode 100644 src/types/earchive.ts diff --git a/src/entity/earchive_mails.ts b/src/entity/earchive_doc.ts similarity index 87% rename from src/entity/earchive_mails.ts rename to src/entity/earchive_doc.ts index 549f078..512ad41 100644 --- a/src/entity/earchive_mails.ts +++ b/src/entity/earchive_doc.ts @@ -1,7 +1,7 @@ import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; -@Entity("earchive_mails", { schema: "earchive" }) -export class EarchiveMail { +@Entity("earchive_doc", { schema: "earchive" }) +export class EarchiveDoc { @PrimaryGeneratedColumn("uuid") id: string; diff --git a/src/entity/earchive_doctype.ts b/src/entity/earchive_doctype.ts new file mode 100644 index 0000000..ca780f5 --- /dev/null +++ b/src/entity/earchive_doctype.ts @@ -0,0 +1,39 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { User } from "./users"; + +@Entity("earchive_doctype", { schema: "earchive" }) +export class EarchiveDocType { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ nullable: true, length: 256, }) + doctype: string; + + @Column({ nullable: true, length: 5, }) + doctypeinitial: string; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ name: 'createdbyid', type: 'uuid', nullable: true }) + createdbyid: string; + + @ManyToOne(() => User, { nullable: true }) + @JoinColumn({ name: 'createdbyid' }) + createdby: User + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} diff --git a/src/schema/earchive.ts b/src/schema/earchive.ts index 8325a98..1b6e56c 100644 --- a/src/schema/earchive.ts +++ b/src/schema/earchive.ts @@ -1 +1,2 @@ -export * from "../entity/earchive_mails"; +export * from "../entity/earchive_doc"; +export * from "../entity/earchive_doctype"; diff --git a/src/types/earchive.ts b/src/types/earchive.ts new file mode 100644 index 0000000..a4cdd9e --- /dev/null +++ b/src/types/earchive.ts @@ -0,0 +1,8 @@ +export enum StatusDocument { + "rejected" = -3, + "draft" = -1, + "submitted" = 0, + "approval" = 1, + "disposition" = 2, +}; +