From 31cc1d6a8c3ad125aec9ddba50cbe53975140293 Mon Sep 17 00:00:00 2001 From: asansal Date: Mon, 27 Oct 2025 07:13:12 +0700 Subject: [PATCH 1/3] fixing earchive doc --- src/entity/earchive_doc.ts | 56 ++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/src/entity/earchive_doc.ts b/src/entity/earchive_doc.ts index b2c802b..bc9dac5 100644 --- a/src/entity/earchive_doc.ts +++ b/src/entity/earchive_doc.ts @@ -2,6 +2,7 @@ import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToO import { User } from "./users"; import { StatusDocument, TypeDocument, TypePriority } from "../types/earchive"; import { EarchiveDocLogs } from "./earchive_doclogs"; +import { EarchiveReceiver } from "./earchive_receiver"; @Entity("earchive_doc", { schema: "earchive" }) export class EarchiveDoc { @@ -10,16 +11,16 @@ export class EarchiveDoc { @Column({ nullable: true }) docnumber: string; - + @Column({ nullable: true }) docsubject: string; - + @Column({ nullable: true }) doctype: TypeDocument; @Column({ nullable: true }) doctypename: string; - + @Column({ nullable: true }) docpriority: TypePriority; @@ -28,39 +29,39 @@ export class EarchiveDoc { @Column({ name: 'docdates', nullable: true }) docdates: Date; - - @Column({ name: 'approvalbyid', type: 'uuid', nullable: true }) - approvalbyid: string; - // @OneToOne(() => User, { nullable: true }) - // @JoinColumn({ name: 'approvalbyid' }) - // approvalby: User + @Column({ name: 'approvalbyid', type: 'uuid', nullable: true }) + approvalbyid: string; + + // @OneToOne(() => User, { nullable: true }) + // @JoinColumn({ name: 'approvalbyid' }) + // approvalby: User @Column({ name: 'approvaldate', nullable: true }) approvaldate: Date; - - @Column({ name: 'dispositionbyid', type: 'uuid', nullable: true }) - dispositionbyid: string; - // @OneToOne(() => User, { nullable: true }) - // @JoinColumn({ name: 'dispositionbyid' }) - // dispositionby: User + @Column({ name: 'dispositionbyid', type: 'uuid', nullable: true }) + dispositionbyid: string; + + // @OneToOne(() => User, { nullable: true }) + // @JoinColumn({ name: 'dispositionbyid' }) + // dispositionby: User @Column({ name: 'dispositiondate', nullable: true }) dispositiondate: Date; @Column({ name: 'attachdoc', nullable: true }) - attachdoc: string; - + attachdoc: string; + @Column({ name: 'attachdocurl', nullable: true }) - attachdocurl: string; - + attachdocurl: string; + @Column({ name: 'attachlink', nullable: true }) - attachlink: string; - + attachlink: string; + @Column({ type: 'text', nullable: true }) content: string; - + @Column({ type: 'int', nullable: true }) statusdoc: StatusDocument; @@ -74,10 +75,13 @@ export class EarchiveDoc { remarks: string; @OneToMany(() => EarchiveDocLogs, (ipo) => ipo.docs, { - cascade: false, - nullable: true, - }) - logs: EarchiveDocLogs; + cascade: false, + nullable: true, + }) + logs: EarchiveDocLogs; + + @OneToMany(() => EarchiveReceiver, (r) => r.doc) + receivers: EarchiveReceiver[]; @Column() @CreateDateColumn() From b5864b219dbef13d9856789cd5085e195ae51223 Mon Sep 17 00:00:00 2001 From: asansal Date: Mon, 27 Oct 2025 11:57:51 +0700 Subject: [PATCH 2/3] add receiver --- src/types/earchive.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/types/earchive.ts b/src/types/earchive.ts index 5a62eb2..f526079 100644 --- a/src/types/earchive.ts +++ b/src/types/earchive.ts @@ -17,7 +17,8 @@ export enum TypeDocument { export enum TypeReceiver { "Personal" = "P", - "Department" = "D" + "Department" = "D", + "Tembusan" = "T" }; export enum TypePriority { From f6a9b017cceaa927766b71b5c51109ab4ae8269c Mon Sep 17 00:00:00 2001 From: asansal Date: Wed, 29 Oct 2025 08:31:42 +0700 Subject: [PATCH 3/3] fixing earchive --- src/entity/earchive_approval.ts | 50 ++++++++++++++++++++++++++ src/entity/earchive_doc.ts | 18 +++++++++- src/entity/earchive_link.ts | 62 +++++++++++++++++++++++++++++++++ src/schema/earchive.ts | 2 ++ src/types/earchive.ts | 15 ++++++++ 5 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 src/entity/earchive_approval.ts create mode 100644 src/entity/earchive_link.ts diff --git a/src/entity/earchive_approval.ts b/src/entity/earchive_approval.ts new file mode 100644 index 0000000..64fc3dd --- /dev/null +++ b/src/entity/earchive_approval.ts @@ -0,0 +1,50 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { User } from "./users"; +import { EarchiveDoc } from "./earchive_doc"; + +@Entity("earchive_approval", { schema: "earchive" }) +export class EarchiveApproval { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ name: 'docid', type: 'uuid', nullable: true }) + docid: string; + + @ManyToOne(() => EarchiveDoc, { nullable: true }) + @JoinColumn({ name: 'docid' }) + doc: EarchiveDoc; + + @Column({ name: 'uuidapproval', type: 'uuid', nullable: true }) + uuidapproval: string; + + @Column({ name: 'approvaldate', nullable: true }) + approvaldate: Date; + + @Column({ type: 'int', nullable: true , default : 0}) + isapproved: Number; + + @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 bc9dac5..a2635f0 100644 --- a/src/entity/earchive_doc.ts +++ b/src/entity/earchive_doc.ts @@ -1,8 +1,9 @@ import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; import { User } from "./users"; -import { StatusDocument, TypeDocument, TypePriority } from "../types/earchive"; +import { BranchCode, StatusDocument, TypeCredential, TypeDocument, TypePriority } from "../types/earchive"; import { EarchiveDocLogs } from "./earchive_doclogs"; import { EarchiveReceiver } from "./earchive_receiver"; +import { EarchiveApproval } from "./earchive_approval"; @Entity("earchive_doc", { schema: "earchive" }) export class EarchiveDoc { @@ -11,6 +12,12 @@ export class EarchiveDoc { @Column({ nullable: true }) docnumber: string; + + @Column({ nullable: true }) + branchcode: BranchCode; + + @Column({ nullable: true }) + branchname: string; @Column({ nullable: true }) docsubject: string; @@ -20,6 +27,12 @@ export class EarchiveDoc { @Column({ nullable: true }) doctypename: string; + + @Column({ nullable: true }) + doccredential: TypeCredential; + + @Column({ nullable: true }) + doccredentialname: string; @Column({ nullable: true }) docpriority: TypePriority; @@ -82,6 +95,9 @@ export class EarchiveDoc { @OneToMany(() => EarchiveReceiver, (r) => r.doc) receivers: EarchiveReceiver[]; + + @OneToMany(() => EarchiveApproval, (r) => r.doc) + approval: EarchiveApproval[]; @Column() @CreateDateColumn() diff --git a/src/entity/earchive_link.ts b/src/entity/earchive_link.ts new file mode 100644 index 0000000..6ae0d7d --- /dev/null +++ b/src/entity/earchive_link.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_link", { schema: "earchive" }) +export class EarchiveLink { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ name: 'docid', type: 'uuid', nullable: true }) + docid: string; + + @ManyToOne(() => EarchiveDoc, { nullable: true }) + @JoinColumn({ name: 'docid' }) + doc: EarchiveDoc; + + @Column({ name: 'title', nullable: true }) + title: string; + + @Column({ name: 'link', nullable: true }) + link: string; + + @Column({ name: 'linksort', nullable: true }) + linksort: string; + + @Column({ name: 'description', nullable: true }) + description: string; + + @Column({ name: 'startdate', nullable: true }) + startdate: Date; + + @Column({ name: 'enddate', nullable: true }) + enddate: Date; + + @Column({ type: 'int', nullable: true , default : 0}) + limit: Number; + + @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 d8e8483..4ccd563 100644 --- a/src/schema/earchive.ts +++ b/src/schema/earchive.ts @@ -2,4 +2,6 @@ export * from "../entity/earchive_doc"; export * from "../entity/earchive_doctype"; export * from "../entity/earchive_doclogs"; export * from "../entity/earchive_receiver"; +export * from "../entity/earchive_approval"; +export * from "../entity/earchive_link"; export * from "../types/earchive"; \ No newline at end of file diff --git a/src/types/earchive.ts b/src/types/earchive.ts index f526079..6cae39d 100644 --- a/src/types/earchive.ts +++ b/src/types/earchive.ts @@ -15,6 +15,21 @@ export enum TypeDocument { "Surat_Izin_Prinsip" = "SIP" }; +export enum BranchCode { + "Bussiness_Department" = "BSN", + "Operation_Department" = "OPR", + "Risk_Management" = "RMC", + "Credit_Risk" = "CRR", + "Complain_Function" = "CMP" +}; + +export enum TypeCredential { + "Kerahasiaan" = "KR", + "Biasa" = "B", + "Rahasia" = "R", + "Sangat_Rahasia" = "SR" +}; + export enum TypeReceiver { "Personal" = "P", "Department" = "D",