update realization fields

This commit is contained in:
fadlydev
2025-01-30 18:41:27 +07:00
parent 87c11a3416
commit aac8d290f0

View File

@ -7,6 +7,12 @@ import {
DeleteDateColumn DeleteDateColumn
} from 'typeorm'; } from 'typeorm';
enum ApprovalStatus {
PENDING = 'PENDING',
APPROVED = 'APPROVED',
REJECTED = 'REJECTED',
}
@Entity('asset_realizations') @Entity('asset_realizations')
export class AssetRealization { export class AssetRealization {
@PrimaryGeneratedColumn('uuid') @PrimaryGeneratedColumn('uuid')
@ -36,6 +42,26 @@ export class AssetRealization {
}) })
department_id: string; 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({ @Column({
nullable: false, nullable: false,
type: 'uuid', type: 'uuid',
@ -54,6 +80,7 @@ export class AssetRealization {
}) })
status: string; status: string;
// Discrepancies
@Column({ @Column({
nullable: true, nullable: true,
type: 'float', type: 'float',
@ -78,6 +105,50 @@ export class AssetRealization {
}) })
discrepancy_images: string; 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() @Column()
@CreateDateColumn() @CreateDateColumn()
created_at: Date; created_at: Date;