import {
  definePrimitivesModule,
  defineUserManagementModule,
  defineItemManagementModule,
  defineProductManagementModule,
} from "@tailor-platform/erp-kit/module";

export const primitivesModules = definePrimitivesModule({});

export const umModules = defineUserManagementModule({
  dbNamespace: "main-db",
});

export const imModules = defineItemManagementModule({
  primitives: {
    db: { unit: primitivesModules.db.unit },
    queries: { getUnit: primitivesModules.queries.getUnit },
  },
});

export const pmModules = defineProductManagementModule({
  primitives: {
    db: { unit: primitivesModules.db.unit },
    queries: { getUnit: primitivesModules.queries.getUnit },
  },
  itemManagement: {
    db: { item: imModules.db.item },
    commands: { createItem: imModules.commands.createItem },
  },
});
