From e6b6bd039f97b13d4cdf1c2ca00f1fef9d2954e3 Mon Sep 17 00:00:00 2001 From: Narul Hidayah Date: Thu, 22 Jan 2026 11:17:13 +0700 Subject: [PATCH 1/2] upd --- src/schema/finances.ts | 1 + src/types/finance.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/schema/finances.ts b/src/schema/finances.ts index b60f739..9ecf3ae 100644 --- a/src/schema/finances.ts +++ b/src/schema/finances.ts @@ -12,5 +12,6 @@ export * from "../entity/finance/finance_plan_items"; export * from "../entity/finance/finance_purchase_requests"; export * from "../entity/finance/finance_purchase_request_items"; export * from "../entity/finance/finance_cpvs"; +export * from "../entity/finance/finance_payment_orders"; export * from "../types/finance"; diff --git a/src/types/finance.ts b/src/types/finance.ts index ffde527..c6918c9 100644 --- a/src/types/finance.ts +++ b/src/types/finance.ts @@ -41,3 +41,10 @@ export enum FinanceCpvStatusType { paid = "paid", reject = "reject", } + +export enum FinancePaymentOrderStatusType { + draft = "draft", + pending_approve = "pending_approve", + approve = "approve", + reject = "reject", +} From 3efecaf6f41713ee3759c5d662c9230dd6d89c7d Mon Sep 17 00:00:00 2001 From: Narul Hidayah Date: Thu, 22 Jan 2026 15:28:46 +0700 Subject: [PATCH 2/2] upd --- src/entity/finance/finance_payment_orders.ts | 102 +++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/entity/finance/finance_payment_orders.ts diff --git a/src/entity/finance/finance_payment_orders.ts b/src/entity/finance/finance_payment_orders.ts new file mode 100644 index 0000000..97dd18a --- /dev/null +++ b/src/entity/finance/finance_payment_orders.ts @@ -0,0 +1,102 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { HrmsEmployee } from "../hrms/hrms_employee"; +import { FinanceCpv } from "./finance_cpvs"; +import { FinanceBankAccount } from "./finance_bank_account"; +import { FinancePaymentOrderStatusType } from "../../types/finance"; + +@Entity("finance_payment_orders", { schema: "finances" }) +export class FinancePaymentOrder { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => FinanceCpv, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + cpv: FinanceCpv; + + @Column({ + unique: true, + length: 128, + }) + code: string; + + @Column({ + nullable: false, + }) + payment_order_at: Date; + + @Column({ + nullable: true, + length: 256, + }) + paid_to_name: string; + + @Column({ + nullable: true, + length: 256, + }) + paid_to_title: string; + + @Column({ + nullable: true, + length: 128, + }) + subject_type: string; + + @ManyToOne(() => FinanceBankAccount, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + bank_account: FinanceBankAccount; + + @Column({ + nullable: true, + type: "float8", + }) + amount: number; + + @Column({ + type: "text", + nullable: true, + }) + amount_words: string; + + @Column({ + type: "text", + nullable: true, + }) + objective: string; + + @ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + approved_by: HrmsEmployee; + + @ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + authorized_by: HrmsEmployee; + + @Column({ + nullable: false, + default: FinancePaymentOrderStatusType.draft, + length: 128, + }) + status: FinancePaymentOrderStatusType; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @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; +}