From aac8d290f09ae8a062f24c0bec5498532fba8891 Mon Sep 17 00:00:00 2001 From: fadlydev Date: Thu, 30 Jan 2025 18:41:27 +0700 Subject: [PATCH] update realization fields --- src/entity/asset_realizations.ts | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/src/entity/asset_realizations.ts b/src/entity/asset_realizations.ts index 03d3710..82906c9 100644 --- a/src/entity/asset_realizations.ts +++ b/src/entity/asset_realizations.ts @@ -7,6 +7,12 @@ import { DeleteDateColumn } from 'typeorm'; +enum ApprovalStatus { + PENDING = 'PENDING', + APPROVED = 'APPROVED', + REJECTED = 'REJECTED', +} + @Entity('asset_realizations') export class AssetRealization { @PrimaryGeneratedColumn('uuid') @@ -36,6 +42,26 @@ export class AssetRealization { }) department_id: string; + // General Manager Approval + @Column({ + type: 'uuid', + nullable: true, + }) + approved_by_gm: string | null; + + @Column({ + type: 'timestamp', + nullable: true, + }) + gm_approval_date: Date | null; + + @Column({ + type: 'enum', + enum: ApprovalStatus, + default: ApprovalStatus.PENDING, + }) + gm_approval_status: ApprovalStatus; + @Column({ nullable: false, type: 'uuid', @@ -54,6 +80,7 @@ export class AssetRealization { }) status: string; + // Discrepancies @Column({ nullable: true, type: 'float', @@ -78,6 +105,50 @@ export class AssetRealization { }) discrepancy_images: string; + // Excess and Insufficient Quantity & Nominal + @Column({ + nullable: true, + type: 'float', + }) + excess_quantity: number; // Stores the extra quantity received + + @Column({ + nullable: true, + type: 'float', + }) + insufficient_quantity: number; // Stores the missing quantity + + @Column({ + nullable: true, + type: 'float', + }) + excess_nominal: number; // Stores the monetary value of excess quantity + + @Column({ + nullable: true, + type: 'float', + }) + insufficient_nominal: number; // Stores the monetary value of insufficient quantity + + // Image Evidence for Excess and Insufficient Quantity + @Column({ + nullable: true, + type: 'text', + }) + insufficient_quantity_images: string; // Stores URLs for insufficient quantity evidence + + @Column({ + nullable: true, + type: 'text', + }) + excess_quantity_images: string; // Stores URLs for excess quantity evidence + + @Column({ + type: 'varchar', + nullable: false, + }) + requested_by: string; + @Column() @CreateDateColumn() created_at: Date;