stashing code
This commit is contained in:
31
apps/frontend/src/lib/domains/order/domain/controller.ts
Normal file
31
apps/frontend/src/lib/domains/order/domain/controller.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { NewOrderModel } from "../data/entities";
|
||||
import type { OrderRepository } from "../data/repository";
|
||||
|
||||
export class OrderController {
|
||||
private repo: OrderRepository;
|
||||
|
||||
constructor(repo: OrderRepository) {
|
||||
this.repo = repo;
|
||||
}
|
||||
|
||||
async listActiveOrdersWithOnlyPrices() {
|
||||
return this.repo.listActiveOrders();
|
||||
}
|
||||
|
||||
async createOrder(payload: NewOrderModel) {
|
||||
return this.repo.createOrder(payload);
|
||||
}
|
||||
|
||||
async getOrderByPNR(pnr: string) {
|
||||
return this.repo.getOrderByPNR(pnr);
|
||||
}
|
||||
|
||||
async markOrdersAsFulfilled(oids: number[]) {
|
||||
throw new Error("NOT YET IMPLEMENTED");
|
||||
// return this.repo.markAgentsOrderAsFulfilled(oid);
|
||||
}
|
||||
|
||||
async deleteOrder(id: number) {
|
||||
return this.repo.deleteOrder(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user