fixing earchive doc

This commit is contained in:
2025-10-27 07:13:12 +07:00
parent 95aa41e07a
commit 31cc1d6a8c

View File

@ -2,6 +2,7 @@ import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToO
import { User } from "./users"; import { User } from "./users";
import { StatusDocument, TypeDocument, TypePriority } from "../types/earchive"; import { StatusDocument, TypeDocument, TypePriority } from "../types/earchive";
import { EarchiveDocLogs } from "./earchive_doclogs"; import { EarchiveDocLogs } from "./earchive_doclogs";
import { EarchiveReceiver } from "./earchive_receiver";
@Entity("earchive_doc", { schema: "earchive" }) @Entity("earchive_doc", { schema: "earchive" })
export class EarchiveDoc { export class EarchiveDoc {
@ -10,16 +11,16 @@ export class EarchiveDoc {
@Column({ nullable: true }) @Column({ nullable: true })
docnumber: string; docnumber: string;
@Column({ nullable: true }) @Column({ nullable: true })
docsubject: string; docsubject: string;
@Column({ nullable: true }) @Column({ nullable: true })
doctype: TypeDocument; doctype: TypeDocument;
@Column({ nullable: true }) @Column({ nullable: true })
doctypename: string; doctypename: string;
@Column({ nullable: true }) @Column({ nullable: true })
docpriority: TypePriority; docpriority: TypePriority;
@ -28,39 +29,39 @@ export class EarchiveDoc {
@Column({ name: 'docdates', nullable: true }) @Column({ name: 'docdates', nullable: true })
docdates: Date; docdates: Date;
@Column({ name: 'approvalbyid', type: 'uuid', nullable: true })
approvalbyid: string;
// @OneToOne(() => User, { nullable: true }) @Column({ name: 'approvalbyid', type: 'uuid', nullable: true })
// @JoinColumn({ name: 'approvalbyid' }) approvalbyid: string;
// approvalby: User
// @OneToOne(() => User, { nullable: true })
// @JoinColumn({ name: 'approvalbyid' })
// approvalby: User
@Column({ name: 'approvaldate', nullable: true }) @Column({ name: 'approvaldate', nullable: true })
approvaldate: Date; approvaldate: Date;
@Column({ name: 'dispositionbyid', type: 'uuid', nullable: true })
dispositionbyid: string;
// @OneToOne(() => User, { nullable: true }) @Column({ name: 'dispositionbyid', type: 'uuid', nullable: true })
// @JoinColumn({ name: 'dispositionbyid' }) dispositionbyid: string;
// dispositionby: User
// @OneToOne(() => User, { nullable: true })
// @JoinColumn({ name: 'dispositionbyid' })
// dispositionby: User
@Column({ name: 'dispositiondate', nullable: true }) @Column({ name: 'dispositiondate', nullable: true })
dispositiondate: Date; dispositiondate: Date;
@Column({ name: 'attachdoc', nullable: true }) @Column({ name: 'attachdoc', nullable: true })
attachdoc: string; attachdoc: string;
@Column({ name: 'attachdocurl', nullable: true }) @Column({ name: 'attachdocurl', nullable: true })
attachdocurl: string; attachdocurl: string;
@Column({ name: 'attachlink', nullable: true }) @Column({ name: 'attachlink', nullable: true })
attachlink: string; attachlink: string;
@Column({ type: 'text', nullable: true }) @Column({ type: 'text', nullable: true })
content: string; content: string;
@Column({ type: 'int', nullable: true }) @Column({ type: 'int', nullable: true })
statusdoc: StatusDocument; statusdoc: StatusDocument;
@ -74,10 +75,13 @@ export class EarchiveDoc {
remarks: string; remarks: string;
@OneToMany(() => EarchiveDocLogs, (ipo) => ipo.docs, { @OneToMany(() => EarchiveDocLogs, (ipo) => ipo.docs, {
cascade: false, cascade: false,
nullable: true, nullable: true,
}) })
logs: EarchiveDocLogs; logs: EarchiveDocLogs;
@OneToMany(() => EarchiveReceiver, (r) => r.doc)
receivers: EarchiveReceiver[];
@Column() @Column()
@CreateDateColumn() @CreateDateColumn()