fix: propagate ticket location to client record on save

This commit is contained in:
kevin-asprec
2026-05-04 14:52:57 +08:00
parent 3b032ab7c4
commit 1a0b4916d0

View File

@@ -103,6 +103,14 @@ export class TicketService {
throw new NotFoundException('Ticket not found');
}
// When saving location, also propagate to the client record
if (dto.latitude !== undefined && dto.longitude !== undefined && existing.clientId) {
await this.prisma.client.update({
where: { id: existing.clientId },
data: { latitude: dto.latitude, longitude: dto.longitude },
});
}
return this.prisma.ticket.update({
where: { id },
data: {