frist mile receive to warehouse and last mile truck arrival integration

This commit is contained in:
hagiye
2026-07-02 01:08:37 +03:00
parent 14a00af341
commit 129448e437
11 changed files with 299 additions and 30 deletions

View File

@@ -129,6 +129,12 @@ export class LastMileService {
}
async create(dto: CreateLastMileDto): Promise<LastMile> {
const [existing] = await this.lastMileRepository.findAll({
where: { bookingId: dto.bookingId },
take: 1,
});
if (existing) return existing;
return this.lastMileRepository.create({
bookingId: dto.bookingId,
status: dto.status ?? 'READY_TO_TRANSIT',