Merge pull request #431 from Tria-plc/freight/feature/first_mile_invoice

Freight/feature/first mile invoice
This commit is contained in:
yaschalew10
2026-07-03 22:59:10 +03:00
committed by GitHub
6 changed files with 151 additions and 35 deletions

View File

@@ -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[];
}

View File

@@ -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 },
},