update entity realization recap

This commit is contained in:
fadlydev
2025-01-10 13:07:29 +07:00
parent f6b518aea1
commit d93d574f6d

View File

@ -7,10 +7,12 @@ import {
DeleteDateColumn,
ManyToOne,
JoinColumn,
OneToMany,
} from 'typeorm';
import { Department } from './department';
import { User } from './users';
import { AssetRealization } from './asset_realizations';
@Entity('asset_realization_recaps')
export class AssetRealizationRecap {
@ -27,13 +29,13 @@ export class AssetRealizationRecap {
nullable: false,
type: 'date',
})
recap_date: Date;
recap_date: Date;
@Column({
nullable: false,
type: 'int',
})
total_assets: number;
total_assets: number;
@Column({
nullable: false,
@ -41,11 +43,11 @@ export class AssetRealizationRecap {
precision: 14,
scale: 2,
})
total_value: number;
total_value: number;
@ManyToOne(() => Department, (department) => department.id, { nullable: false })
@JoinColumn({ name: 'department_id' })
department: Department;
department: Department;
@Column({
nullable: false,
@ -63,15 +65,32 @@ export class AssetRealizationRecap {
})
created_by: string;
@OneToMany(() => AssetRealization, (realization) => realization.id)
assetRealizations: AssetRealization[];
@Column({
nullable: true,
type: 'float',
})
total_quantity_discrepancy: number;
@Column({
nullable: true,
type: 'decimal',
precision: 14,
scale: 2,
})
total_payment_discrepancy: number;
@Column({
nullable: true,
type: 'text',
})
remarks: string;
remarks: string;
@Column()
@CreateDateColumn()
created_at: Date;
created_at: Date;
@Column({ nullable: true })
@UpdateDateColumn()
@ -79,5 +98,5 @@ export class AssetRealizationRecap {
@Column({ nullable: true })
@DeleteDateColumn()
deleted_at: Date;
deleted_at: Date;
}