From 31cc1d6a8c3ad125aec9ddba50cbe53975140293 Mon Sep 17 00:00:00 2001 From: asansal Date: Mon, 27 Oct 2025 07:13:12 +0700 Subject: [PATCH] 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()