mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 17:38:12 +00:00
vehicle
This commit is contained in:
@@ -26,39 +26,34 @@ export enum VehicleStatus {
|
||||
}
|
||||
|
||||
@Entity({ name: 'vehicles', schema: 'freight' })
|
||||
@Index(['plateNumber'])
|
||||
@Index(['registrationNumber'])
|
||||
@Index(['status'])
|
||||
@Index(['vehicleType'])
|
||||
@Index(['manufacturer'])
|
||||
export class Vehicle extends BaseEntity {
|
||||
@Column({ name: 'plate_number', unique: true })
|
||||
plateNumber!: string;
|
||||
@Column({ name: 'plate_number', unique: true, nullable: true })
|
||||
plateNumber?: string;
|
||||
|
||||
@Column({ name: 'registration_number', unique: true })
|
||||
registrationNumber!: string;
|
||||
@Column({ name: 'registration_number', unique: true, nullable: true })
|
||||
registrationNumber?: string;
|
||||
|
||||
@Column({ name: 'vehicle_type', type: 'varchar' })
|
||||
vehicleType!: VehicleType;
|
||||
@Column({ name: 'vehicle_type', type: 'varchar', nullable: true })
|
||||
vehicleType?: VehicleType;
|
||||
|
||||
@Column()
|
||||
manufacturer!: string;
|
||||
@Column({ nullable: true })
|
||||
manufacturer?: string;
|
||||
|
||||
@Column()
|
||||
model!: string;
|
||||
@Column({ nullable: true })
|
||||
model?: string;
|
||||
|
||||
@Column()
|
||||
year!: number;
|
||||
@Column({ nullable: true })
|
||||
year?: number;
|
||||
|
||||
@Column({ name: 'fuel_type', type: 'varchar' })
|
||||
fuelType!: FuelType;
|
||||
@Column({ name: 'fuel_type', type: 'varchar', nullable: true })
|
||||
fuelType?: FuelType;
|
||||
|
||||
@Column()
|
||||
capacity!: number;
|
||||
@Column({ nullable: true })
|
||||
capacity?: number;
|
||||
|
||||
@Column({ name: 'status', type: 'varchar', default: VehicleStatus.ACTIVE })
|
||||
status!: VehicleStatus;
|
||||
@Column({ name: 'status', type: 'varchar', default: VehicleStatus.ACTIVE, nullable: true })
|
||||
status?: VehicleStatus;
|
||||
|
||||
@Column({ type: 'text', nullable: true })
|
||||
description!: string | null;
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user