Orders con endpoints para monitorizacion
This commit is contained in:
37
packages/sim-entrada-eventos/aplication/Order.usecases.ts
Normal file
37
packages/sim-entrada-eventos/aplication/Order.usecases.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { PaginationArgs } from "#domain/common.js";
|
||||
import { OrderRepository } from "sim-shared/infrastructure/OrderRepository.js";
|
||||
|
||||
|
||||
export class OrderUsecases {
|
||||
private orderRepository: OrderRepository;
|
||||
constructor(args: {
|
||||
orderRepository: OrderRepository
|
||||
}
|
||||
) {
|
||||
this.orderRepository = args.orderRepository
|
||||
}
|
||||
|
||||
public getById(args: {
|
||||
id: number
|
||||
}) {
|
||||
return async () => {
|
||||
return await this.orderRepository.getOrderById(args)
|
||||
}
|
||||
}
|
||||
|
||||
public getByQueueId(args: {
|
||||
message_id: string
|
||||
}) {
|
||||
return async () => {
|
||||
return await this.orderRepository.getOrderByQueueId(args)
|
||||
}
|
||||
}
|
||||
|
||||
public getPending(args: PaginationArgs & {
|
||||
}) {
|
||||
return async () => {
|
||||
return await this.orderRepository.getPendingOrders(args)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user