big boi refactor to customer inof from passenger info

This commit is contained in:
user
2025-10-20 21:46:26 +03:00
parent 2cc0ca4c51
commit 2fdb934ec9
53 changed files with 702 additions and 2068 deletions

View File

@@ -0,0 +1,42 @@
import { db } from "@pkg/db";
import type {
CreateCustomerInfoPayload,
UpdateCustomerInfoPayload,
} from "./data";
import { CustomerInfoRepository } from "./repository";
export class CustomerInfoUseCases {
private repo: CustomerInfoRepository;
constructor(repo: CustomerInfoRepository) {
this.repo = repo;
}
async getAllCustomerInfo() {
return this.repo.getAllCustomerInfo();
}
async getCustomerInfoById(id: number) {
return this.repo.getCustomerInfoById(id);
}
async getCustomerInfoByOrderId(orderId: number) {
return this.repo.getCustomerInfoByOrderId(orderId);
}
async createCustomerInfo(payload: CreateCustomerInfoPayload) {
return this.repo.createCustomerInfo(payload);
}
async updateCustomerInfo(payload: UpdateCustomerInfoPayload) {
return this.repo.updateCustomerInfo(payload);
}
async deleteCustomerInfo(id: number) {
return this.repo.deleteCustomerInfo(id);
}
}
export function getCustomerInfoUseCases() {
return new CustomerInfoUseCases(new CustomerInfoRepository(db));
}