Fix de gestion de orders

Proceso de cancelacion verificado
This commit is contained in:
2026-02-27 13:43:09 +01:00
parent 04a6e50b7a
commit 4853fec7ff
10 changed files with 73 additions and 21 deletions

View File

@@ -240,7 +240,7 @@ export class OrderRepository {
)
RETURNING id;
`
const vOrderHistory = [args.id, currentOrder.status, args.new_status, args.reason]
const vOrderHistory = [orderId, currentOrder.status, args.new_status, args.reason]
const newOrderHistoryResult = await this.getFirst(
client.query<{ id: number }>(iOrderHistory, vOrderHistory)
)
@@ -331,7 +331,7 @@ export class OrderRepository {
)
RETURNING id;
`
const vOrderHistory = [args.id, currentOrder.status, args.reason ?? "finished successfully"]
const vOrderHistory = [orderId, currentOrder.status, args.reason ?? "finished successfully"]
const newOrderHistoryResult = await this.getFirst(
client.query<{ id: number }>(iOrderHistory, vOrderHistory)
)
@@ -352,6 +352,7 @@ export class OrderRepository {
return updatedOrder
}
// TODO: tema de poder filtrar por correlation_id
public async errorOrder(args: {
id: number,
status: "failed" | "dlx",