mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 18:20:57 +00:00
Merge pull request #431 from Tria-plc/freight/feature/first_mile_invoice
Freight/feature/first mile invoice
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
import { IsArray, IsUUID, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
export class LastMileContainerAllocationDto {
|
||||
@IsUUID()
|
||||
containerId!: string;
|
||||
|
||||
@IsUUID()
|
||||
vehicleId!: string;
|
||||
}
|
||||
|
||||
export class AllocateLastMileContainersDto {
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => LastMileContainerAllocationDto)
|
||||
allocations!: LastMileContainerAllocationDto[];
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ export class LastMileService {
|
||||
const [data, total] = await this.lastMileRepository.findAndCount({
|
||||
where,
|
||||
relations: {
|
||||
booking: { company: true, serviceType: true, originYard: true, destinationYard: true, cargoType: true, bookingContainers: true },
|
||||
booking: { company: true, serviceType: true, originYard: true, destinationYard: true, cargoType: true, bookingContainers: { containerType: true } },
|
||||
vehicle: true,
|
||||
vehicleAssignments: { vehicle: true },
|
||||
},
|
||||
@@ -173,7 +173,7 @@ export class LastMileService {
|
||||
async findById(id: string): Promise<LastMile> {
|
||||
const record = await this.lastMileRepository.findById(id, {
|
||||
relations: {
|
||||
booking: { company: true, serviceType: true, originYard: true, destinationYard: true, cargoType: true, bookingContainers: true },
|
||||
booking: { company: true, serviceType: true, originYard: true, destinationYard: true, cargoType: true, bookingContainers: { containerType: true } },
|
||||
vehicle: true,
|
||||
vehicleAssignments: { vehicle: true },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user