Visualizacion via api de las operaciones pendientes
This commit is contained in:
@@ -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" }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user