From b1a3804dd616b67fcafa04aece7262ca12e4ca4d Mon Sep 17 00:00:00 2001 From: asansal Date: Tue, 2 Dec 2025 12:39:54 +0700 Subject: [PATCH] add decision --- src/entity/earchive_decision.ts | 62 +++++++++++++++++++++++++++++++++ src/entity/earchive_doc.ts | 4 +++ src/schema/earchive.ts | 1 + src/types/earchive.ts | 1 + 4 files changed, 68 insertions(+) create mode 100644 src/entity/earchive_decision.ts diff --git a/src/entity/earchive_decision.ts b/src/entity/earchive_decision.ts new file mode 100644 index 0000000..ed41b7d --- /dev/null +++ b/src/entity/earchive_decision.ts @@ -0,0 +1,62 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { User } from "./users"; +import { EarchiveDoc } from "./earchive_doc"; + +@Entity("earchive_decision", { schema: "earchive" }) +export class EarchiveDecision { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ type: 'int', nullable: true , default : 0}) + sorts: Number; + + @Column({ name: 'docid', type: 'uuid', nullable: true }) + docid: string; + + @ManyToOne(() => EarchiveDoc, { nullable: true }) + @JoinColumn({ name: 'docid' }) + doc: EarchiveDoc; + + @Column({ name: 'nik', nullable: true }) + nik: string; + + @Column({ name: 'employeename', nullable: true }) + employeename: string; + + @Column({ name: 'uuiddecision', type: 'uuid', nullable: true }) + uuiddecision: string; + + @Column({ name: 'decisiondate', nullable: true }) + decisiondate: Date; + + @Column({ type: 'int', nullable: true , default : 0}) + isapproved: Number; + + @Column({ name: 'remarks', nullable: true }) + remarks: 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/entity/earchive_doc.ts b/src/entity/earchive_doc.ts index 30dfbed..cc21117 100644 --- a/src/entity/earchive_doc.ts +++ b/src/entity/earchive_doc.ts @@ -8,6 +8,7 @@ import { EarchiveLink } from "./earchive_link"; import { EarchiveDisposisi } from "./earchive_disposisi"; import { EarchiveChecker } from "./earchive_checker"; import { EarchiveStar } from "./earchive_star"; +import { EarchiveDecision } from "./earchive_decision"; @Entity("earchive_doc", { schema: "earchive" }) export class EarchiveDoc { @@ -126,6 +127,9 @@ export class EarchiveDoc { @OneToMany(() => EarchiveDisposisi, (r) => r.doc) disposisi: EarchiveDisposisi[]; + + @OneToMany(() => EarchiveDecision, (r) => r.doc) + decision: EarchiveDecision[]; @OneToMany(() => EarchiveStar, (r) => r.doc) star: EarchiveStar[]; diff --git a/src/schema/earchive.ts b/src/schema/earchive.ts index 21cde98..289f98f 100644 --- a/src/schema/earchive.ts +++ b/src/schema/earchive.ts @@ -6,5 +6,6 @@ export * from "../entity/earchive_checker"; export * from "../entity/earchive_approval"; export * from "../entity/earchive_link"; export * from "../entity/earchive_disposisi"; +export * from "../entity/earchive_decision"; export * from "../entity/earchive_star"; export * from "../types/earchive"; \ No newline at end of file diff --git a/src/types/earchive.ts b/src/types/earchive.ts index a2c98c8..31d57e3 100644 --- a/src/types/earchive.ts +++ b/src/types/earchive.ts @@ -6,6 +6,7 @@ export enum StatusDocument { "checker" = 1, "approval" = 2, "disposition" = 3, + "decision" = 4, }; export enum TypeDocument {