@elaraai/e3-ui 1.0.98 → 1.0.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/src/allocation/adapters.d.ts +1 -1
- package/dist/src/allocation/adapters.js +1 -1
- package/dist/src/allocation/index.d.ts +46 -90
- package/dist/src/allocation/index.d.ts.map +1 -1
- package/dist/src/allocation/index.js +5 -5
- package/dist/src/allocation/index.js.map +1 -1
- package/dist/src/bind/data-indexed.d.ts +273 -51
- package/dist/src/bind/data-indexed.d.ts.map +1 -1
- package/dist/src/bind/data-indexed.js +233 -56
- package/dist/src/bind/data-indexed.js.map +1 -1
- package/dist/src/bind/data.d.ts +48 -9
- package/dist/src/bind/data.d.ts.map +1 -1
- package/dist/src/bind/data.js +48 -3
- package/dist/src/bind/data.js.map +1 -1
- package/dist/src/bind/record.d.ts +61 -24
- package/dist/src/bind/record.d.ts.map +1 -1
- package/dist/src/bind/record.js +17 -57
- package/dist/src/bind/record.js.map +1 -1
- package/dist/src/calendar/index.d.ts +55 -95
- package/dist/src/calendar/index.d.ts.map +1 -1
- package/dist/src/calendar/index.js +10 -6
- package/dist/src/calendar/index.js.map +1 -1
- package/dist/src/flowchart/index.d.ts +35 -31
- package/dist/src/flowchart/index.d.ts.map +1 -1
- package/dist/src/flowchart/index.js +35 -31
- package/dist/src/flowchart/index.js.map +1 -1
- package/dist/src/flowchart/library.d.ts +108 -84
- package/dist/src/flowchart/library.d.ts.map +1 -1
- package/dist/src/flowchart/library.js +108 -84
- package/dist/src/flowchart/library.js.map +1 -1
- package/dist/src/flowchart/payload.d.ts +39 -107
- package/dist/src/flowchart/payload.d.ts.map +1 -1
- package/dist/src/flowchart/payload.js +3 -3
- package/dist/src/flowchart/payload.js.map +1 -1
- package/dist/src/flowchart/values.d.ts +35 -31
- package/dist/src/flowchart/values.d.ts.map +1 -1
- package/dist/src/flowchart/values.js +35 -31
- package/dist/src/flowchart/values.js.map +1 -1
- package/dist/src/flowchart/window.d.ts +0 -12
- package/dist/src/flowchart/window.d.ts.map +1 -1
- package/dist/src/flowchart/window.js +3 -2
- package/dist/src/flowchart/window.js.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +7 -3
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +12 -3
- package/dist/src/internal.js.map +1 -1
- package/dist/src/plan/assemble.d.ts +8 -0
- package/dist/src/plan/assemble.d.ts.map +1 -1
- package/dist/src/plan/assemble.js +1 -1
- package/dist/src/plan/assemble.js.map +1 -1
- package/dist/src/plan/builders.d.ts +1518 -2
- package/dist/src/plan/builders.d.ts.map +1 -1
- package/dist/src/plan/builders.js +248 -114
- package/dist/src/plan/builders.js.map +1 -1
- package/dist/src/plan/event-rows.d.ts +9 -14
- package/dist/src/plan/event-rows.d.ts.map +1 -1
- package/dist/src/plan/event-rows.js +6 -46
- package/dist/src/plan/event-rows.js.map +1 -1
- package/dist/src/plan/factories.d.ts +72 -4
- package/dist/src/plan/factories.d.ts.map +1 -1
- package/dist/src/plan/factories.js +147 -1
- package/dist/src/plan/factories.js.map +1 -1
- package/dist/src/plan/index.d.ts +147 -125
- package/dist/src/plan/index.d.ts.map +1 -1
- package/dist/src/plan/index.js +135 -122
- package/dist/src/plan/index.js.map +1 -1
- package/dist/src/plan/ir.d.ts +1105 -44
- package/dist/src/plan/ir.d.ts.map +1 -1
- package/dist/src/plan/ir.js +5 -0
- package/dist/src/plan/ir.js.map +1 -1
- package/dist/src/plan/library.d.ts +65 -42
- package/dist/src/plan/library.d.ts.map +1 -1
- package/dist/src/plan/library.js +65 -42
- package/dist/src/plan/library.js.map +1 -1
- package/dist/src/plan/nested-checks.d.ts +146 -0
- package/dist/src/plan/nested-checks.d.ts.map +1 -0
- package/dist/src/plan/nested-checks.js +468 -0
- package/dist/src/plan/nested-checks.js.map +1 -0
- package/dist/src/plan/nested-patch.d.ts +35 -0
- package/dist/src/plan/nested-patch.d.ts.map +1 -0
- package/dist/src/plan/nested-patch.js +143 -0
- package/dist/src/plan/nested-patch.js.map +1 -0
- package/dist/src/plan/nested-read.d.ts +3250 -0
- package/dist/src/plan/nested-read.d.ts.map +1 -0
- package/dist/src/plan/nested-read.js +163 -0
- package/dist/src/plan/nested-read.js.map +1 -0
- package/dist/src/plan/nested.d.ts +280 -0
- package/dist/src/plan/nested.d.ts.map +1 -0
- package/dist/src/plan/nested.js +6 -0
- package/dist/src/plan/nested.js.map +1 -0
- package/dist/src/plan/ordered-source.d.ts +1030 -1
- package/dist/src/plan/ordered-source.d.ts.map +1 -1
- package/dist/src/plan/ordered-source.js +48 -6
- package/dist/src/plan/ordered-source.js.map +1 -1
- package/dist/src/plan/over.d.ts +111 -75
- package/dist/src/plan/over.d.ts.map +1 -1
- package/dist/src/plan/over.js +111 -75
- package/dist/src/plan/over.js.map +1 -1
- package/dist/src/plan/pick.d.ts +15 -3
- package/dist/src/plan/pick.d.ts.map +1 -1
- package/dist/src/plan/pick.js +75 -36
- package/dist/src/plan/pick.js.map +1 -1
- package/dist/src/plan/plan.d.ts +2719 -558
- package/dist/src/plan/plan.d.ts.map +1 -1
- package/dist/src/plan/plan.js +14 -2
- package/dist/src/plan/plan.js.map +1 -1
- package/dist/src/plan/reads.d.ts +421 -0
- package/dist/src/plan/reads.d.ts.map +1 -0
- package/dist/src/plan/reads.js +143 -0
- package/dist/src/plan/reads.js.map +1 -0
- package/dist/src/plan/refs.d.ts +111 -75
- package/dist/src/plan/refs.d.ts.map +1 -1
- package/dist/src/plan/refs.js +111 -75
- package/dist/src/plan/refs.js.map +1 -1
- package/dist/src/plan/root.d.ts +10 -5
- package/dist/src/plan/root.d.ts.map +1 -1
- package/dist/src/plan/root.js +76 -13
- package/dist/src/plan/root.js.map +1 -1
- package/dist/src/plan/series.d.ts +5140 -4331
- package/dist/src/plan/series.d.ts.map +1 -1
- package/dist/src/plan/series.js +1026 -264
- package/dist/src/plan/series.js.map +1 -1
- package/dist/src/plan/shade.d.ts +981 -0
- package/dist/src/plan/shade.d.ts.map +1 -0
- package/dist/src/plan/shade.js +60 -0
- package/dist/src/plan/shade.js.map +1 -0
- package/dist/src/plan/types.d.ts +178 -18
- package/dist/src/plan/types.d.ts.map +1 -1
- package/dist/src/plan/types.js +69 -19
- package/dist/src/plan/types.js.map +1 -1
- package/dist/src/query/builder.d.ts +3 -3
- package/dist/src/query/builder.d.ts.map +1 -1
- package/dist/src/query/builder.js +1 -1
- package/dist/src/query/library.d.ts +3 -3
- package/dist/src/query/library.d.ts.map +1 -1
- package/dist/src/query/library.js +1 -1
- package/dist/src/query/queries.d.ts +2 -2
- package/dist/src/query/queries.js +1 -1
- package/dist/src/query/saved.d.ts +8 -4
- package/dist/src/query/saved.d.ts.map +1 -1
- package/dist/src/query/saved.js +8 -4
- package/dist/src/query/saved.js.map +1 -1
- package/dist/src/query/types.d.ts +8 -3
- package/dist/src/query/types.d.ts.map +1 -1
- package/dist/src/query/types.js +8 -3
- package/dist/src/query/types.js.map +1 -1
- package/dist/src/roster/index.d.ts +47 -91
- package/dist/src/roster/index.d.ts.map +1 -1
- package/dist/src/roster/index.js +6 -6
- package/dist/src/roster/index.js.map +1 -1
- package/dist/src/roster/targets.d.ts +8 -4
- package/dist/src/roster/targets.d.ts.map +1 -1
- package/dist/src/roster/targets.js +9 -5
- package/dist/src/roster/targets.js.map +1 -1
- package/dist/src/schedule/cell-checks.js +3 -3
- package/dist/src/schedule/cell-checks.js.map +1 -1
- package/dist/src/schedule/days.d.ts +1 -1
- package/dist/src/schedule/days.js +1 -1
- package/dist/src/schedule/events.d.ts +10 -6
- package/dist/src/schedule/events.d.ts.map +1 -1
- package/dist/src/schedule/events.js +252 -228
- package/dist/src/schedule/events.js.map +1 -1
- package/dist/src/schedule/patch.d.ts +1 -1
- package/dist/src/schedule/patch.js +1 -1
- package/dist/src/schedule/periods.d.ts +8 -4
- package/dist/src/schedule/periods.d.ts.map +1 -1
- package/dist/src/schedule/periods.js +1 -1
- package/dist/src/schedule/periods.js.map +1 -1
- package/dist/src/schedule/record-window.d.ts +38 -58
- package/dist/src/schedule/record-window.d.ts.map +1 -1
- package/dist/src/schedule/record-window.js +15 -16
- package/dist/src/schedule/record-window.js.map +1 -1
- package/dist/src/schedule/resources.d.ts +1 -1
- package/dist/src/schedule/session.d.ts +1 -1
- package/dist/src/schedule/session.js +1 -1
- package/dist/src/schedule/types.d.ts +29 -1
- package/dist/src/schedule/types.d.ts.map +1 -1
- package/dist/src/schedule/types.js +16 -1
- package/dist/src/schedule/types.js.map +1 -1
- package/dist/src/schematic/index.d.ts +19 -9
- package/dist/src/schematic/index.d.ts.map +1 -1
- package/dist/src/schematic/index.js +19 -9
- package/dist/src/schematic/index.js.map +1 -1
- package/dist/src/schematic/kinds.d.ts +4 -4
- package/dist/src/schematic/kinds.js +9 -9
- package/dist/src/schematic/kinds.js.map +1 -1
- package/dist/src/schematic/payload.d.ts +38 -88
- package/dist/src/schematic/payload.d.ts.map +1 -1
- package/dist/src/schematic/payload.js +4 -4
- package/dist/src/schematic/payload.js.map +1 -1
- package/dist/src/schematic/window.d.ts +8 -7
- package/dist/src/schematic/window.d.ts.map +1 -1
- package/dist/src/schematic/window.js +22 -19
- package/dist/src/schematic/window.js.map +1 -1
- package/dist/src/sheet/bridge.d.ts +19 -0
- package/dist/src/sheet/bridge.d.ts.map +1 -1
- package/dist/src/sheet/bridge.js +28 -21
- package/dist/src/sheet/bridge.js.map +1 -1
- package/dist/src/sheet/index.d.ts +66 -46
- package/dist/src/sheet/index.d.ts.map +1 -1
- package/dist/src/sheet/index.js +66 -46
- package/dist/src/sheet/index.js.map +1 -1
- package/dist/src/sheet/library.d.ts +13 -8
- package/dist/src/sheet/library.d.ts.map +1 -1
- package/dist/src/sheet/library.js +13 -8
- package/dist/src/sheet/library.js.map +1 -1
- package/dist/src/sheet/record.d.ts +1 -1
- package/dist/src/sheet/record.js +2 -2
- package/dist/src/sheet/record.js.map +1 -1
- package/dist/src/sheet/registers.d.ts +152 -128
- package/dist/src/sheet/registers.d.ts.map +1 -1
- package/dist/src/sheet/registers.js +152 -128
- package/dist/src/sheet/registers.js.map +1 -1
- package/dist/src/sheet/root.d.ts +4 -1
- package/dist/src/sheet/root.d.ts.map +1 -1
- package/dist/src/sheet/root.js +15 -3
- package/dist/src/sheet/root.js.map +1 -1
- package/dist/src/sheet/sheet.d.ts +39 -113
- package/dist/src/sheet/sheet.d.ts.map +1 -1
- package/dist/src/sheet/sheet.js +7 -5
- package/dist/src/sheet/sheet.js.map +1 -1
- package/dist/src/sheet/sub-rows.d.ts +106 -76
- package/dist/src/sheet/sub-rows.d.ts.map +1 -1
- package/dist/src/sheet/sub-rows.js +106 -76
- package/dist/src/sheet/sub-rows.js.map +1 -1
- package/dist/src/sheet/types.d.ts +19 -62
- package/dist/src/sheet/types.d.ts.map +1 -1
- package/dist/src/studio/builder.d.ts +3 -153
- package/dist/src/studio/builder.d.ts.map +1 -1
- package/dist/src/studio/builder.js +1 -1
- package/dist/src/studio/canvas.d.ts +5 -4
- package/dist/src/studio/canvas.d.ts.map +1 -1
- package/dist/src/studio/canvas.js +8 -7
- package/dist/src/studio/canvas.js.map +1 -1
- package/dist/src/studio/component.d.ts +30 -20
- package/dist/src/studio/component.d.ts.map +1 -1
- package/dist/src/studio/component.js +26 -61
- package/dist/src/studio/component.js.map +1 -1
- package/dist/src/studio/index.d.ts +2 -2
- package/dist/src/studio/index.d.ts.map +1 -1
- package/dist/src/studio/index.js +1 -1
- package/dist/src/studio/index.js.map +1 -1
- package/dist/src/studio/inspector.d.ts +10 -39
- package/dist/src/studio/inspector.d.ts.map +1 -1
- package/dist/src/studio/inspector.js +11 -31
- package/dist/src/studio/inspector.js.map +1 -1
- package/dist/src/studio/library.d.ts +3 -169
- package/dist/src/studio/library.d.ts.map +1 -1
- package/dist/src/studio/library.js +1 -1
- package/dist/src/studio/page.d.ts +0 -8
- package/dist/src/studio/page.d.ts.map +1 -1
- package/dist/src/studio/pages.d.ts +17 -591
- package/dist/src/studio/pages.d.ts.map +1 -1
- package/dist/src/studio/pages.js +17 -44
- package/dist/src/studio/pages.js.map +1 -1
- package/dist/src/studio/palette.d.ts +2 -7
- package/dist/src/studio/palette.d.ts.map +1 -1
- package/dist/src/studio/palette.js +4 -5
- package/dist/src/studio/palette.js.map +1 -1
- package/dist/src/studio/publish.d.ts +8 -18
- package/dist/src/studio/publish.d.ts.map +1 -1
- package/dist/src/studio/publish.js +10 -36
- package/dist/src/studio/publish.js.map +1 -1
- package/dist/src/utils/derive.d.ts +12 -12
- package/dist/src/utils/derive.d.ts.map +1 -1
- package/dist/src/utils/derive.js +5 -2
- package/dist/src/utils/derive.js.map +1 -1
- package/dist/src/utils/ordered-source.d.ts.map +1 -1
- package/dist/src/utils/ordered-source.js +14 -5
- package/dist/src/utils/ordered-source.js.map +1 -1
- package/dist/test/allocation/allocation.examples.d.ts +1900 -1598
- package/dist/test/allocation/allocation.examples.d.ts.map +1 -1
- package/dist/test/allocation/allocation.examples.js +179 -89
- package/dist/test/allocation/allocation.examples.js.map +1 -1
- package/dist/test/allocation/optimise.examples.d.ts.map +1 -1
- package/dist/test/allocation/optimise.examples.js +7 -7
- package/dist/test/allocation/optimise.examples.js.map +1 -1
- package/dist/test/bind/data/data.examples.d.ts +1057 -903
- package/dist/test/bind/data/data.examples.d.ts.map +1 -1
- package/dist/test/bind/data/data.examples.js +260 -204
- package/dist/test/bind/data/data.examples.js.map +1 -1
- package/dist/test/bind/record/record.examples.d.ts +457 -426
- package/dist/test/bind/record/record.examples.d.ts.map +1 -1
- package/dist/test/bind/record/record.examples.js +41 -21
- package/dist/test/bind/record/record.examples.js.map +1 -1
- package/dist/test/calendar/calendar-records.examples.d.ts +162 -170
- package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -1
- package/dist/test/calendar/calendar-records.examples.js +20 -12
- package/dist/test/calendar/calendar-records.examples.js.map +1 -1
- package/dist/test/calendar/calendar-windows.examples.d.ts.map +1 -1
- package/dist/test/calendar/calendar-windows.examples.js +12 -12
- package/dist/test/calendar/calendar-windows.examples.js.map +1 -1
- package/dist/test/calendar/calendar.examples.d.ts +1172 -901
- package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
- package/dist/test/calendar/calendar.examples.js +211 -124
- package/dist/test/calendar/calendar.examples.js.map +1 -1
- package/dist/test/calendar/optimise.examples.js +2 -2
- package/dist/test/calendar/optimise.examples.js.map +1 -1
- package/dist/test/examples-package.d.ts +6 -9
- package/dist/test/examples-package.d.ts.map +1 -1
- package/dist/test/examples-package.js +11 -32
- package/dist/test/examples-package.js.map +1 -1
- package/dist/test/flowchart/flowchart.examples.d.ts +3841 -2820
- package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
- package/dist/test/flowchart/flowchart.examples.js +211 -121
- package/dist/test/flowchart/flowchart.examples.js.map +1 -1
- package/dist/test/plan/optimise.examples.js +2 -2
- package/dist/test/plan/optimise.examples.js.map +1 -1
- package/dist/test/plan/plan-events.examples.d.ts +4055 -3263
- package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-events.examples.js +492 -319
- package/dist/test/plan/plan-events.examples.js.map +1 -1
- package/dist/test/plan/plan-nested.examples.d.ts +1829 -0
- package/dist/test/plan/plan-nested.examples.d.ts.map +1 -0
- package/dist/test/plan/plan-nested.examples.js +321 -0
- package/dist/test/plan/plan-nested.examples.js.map +1 -0
- package/dist/test/plan/plan-records.examples.d.ts +328 -362
- package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-records.examples.js +81 -57
- package/dist/test/plan/plan-records.examples.js.map +1 -1
- package/dist/test/plan/plan-windows.examples.d.ts +1756 -1398
- package/dist/test/plan/plan-windows.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-windows.examples.js +161 -128
- package/dist/test/plan/plan-windows.examples.js.map +1 -1
- package/dist/test/plan/plan.examples.d.ts +2238 -5712
- package/dist/test/plan/plan.examples.d.ts.map +1 -1
- package/dist/test/plan/plan.examples.js +839 -968
- package/dist/test/plan/plan.examples.js.map +1 -1
- package/dist/test/query/query.examples.d.ts +5221 -3005
- package/dist/test/query/query.examples.d.ts.map +1 -1
- package/dist/test/query/query.examples.js +169 -118
- package/dist/test/query/query.examples.js.map +1 -1
- package/dist/test/roster/optimise.examples.d.ts.map +1 -1
- package/dist/test/roster/optimise.examples.js +7 -7
- package/dist/test/roster/optimise.examples.js.map +1 -1
- package/dist/test/roster/roster-records.examples.d.ts +364 -392
- package/dist/test/roster/roster-records.examples.d.ts.map +1 -1
- package/dist/test/roster/roster-records.examples.js +40 -26
- package/dist/test/roster/roster-records.examples.js.map +1 -1
- package/dist/test/roster/roster.examples.d.ts +4605 -4308
- package/dist/test/roster/roster.examples.d.ts.map +1 -1
- package/dist/test/roster/roster.examples.js +212 -113
- package/dist/test/roster/roster.examples.js.map +1 -1
- package/dist/test/schedule/schedule.examples.d.ts +2646 -2471
- package/dist/test/schedule/schedule.examples.d.ts.map +1 -1
- package/dist/test/schedule/schedule.examples.js +144 -88
- package/dist/test/schedule/schedule.examples.js.map +1 -1
- package/dist/test/schematic/schematic-records.examples.d.ts +286 -276
- package/dist/test/schematic/schematic-records.examples.d.ts.map +1 -1
- package/dist/test/schematic/schematic-records.examples.js +52 -38
- package/dist/test/schematic/schematic-records.examples.js.map +1 -1
- package/dist/test/schematic/schematic.examples.d.ts +1842 -1491
- package/dist/test/schematic/schematic.examples.d.ts.map +1 -1
- package/dist/test/schematic/schematic.examples.js +240 -134
- package/dist/test/schematic/schematic.examples.js.map +1 -1
- package/dist/test/sheet/optimise.examples.d.ts +102 -95
- package/dist/test/sheet/optimise.examples.d.ts.map +1 -1
- package/dist/test/sheet/optimise.examples.js +7 -3
- package/dist/test/sheet/optimise.examples.js.map +1 -1
- package/dist/test/sheet/sheet-records.examples.d.ts +175 -214
- package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -1
- package/dist/test/sheet/sheet-records.examples.js +29 -17
- package/dist/test/sheet/sheet-records.examples.js.map +1 -1
- package/dist/test/sheet/sheet.examples.d.ts +3642 -3353
- package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
- package/dist/test/sheet/sheet.examples.js +389 -282
- package/dist/test/sheet/sheet.examples.js.map +1 -1
- package/dist/test/studio/component.examples.js +2 -2
- package/dist/test/studio/component.examples.js.map +1 -1
- package/dist/test/studio/page.examples.js +6 -6
- package/dist/test/studio/page.examples.js.map +1 -1
- package/dist/test/studio/studio.examples.d.ts +2329 -873
- package/dist/test/studio/studio.examples.d.ts.map +1 -1
- package/dist/test/studio/studio.examples.js +155 -107
- package/dist/test/studio/studio.examples.js.map +1 -1
- package/package.json +15 -11
|
@@ -4,8 +4,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "@elaraai/e3-ui/jsx-runtime";
|
|
|
4
4
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
5
5
|
*/
|
|
6
6
|
/** @jsxImportSource @elaraai/e3-ui */
|
|
7
|
-
import { ArrayType, DateTimeType, DictType, East, FloatType, FunctionType, IntegerType, NullType, OptionType, PatchType, StringType, StructType, VariantType, example, none, some, variant, } from "@elaraai/east";
|
|
8
|
-
import { Chart, EventStateType, Format, Reactive, SegmentGroup, Slice, Text, UIComponentType, VStack } from "@elaraai/east-ui";
|
|
7
|
+
import { ArrayType, DateTimeType, DictType, East, FloatType, FunctionType, IntegerType, NullType, OptionType, PatchType, SortedMap, StringType, StructType, VariantType, compareFor, example, none, some, variant, } from "@elaraai/east";
|
|
8
|
+
import { Box, Button, Chart, EventStateType, Format, HStack, Reactive, SegmentGroup, Slice, Text, UIComponentType, VStack } from "@elaraai/east-ui";
|
|
9
9
|
import { Data, Plan, Record, Schedule } from "@elaraai/e3-ui";
|
|
10
10
|
import e3 from "@elaraai/e3";
|
|
11
11
|
// A Plan of event kinds (#1191, `Plan Builder Spec.md` §3): the resources are
|
|
@@ -58,141 +58,181 @@ export const PrintShift = StructType({ title: StringType, start: DateTimeType, e
|
|
|
58
58
|
/** A customer: its name, the district it is in and its trade. */
|
|
59
59
|
export const PrintCustomer = StructType({ name: StringType, district: StringType, trade: StringType });
|
|
60
60
|
/** The presses: three in each hall. A Plan never writes its resources. */
|
|
61
|
-
export const planPrintPresses = e3.record("plan_print_presses", DictType(StringType, PrintPress),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
]
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
export const planPrintPresses = e3.record("plan_print_presses", DictType(StringType, PrintPress), {
|
|
62
|
+
initial: new Map([
|
|
63
|
+
["a1", { name: "Press A1", hall: "Hall A", sheets_per_hour: 12000.0 }],
|
|
64
|
+
["a2", { name: "Press A2", hall: "Hall A", sheets_per_hour: 10000.0 }],
|
|
65
|
+
["a3", { name: "Press A3", hall: "Hall A", sheets_per_hour: 8000.0 }],
|
|
66
|
+
["b1", { name: "Press B1", hall: "Hall B", sheets_per_hour: 15000.0 }],
|
|
67
|
+
["b2", { name: "Press B2", hall: "Hall B", sheets_per_hour: 12000.0 }],
|
|
68
|
+
["b3", { name: "Press B3", hall: "Hall B", sheets_per_hour: 6000.0 }],
|
|
69
|
+
]),
|
|
70
|
+
indexes: (index) => ({
|
|
71
|
+
plan_print_presses_by_hall: index.on(["hall"]),
|
|
72
|
+
}),
|
|
73
|
+
mutations: (mutation) => ({
|
|
74
|
+
// The presses' patch door: the works edits its presses elsewhere, and a Plan reads them live.
|
|
75
|
+
patch: mutation.patch(),
|
|
76
|
+
}),
|
|
77
|
+
});
|
|
71
78
|
/** The crews: two in each hall. */
|
|
72
|
-
export const planPrintCrews = e3.record("plan_print_crews", DictType(StringType, PrintCrew),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
]
|
|
79
|
+
export const planPrintCrews = e3.record("plan_print_crews", DictType(StringType, PrintCrew), {
|
|
80
|
+
initial: new Map([
|
|
81
|
+
["c1", { name: "Crew 1", hall: "Hall A" }],
|
|
82
|
+
["c2", { name: "Crew 2", hall: "Hall A" }],
|
|
83
|
+
["c3", { name: "Crew 3", hall: "Hall B" }],
|
|
84
|
+
["c4", { name: "Crew 4", hall: "Hall B" }],
|
|
85
|
+
]),
|
|
86
|
+
});
|
|
78
87
|
/**
|
|
79
88
|
* The print jobs: actual before 14 October, in progress on it, confirmed,
|
|
80
89
|
* proposed and estimated after it; two overlapping on Press B2 on the 20th;
|
|
81
90
|
* and eight with no start waiting in the backlog, two due this week, two next
|
|
82
91
|
* week, two later and two with no due date.
|
|
83
92
|
*/
|
|
84
|
-
export const planPrintJobs = e3.record("plan_print_jobs", DictType(StringType, PrintJob),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
93
|
+
export const planPrintJobs = e3.record("plan_print_jobs", DictType(StringType, PrintJob), {
|
|
94
|
+
initial: new Map([
|
|
95
|
+
["J-1001", { title: "Spring catalogue", start: some(new Date("2026-10-05T06:00:00Z")), end: some(new Date("2026-10-05T14:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-07T00:00:00Z")) }],
|
|
96
|
+
["J-1002", { title: "Museum guide", start: some(new Date("2026-10-07T06:00:00Z")), end: some(new Date("2026-10-07T12:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 72000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
97
|
+
["J-1003", { title: "Event posters", start: some(new Date("2026-10-14T07:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a1"), state: variant("in-progress", null), sheets: 60000.0, customer: "Granite Hall", stock: variant("uncoated", null), due: some(new Date("2026-10-15T00:00:00Z")) }],
|
|
98
|
+
["J-1004", { title: "Course handbook", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-19T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
99
|
+
["J-1005", { title: "Menu cards", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T08:00:00Z")), press: some("a1"), state: variant("proposed", variant("recommended", null)), sheets: 24000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
100
|
+
["J-1006", { title: "Tour brochure", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a2"), state: variant("actual", null), sheets: 80000.0, customer: "Bluewater Tours", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
101
|
+
["J-1007", { title: "Annual report", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a2"), state: variant("in-progress", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
102
|
+
["J-1008", { title: "Seed catalogue", start: some(new Date("2026-10-21T06:00:00Z")), end: some(new Date("2026-10-21T16:00:00Z")), press: some("a2"), state: variant("proposed", variant("added", null)), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-24T00:00:00Z")) }],
|
|
103
|
+
["J-1009", { title: "Season flyers", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-28T09:00:00Z")), press: some("a2"), state: variant("estimated", null), sheets: 30000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-10-31T00:00:00Z")) }],
|
|
104
|
+
["J-1010", { title: "Club newsletter", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Kestrel Cycling Club", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
105
|
+
["J-1011", { title: "Stationery set", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-15T09:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 24000.0, customer: "Ivy Lane Studio", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
106
|
+
["J-1012", { title: "Gift boxes", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-22T12:00:00Z")), press: some("a3"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
|
|
107
|
+
["J-1013", { title: "Holiday catalogue", start: some(new Date("2026-10-05T06:00:00Z")), end: some(new Date("2026-10-05T22:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 240000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
108
|
+
["J-1014", { title: "Magazine run", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-12T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 180000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
|
|
109
|
+
["J-1015", { title: "Store flyers", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T16:00:00Z")), press: some("b1"), state: variant("in-progress", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
110
|
+
["J-1016", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-26T12:00:00Z")), press: some("b1"), state: variant("estimated", null), sheets: 90000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
111
|
+
["J-1017", { title: "Timetables", start: some(new Date("2026-10-09T06:00:00Z")), end: some(new Date("2026-10-09T10:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 48000.0, customer: "Bluewater Tours", stock: variant("uncoated", null), due: some(new Date("2026-10-12T00:00:00Z")) }],
|
|
112
|
+
["J-1018", { title: "Market posters", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
|
|
113
|
+
["J-1019", { title: "Loyalty cards", start: some(new Date("2026-10-20T10:00:00Z")), end: some(new Date("2026-10-20T13:00:00Z")), press: some("b2"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
114
|
+
["J-1020", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-29T08:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 24000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
115
|
+
["J-1021", { title: "Handbook covers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T08:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 12000.0, customer: "Elmway College", stock: variant("board", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
116
|
+
["J-1022", { title: "Box sleeves", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T09:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 18000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
|
|
117
|
+
["J-1023", { title: "Guide reprint", start: none, end: none, press: none, state: variant("estimated", null), sheets: 24000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
118
|
+
["J-1024", { title: "Order forms", start: none, end: none, press: none, state: variant("proposed", variant("added", null)), sheets: 40000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-17T00:00:00Z")) }],
|
|
119
|
+
["J-1025", { title: "Winter brochure", start: none, end: none, press: none, state: variant("estimated", null), sheets: 64000.0, customer: "Bluewater Tours", stock: variant("coated", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
|
|
120
|
+
["J-1026", { title: "Wall calendars", start: none, end: none, press: none, state: variant("estimated", null), sheets: 50000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
121
|
+
["J-1027", { title: "Prospectus", start: none, end: none, press: none, state: variant("estimated", null), sheets: 100000.0, customer: "Elmway College", stock: variant("coated", null), due: some(new Date("2026-11-06T00:00:00Z")) }],
|
|
122
|
+
["J-1028", { title: "Price lists", start: none, end: none, press: none, state: variant("estimated", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-11-13T00:00:00Z")) }],
|
|
123
|
+
["J-1029", { title: "Spare covers", start: none, end: none, press: none, state: variant("estimated", null), sheets: 8000.0, customer: "Meridian Monthly", stock: variant("board", null), due: none }],
|
|
124
|
+
["J-1030", { title: "Proof sheets", start: none, end: none, press: none, state: variant("estimated", null), sheets: 2000.0, customer: "Alder & Finch", stock: variant("uncoated", null), due: none }],
|
|
125
|
+
]),
|
|
126
|
+
indexes: (index) => ({
|
|
127
|
+
// The rail narrows each record through its own indexes (#1344): the jobs and the shifts over their interval
|
|
128
|
+
// indexes — on their own, and after a job's stock — so a narrowing keeps every event overlapping the window once;
|
|
129
|
+
// the presses by hall, the customers by district, and each templates record by its group.
|
|
130
|
+
plan_print_jobs_by_time: index.interval({ from: "start", to: "end" }),
|
|
131
|
+
plan_print_jobs_by_stock_time: index.interval({ on: ["stock"], from: "start", to: "end" }),
|
|
132
|
+
}),
|
|
133
|
+
mutations: (mutation) => ({
|
|
134
|
+
// The jobs' patch door: every Save commits through it.
|
|
135
|
+
patch: mutation.patch(),
|
|
136
|
+
}),
|
|
137
|
+
});
|
|
118
138
|
/** The stops: plate changes and services across the presses. */
|
|
119
|
-
export const planPrintStops = e3.record("plan_print_stops", DictType(StringType, PrintStop),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
139
|
+
export const planPrintStops = e3.record("plan_print_stops", DictType(StringType, PrintStop), {
|
|
140
|
+
initial: new Map([
|
|
141
|
+
["S-01", { title: "Plate change", at: new Date("2026-10-07T12:00:00Z"), press: "a1", kind: variant("plate_change", null) }],
|
|
142
|
+
["S-02", { title: "Service", at: new Date("2026-10-12T04:00:00Z"), press: "b1", kind: variant("service", null) }],
|
|
143
|
+
["S-03", { title: "Plate change", at: new Date("2026-10-14T12:00:00Z"), press: "a2", kind: variant("plate_change", null) }],
|
|
144
|
+
["S-04", { title: "Plate change", at: new Date("2026-10-19T18:00:00Z"), press: "a1", kind: variant("plate_change", null) }],
|
|
145
|
+
["S-05", { title: "Service", at: new Date("2026-10-26T14:00:00Z"), press: "a3", kind: variant("service", null) }],
|
|
146
|
+
["S-06", { title: "Plate change", at: new Date("2026-10-28T10:00:00Z"), press: "b2", kind: variant("plate_change", null) }],
|
|
147
|
+
]),
|
|
148
|
+
mutations: (mutation) => ({
|
|
149
|
+
// The stops' patch door.
|
|
150
|
+
patch: mutation.patch(),
|
|
151
|
+
}),
|
|
152
|
+
});
|
|
129
153
|
/** The shifts: each crew's early and late shifts, confirmed for the first two weeks and proposed for the last two. */
|
|
130
|
-
export const planPrintShifts = e3.record("plan_print_shifts", DictType(StringType, PrintShift),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
export const planPrintShifts = e3.record("plan_print_shifts", DictType(StringType, PrintShift), {
|
|
155
|
+
initial: new Map([
|
|
156
|
+
["SH-01", { title: "Early", start: new Date("2026-10-05T06:00:00Z"), end: new Date("2026-10-05T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
157
|
+
["SH-02", { title: "Early", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
158
|
+
["SH-03", { title: "Late", start: new Date("2026-10-13T14:00:00Z"), end: new Date("2026-10-13T22:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
159
|
+
["SH-04", { title: "Late", start: new Date("2026-10-15T14:00:00Z"), end: new Date("2026-10-15T22:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
160
|
+
["SH-05", { title: "Early", start: new Date("2026-10-19T06:00:00Z"), end: new Date("2026-10-19T14:00:00Z"), crew: "c1", state: variant("proposed", variant("recommended", null)) }],
|
|
161
|
+
["SH-06", { title: "Early", start: new Date("2026-10-26T06:00:00Z"), end: new Date("2026-10-26T14:00:00Z"), crew: "c1", state: variant("proposed", variant("recommended", null)) }],
|
|
162
|
+
["SH-07", { title: "Late", start: new Date("2026-10-05T14:00:00Z"), end: new Date("2026-10-05T22:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
|
|
163
|
+
["SH-08", { title: "Late", start: new Date("2026-10-07T14:00:00Z"), end: new Date("2026-10-07T22:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
|
|
164
|
+
["SH-09", { title: "Early", start: new Date("2026-10-13T06:00:00Z"), end: new Date("2026-10-13T14:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
|
|
165
|
+
["SH-10", { title: "Early", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-15T14:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
|
|
166
|
+
["SH-11", { title: "Late", start: new Date("2026-10-19T14:00:00Z"), end: new Date("2026-10-19T22:00:00Z"), crew: "c2", state: variant("proposed", variant("recommended", null)) }],
|
|
167
|
+
["SH-12", { title: "Late", start: new Date("2026-10-26T14:00:00Z"), end: new Date("2026-10-26T22:00:00Z"), crew: "c2", state: variant("proposed", variant("recommended", null)) }],
|
|
168
|
+
["SH-13", { title: "Early", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T14:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
|
|
169
|
+
["SH-14", { title: "Early", start: new Date("2026-10-08T06:00:00Z"), end: new Date("2026-10-08T14:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
|
|
170
|
+
["SH-15", { title: "Late", start: new Date("2026-10-12T14:00:00Z"), end: new Date("2026-10-12T22:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
|
|
171
|
+
["SH-16", { title: "Late", start: new Date("2026-10-14T14:00:00Z"), end: new Date("2026-10-14T22:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
|
|
172
|
+
["SH-17", { title: "Early", start: new Date("2026-10-20T06:00:00Z"), end: new Date("2026-10-20T14:00:00Z"), crew: "c3", state: variant("proposed", variant("recommended", null)) }],
|
|
173
|
+
["SH-18", { title: "Early", start: new Date("2026-10-27T06:00:00Z"), end: new Date("2026-10-27T14:00:00Z"), crew: "c3", state: variant("proposed", variant("added", null)) }],
|
|
174
|
+
["SH-19", { title: "Late", start: new Date("2026-10-06T14:00:00Z"), end: new Date("2026-10-06T22:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
|
|
175
|
+
["SH-20", { title: "Late", start: new Date("2026-10-08T14:00:00Z"), end: new Date("2026-10-08T22:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
|
|
176
|
+
["SH-21", { title: "Early", start: new Date("2026-10-12T06:00:00Z"), end: new Date("2026-10-12T14:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
|
|
177
|
+
["SH-22", { title: "Early", start: new Date("2026-10-14T06:00:00Z"), end: new Date("2026-10-14T14:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
|
|
178
|
+
["SH-23", { title: "Late", start: new Date("2026-10-20T14:00:00Z"), end: new Date("2026-10-20T22:00:00Z"), crew: "c4", state: variant("proposed", variant("recommended", null)) }],
|
|
179
|
+
["SH-24", { title: "Late", start: new Date("2026-10-27T14:00:00Z"), end: new Date("2026-10-27T22:00:00Z"), crew: "c4", state: variant("proposed", variant("added", null)) }],
|
|
180
|
+
]),
|
|
181
|
+
indexes: (index) => ({
|
|
182
|
+
plan_print_shifts_by_time: index.interval({ from: "start", to: "end" }),
|
|
183
|
+
}),
|
|
184
|
+
mutations: (mutation) => ({
|
|
185
|
+
// The shifts' patch door.
|
|
186
|
+
patch: mutation.patch(),
|
|
187
|
+
}),
|
|
188
|
+
});
|
|
158
189
|
/** A crew roster the works has locked for the week: Crew 1's two early shifts. */
|
|
159
|
-
export const planLockedShifts = e3.record("plan_locked_shifts", DictType(StringType, PrintShift),
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}))
|
|
190
|
+
export const planLockedShifts = e3.record("plan_locked_shifts", DictType(StringType, PrintShift), {
|
|
191
|
+
initial: new Map([
|
|
192
|
+
["SH-01", { title: "Early", start: new Date("2026-10-05T06:00:00Z"), end: new Date("2026-10-05T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
193
|
+
["SH-02", { title: "Early", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
194
|
+
]),
|
|
195
|
+
mutations: (mutation) => ({
|
|
196
|
+
// The locked roster's patch door, a checked one: it takes any change to a
|
|
197
|
+
// shift, and refuses one that takes a shift off the roster, naming why — what
|
|
198
|
+
// a Save that deletes one is answered.
|
|
199
|
+
patch: mutation.reduce(East.function([DictType(StringType, PrintShift), PatchType(DictType(StringType, PrintShift))], DictType(StringType, PrintShift), ($, roster, patch) => {
|
|
200
|
+
const next = $.let(East.applyPatch(roster, patch));
|
|
201
|
+
$.for(roster, ($2, _shift, key) => {
|
|
202
|
+
$2.if(next.has(key).not(), ($3) => { $3.error("the crew roster is locked for the week"); });
|
|
203
|
+
});
|
|
204
|
+
return next;
|
|
205
|
+
})),
|
|
206
|
+
}),
|
|
207
|
+
});
|
|
175
208
|
/** The customers the jobs are printed for, by account, in three districts: what the print works' library lists. A Plan never writes them. */
|
|
176
|
-
export const planPrintCustomers = e3.record("plan_print_customers", DictType(StringType, PrintCustomer),
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
]
|
|
194
|
-
|
|
195
|
-
|
|
209
|
+
export const planPrintCustomers = e3.record("plan_print_customers", DictType(StringType, PrintCustomer), {
|
|
210
|
+
initial: new Map([
|
|
211
|
+
["alder-finch", { name: "Alder & Finch", district: "Old Town", trade: "Retail" }],
|
|
212
|
+
["bluewater-tours", { name: "Bluewater Tours", district: "North Quay", trade: "Travel" }],
|
|
213
|
+
["copperleaf-cafe", { name: "Copperleaf Cafe", district: "Old Town", trade: "Hospitality" }],
|
|
214
|
+
["driftwood-museum", { name: "Driftwood Museum", district: "North Quay", trade: "Arts" }],
|
|
215
|
+
["elmway-college", { name: "Elmway College", district: "Riverside", trade: "Education" }],
|
|
216
|
+
["foxglove-gardens", { name: "Foxglove Gardens", district: "Riverside", trade: "Retail" }],
|
|
217
|
+
["granite-hall", { name: "Granite Hall", district: "Old Town", trade: "Events" }],
|
|
218
|
+
["harbour-arts", { name: "Harbour Arts Society", district: "North Quay", trade: "Arts" }],
|
|
219
|
+
["heathfield", { name: "Heathfield Theatre", district: "Old Town", trade: "Arts" }],
|
|
220
|
+
["ivy-lane", { name: "Ivy Lane Studio", district: "Riverside", trade: "Design" }],
|
|
221
|
+
["juniper-toys", { name: "Juniper Toys", district: "Riverside", trade: "Retail" }],
|
|
222
|
+
["kestrel-cycling", { name: "Kestrel Cycling Club", district: "Riverside", trade: "Sport" }],
|
|
223
|
+
["larkspur-home", { name: "Larkspur Home", district: "Old Town", trade: "Retail" }],
|
|
224
|
+
["meridian-monthly", { name: "Meridian Monthly", district: "North Quay", trade: "Publishing" }],
|
|
225
|
+
["northwind", { name: "Northwind Outfitters", district: "North Quay", trade: "Retail" }],
|
|
226
|
+
["orchard-market", { name: "Orchard Street Market", district: "Old Town", trade: "Markets" }],
|
|
227
|
+
]),
|
|
228
|
+
indexes: (index) => ({
|
|
229
|
+
plan_print_customers_by_district: index.on(["district"]),
|
|
230
|
+
}),
|
|
231
|
+
mutations: (mutation) => ({
|
|
232
|
+
// The customers' patch door: the works edits its customers elsewhere, and a Plan reads them live.
|
|
233
|
+
patch: mutation.patch(),
|
|
234
|
+
}),
|
|
235
|
+
});
|
|
196
236
|
/**
|
|
197
237
|
* Each press's utilisation (%): a reading a day from 5 October, as the
|
|
198
238
|
* dataflow measures it, idle at the weekends. Press B2's 97 on the 20th is
|
|
@@ -222,22 +262,26 @@ export const planPrintOutput = e3.input("plan_print_output", ArrayType(FloatType
|
|
|
222
262
|
* yet; and three with no start waiting in the backlog, due this week, next
|
|
223
263
|
* week and never.
|
|
224
264
|
*/
|
|
225
|
-
export const planEventJobs = e3.record("plan_event_jobs", DictType(StringType, PrintJob),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
265
|
+
export const planEventJobs = e3.record("plan_event_jobs", DictType(StringType, PrintJob), {
|
|
266
|
+
initial: new Map([
|
|
267
|
+
["J-3001", { title: "Spring catalogue", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
268
|
+
["J-3002", { title: "Course handbook", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-19T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
269
|
+
["J-3003", { title: "Annual report", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a2"), state: variant("in-progress", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
270
|
+
["J-3004", { title: "Club newsletter", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Kestrel Cycling Club", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
271
|
+
["J-3005", { title: "Store flyers", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-15T16:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
272
|
+
["J-3006", { title: "Market posters", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
|
|
273
|
+
["J-3007", { title: "Loyalty cards", start: some(new Date("2026-10-20T10:00:00Z")), end: some(new Date("2026-10-20T13:00:00Z")), press: some("b2"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
274
|
+
["J-3008", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T12:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
275
|
+
["J-3009", { title: "Ticket books", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-22T09:00:00Z")), press: none, state: variant("proposed", variant("added", null)), sheets: 24000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
|
|
276
|
+
["J-3010", { title: "Guide reprint", start: none, end: none, press: none, state: variant("estimated", null), sheets: 24000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
277
|
+
["J-3011", { title: "Wall calendars", start: none, end: none, press: none, state: variant("estimated", null), sheets: 50000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
278
|
+
["J-3012", { title: "Spare covers", start: none, end: none, press: none, state: variant("estimated", null), sheets: 8000.0, customer: "Meridian Monthly", stock: variant("board", null), due: none }],
|
|
279
|
+
]),
|
|
280
|
+
mutations: (mutation) => ({
|
|
281
|
+
// The smallest builder's jobs' patch door: its Save commits through it.
|
|
282
|
+
patch: mutation.patch(),
|
|
283
|
+
}),
|
|
284
|
+
});
|
|
241
285
|
/**
|
|
242
286
|
* The smallest builder (`Plan Builder Spec.md` §3.2): a row per press, each
|
|
243
287
|
* job a bar on its press, the jobs a record of the example's own. Jobs move
|
|
@@ -257,13 +301,13 @@ export const planEvents = example({
|
|
|
257
301
|
"Plan", "Schedule", "Schedule.resources", "Schedule.events", "Schedule.field", "event kinds", "events", "resources",
|
|
258
302
|
"rows", "jobs", "presses", "bars", "state", "backlog", "duration", "due", "fields", "library", "Plan.library",
|
|
259
303
|
"Plan.library.backlog", "Plan.library.tab", "customers", "drop", "Schedule.patch", "inspector", "overlaps",
|
|
260
|
-
"Unassigned", "id", "record", "Record.bind", "e3.record", "
|
|
304
|
+
"Unassigned", "id", "record", "Record.bind", "e3.record", "mutation.patch", "patch", "smallest", "builder",
|
|
261
305
|
"#1191", "#1195", "#1197", "#1198",
|
|
262
306
|
],
|
|
263
307
|
description: "The smallest builder — the presses as its rows (`Schedule.resources`) and the print jobs as bars on them (`Schedule.events`), a record of its own bound with its patch mutation; its library the backlog and the customers, each card setting the customer of the job it is dropped on (`Schedule.patch`); its inspector a job's customer and stock; an overlap on Press B2, and a job on no press on the Unassigned row",
|
|
264
308
|
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
265
309
|
const presses = $.let(Record.bind(planPrintPresses, []));
|
|
266
|
-
const jobs = $.let(Record.bind(planEventJobs
|
|
310
|
+
const jobs = $.let(Record.bind(planEventJobs));
|
|
267
311
|
const customers = $.let(Record.bind(planPrintCustomers, []));
|
|
268
312
|
const axis = $.let(Plan.axis({
|
|
269
313
|
window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
@@ -300,22 +344,32 @@ export const planEvents = example({
|
|
|
300
344
|
// ============================================================================
|
|
301
345
|
// planEventLinks — every way a link draws, and rows over a dataset
|
|
302
346
|
// ============================================================================
|
|
303
|
-
/** A paper stock: its name, and its level in thousands of sheets, a reading a week
|
|
304
|
-
export const PrintStock = StructType({ name: StringType, weekly:
|
|
347
|
+
/** A paper stock: its name, and its level in thousands of sheets, a reading a week keyed by its week (#1436). */
|
|
348
|
+
export const PrintStock = StructType({ name: StringType, weekly: DictType(DateTimeType, FloatType) });
|
|
305
349
|
/** Four jobs on the print works' presses — the covers and the sleeves on Press B3, and the handbooks and the boxes they go into on Press A1 — which the Plan's specs read as a second kind of job. */
|
|
306
|
-
export const planLinkJobs = e3.record("plan_link_jobs", DictType(StringType, PrintJob),
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
350
|
+
export const planLinkJobs = e3.record("plan_link_jobs", DictType(StringType, PrintJob), {
|
|
351
|
+
initial: new Map([
|
|
352
|
+
["J-2001", { title: "Handbook covers", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T08:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 12000.0, customer: "Elmway College", stock: variant("board", null), due: some(new Date("2026-10-07T00:00:00Z")) }],
|
|
353
|
+
["J-2002", { title: "Course handbook", start: some(new Date("2026-10-13T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
354
|
+
["J-2003", { title: "Box sleeves", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T09:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 18000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
|
|
355
|
+
["J-2004", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T12:00:00Z")), press: some("a1"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
356
|
+
]),
|
|
357
|
+
mutations: (mutation) => ({
|
|
358
|
+
// The linked jobs' patch door.
|
|
359
|
+
patch: mutation.patch(),
|
|
360
|
+
}),
|
|
361
|
+
});
|
|
314
362
|
/** The paper in stock. */
|
|
315
363
|
export const planLinkStock = e3.input("plan_link_stock", DictType(StringType, PrintStock), variant("value", new Map([
|
|
316
|
-
["board", { name: "Board", weekly: [
|
|
317
|
-
|
|
318
|
-
|
|
364
|
+
["board", { name: "Board", weekly: new SortedMap([
|
|
365
|
+
[new Date("2026-10-05T00:00:00Z"), 40.0], [new Date("2026-10-12T00:00:00Z"), 22.0], [new Date("2026-10-19T00:00:00Z"), 31.0], [new Date("2026-10-26T00:00:00Z"), 18.0],
|
|
366
|
+
], compareFor(DateTimeType)) }],
|
|
367
|
+
["coated", { name: "Coated", weekly: new SortedMap([
|
|
368
|
+
[new Date("2026-10-05T00:00:00Z"), 520.0], [new Date("2026-10-12T00:00:00Z"), 410.0], [new Date("2026-10-19T00:00:00Z"), 460.0], [new Date("2026-10-26T00:00:00Z"), 380.0],
|
|
369
|
+
], compareFor(DateTimeType)) }],
|
|
370
|
+
["uncoated", { name: "Uncoated", weekly: new SortedMap([
|
|
371
|
+
[new Date("2026-10-05T00:00:00Z"), 300.0], [new Date("2026-10-12T00:00:00Z"), 260.0], [new Date("2026-10-19T00:00:00Z"), 280.0], [new Date("2026-10-26T00:00:00Z"), 240.0],
|
|
372
|
+
], compareFor(DateTimeType)) }],
|
|
319
373
|
])));
|
|
320
374
|
/** A work centre a job passes through on its way out: the platesetter, the bindery's folder and binder, the dispatch bay. */
|
|
321
375
|
export const PrintCentre = StructType({ name: StringType });
|
|
@@ -326,73 +380,95 @@ export const PrintBinding = StructType({ title: StringType, start: DateTimeType,
|
|
|
326
380
|
/** A delivery leaving the dispatch bay. */
|
|
327
381
|
export const PrintDelivery = StructType({ title: StringType, at: DateTimeType, bay: StringType });
|
|
328
382
|
/** The platesetter. A Plan never writes its resources. */
|
|
329
|
-
export const planLinkSetters = e3.record("plan_link_setters", DictType(StringType, PrintCentre),
|
|
330
|
-
|
|
331
|
-
]
|
|
383
|
+
export const planLinkSetters = e3.record("plan_link_setters", DictType(StringType, PrintCentre), {
|
|
384
|
+
initial: new Map([
|
|
385
|
+
["ps", { name: "Platesetter" }],
|
|
386
|
+
]),
|
|
387
|
+
});
|
|
332
388
|
/** The bindery's two lines. */
|
|
333
|
-
export const planLinkLines = e3.record("plan_link_lines", DictType(StringType, PrintCentre),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
]
|
|
389
|
+
export const planLinkLines = e3.record("plan_link_lines", DictType(StringType, PrintCentre), {
|
|
390
|
+
initial: new Map([
|
|
391
|
+
["fold", { name: "Folder" }],
|
|
392
|
+
["bind", { name: "Binder" }],
|
|
393
|
+
]),
|
|
394
|
+
});
|
|
337
395
|
/** The dispatch bay. */
|
|
338
|
-
export const planLinkBays = e3.record("plan_link_bays", DictType(StringType, PrintCentre),
|
|
339
|
-
|
|
340
|
-
]
|
|
396
|
+
export const planLinkBays = e3.record("plan_link_bays", DictType(StringType, PrintCentre), {
|
|
397
|
+
initial: new Map([
|
|
398
|
+
["bay", { name: "Dispatch bay" }],
|
|
399
|
+
]),
|
|
400
|
+
});
|
|
341
401
|
/** The plates for the catalogue covers, made on the window's first day. */
|
|
342
|
-
export const planLinkPlates = e3.record("plan_link_plates", DictType(StringType, PrintPlates),
|
|
343
|
-
|
|
344
|
-
]
|
|
345
|
-
|
|
346
|
-
|
|
402
|
+
export const planLinkPlates = e3.record("plan_link_plates", DictType(StringType, PrintPlates), {
|
|
403
|
+
initial: new Map([
|
|
404
|
+
["P-01", { title: "Catalogue plates", at: new Date("2026-10-05T12:00:00Z"), setter: "ps" }],
|
|
405
|
+
]),
|
|
406
|
+
mutations: (mutation) => ({
|
|
407
|
+
// The plates' patch door.
|
|
408
|
+
patch: mutation.patch(),
|
|
409
|
+
}),
|
|
410
|
+
});
|
|
347
411
|
/**
|
|
348
412
|
* The jobs the links join, on the six presses. Each link's jobs sit where its
|
|
349
413
|
* figure needs them: a job of two hours, which draws the narrowest bar; a job
|
|
350
414
|
* running in from before the window; one that ends before it starts, and one
|
|
351
415
|
* that starts after it ends; two jobs back to back on one press.
|
|
352
416
|
*/
|
|
353
|
-
export const planLinkCaseJobs = e3.record("plan_link_case_jobs", DictType(StringType, PrintJob),
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
417
|
+
export const planLinkCaseJobs = e3.record("plan_link_case_jobs", DictType(StringType, PrintJob), {
|
|
418
|
+
initial: new Map([
|
|
419
|
+
["J-2001", { title: "Catalogue covers", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 12000.0, customer: "Larkspur Home", stock: variant("board", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
420
|
+
["J-2002", { title: "Shop posters", start: some(new Date("2026-10-10T06:00:00Z")), end: some(new Date("2026-10-11T06:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 24000.0, customer: "Orchard Street Market", stock: variant("uncoated", null), due: some(new Date("2026-10-20T00:00:00Z")) }],
|
|
421
|
+
["J-2003", { title: "Catalogue inserts", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-17T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
422
|
+
["J-2004", { title: "Price lists", start: some(new Date("2026-10-07T12:00:00Z")), end: some(new Date("2026-10-08T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
423
|
+
["J-2005", { title: "Menu cards", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-11T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
|
|
424
|
+
["J-2006", { title: "Gift tags", start: some(new Date("2026-10-25T06:00:00Z")), end: some(new Date("2026-10-25T18:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 20000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-28T00:00:00Z")) }],
|
|
425
|
+
["J-2007", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T14:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
426
|
+
["J-2008", { title: "Proof run", start: some(new Date("2026-10-02T06:00:00Z")), end: some(new Date("2026-10-05T18:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
427
|
+
["J-2009", { title: "Annual report", start: some(new Date("2026-10-19T18:00:00Z")), end: some(new Date("2026-10-21T06:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
428
|
+
["J-2010", { title: "Desk calendars", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-29T06:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
429
|
+
["J-2011", { title: "Calendar pads", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T18:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
430
|
+
["J-2012", { title: "Proof sheets", start: some(new Date("2026-09-28T06:00:00Z")), end: some(new Date("2026-09-30T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 8000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-01T00:00:00Z")) }],
|
|
431
|
+
["J-2013", { title: "Catalogue", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
432
|
+
["J-2014", { title: "Seed catalogue", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-23T12:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
|
|
433
|
+
["J-2015", { title: "Night run", start: some(new Date("2026-10-05T00:00:00Z")), end: some(new Date("2026-10-05T08:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
434
|
+
["J-2016", { title: "Store flyers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T20:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
435
|
+
["J-2017", { title: "Seed packets", start: some(new Date("2026-10-23T06:00:00Z")), end: some(new Date("2026-10-24T06:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-10-27T00:00:00Z")) }],
|
|
436
|
+
["J-2018", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-27T18:00:00Z")), press: some("b2"), state: variant("proposed", variant("recommended", null)), sheets: 54000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
437
|
+
["J-2019", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T06:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
438
|
+
["J-2020", { title: "Card stock", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("b3"), state: variant("actual", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
439
|
+
["J-2021", { title: "Book sections", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-12T12:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 84000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-14T00:00:00Z")) }],
|
|
440
|
+
["J-2022", { title: "Report covers", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-20T18:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
|
|
441
|
+
["J-2023", { title: "Spring brochure", start: some(new Date("2026-11-03T06:00:00Z")), end: some(new Date("2026-11-04T18:00:00Z")), press: some("b3"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("coated", null), due: some(new Date("2026-11-09T00:00:00Z")) }],
|
|
442
|
+
]),
|
|
443
|
+
mutations: (mutation) => ({
|
|
444
|
+
// The jobs' patch door.
|
|
445
|
+
patch: mutation.patch(),
|
|
446
|
+
}),
|
|
447
|
+
});
|
|
380
448
|
/** The bindery's jobs: two foldings of the book's sections, and two bindings. */
|
|
381
|
-
export const planLinkBindings = e3.record("plan_link_bindings", DictType(StringType, PrintBinding),
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
449
|
+
export const planLinkBindings = e3.record("plan_link_bindings", DictType(StringType, PrintBinding), {
|
|
450
|
+
initial: new Map([
|
|
451
|
+
["B-01", { title: "Fold sections", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-16T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
452
|
+
["B-02", { title: "Fold sections", start: new Date("2026-10-17T06:00:00Z"), end: new Date("2026-10-18T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
453
|
+
["B-03", { title: "Bind books", start: new Date("2026-10-20T18:00:00Z"), end: new Date("2026-10-21T18:00:00Z"), line: "bind", state: variant("confirmed", null) }],
|
|
454
|
+
["B-04", { title: "Bind exhibition book", start: new Date("2026-10-25T06:00:00Z"), end: new Date("2026-10-26T06:00:00Z"), line: "bind", state: variant("proposed", variant("recommended", null)) }],
|
|
455
|
+
]),
|
|
456
|
+
mutations: (mutation) => ({
|
|
457
|
+
// The bindery's patch door.
|
|
458
|
+
patch: mutation.patch(),
|
|
459
|
+
}),
|
|
460
|
+
});
|
|
389
461
|
/** The deliveries: the shop posters in the third week, the bound books in the fourth. */
|
|
390
|
-
export const planLinkDeliveries = e3.record("plan_link_deliveries", DictType(StringType, PrintDelivery),
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
]
|
|
394
|
-
|
|
395
|
-
|
|
462
|
+
export const planLinkDeliveries = e3.record("plan_link_deliveries", DictType(StringType, PrintDelivery), {
|
|
463
|
+
initial: new Map([
|
|
464
|
+
["D-01", { title: "Books", at: new Date("2026-10-28T10:00:00Z"), bay: "bay" }],
|
|
465
|
+
["D-02", { title: "Posters", at: new Date("2026-10-20T10:00:00Z"), bay: "bay" }],
|
|
466
|
+
]),
|
|
467
|
+
mutations: (mutation) => ({
|
|
468
|
+
// The deliveries' patch door.
|
|
469
|
+
patch: mutation.patch(),
|
|
470
|
+
}),
|
|
471
|
+
});
|
|
396
472
|
// ============================================================================
|
|
397
473
|
// Jobs of the Plan's specs' own: a kind in lanes, and a resource by its case
|
|
398
474
|
// ============================================================================
|
|
@@ -406,33 +482,45 @@ export const PrintLaneJob = StructType({
|
|
|
406
482
|
status: VariantType({ fine: NullType, late: NullType }),
|
|
407
483
|
});
|
|
408
484
|
/** Three lane jobs in the first week: two on Press A1 in its AM and PM lanes, one late; one late on Press A2. */
|
|
409
|
-
export const planRowsLaneJobs = e3.record("plan_rows_lane_jobs", DictType(StringType, PrintLaneJob),
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
485
|
+
export const planRowsLaneJobs = e3.record("plan_rows_lane_jobs", DictType(StringType, PrintLaneJob), {
|
|
486
|
+
initial: new Map([
|
|
487
|
+
["L-1", { title: "Proofs", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T08:00:00Z"), press: some("a1"), lane: "pm", status: variant("fine", null) }],
|
|
488
|
+
["L-2", { title: "Plates", start: new Date("2026-10-06T09:00:00Z"), end: new Date("2026-10-06T10:00:00Z"), press: some("a1"), lane: "am", status: variant("late", null) }],
|
|
489
|
+
["L-3", { title: "Wash-up", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T07:00:00Z"), press: some("a2"), lane: "am", status: variant("late", null) }],
|
|
490
|
+
]),
|
|
491
|
+
mutations: (mutation) => ({
|
|
492
|
+
// The lane jobs' patch door.
|
|
493
|
+
patch: mutation.patch(),
|
|
494
|
+
}),
|
|
495
|
+
});
|
|
416
496
|
/** A job on a press or in a bay — a resource field whose case names the kind. */
|
|
417
497
|
export const PrintOnJob = StructType({ title: StringType, start: DateTimeType, end: DateTimeType, on: VariantType({ press: StringType, bay: StringType }) });
|
|
418
498
|
/** One job on Press A1, and one in Bay A1: two kinds of resource with the same key. */
|
|
419
|
-
export const planRowsOnJobs = e3.record("plan_rows_on_jobs", DictType(StringType, PrintOnJob),
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
499
|
+
export const planRowsOnJobs = e3.record("plan_rows_on_jobs", DictType(StringType, PrintOnJob), {
|
|
500
|
+
initial: new Map([
|
|
501
|
+
["O-1", { title: "On the press", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T08:00:00Z"), on: variant("press", "a1") }],
|
|
502
|
+
["O-2", { title: "In the bay", start: new Date("2026-10-06T09:00:00Z"), end: new Date("2026-10-06T10:00:00Z"), on: variant("bay", "a1") }],
|
|
503
|
+
]),
|
|
504
|
+
mutations: (mutation) => ({
|
|
505
|
+
// The press-or-bay jobs' patch door.
|
|
506
|
+
patch: mutation.patch(),
|
|
507
|
+
}),
|
|
508
|
+
});
|
|
425
509
|
// ============================================================================
|
|
426
510
|
// The print works' finishing and dispatch records (#1200)
|
|
427
511
|
// ============================================================================
|
|
428
512
|
/** The parent of the shared folder and binder, held in a record like every other resource. */
|
|
429
|
-
export const planPrintBindery = e3.record("plan_print_bindery", DictType(StringType, PrintCentre),
|
|
430
|
-
|
|
431
|
-
]
|
|
513
|
+
export const planPrintBindery = e3.record("plan_print_bindery", DictType(StringType, PrintCentre), {
|
|
514
|
+
initial: new Map([
|
|
515
|
+
["bindery", { name: "Bindery" }],
|
|
516
|
+
]),
|
|
517
|
+
});
|
|
432
518
|
/** The vans a delivery can move onto from the dispatch bay. */
|
|
433
|
-
export const planPrintVans = e3.record("plan_print_vans", DictType(StringType, PrintCentre),
|
|
434
|
-
|
|
435
|
-
]
|
|
519
|
+
export const planPrintVans = e3.record("plan_print_vans", DictType(StringType, PrintCentre), {
|
|
520
|
+
initial: new Map([
|
|
521
|
+
["van1", { name: "Van 1" }], ["van2", { name: "Van 2" }],
|
|
522
|
+
]),
|
|
523
|
+
});
|
|
436
524
|
/** A delivery's own status, separate from the schedule's lifecycle. */
|
|
437
525
|
export const PrintDispatchStatus = VariantType({ queued: NullType, ready: NullType, dispatched: NullType });
|
|
438
526
|
/** A delivery on a bay or a van: the variant preserves the resource kind when it moves. */
|
|
@@ -442,28 +530,40 @@ export const PrintDispatch = StructType({
|
|
|
442
530
|
lane: StringType, status: PrintDispatchStatus, pallets: FloatType,
|
|
443
531
|
});
|
|
444
532
|
/** The print works' own plate orders, timed before its existing jobs. */
|
|
445
|
-
export const planPrintPlates = e3.record("plan_print_plates", DictType(StringType, PrintPlates),
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
]
|
|
449
|
-
|
|
450
|
-
|
|
533
|
+
export const planPrintPlates = e3.record("plan_print_plates", DictType(StringType, PrintPlates), {
|
|
534
|
+
initial: new Map([
|
|
535
|
+
["P-101", { title: "Handbook plates", at: new Date("2026-10-16T14:00:00Z"), setter: "ps" }],
|
|
536
|
+
["P-102", { title: "Poster plates", at: new Date("2026-10-13T14:00:00Z"), setter: "ps" }],
|
|
537
|
+
]),
|
|
538
|
+
mutations: (mutation) => ({
|
|
539
|
+
// The print works' plates commit through their own patch door.
|
|
540
|
+
patch: mutation.patch(),
|
|
541
|
+
}),
|
|
542
|
+
});
|
|
451
543
|
/** Two foldings run in parallel, followed by binding, after the handbook leaves Press A1. */
|
|
452
|
-
export const planPrintBindings = e3.record("plan_print_bindings", DictType(StringType, PrintBinding),
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
544
|
+
export const planPrintBindings = e3.record("plan_print_bindings", DictType(StringType, PrintBinding), {
|
|
545
|
+
initial: new Map([
|
|
546
|
+
["B-101", { title: "Fold handbook sections", start: new Date("2026-10-20T06:00:00Z"), end: new Date("2026-10-20T14:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
547
|
+
["B-102", { title: "Fold handbook inserts", start: new Date("2026-10-20T10:00:00Z"), end: new Date("2026-10-20T16:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
548
|
+
["B-103", { title: "Bind handbooks", start: new Date("2026-10-21T06:00:00Z"), end: new Date("2026-10-21T14:00:00Z"), line: "bind", state: variant("confirmed", null) }],
|
|
549
|
+
]),
|
|
550
|
+
mutations: (mutation) => ({
|
|
551
|
+
// The print works' bindery jobs commit through their own patch door.
|
|
552
|
+
patch: mutation.patch(),
|
|
553
|
+
}),
|
|
554
|
+
});
|
|
459
555
|
/** Deliveries occupy AM/PM lanes and carry each of the dispatch statuses. */
|
|
460
|
-
export const planPrintDeliveries = e3.record("plan_print_deliveries", DictType(StringType, PrintDispatch),
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
556
|
+
export const planPrintDeliveries = e3.record("plan_print_deliveries", DictType(StringType, PrintDispatch), {
|
|
557
|
+
initial: new Map([
|
|
558
|
+
["D-101", { title: "Handbooks", at: new Date("2026-10-22T10:00:00Z"), location: variant("bay", "bay"), lane: "AM", status: variant("queued", null), pallets: 3.0 }],
|
|
559
|
+
["D-102", { title: "Event posters", at: new Date("2026-10-15T14:00:00Z"), location: variant("van", "van1"), lane: "PM", status: variant("ready", null), pallets: 2.0 }],
|
|
560
|
+
["D-103", { title: "Museum guides", at: new Date("2026-10-09T10:00:00Z"), location: variant("van", "van2"), lane: "AM", status: variant("dispatched", null), pallets: 1.0 }],
|
|
561
|
+
]),
|
|
562
|
+
mutations: (mutation) => ({
|
|
563
|
+
// The print works' deliveries commit through their own patch door.
|
|
564
|
+
patch: mutation.patch(),
|
|
565
|
+
}),
|
|
566
|
+
});
|
|
467
567
|
// ============================================================================
|
|
468
568
|
// The print works' templates, each a record of its own (#1344)
|
|
469
569
|
// ============================================================================
|
|
@@ -486,49 +586,65 @@ export const PrintDeliveryTemplate = StructType({
|
|
|
486
586
|
values: StructType({ title: StringType, lane: StringType, status: PrintDispatchStatus, pallets: FloatType }),
|
|
487
587
|
});
|
|
488
588
|
/** The job templates. A Plan never writes them: the library lists them, and a drop creates a job from one. */
|
|
489
|
-
export const planPrintJobTemplates = e3.record("plan_print_job_templates", DictType(StringType, PrintJobTemplate),
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
589
|
+
export const planPrintJobTemplates = e3.record("plan_print_job_templates", DictType(StringType, PrintJobTemplate), {
|
|
590
|
+
initial: new Map([
|
|
591
|
+
["board", { name: "Board run", group: "Jobs", hours: 8.0, values: { title: "Board run", state: variant("proposed", variant("added", null)), sheets: 24000.0, customer: "", stock: variant("board", null), due: none } }],
|
|
592
|
+
["brochure", { name: "Brochure run", group: "Jobs", hours: 6.0, values: { title: "Brochure run", state: variant("proposed", variant("added", null)), sheets: 40000.0, customer: "", stock: variant("coated", null), due: none } }],
|
|
593
|
+
["catalogue", { name: "Catalogue run", group: "Jobs", hours: 12.0, values: { title: "Catalogue run", state: variant("proposed", variant("added", null)), sheets: 96000.0, customer: "", stock: variant("coated", null), due: none } }],
|
|
594
|
+
["poster", { name: "Poster run", group: "Jobs", hours: 4.0, values: { title: "Poster run", state: variant("proposed", variant("added", null)), sheets: 20000.0, customer: "", stock: variant("uncoated", null), due: none } }],
|
|
595
|
+
]),
|
|
596
|
+
indexes: (index) => ({
|
|
597
|
+
plan_print_job_templates_by_group: index.on(["group"]),
|
|
598
|
+
}),
|
|
599
|
+
});
|
|
495
600
|
/** The stop templates. */
|
|
496
|
-
export const planPrintStopTemplates = e3.record("plan_print_stop_templates", DictType(StringType, PrintStopTemplate),
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
]
|
|
601
|
+
export const planPrintStopTemplates = e3.record("plan_print_stop_templates", DictType(StringType, PrintStopTemplate), {
|
|
602
|
+
initial: new Map([
|
|
603
|
+
["plates", { name: "Plate change", group: "Stops", values: { title: "Plate change", kind: variant("plate_change", null) } }],
|
|
604
|
+
["service", { name: "Service", group: "Stops", values: { title: "Service", kind: variant("service", null) } }],
|
|
605
|
+
]),
|
|
606
|
+
indexes: (index) => ({
|
|
607
|
+
plan_print_stop_templates_by_group: index.on(["group"]),
|
|
608
|
+
}),
|
|
609
|
+
});
|
|
500
610
|
/** The shift templates: early, late and night. */
|
|
501
|
-
export const planPrintShiftTemplates = e3.record("plan_print_shift_templates", DictType(StringType, PrintShiftTemplate),
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
611
|
+
export const planPrintShiftTemplates = e3.record("plan_print_shift_templates", DictType(StringType, PrintShiftTemplate), {
|
|
612
|
+
initial: new Map([
|
|
613
|
+
["early", { name: "Early shift", group: "Shifts", hour: 6n, values: { title: "Early", state: variant("confirmed", null) } }],
|
|
614
|
+
["late", { name: "Late shift", group: "Shifts", hour: 14n, values: { title: "Late", state: variant("confirmed", null) } }],
|
|
615
|
+
["night", { name: "Night shift", group: "Shifts", hour: 22n, values: { title: "Night", state: variant("proposed", variant("added", null)) } }],
|
|
616
|
+
]),
|
|
617
|
+
indexes: (index) => ({
|
|
618
|
+
plan_print_shift_templates_by_group: index.on(["group"]),
|
|
619
|
+
}),
|
|
620
|
+
});
|
|
506
621
|
/** The plates templates. */
|
|
507
|
-
export const planPrintPlatesTemplates = e3.record("plan_print_plates_templates", DictType(StringType, PrintPlatesTemplate),
|
|
508
|
-
|
|
509
|
-
]
|
|
622
|
+
export const planPrintPlatesTemplates = e3.record("plan_print_plates_templates", DictType(StringType, PrintPlatesTemplate), {
|
|
623
|
+
initial: new Map([
|
|
624
|
+
["plates", { name: "Job plates", group: "Plate room", values: { title: "Job plates" } }],
|
|
625
|
+
]),
|
|
626
|
+
indexes: (index) => ({
|
|
627
|
+
plan_print_plates_templates_by_group: index.on(["group"]),
|
|
628
|
+
}),
|
|
629
|
+
});
|
|
510
630
|
/** The bindery templates. */
|
|
511
|
-
export const planPrintBindingTemplates = e3.record("plan_print_binding_templates", DictType(StringType, PrintBindingTemplate),
|
|
512
|
-
|
|
513
|
-
]
|
|
631
|
+
export const planPrintBindingTemplates = e3.record("plan_print_binding_templates", DictType(StringType, PrintBindingTemplate), {
|
|
632
|
+
initial: new Map([
|
|
633
|
+
["fold", { name: "Fold sections", group: "Bindery", hours: 8.0, values: { title: "Fold sections", state: variant("confirmed", null) } }],
|
|
634
|
+
]),
|
|
635
|
+
indexes: (index) => ({
|
|
636
|
+
plan_print_binding_templates_by_group: index.on(["group"]),
|
|
637
|
+
}),
|
|
638
|
+
});
|
|
514
639
|
/** The delivery templates. */
|
|
515
|
-
export const planPrintDeliveryTemplates = e3.record("plan_print_delivery_templates", DictType(StringType, PrintDeliveryTemplate),
|
|
516
|
-
|
|
517
|
-
]
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
export const planPrintShiftsByTime = e3.recordIndex.interval("plan_print_shifts_by_time", planPrintShifts, { from: "start", to: "end" });
|
|
524
|
-
export const planPrintPressesByHall = e3.recordIndex("plan_print_presses_by_hall", planPrintPresses, { on: ["hall"] });
|
|
525
|
-
export const planPrintCustomersByDistrict = e3.recordIndex("plan_print_customers_by_district", planPrintCustomers, { on: ["district"] });
|
|
526
|
-
export const planPrintJobTemplatesByGroup = e3.recordIndex("plan_print_job_templates_by_group", planPrintJobTemplates, { on: ["group"] });
|
|
527
|
-
export const planPrintStopTemplatesByGroup = e3.recordIndex("plan_print_stop_templates_by_group", planPrintStopTemplates, { on: ["group"] });
|
|
528
|
-
export const planPrintShiftTemplatesByGroup = e3.recordIndex("plan_print_shift_templates_by_group", planPrintShiftTemplates, { on: ["group"] });
|
|
529
|
-
export const planPrintPlatesTemplatesByGroup = e3.recordIndex("plan_print_plates_templates_by_group", planPrintPlatesTemplates, { on: ["group"] });
|
|
530
|
-
export const planPrintBindingTemplatesByGroup = e3.recordIndex("plan_print_binding_templates_by_group", planPrintBindingTemplates, { on: ["group"] });
|
|
531
|
-
export const planPrintDeliveryTemplatesByGroup = e3.recordIndex("plan_print_delivery_templates_by_group", planPrintDeliveryTemplates, { on: ["group"] });
|
|
640
|
+
export const planPrintDeliveryTemplates = e3.record("plan_print_delivery_templates", DictType(StringType, PrintDeliveryTemplate), {
|
|
641
|
+
initial: new Map([
|
|
642
|
+
["delivery", { name: "Morning delivery", group: "Dispatch", hour: 10n, values: { title: "Delivery", lane: "AM", status: variant("queued", null), pallets: 1.0 } }],
|
|
643
|
+
]),
|
|
644
|
+
indexes: (index) => ({
|
|
645
|
+
plan_print_delivery_templates_by_group: index.on(["group"]),
|
|
646
|
+
}),
|
|
647
|
+
});
|
|
532
648
|
// ============================================================================
|
|
533
649
|
// planPrintWorks — the print works (§3.3)
|
|
534
650
|
// ============================================================================
|
|
@@ -566,7 +682,7 @@ export const planPrintWorks = example({
|
|
|
566
682
|
"Plan.library", "customers", "Schedule.patch", "inspector", "selection", "kind's own inspector", "update",
|
|
567
683
|
"Record.bind", "Data.bind", "e3.record", "e3.input", "#1191", "#1195", "#1197", "#1200", "parent", "rollup", "collapsed", "meta", "value",
|
|
568
684
|
"buckets", "lane", "status", "ready", "overlaps", "allow", "canDrop", "Schedule.Types.Candidate",
|
|
569
|
-
"variant resource", "bay", "van", "Slice", "Slice.bindRecords", "sources", "Data.bindPaged", "
|
|
685
|
+
"variant resource", "bay", "van", "Slice", "Slice.bindRecords", "sources", "Data.bindPaged", "indexes", "interval",
|
|
570
686
|
"window", "range", "brush", "resolution", "Schedule.templates", "templates record", "Plan.eventRef", "Plan.over", "#1344",
|
|
571
687
|
],
|
|
572
688
|
description: "The print works from plates to dispatch — jobs, stops and shifts on grouped presses and crews, nested bindery resources, deliveries in AM/PM lanes on a bay or a van, status and readiness, links between event kinds, utilisation and paper stock; one Slice.bindRecords rail — the jobs and the shifts through their interval indexes, their range the one window, the presses, the customers and each kind's templates record — and the shared library, inspector and Save session",
|
|
@@ -576,9 +692,9 @@ export const planPrintWorks = example({
|
|
|
576
692
|
// pages alone.
|
|
577
693
|
const presses = $.let(Data.bind(planPrintPresses));
|
|
578
694
|
const crews = $.let(Record.bind(planPrintCrews, []));
|
|
579
|
-
const jobs = $.let(Record.bind(planPrintJobs
|
|
580
|
-
const stops = $.let(Record.bind(planPrintStops
|
|
581
|
-
const shifts = $.let(Record.bind(planPrintShifts
|
|
695
|
+
const jobs = $.let(Record.bind(planPrintJobs));
|
|
696
|
+
const stops = $.let(Record.bind(planPrintStops));
|
|
697
|
+
const shifts = $.let(Record.bind(planPrintShifts));
|
|
582
698
|
const customers = $.let(Data.bind(planPrintCustomers));
|
|
583
699
|
const jobTemplates = $.let(Data.bind(planPrintJobTemplates));
|
|
584
700
|
const stopTemplates = $.let(Data.bind(planPrintStopTemplates));
|
|
@@ -590,25 +706,25 @@ export const planPrintWorks = example({
|
|
|
590
706
|
// indexes, their range the one window the toolbar's dates, the resolution and the brush write; the
|
|
591
707
|
// presses, the customers and each templates record by its fields.
|
|
592
708
|
const slice = $.let(Slice.bindRecords("ex.planPrintWorks", {
|
|
593
|
-
job: { source: Data.bindPaged(planPrintJobs, { indexes: [
|
|
709
|
+
job: { source: Data.bindPaged(planPrintJobs, { indexes: ["plan_print_jobs_by_time", "plan_print_jobs_by_stock_time"] }), icon: { prefix: "fas", name: "file-lines" },
|
|
594
710
|
fields: { stock: { label: "Stock" }, start: { label: "Dates" } }, range: "start" },
|
|
595
|
-
shift: { source: Data.bindPaged(planPrintShifts, { indexes: [
|
|
711
|
+
shift: { source: Data.bindPaged(planPrintShifts, { indexes: ["plan_print_shifts_by_time"] }), icon: { prefix: "fas", name: "user-clock" },
|
|
596
712
|
fields: { start: { label: "Dates" } }, range: "start" },
|
|
597
|
-
presses: { source: Data.bindPaged(planPrintPresses, { indexes: [
|
|
713
|
+
presses: { source: Data.bindPaged(planPrintPresses, { indexes: ["plan_print_presses_by_hall"] }), icon: { prefix: "fas", name: "print" },
|
|
598
714
|
fields: { hall: { label: "Hall", hints: ["Hall A", "Hall B"] } } },
|
|
599
|
-
customers: { source: Data.bindPaged(planPrintCustomers, { indexes: [
|
|
715
|
+
customers: { source: Data.bindPaged(planPrintCustomers, { indexes: ["plan_print_customers_by_district"] }), icon: { prefix: "fas", name: "building" },
|
|
600
716
|
fields: { district: { label: "District", hints: ["North Quay", "Old Town", "Riverside"] } } },
|
|
601
|
-
jobTemplates: { source: Data.bindPaged(planPrintJobTemplates, { indexes: [
|
|
717
|
+
jobTemplates: { source: Data.bindPaged(planPrintJobTemplates, { indexes: ["plan_print_job_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
|
|
602
718
|
fields: { group: { label: "Job templates", hints: ["Jobs"] } } },
|
|
603
|
-
stopTemplates: { source: Data.bindPaged(planPrintStopTemplates, { indexes: [
|
|
719
|
+
stopTemplates: { source: Data.bindPaged(planPrintStopTemplates, { indexes: ["plan_print_stop_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
|
|
604
720
|
fields: { group: { label: "Stop templates", hints: ["Stops"] } } },
|
|
605
|
-
shiftTemplates: { source: Data.bindPaged(planPrintShiftTemplates, { indexes: [
|
|
721
|
+
shiftTemplates: { source: Data.bindPaged(planPrintShiftTemplates, { indexes: ["plan_print_shift_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
|
|
606
722
|
fields: { group: { label: "Shift templates", hints: ["Shifts"] } } },
|
|
607
|
-
platesTemplates: { source: Data.bindPaged(planPrintPlatesTemplates, { indexes: [
|
|
723
|
+
platesTemplates: { source: Data.bindPaged(planPrintPlatesTemplates, { indexes: ["plan_print_plates_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
|
|
608
724
|
fields: { group: { label: "Plates templates", hints: ["Plate room"] } } },
|
|
609
|
-
bindingTemplates: { source: Data.bindPaged(planPrintBindingTemplates, { indexes: [
|
|
725
|
+
bindingTemplates: { source: Data.bindPaged(planPrintBindingTemplates, { indexes: ["plan_print_binding_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
|
|
610
726
|
fields: { group: { label: "Bindery templates", hints: ["Bindery"] } } },
|
|
611
|
-
deliveryTemplates: { source: Data.bindPaged(planPrintDeliveryTemplates, { indexes: [
|
|
727
|
+
deliveryTemplates: { source: Data.bindPaged(planPrintDeliveryTemplates, { indexes: ["plan_print_delivery_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
|
|
612
728
|
fields: { group: { label: "Delivery templates", hints: ["Dispatch"] } } },
|
|
613
729
|
}));
|
|
614
730
|
// A kind narrowed through its source reads one event by its key through the record's own entries.
|
|
@@ -619,9 +735,9 @@ export const planPrintWorks = example({
|
|
|
619
735
|
const bindery = $.let(Record.bind(planPrintBindery, []));
|
|
620
736
|
const bays = $.let(Record.bind(planLinkBays, []));
|
|
621
737
|
const vans = $.let(Record.bind(planPrintVans, []));
|
|
622
|
-
const plates = $.let(Record.bind(planPrintPlates
|
|
623
|
-
const bindings = $.let(Record.bind(planPrintBindings
|
|
624
|
-
const deliveries = $.let(Record.bind(planPrintDeliveries
|
|
738
|
+
const plates = $.let(Record.bind(planPrintPlates));
|
|
739
|
+
const bindings = $.let(Record.bind(planPrintBindings));
|
|
740
|
+
const deliveries = $.let(Record.bind(planPrintDeliveries));
|
|
625
741
|
const stock = $.let(Data.bind(planLinkStock));
|
|
626
742
|
const lineRows = $.const(lines.read().union(bindery.read(), (_$2, line) => line));
|
|
627
743
|
const util = $.let(Data.bind(planPrintUtilisation));
|
|
@@ -642,8 +758,6 @@ export const planPrintWorks = example({
|
|
|
642
758
|
window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
643
759
|
resolution: "day", resolutions: ["week", "day"], now: new Date("2026-10-14T09:00:00Z"),
|
|
644
760
|
}));
|
|
645
|
-
const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
|
|
646
|
-
const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) => East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
|
|
647
761
|
const canDrop = $.const(East.function([Schedule.Types.Candidate], OptionType(StringType), ($2, candidate) => {
|
|
648
762
|
const reason = $2.let(none, OptionType(StringType));
|
|
649
763
|
$2.match(candidate.resource, { some: ($3, resource) => {
|
|
@@ -757,7 +871,7 @@ export const planPrintWorks = example({
|
|
|
757
871
|
}),
|
|
758
872
|
Plan.over(stock, [Plan.series.table(PrintStock, {
|
|
759
873
|
key: "stock", title: "Paper stock", label: s => s.name,
|
|
760
|
-
cells:
|
|
874
|
+
cells: Plan.tableCells(Plan.values("weekly", (level) => ({ value: level }))), format: Format.Number({ maximumFractionDigits: 0n }),
|
|
761
875
|
})]),
|
|
762
876
|
], links: [
|
|
763
877
|
Plan.link({ key: "plates", from: Plan.eventRef("plate", "P-101"), to: Plan.eventRef("job", "J-1004") }),
|
|
@@ -835,15 +949,11 @@ export const planEventLinks = example({
|
|
|
835
949
|
const presses = $.let(Record.bind(planPrintPresses, []));
|
|
836
950
|
const lines = $.let(Record.bind(planLinkLines, []));
|
|
837
951
|
const bays = $.let(Record.bind(planLinkBays, []));
|
|
838
|
-
const plates = $.let(Record.bind(planLinkPlates
|
|
839
|
-
const jobs = $.let(Record.bind(planLinkCaseJobs
|
|
840
|
-
const bindings = $.let(Record.bind(planLinkBindings
|
|
841
|
-
const deliveries = $.let(Record.bind(planLinkDeliveries
|
|
952
|
+
const plates = $.let(Record.bind(planLinkPlates));
|
|
953
|
+
const jobs = $.let(Record.bind(planLinkCaseJobs));
|
|
954
|
+
const bindings = $.let(Record.bind(planLinkBindings));
|
|
955
|
+
const deliveries = $.let(Record.bind(planLinkDeliveries));
|
|
842
956
|
const stock = $.let(Data.bind(planLinkStock));
|
|
843
|
-
// The window's first Monday: each stock reading runs from it, a week apiece.
|
|
844
|
-
const first = $.const(new Date("2026-10-05T00:00:00Z"), DateTimeType);
|
|
845
|
-
const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
|
|
846
|
-
const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) => East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
|
|
847
957
|
const axis = $.let(Plan.axis({
|
|
848
958
|
window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
849
959
|
resolution: "week", now: new Date("2026-10-14T09:00:00Z"),
|
|
@@ -881,7 +991,7 @@ export const planEventLinks = example({
|
|
|
881
991
|
Plan.over(stock, [
|
|
882
992
|
Plan.series.table(PrintStock, {
|
|
883
993
|
key: "stock", title: "Paper stock", label: s => s.name,
|
|
884
|
-
cells:
|
|
994
|
+
cells: Plan.tableCells(Plan.values("weekly", (level) => ({ value: level }))),
|
|
885
995
|
format: Format.Number({ maximumFractionDigits: 0n }),
|
|
886
996
|
}),
|
|
887
997
|
]),
|
|
@@ -910,4 +1020,67 @@ export const planEventLinks = example({
|
|
|
910
1020
|
} }))),
|
|
911
1021
|
inputs: [],
|
|
912
1022
|
});
|
|
1023
|
+
/** The jobs the conflicts example edits, in a record of their own, so no other example's edits meet them. */
|
|
1024
|
+
export const planConflictJobs = e3.record("plan_conflict_jobs", DictType(StringType, PrintJob), {
|
|
1025
|
+
initial: new Map([
|
|
1026
|
+
["J-3001", { title: "Spring catalogue", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
1027
|
+
["J-3002", { title: "Course handbook", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-12T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
1028
|
+
["J-3003", { title: "Annual report", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T12:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-10T00:00:00Z")) }],
|
|
1029
|
+
["J-3005", { title: "Store flyers", start: some(new Date("2026-10-09T06:00:00Z")), end: some(new Date("2026-10-09T16:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-12T00:00:00Z")) }],
|
|
1030
|
+
["J-3006", { title: "Market posters", start: some(new Date("2026-10-13T06:00:00Z")), end: some(new Date("2026-10-13T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-15T00:00:00Z")) }],
|
|
1031
|
+
]),
|
|
1032
|
+
mutations: (mutation) => ({
|
|
1033
|
+
// The jobs' patch door — every Save commits through it.
|
|
1034
|
+
patch: mutation.patch(),
|
|
1035
|
+
// Someone else's save: every job a day later, its press and its other fields as they were.
|
|
1036
|
+
elsewhere: mutation.reduce(East.function([DictType(StringType, PrintJob)], DictType(StringType, PrintJob), (_$, jobs) => jobs.map((_$2, job) => ({
|
|
1037
|
+
title: job.title,
|
|
1038
|
+
start: job.start.match({
|
|
1039
|
+
some: (_$3, at) => East.value(some(at.addDays(1n)), OptionType(DateTimeType)),
|
|
1040
|
+
none: (_$3) => East.value(none, OptionType(DateTimeType)),
|
|
1041
|
+
}),
|
|
1042
|
+
end: job.end.match({
|
|
1043
|
+
some: (_$3, at) => East.value(some(at.addDays(1n)), OptionType(DateTimeType)),
|
|
1044
|
+
none: (_$3) => East.value(none, OptionType(DateTimeType)),
|
|
1045
|
+
}),
|
|
1046
|
+
press: job.press, state: job.state, sheets: job.sheets, customer: job.customer, stock: job.stock, due: job.due,
|
|
1047
|
+
})))),
|
|
1048
|
+
}),
|
|
1049
|
+
});
|
|
1050
|
+
/**
|
|
1051
|
+
* Your edits meeting someone else's save, in one window: edit, then press
|
|
1052
|
+
* Someone else saves, which saves another person's change to the same jobs —
|
|
1053
|
+
* every job a day later. A bar you moved or resized too is a conflict, its
|
|
1054
|
+
* dates one card to choose; a customer or stock you changed in the panel
|
|
1055
|
+
* combines with theirs. Each press saves their change again.
|
|
1056
|
+
*/
|
|
1057
|
+
export const planConflicts = example({
|
|
1058
|
+
keywords: ["Plan", "conflict", "conflicts", "combine", "someone else", "Choose", "dates", "bars", "Schedule.events", "Record.bind", "mutate", "Button", "inspector", "Save"],
|
|
1059
|
+
description: "Your edits meeting someone else's save, in one window — move or resize a job's bar, then press Someone else saves, which saves another person's change to the same jobs (every job a day later), so yours conflict, its dates one card to choose; a customer or stock you change in the panel combines with theirs",
|
|
1060
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
1061
|
+
const presses = $.let(Record.bind(planPrintPresses, []));
|
|
1062
|
+
const jobs = $.let(Record.bind(planConflictJobs, ["patch"]));
|
|
1063
|
+
const others = $.let(Record.bind(planConflictJobs, ["elsewhere"]));
|
|
1064
|
+
const theirs = $.const(East.function([], NullType, ($) => { $(others.mutate.elsewhere()); }));
|
|
1065
|
+
const axis = $.let(Plan.axis({
|
|
1066
|
+
window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-10-19T00:00:00Z") },
|
|
1067
|
+
resolution: "day", now: new Date("2026-10-07T09:00:00Z"),
|
|
1068
|
+
}));
|
|
1069
|
+
return (_jsxs(VStack, { gap: "3", align: "stretch", children: [_jsxs(HStack, { gap: "3", children: [_jsx(Button, { variant: "outline", onClick: theirs, loading: others.mutate.pending(), children: "Someone else saves" }), _jsx(Text, { color: "fg.muted", children: "Their change: every job a day later" })] }), _jsx(Box, { height: "560px", children: _jsx(Plan, { id: "conflicts", axis: axis, resources: {
|
|
1070
|
+
presses: Schedule.resources(presses.read(), { name: "Presses", icon: "print", label: p => p.name }),
|
|
1071
|
+
}, events: {
|
|
1072
|
+
job: Schedule.events(jobs, {
|
|
1073
|
+
name: "Print job", icon: "file-lines",
|
|
1074
|
+
title: "title", start: "start", end: "end",
|
|
1075
|
+
resource: { field: "press", of: "presses" },
|
|
1076
|
+
state: "state",
|
|
1077
|
+
fields: {
|
|
1078
|
+
customer: Schedule.field.text({ label: "Customer" }),
|
|
1079
|
+
stock: Schedule.field.select({ labels: { coated: "Coated", uncoated: "Uncoated", board: "Board" } }),
|
|
1080
|
+
},
|
|
1081
|
+
}),
|
|
1082
|
+
}, inspector: true }) })] }));
|
|
1083
|
+
} }))),
|
|
1084
|
+
inputs: [],
|
|
1085
|
+
});
|
|
913
1086
|
//# sourceMappingURL=plan-events.examples.js.map
|