ConusAI vendor v0.1.0-beta.114
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-beta.114
2026-11-14 09:56:45 +00:00
commit 1ce8d23c35
867 changed files with 122104 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
// What the generated tenant-isolation suite (test/isolation.test.ts) needs of this module, from this
// folder: one fixture per tenant-scoped procedure, each called as a member of one organization with
// another's slugs, which the resolver must refuse before the Inventory service is reached.
//
// The module keeps no row of its own, so it seeds nothing: what a fixture names is the other tenant's
// project, and an id is any well-formed one (the service is never asked). The suite reads this file by
// its place whether or not the module is on, and checks only the procedures the app registers, so
// while the module is off (the template's default) it brings no fixture; `procedures.test.ts` runs the
// same fixtures against the module on its own, on or off.
import type { TransportCaller } from "@conusai-kit/core"
import type { IsolationFixture, IsolationTenant } from "@conusai-kit/testing"
import { businessModulesOn } from "../../index.js"
const SOMEWHERE = "00000000-0000-4000-8000-000000000001"
const inProjectOf = (t: IsolationTenant) => ({ org: t.orgSlug, workspace: t.workspaceSlug, project: t.projectSlug })
export const inventoryIsolationFixtures: Record<string, IsolationFixture> = {
"inventory.item.list": { input: (t) => inProjectOf(t) },
"inventory.item.create": { input: (t) => ({ ...inProjectOf(t), sku: "INTRUDER-1", name: "Intruder", unit: "pcs" }) },
"inventory.item.availability": { input: (t) => ({ ...inProjectOf(t), itemId: SOMEWHERE }) },
"inventory.reservation.list": { input: (t) => inProjectOf(t) },
"inventory.stock.reserve": {
input: (t) => ({ ...inProjectOf(t), itemId: SOMEWHERE, locationId: SOMEWHERE, quantity: 1, requestId: SOMEWHERE }),
},
"inventory.stock.release": { input: (t) => ({ ...inProjectOf(t), reservationId: SOMEWHERE, requestId: SOMEWHERE }) },
}
/** The shape the suite reads (`modules/notes/__tests__/isolation.ts` names it), so no other module is imported. */
export const isolation: {
seed(
call: TransportCaller,
inProject: { org: string; workspace: string; project: string },
): Promise<Record<string, string>>
fixtures: Record<string, IsolationFixture>
} = {
seed: async () => ({}),
fixtures: businessModulesOn.includes("inventory") ? inventoryIsolationFixtures : {},
}