Files
2026-11-14 09:56:45 +00:00

52 lines
2.3 KiB
TypeScript

// The inventory module's manifest: a client of the platform's Inventory business service (B-wave
// contract §3.14, docs/business-services.md). It keeps no table of its own -- the items, the stock
// and the reservations are the service's, in the deployment's organization -- so it has procedures,
// permissions, pages and messages, and no repository, migration, job or event.
//
// The template ships it off: `kit module:on inventory` adds it to the list in modules/index.ts and
// asks the deployment token for the service scopes it needs (`inventory.items:read|write`,
// `inventory.stock:read`, `inventory.reservations:read|write`) in conusai.json.
import { defineModule } from "@conusai-kit/core"
import { INVENTORY_PROCEDURES } from "./adapters/procedures.js"
import { en, lt } from "./i18n/index.js"
export const inventoryModule = defineModule({
id: "inventory",
// A business module is its service, which this app reaches on these profiles (test/module-profiles.test.ts).
profiles: ["postgres", "mariadb", "mongodb"],
version: "0.1.0",
kit: "^0.1.0",
requires: ["tenancy"],
permissions: {
"inventory.item.read": "viewer",
"inventory.item.write": "editor",
"inventory.stock.reserve": "editor",
},
procedures: INVENTORY_PROCEDURES,
serviceRequirements: [
{
transport: "business",
service: "inventory",
apiRange: "^1.2.0",
profiles: ["postgres", "mariadb", "mongodb"],
operations: {
"inventory.item.list": ["inventory.items:read"],
"inventory.item.create": ["inventory.items:write"],
"inventory.item.availability": ["inventory.items:read", "inventory.stock:read"],
"inventory.reservation.list": ["inventory.reservations:read"],
"inventory.stock.reserve": ["inventory.reservations:write"],
"inventory.stock.release": ["inventory.reservations:read", "inventory.reservations:write"],
},
configuration: [],
dependencies: [],
dataClasses: ["operational"],
partitionRequired: true,
remediation: "/docs/business-services.md",
},
],
// `inventory` is the segment the web shell's module mount routes to `inventoryPage` (ui/pages.tsx).
ui: { nav: [{ scope: "project", label: "inventory.title", href: "inventory", permission: "inventory.item.read" }] },
i18n: { en, lt },
})