Add physical operations and warehouse journeys

This commit is contained in:
2026-11-05 23:33:26 +00:00
parent 6f3146dbc4
commit cb1eb10953
5 changed files with 49 additions and 9 deletions
+14 -2
View File
@@ -4,12 +4,15 @@ import { CAPABILITY_PRESETS, CATALOG_SYSTEM_PRESETS, DEPLOYMENT_TEMPLATES, START
describe('landscape model', () => {
it('provides the editable demo landscape', () => {
const landscape = demoLandscape()
expect(landscape.systems).toHaveLength(10)
expect(landscape.scenarios.map((scenario) => scenario.name)).toEqual(expect.arrayContaining(['Place order', 'Register customer', 'Contact enquiry', 'Sample request', 'Commercial order', 'Order retry and recovery', 'Commit, build and deploy', 'Website → Middleware → ERP order']))
expect(landscape.systems).toHaveLength(15)
expect(landscape.scenarios.map((scenario) => scenario.name)).toEqual(expect.arrayContaining(['Place order', 'Register customer', 'Contact enquiry', 'Sample request', 'Commercial order', 'Order retry and recovery', 'Commit, build and deploy', 'Website → Middleware → ERP order', 'Physical goods receipt']))
expect(landscape.scenarios[0].steps[2].connectionIds).toHaveLength(2)
expect(getPreset('bitbucket')?.category).toBe('development-tool')
expect(landscape.connections.find((connection) => connection.id === 'azure-devops-website')?.connectionType).toBe('deployment')
expect(landscape.systems.find((system) => system.id === 'sitecore')?.environments?.[0].components.map((component) => component.role)).toEqual(expect.arrayContaining(['content-management', 'content-delivery', 'database-server', 'database', 'search-service']))
expect(landscape.systems.find((system) => system.id === 'warehouse')?.category).toBe('physical-location')
expect(landscape.connections.find((connection) => connection.id === 'supplier-warehouse-goods')?.connectionType).toBe('physical-goods')
expect(landscape.connections.find((connection) => connection.id === 'warehouse-operative-confirmation')?.connectionType).toBe('human-task')
})
it('round-trips a valid landscape and preserves positions', () => {
const source = demoLandscape(); const imported = validateLandscape(JSON.parse(JSON.stringify(source)))
@@ -72,4 +75,13 @@ describe('landscape model', () => {
placed.capabilities[0].payload = '{"edited":true}'
expect(website.capabilities[0].payload).not.toBe('{"edited":true}')
})
it('models a mixed physical and information journey with a human decision pause', () => {
const scenario = demoLandscape().scenarios.find((item) => item.id === 'physical-receipt')!
expect(scenario.steps[1].connectionIds).toEqual(['supplier-warehouse-goods'])
expect(scenario.steps[2].humanDecision?.roleSystemId).toBe('warehouse-operative')
expect(scenario.steps[2].humanDecision?.actions[0].connectionId).toBe('operative-wms-receipt')
expect(scenario.steps[3].connectionIds).toEqual(['wms-sap-receipt'])
const imported = validateLandscape(JSON.parse(JSON.stringify(demoLandscape())))
expect(imported.connections.find((connection) => connection.id === 'supplier-warehouse-goods')?.dataType).toBe('Physical goods')
})
})