mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
32 lines
845 B
TypeScript
32 lines
845 B
TypeScript
import { BaseEntity } from '@edr/api-common';
|
|
import { Entity, Column, Index } from 'typeorm';
|
|
|
|
export enum DisposalMethod {
|
|
SALE = 'SALE',
|
|
SCRAP = 'SCRAP',
|
|
RETURN_LEASE = 'RETURN_LEASE',
|
|
TRADE_IN = 'TRADE_IN',
|
|
}
|
|
|
|
@Entity({ name: 'asset_disposals', schema: 'freight' })
|
|
@Index(['vehicleId', 'disposalDate'])
|
|
export class AssetDisposal extends BaseEntity {
|
|
@Column({ name: 'vehicle_id', type: 'uuid' })
|
|
vehicleId!: string;
|
|
|
|
@Column({ name: 'disposal_date', type: 'date' })
|
|
disposalDate!: string;
|
|
|
|
@Column({ name: 'method', type: 'varchar' })
|
|
method!: DisposalMethod;
|
|
|
|
@Column({ name: 'sale_price', type: 'numeric', precision: 14, scale: 2, nullable: true })
|
|
salePrice?: number;
|
|
|
|
@Column({ name: 'buyer', nullable: true })
|
|
buyer?: string;
|
|
|
|
@Column({ name: 'notes', type: 'text', nullable: true })
|
|
notes?: string;
|
|
}
|