health-petal/apps/backend/src/lib/data-manager.ts
2026-05-23 16:20:42 +05:30

39 lines
1.1 KiB
TypeScript

import {
createStorageSpacesRepo,
createDistributorsRepo,
createProductsRepo,
createDrugInfoRepo,
createUnitsRepo,
createStockBatchesRepo,
type StorageSpacesRepo,
type DistributorsRepo,
type ProductsRepo,
type DrugInfoRepo,
type UnitsRepo,
type StockBatchesRepo,
} from "data-manager-sqlite";
export class DataManager {
readonly storageSpaces: StorageSpacesRepo;
readonly distributors: DistributorsRepo;
readonly products: ProductsRepo;
readonly drugInfo: DrugInfoRepo;
readonly units: UnitsRepo;
readonly stockBatches: StockBatchesRepo;
constructor() {
const { repo: storageSpacesRepo } = createStorageSpacesRepo();
const { repo: distributorsRepo } = createDistributorsRepo();
const { repo: productsRepo } = createProductsRepo();
const { repo: drugInfoRepo } = createDrugInfoRepo();
const { repo: unitsRepo } = createUnitsRepo();
const { repo: stockBatchesRepo } = createStockBatchesRepo();
this.storageSpaces = storageSpacesRepo;
this.distributors = distributorsRepo;
this.products = productsRepo;
this.drugInfo = drugInfoRepo;
this.units = unitsRepo;
this.stockBatches = stockBatchesRepo;
}
}