Visualizacion via api de las operaciones pendientes

This commit is contained in:
2026-02-25 17:23:22 +01:00
parent 02c80cd503
commit f221035c8b
9 changed files with 151 additions and 35 deletions

View File

@@ -63,7 +63,7 @@ describe("Test OrderRepository", {}, (ctx) => {
})
it("Find by correlation id should return a valid order", async () => {
const result = await orderRepo.getOrderByQueueId({ message_id: order1.correlation_id })
const result = await orderRepo.getOrderByQueueId({ correlation_id: order1.correlation_id })
assert(result.error == undefined)
assert(result.data != undefined)
@@ -74,6 +74,7 @@ describe("Test OrderRepository", {}, (ctx) => {
it("Get pending orders should return all pending orders in ASC order", async () => {
// We already have 'testId' from before block
// Insert two more orders
const orderA = { ...order1, correlation_id: "pending-A" }
const orderB = { ...order1, correlation_id: "pending-B" }

View File

@@ -72,12 +72,12 @@ export class OrderRepository {
/**
* Busqueda según la id de RabbitMq
*/
public async getOrderByQueueId<T>(data: { message_id: string }, pool?: PoolClient) {
public async getOrderByQueueId<T>(data: { correlation_id: string }, pool?: PoolClient) {
const query = `
SELECT * FROM order_tracking
WHERE correlation_id = $1
`
const values = [data.message_id]
const values = [data.correlation_id]
const queryPromise = this.pgClient.query<OrderTracking<T>>(query, values)
const result = await this.getFirst(queryPromise);
return result