32 lines
717 B
TypeScript
32 lines
717 B
TypeScript
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 getOrderByUID(uid: string) {
|
|
return this.repo.getOrderByUID(uid);
|
|
}
|
|
|
|
async markOrdersAsFulfilled(oids: number[]) {
|
|
throw new Error("NOT YET IMPLEMENTED");
|
|
// return this.repo.markAgentsOrderAsFulfilled(oid);
|
|
}
|
|
|
|
async deleteOrder(id: number) {
|
|
return this.repo.deleteOrder(id);
|
|
}
|
|
}
|