@endora-commerce/mod-inventory 0.100.0
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/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/admin/api/warehouses-client.d.ts +22 -0
- package/dist/admin/api/warehouses-client.d.ts.map +1 -0
- package/dist/admin/api/warehouses-client.js +32 -0
- package/dist/admin/api/warehouses-client.js.map +1 -0
- package/dist/admin/index.d.ts +43 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +190 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/pages/AvailabilityNotificationsPage.d.ts +15 -0
- package/dist/admin/pages/AvailabilityNotificationsPage.d.ts.map +1 -0
- package/dist/admin/pages/AvailabilityNotificationsPage.js +111 -0
- package/dist/admin/pages/AvailabilityNotificationsPage.js.map +1 -0
- package/dist/admin/pages/InventoryPage.d.ts +17 -0
- package/dist/admin/pages/InventoryPage.d.ts.map +1 -0
- package/dist/admin/pages/InventoryPage.js +135 -0
- package/dist/admin/pages/InventoryPage.js.map +1 -0
- package/dist/admin/pages/LowStockPage.d.ts +16 -0
- package/dist/admin/pages/LowStockPage.d.ts.map +1 -0
- package/dist/admin/pages/LowStockPage.js +61 -0
- package/dist/admin/pages/LowStockPage.js.map +1 -0
- package/dist/admin/pages/StockImportWizard.d.ts +17 -0
- package/dist/admin/pages/StockImportWizard.d.ts.map +1 -0
- package/dist/admin/pages/StockImportWizard.js +111 -0
- package/dist/admin/pages/StockImportWizard.js.map +1 -0
- package/dist/admin/pages/WarehouseEditor.d.ts +12 -0
- package/dist/admin/pages/WarehouseEditor.d.ts.map +1 -0
- package/dist/admin/pages/WarehouseEditor.js +194 -0
- package/dist/admin/pages/WarehouseEditor.js.map +1 -0
- package/dist/admin/pages/WarehousesList.d.ts +12 -0
- package/dist/admin/pages/WarehousesList.d.ts.map +1 -0
- package/dist/admin/pages/WarehousesList.js +69 -0
- package/dist/admin/pages/WarehousesList.js.map +1 -0
- package/dist/admin/zones/ChannelWarehouses.d.ts +49 -0
- package/dist/admin/zones/ChannelWarehouses.d.ts.map +1 -0
- package/dist/admin/zones/ChannelWarehouses.js +109 -0
- package/dist/admin/zones/ChannelWarehouses.js.map +1 -0
- package/dist/backend/demo/reset.d.ts +18 -0
- package/dist/backend/demo/reset.d.ts.map +1 -0
- package/dist/backend/demo/reset.js +20 -0
- package/dist/backend/demo/reset.js.map +1 -0
- package/dist/backend/demo/rows.d.ts +38 -0
- package/dist/backend/demo/rows.d.ts.map +1 -0
- package/dist/backend/demo/rows.js +38 -0
- package/dist/backend/demo/rows.js.map +1 -0
- package/dist/backend/demo/seed.d.ts +26 -0
- package/dist/backend/demo/seed.d.ts.map +1 -0
- package/dist/backend/demo/seed.js +65 -0
- package/dist/backend/demo/seed.js.map +1 -0
- package/dist/backend/email-templates/transactional-defaults.d.ts +11 -0
- package/dist/backend/email-templates/transactional-defaults.d.ts.map +1 -0
- package/dist/backend/email-templates/transactional-defaults.js +49 -0
- package/dist/backend/email-templates/transactional-defaults.js.map +1 -0
- package/dist/backend/entities/availability-notification.entity.d.ts +49 -0
- package/dist/backend/entities/availability-notification.entity.d.ts.map +1 -0
- package/dist/backend/entities/availability-notification.entity.js +93 -0
- package/dist/backend/entities/availability-notification.entity.js.map +1 -0
- package/dist/backend/entities/inventory-threshold.entity.d.ts +24 -0
- package/dist/backend/entities/inventory-threshold.entity.d.ts.map +1 -0
- package/dist/backend/entities/inventory-threshold.entity.js +61 -0
- package/dist/backend/entities/inventory-threshold.entity.js.map +1 -0
- package/dist/backend/entities/product-warehouse-low-stock-threshold.entity.d.ts +15 -0
- package/dist/backend/entities/product-warehouse-low-stock-threshold.entity.d.ts.map +1 -0
- package/dist/backend/entities/product-warehouse-low-stock-threshold.entity.js +51 -0
- package/dist/backend/entities/product-warehouse-low-stock-threshold.entity.js.map +1 -0
- package/dist/backend/entities/stock-allocation.entity.d.ts +22 -0
- package/dist/backend/entities/stock-allocation.entity.d.ts.map +1 -0
- package/dist/backend/entities/stock-allocation.entity.js +69 -0
- package/dist/backend/entities/stock-allocation.entity.js.map +1 -0
- package/dist/backend/entities/stock-level.entity.d.ts +24 -0
- package/dist/backend/entities/stock-level.entity.d.ts.map +1 -0
- package/dist/backend/entities/stock-level.entity.js +74 -0
- package/dist/backend/entities/stock-level.entity.js.map +1 -0
- package/dist/backend/entities/warehouse-channel-assignment.entity.d.ts +17 -0
- package/dist/backend/entities/warehouse-channel-assignment.entity.d.ts.map +1 -0
- package/dist/backend/entities/warehouse-channel-assignment.entity.js +60 -0
- package/dist/backend/entities/warehouse-channel-assignment.entity.js.map +1 -0
- package/dist/backend/entities/warehouse.entity.d.ts +37 -0
- package/dist/backend/entities/warehouse.entity.d.ts.map +1 -0
- package/dist/backend/entities/warehouse.entity.js +90 -0
- package/dist/backend/entities/warehouse.entity.js.map +1 -0
- package/dist/backend/index.d.ts +139 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.js +351 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/plugin.d.ts +113 -0
- package/dist/backend/plugin.d.ts.map +1 -0
- package/dist/backend/plugin.js +75 -0
- package/dist/backend/plugin.js.map +1 -0
- package/dist/backend/prompt-tools.d.ts +23 -0
- package/dist/backend/prompt-tools.d.ts.map +1 -0
- package/dist/backend/prompt-tools.js +77 -0
- package/dist/backend/prompt-tools.js.map +1 -0
- package/dist/backend/routes.admin.d.ts +62 -0
- package/dist/backend/routes.admin.d.ts.map +1 -0
- package/dist/backend/routes.admin.js +383 -0
- package/dist/backend/routes.admin.js.map +1 -0
- package/dist/backend/routes.d.ts +40 -0
- package/dist/backend/routes.d.ts.map +1 -0
- package/dist/backend/routes.js +263 -0
- package/dist/backend/routes.js.map +1 -0
- package/dist/backend/services/audit-references.d.ts +15 -0
- package/dist/backend/services/audit-references.d.ts.map +1 -0
- package/dist/backend/services/audit-references.js +27 -0
- package/dist/backend/services/audit-references.js.map +1 -0
- package/dist/backend/services/availability-notification-service.d.ts +155 -0
- package/dist/backend/services/availability-notification-service.d.ts.map +1 -0
- package/dist/backend/services/availability-notification-service.js +363 -0
- package/dist/backend/services/availability-notification-service.js.map +1 -0
- package/dist/backend/services/availability-worker.d.ts +57 -0
- package/dist/backend/services/availability-worker.d.ts.map +1 -0
- package/dist/backend/services/availability-worker.js +135 -0
- package/dist/backend/services/availability-worker.js.map +1 -0
- package/dist/backend/services/csv-stock-importer.d.ts +52 -0
- package/dist/backend/services/csv-stock-importer.d.ts.map +1 -0
- package/dist/backend/services/csv-stock-importer.js +154 -0
- package/dist/backend/services/csv-stock-importer.js.map +1 -0
- package/dist/backend/services/display-band-resolver.d.ts +19 -0
- package/dist/backend/services/display-band-resolver.d.ts.map +1 -0
- package/dist/backend/services/display-band-resolver.js +21 -0
- package/dist/backend/services/display-band-resolver.js.map +1 -0
- package/dist/backend/services/effective-fulfilment-strategy.d.ts +16 -0
- package/dist/backend/services/effective-fulfilment-strategy.d.ts.map +1 -0
- package/dist/backend/services/effective-fulfilment-strategy.js +16 -0
- package/dist/backend/services/effective-fulfilment-strategy.js.map +1 -0
- package/dist/backend/services/fulfilment-strategy-resolver.d.ts +13 -0
- package/dist/backend/services/fulfilment-strategy-resolver.d.ts.map +1 -0
- package/dist/backend/services/fulfilment-strategy-resolver.js +13 -0
- package/dist/backend/services/fulfilment-strategy-resolver.js.map +1 -0
- package/dist/backend/services/inventory-read-port.d.ts +65 -0
- package/dist/backend/services/inventory-read-port.d.ts.map +1 -0
- package/dist/backend/services/inventory-read-port.js +168 -0
- package/dist/backend/services/inventory-read-port.js.map +1 -0
- package/dist/backend/services/inventory-reservation-apply-port.d.ts +62 -0
- package/dist/backend/services/inventory-reservation-apply-port.d.ts.map +1 -0
- package/dist/backend/services/inventory-reservation-apply-port.js +134 -0
- package/dist/backend/services/inventory-reservation-apply-port.js.map +1 -0
- package/dist/backend/services/low-stock-alert-service.d.ts +87 -0
- package/dist/backend/services/low-stock-alert-service.d.ts.map +1 -0
- package/dist/backend/services/low-stock-alert-service.js +164 -0
- package/dist/backend/services/low-stock-alert-service.js.map +1 -0
- package/dist/backend/services/product-threshold-write.service.d.ts +38 -0
- package/dist/backend/services/product-threshold-write.service.d.ts.map +1 -0
- package/dist/backend/services/product-threshold-write.service.js +80 -0
- package/dist/backend/services/product-threshold-write.service.js.map +1 -0
- package/dist/backend/services/stock-import.service.d.ts +43 -0
- package/dist/backend/services/stock-import.service.d.ts.map +1 -0
- package/dist/backend/services/stock-import.service.js +124 -0
- package/dist/backend/services/stock-import.service.js.map +1 -0
- package/dist/backend/services/stock-level-service.d.ts +146 -0
- package/dist/backend/services/stock-level-service.d.ts.map +1 -0
- package/dist/backend/services/stock-level-service.js +489 -0
- package/dist/backend/services/stock-level-service.js.map +1 -0
- package/dist/backend/services/threshold-admin-service.d.ts +73 -0
- package/dist/backend/services/threshold-admin-service.d.ts.map +1 -0
- package/dist/backend/services/threshold-admin-service.js +167 -0
- package/dist/backend/services/threshold-admin-service.js.map +1 -0
- package/dist/backend/services/threshold-resolver.d.ts +23 -0
- package/dist/backend/services/threshold-resolver.d.ts.map +1 -0
- package/dist/backend/services/threshold-resolver.js +29 -0
- package/dist/backend/services/threshold-resolver.js.map +1 -0
- package/dist/backend/services/threshold-settings-mirror.d.ts +55 -0
- package/dist/backend/services/threshold-settings-mirror.d.ts.map +1 -0
- package/dist/backend/services/threshold-settings-mirror.js +84 -0
- package/dist/backend/services/threshold-settings-mirror.js.map +1 -0
- package/dist/backend/services/warehouse-channel-reconciler.d.ts +19 -0
- package/dist/backend/services/warehouse-channel-reconciler.d.ts.map +1 -0
- package/dist/backend/services/warehouse-channel-reconciler.js +65 -0
- package/dist/backend/services/warehouse-channel-reconciler.js.map +1 -0
- package/dist/backend/services/warehouse-channel-service.d.ts +57 -0
- package/dist/backend/services/warehouse-channel-service.d.ts.map +1 -0
- package/dist/backend/services/warehouse-channel-service.js +205 -0
- package/dist/backend/services/warehouse-channel-service.js.map +1 -0
- package/dist/backend/services/warehouse-country-reference.d.ts +14 -0
- package/dist/backend/services/warehouse-country-reference.d.ts.map +1 -0
- package/dist/backend/services/warehouse-country-reference.js +27 -0
- package/dist/backend/services/warehouse-country-reference.js.map +1 -0
- package/dist/backend/services/warehouse-service.d.ts +86 -0
- package/dist/backend/services/warehouse-service.d.ts.map +1 -0
- package/dist/backend/services/warehouse-service.js +267 -0
- package/dist/backend/services/warehouse-service.js.map +1 -0
- package/dist/manifest.d.ts +219 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +377 -0
- package/dist/manifest.js.map +1 -0
- package/dist/migrations/20260503T182812_inventory_workflow.d.ts +39 -0
- package/dist/migrations/20260503T182812_inventory_workflow.d.ts.map +1 -0
- package/dist/migrations/20260503T182812_inventory_workflow.js +205 -0
- package/dist/migrations/20260503T182812_inventory_workflow.js.map +1 -0
- package/dist/migrations/20260611T140347_inventory_warehouse_default_low_stock_threshold.d.ts +14 -0
- package/dist/migrations/20260611T140347_inventory_warehouse_default_low_stock_threshold.d.ts.map +1 -0
- package/dist/migrations/20260611T140347_inventory_warehouse_default_low_stock_threshold.js +18 -0
- package/dist/migrations/20260611T140347_inventory_warehouse_default_low_stock_threshold.js.map +1 -0
- package/dist/migrations/20260611T140348_inventory_per_warehouse_low_stock_thresholds.d.ts +28 -0
- package/dist/migrations/20260611T140348_inventory_per_warehouse_low_stock_thresholds.d.ts.map +1 -0
- package/dist/migrations/20260611T140348_inventory_per_warehouse_low_stock_thresholds.js +48 -0
- package/dist/migrations/20260611T140348_inventory_per_warehouse_low_stock_thresholds.js.map +1 -0
- package/dist/migrations/20260818T081243_inventory_stock_allocation_order_item_fk.d.ts +44 -0
- package/dist/migrations/20260818T081243_inventory_stock_allocation_order_item_fk.d.ts.map +1 -0
- package/dist/migrations/20260818T081243_inventory_stock_allocation_order_item_fk.js +81 -0
- package/dist/migrations/20260818T081243_inventory_stock_allocation_order_item_fk.js.map +1 -0
- package/dist/migrations/20260830T182139_inventory_organization_attribution.d.ts +109 -0
- package/dist/migrations/20260830T182139_inventory_organization_attribution.d.ts.map +1 -0
- package/dist/migrations/20260830T182139_inventory_organization_attribution.js +178 -0
- package/dist/migrations/20260830T182139_inventory_organization_attribution.js.map +1 -0
- package/dist/migrations/20260912T125716_inventory_organization_warehouses.d.ts +34 -0
- package/dist/migrations/20260912T125716_inventory_organization_warehouses.d.ts.map +1 -0
- package/dist/migrations/20260912T125716_inventory_organization_warehouses.js +50 -0
- package/dist/migrations/20260912T125716_inventory_organization_warehouses.js.map +1 -0
- package/dist/migrations/index.d.ts +32 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +39 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/ports/index.d.ts +183 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/index.js +2 -0
- package/dist/ports/index.js.map +1 -0
- package/docs/inventory.md +177 -0
- package/i18n/en.json +32 -0
- package/i18n/pl.json +32 -0
- package/package.json +105 -0
- package/tailwind.css +14 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings manifest for the Inventory module — feature 010.
|
|
3
|
+
*
|
|
4
|
+
* Seven settings (FR-019 / FR-029 / FR-031). Setting codes follow
|
|
5
|
+
* the foundation regex `^[a-z][a-z0-9_][a-z0-9_.]*[a-z0-9]$`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const INVENTORY_SETTING_CODES: {
|
|
8
|
+
readonly DISPLAY_MODE: "inventory.display_mode";
|
|
9
|
+
readonly FULFILMENT_STRATEGY: "inventory.fulfilment_strategy";
|
|
10
|
+
readonly FULFILMENT_STRATEGY_WAREHOUSE_ORDER: "inventory.fulfilment_strategy_warehouse_order";
|
|
11
|
+
readonly GLOBAL_THRESHOLD_HIGH: "inventory.global_threshold_high";
|
|
12
|
+
readonly GLOBAL_THRESHOLD_MEDIUM: "inventory.global_threshold_medium";
|
|
13
|
+
readonly GLOBAL_THRESHOLD_LOW: "inventory.global_threshold_low";
|
|
14
|
+
readonly LOW_STOCK_ALERT_RECIPIENT_EMAIL: "inventory.low_stock_alert_recipient_email";
|
|
15
|
+
readonly ALLOW_NEGATIVE_STOCK: "inventory.allow_negative_stock";
|
|
16
|
+
};
|
|
17
|
+
/** Module-lifecycle manifest (feature 018). */
|
|
18
|
+
export declare const manifest: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
version: string;
|
|
22
|
+
dependencies: string[];
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
acknowledgedDependencies?: {
|
|
25
|
+
moduleId: string;
|
|
26
|
+
port: string;
|
|
27
|
+
reason: string;
|
|
28
|
+
}[] | undefined;
|
|
29
|
+
nonBindingDependencies?: {
|
|
30
|
+
moduleId: string;
|
|
31
|
+
name: string;
|
|
32
|
+
kind: "contributes-to" | "degrades-without" | "refuses-without";
|
|
33
|
+
reason: string;
|
|
34
|
+
whenAbsent?: string | undefined;
|
|
35
|
+
}[] | undefined;
|
|
36
|
+
activation?: {
|
|
37
|
+
settingCode: string;
|
|
38
|
+
default: boolean;
|
|
39
|
+
} | {
|
|
40
|
+
nonDeactivatable: true;
|
|
41
|
+
reason: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
settings?: {
|
|
44
|
+
moduleCode: string;
|
|
45
|
+
groups: {
|
|
46
|
+
code: string;
|
|
47
|
+
name: string;
|
|
48
|
+
salesChannelCodes?: string[] | undefined;
|
|
49
|
+
isSystemProtected?: boolean | undefined;
|
|
50
|
+
}[];
|
|
51
|
+
settings: {
|
|
52
|
+
code: string;
|
|
53
|
+
name: string;
|
|
54
|
+
valueType: "string" | "number" | "boolean" | "json" | "string_list" | "secret" | "credential_ref";
|
|
55
|
+
defaultValue: unknown;
|
|
56
|
+
description?: string | undefined;
|
|
57
|
+
groupCode?: string | undefined;
|
|
58
|
+
previousDefaultValues?: unknown[] | undefined;
|
|
59
|
+
salesChannelCodes?: string[] | undefined;
|
|
60
|
+
enumOptions?: string[] | undefined;
|
|
61
|
+
configurationType?: string | undefined;
|
|
62
|
+
hidden?: boolean | undefined;
|
|
63
|
+
}[];
|
|
64
|
+
} | undefined;
|
|
65
|
+
i18n?: {
|
|
66
|
+
bundlesDir: string;
|
|
67
|
+
} | undefined;
|
|
68
|
+
docs?: false | {
|
|
69
|
+
dir: string;
|
|
70
|
+
} | undefined;
|
|
71
|
+
demo?: false | {
|
|
72
|
+
summary: string;
|
|
73
|
+
seed: (context: import("@endora-commerce/contracts").ModuleDemoContext<never>) => Promise<import("@endora-commerce/contracts").DemoSeedResult>;
|
|
74
|
+
reset: (context: import("@endora-commerce/contracts").ModuleDemoContext<never>) => Promise<import("@endora-commerce/contracts").DemoResetResult>;
|
|
75
|
+
after?: readonly string[] | undefined;
|
|
76
|
+
package?: string | undefined;
|
|
77
|
+
} | undefined;
|
|
78
|
+
actions?: {
|
|
79
|
+
id: string;
|
|
80
|
+
labelKey: string;
|
|
81
|
+
icon: "Warehouse" | "Plus" | "Sparkles" | "Settings" | "Search" | "Boxes" | "Layers" | "Menu" | "PlusCircle" | "PlusSquare" | "FilePlus" | "FolderPlus" | "Upload" | "FileUp" | "CloudUpload" | "Download" | "FileDown" | "FileText" | "BookOpen" | "Rss" | "Package" | "Tag" | "ShoppingCart" | "Receipt" | "CreditCard" | "Users" | "UserPlus" | "Inbox" | "ListChecks" | "ClipboardList" | "Image" | "Video" | "LayoutDashboard" | "PanelLeft" | "KeyRound" | "ShieldCheck" | "Edit" | "Archive" | "Box" | "Truck" | "CircleDollarSign" | "Activity" | "LineChart" | "Smartphone" | "Webhook" | "Scale" | "PlugZap" | "PercentDiamond" | "Newspaper" | "Languages" | "Eraser" | "TrendingDown" | "Bell" | "PackageOpen" | "Building2" | "Store" | "ClipboardCheck";
|
|
82
|
+
targetRoute: string;
|
|
83
|
+
keywords: string[];
|
|
84
|
+
weight: number;
|
|
85
|
+
descriptionKey?: string | undefined;
|
|
86
|
+
requiredPermission?: string | undefined;
|
|
87
|
+
}[] | undefined;
|
|
88
|
+
permissions?: {
|
|
89
|
+
code: string;
|
|
90
|
+
label: string;
|
|
91
|
+
module?: string | undefined;
|
|
92
|
+
description?: string | undefined;
|
|
93
|
+
requires?: string[] | undefined;
|
|
94
|
+
}[] | undefined;
|
|
95
|
+
transactionalEmails?: {
|
|
96
|
+
code: string;
|
|
97
|
+
name: string;
|
|
98
|
+
variables: {
|
|
99
|
+
key: string;
|
|
100
|
+
label: string;
|
|
101
|
+
sampleValue?: string | undefined;
|
|
102
|
+
description?: string | undefined;
|
|
103
|
+
}[];
|
|
104
|
+
description?: string | undefined;
|
|
105
|
+
group?: string | undefined;
|
|
106
|
+
}[] | undefined;
|
|
107
|
+
capabilities?: string[] | undefined;
|
|
108
|
+
exclusiveCapabilities?: {
|
|
109
|
+
key: string;
|
|
110
|
+
errorCode: string;
|
|
111
|
+
}[] | undefined;
|
|
112
|
+
errorCodes?: {
|
|
113
|
+
code: string;
|
|
114
|
+
tokens?: string[] | undefined;
|
|
115
|
+
}[] | undefined;
|
|
116
|
+
blocks?: {
|
|
117
|
+
name: string;
|
|
118
|
+
labelKey: string;
|
|
119
|
+
category: string;
|
|
120
|
+
contexts: ("email" | "invoice" | "cms" | "newsletter")[];
|
|
121
|
+
fields: Record<string, {
|
|
122
|
+
type: "number" | "object" | "array" | "uuid" | "text" | "textarea" | "select" | "radio" | "external" | "richtext";
|
|
123
|
+
label?: string | undefined;
|
|
124
|
+
required?: boolean | undefined;
|
|
125
|
+
options?: {
|
|
126
|
+
label: string;
|
|
127
|
+
value: string | number;
|
|
128
|
+
}[] | undefined;
|
|
129
|
+
refKind?: string | undefined;
|
|
130
|
+
}>;
|
|
131
|
+
descriptionKey?: string | undefined;
|
|
132
|
+
defaultProps?: Record<string, unknown> | undefined;
|
|
133
|
+
responsiveFields?: string[] | undefined;
|
|
134
|
+
previewIcon?: string | undefined;
|
|
135
|
+
weight?: number | undefined;
|
|
136
|
+
}[] | undefined;
|
|
137
|
+
blockCategories?: {
|
|
138
|
+
key: string;
|
|
139
|
+
titleKey: string;
|
|
140
|
+
contexts: ("email" | "invoice" | "cms" | "newsletter")[];
|
|
141
|
+
weight?: number | undefined;
|
|
142
|
+
visible?: boolean | undefined;
|
|
143
|
+
}[] | undefined;
|
|
144
|
+
env?: {
|
|
145
|
+
name: string;
|
|
146
|
+
describes: {
|
|
147
|
+
en: string;
|
|
148
|
+
pl: string;
|
|
149
|
+
};
|
|
150
|
+
requirement: {
|
|
151
|
+
kind: "required";
|
|
152
|
+
} | {
|
|
153
|
+
kind: "requiredWhen";
|
|
154
|
+
input: string;
|
|
155
|
+
equals: string;
|
|
156
|
+
} | {
|
|
157
|
+
kind: "optional";
|
|
158
|
+
without: {
|
|
159
|
+
en: string;
|
|
160
|
+
pl: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
secret: boolean;
|
|
164
|
+
generable: boolean;
|
|
165
|
+
owner: {
|
|
166
|
+
kind: "platform";
|
|
167
|
+
} | {
|
|
168
|
+
kind: "application";
|
|
169
|
+
application: "admin" | "backend" | "storefront";
|
|
170
|
+
} | {
|
|
171
|
+
kind: "module";
|
|
172
|
+
moduleId: string;
|
|
173
|
+
};
|
|
174
|
+
consumers: ("admin" | "backend" | "storefront")[];
|
|
175
|
+
addressOf: "admin" | "backend" | "storefront" | null;
|
|
176
|
+
}[] | undefined;
|
|
177
|
+
};
|
|
178
|
+
/** Legacy export retained for backward compatibility. */
|
|
179
|
+
export declare const inventoryManifest: {
|
|
180
|
+
moduleCode: string;
|
|
181
|
+
groups: {
|
|
182
|
+
code: string;
|
|
183
|
+
name: string;
|
|
184
|
+
salesChannelCodes?: string[] | undefined;
|
|
185
|
+
isSystemProtected?: boolean | undefined;
|
|
186
|
+
}[];
|
|
187
|
+
settings: {
|
|
188
|
+
code: string;
|
|
189
|
+
name: string;
|
|
190
|
+
valueType: "string" | "number" | "boolean" | "json" | "string_list" | "secret" | "credential_ref";
|
|
191
|
+
defaultValue: unknown;
|
|
192
|
+
description?: string | undefined;
|
|
193
|
+
groupCode?: string | undefined;
|
|
194
|
+
previousDefaultValues?: unknown[] | undefined;
|
|
195
|
+
salesChannelCodes?: string[] | undefined;
|
|
196
|
+
enumOptions?: string[] | undefined;
|
|
197
|
+
configurationType?: string | undefined;
|
|
198
|
+
hidden?: boolean | undefined;
|
|
199
|
+
}[];
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* What this module offers the admin home dashboard's Recent Activity card —
|
|
203
|
+
* feature 080, T042j / D-163.1.
|
|
204
|
+
*
|
|
205
|
+
* The **declaration** axis: eligibility, never a decision. Whether these rows
|
|
206
|
+
* appear is the operator's, held in `inventory.recent_activity_visible` and
|
|
207
|
+
* defaulting to visible, flipped on `/platform/modules` beside this module's
|
|
208
|
+
* activation control. The two are different questions about the same module —
|
|
209
|
+
* "does this client want stock management" and "does this client want stock
|
|
210
|
+
* movements on their home screen" — which is why there are two switches.
|
|
211
|
+
*/
|
|
212
|
+
export declare const recentActivity: {
|
|
213
|
+
entries: {
|
|
214
|
+
action: string;
|
|
215
|
+
icon: "Warehouse" | "Plus" | "Sparkles" | "Settings" | "Search" | "Boxes" | "Layers" | "Menu" | "PlusCircle" | "PlusSquare" | "FilePlus" | "FolderPlus" | "Upload" | "FileUp" | "CloudUpload" | "Download" | "FileDown" | "FileText" | "BookOpen" | "Rss" | "Package" | "Tag" | "ShoppingCart" | "Receipt" | "CreditCard" | "Users" | "UserPlus" | "Inbox" | "ListChecks" | "ClipboardList" | "Image" | "Video" | "LayoutDashboard" | "PanelLeft" | "KeyRound" | "ShieldCheck" | "Edit" | "Archive" | "Box" | "Truck" | "CircleDollarSign" | "Activity" | "LineChart" | "Smartphone" | "Webhook" | "Scale" | "PlugZap" | "PercentDiamond" | "Newspaper" | "Languages" | "Eraser" | "TrendingDown" | "Bell" | "PackageOpen" | "Building2" | "Store" | "ClipboardCheck";
|
|
216
|
+
labelKey: string;
|
|
217
|
+
}[];
|
|
218
|
+
};
|
|
219
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAgCA;;;;;GAKG;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;CAS1B,CAAC;AAuFX,+CAA+C;AAC/C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+MnB,CAAC;AAEH,yDAAyD;AACzD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;CAAW,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc;;;;;;CAoCzB,CAAC"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { defineModuleManifest, defineModuleRecentActivity, defineModuleSettingsManifest, } from '@endora-commerce/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* The demo data this module owns (feature 113, T223 — contract §1.3).
|
|
4
|
+
*
|
|
5
|
+
* A typed `const` rather than an inline object literal: declared inline the
|
|
6
|
+
* parameter infers from the schema and is `never`, so the author loses
|
|
7
|
+
* `context.ctx: ModuleContext`.
|
|
8
|
+
*
|
|
9
|
+
* Both bodies are reached by a **relative `await import()`** (§1.4), in
|
|
10
|
+
* `cliCommands.run`'s shape and for `cliCommands`' reason: a manifest is loaded
|
|
11
|
+
* by every process that composes the platform and by the check scripts that
|
|
12
|
+
* import the generated index, so a demo body imported at the top of this file
|
|
13
|
+
* would be a service graph pulled into all of them. It needs no `exports`
|
|
14
|
+
* subpath and no `files` entry (§1.5).
|
|
15
|
+
*
|
|
16
|
+
* The stock spread across the two warehouses is **not** here: quantities per
|
|
17
|
+
* product are `catalog`'s rows and this module's in one statement, so they are
|
|
18
|
+
* a composition step (§5.1) and belong to whoever owns the instance.
|
|
19
|
+
*/
|
|
20
|
+
const demo = {
|
|
21
|
+
summary: 'A second warehouse, assigned to every sales channel.',
|
|
22
|
+
seed: async (context) => (await import('./backend/demo/seed.js')).seedDemo(context),
|
|
23
|
+
reset: async (context) => (await import('./backend/demo/reset.js')).resetDemo(context),
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Settings manifest for the Inventory module — feature 010.
|
|
27
|
+
*
|
|
28
|
+
* Seven settings (FR-019 / FR-029 / FR-031). Setting codes follow
|
|
29
|
+
* the foundation regex `^[a-z][a-z0-9_][a-z0-9_.]*[a-z0-9]$`.
|
|
30
|
+
*/
|
|
31
|
+
export const INVENTORY_SETTING_CODES = {
|
|
32
|
+
DISPLAY_MODE: 'inventory.display_mode',
|
|
33
|
+
FULFILMENT_STRATEGY: 'inventory.fulfilment_strategy',
|
|
34
|
+
FULFILMENT_STRATEGY_WAREHOUSE_ORDER: 'inventory.fulfilment_strategy_warehouse_order',
|
|
35
|
+
GLOBAL_THRESHOLD_HIGH: 'inventory.global_threshold_high',
|
|
36
|
+
GLOBAL_THRESHOLD_MEDIUM: 'inventory.global_threshold_medium',
|
|
37
|
+
GLOBAL_THRESHOLD_LOW: 'inventory.global_threshold_low',
|
|
38
|
+
LOW_STOCK_ALERT_RECIPIENT_EMAIL: 'inventory.low_stock_alert_recipient_email',
|
|
39
|
+
ALLOW_NEGATIVE_STOCK: 'inventory.allow_negative_stock',
|
|
40
|
+
};
|
|
41
|
+
const settings = defineModuleSettingsManifest({
|
|
42
|
+
moduleCode: 'inventory',
|
|
43
|
+
groups: [{ code: 'inventory', name: 'Inventory' }],
|
|
44
|
+
settings: [
|
|
45
|
+
{
|
|
46
|
+
// Feature 073 — the operator's activation control. Platform-wide.
|
|
47
|
+
code: 'inventory.enabled',
|
|
48
|
+
name: 'Inventory enabled',
|
|
49
|
+
description: 'Switches stock management on or off: warehouses, stock levels and their adjustments, low-stock alerts, the back-in-stock notification flow and the storefront stock figure. Nothing is dropped — every warehouse, stock row and pending notification stays in the database and resumes where it was.',
|
|
50
|
+
groupCode: 'inventory',
|
|
51
|
+
valueType: 'boolean',
|
|
52
|
+
defaultValue: true,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
code: INVENTORY_SETTING_CODES.DISPLAY_MODE,
|
|
56
|
+
name: 'Storefront stock display mode',
|
|
57
|
+
description: 'How storefront product cards and PDP render stock: exact / band / available_or_not.',
|
|
58
|
+
groupCode: 'inventory',
|
|
59
|
+
valueType: 'string',
|
|
60
|
+
defaultValue: 'band',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
code: INVENTORY_SETTING_CODES.FULFILMENT_STRATEGY,
|
|
64
|
+
name: 'Order fulfilment strategy',
|
|
65
|
+
description: 'Picks warehouses to fulfil order lines. any | default_first | lowest_stock_first | highest_stock_first | defined_order.',
|
|
66
|
+
groupCode: 'inventory',
|
|
67
|
+
valueType: 'string',
|
|
68
|
+
defaultValue: 'default_first',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
code: INVENTORY_SETTING_CODES.FULFILMENT_STRATEGY_WAREHOUSE_ORDER,
|
|
72
|
+
name: 'Warehouse order (for "defined_order" strategy)',
|
|
73
|
+
description: 'Ordered list of warehouse IDs walked by the defined-order strategy.',
|
|
74
|
+
groupCode: 'inventory',
|
|
75
|
+
valueType: 'json',
|
|
76
|
+
defaultValue: [],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
code: INVENTORY_SETTING_CODES.GLOBAL_THRESHOLD_HIGH,
|
|
80
|
+
name: 'Global high-stock threshold',
|
|
81
|
+
description: 'Quantity at or above which a product is considered high-stock.',
|
|
82
|
+
groupCode: 'inventory',
|
|
83
|
+
valueType: 'number',
|
|
84
|
+
defaultValue: 100,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
code: INVENTORY_SETTING_CODES.GLOBAL_THRESHOLD_MEDIUM,
|
|
88
|
+
name: 'Global medium-stock threshold',
|
|
89
|
+
description: 'Quantity at or above which a product is considered medium-stock.',
|
|
90
|
+
groupCode: 'inventory',
|
|
91
|
+
valueType: 'number',
|
|
92
|
+
defaultValue: 20,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
code: INVENTORY_SETTING_CODES.GLOBAL_THRESHOLD_LOW,
|
|
96
|
+
name: 'Global low-stock threshold',
|
|
97
|
+
description: 'Quantity at or above which a product is considered low-stock. Below this it is out of stock.',
|
|
98
|
+
groupCode: 'inventory',
|
|
99
|
+
valueType: 'number',
|
|
100
|
+
defaultValue: 1,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
code: INVENTORY_SETTING_CODES.LOW_STOCK_ALERT_RECIPIENT_EMAIL,
|
|
104
|
+
name: 'Low-stock alert recipient email',
|
|
105
|
+
description: 'Email to receive low-stock alerts. Empty falls back to the platform admin.',
|
|
106
|
+
groupCode: 'inventory',
|
|
107
|
+
valueType: 'string',
|
|
108
|
+
defaultValue: '',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
code: INVENTORY_SETTING_CODES.ALLOW_NEGATIVE_STOCK,
|
|
112
|
+
name: 'Allow ordering below stock (negative stock)',
|
|
113
|
+
description: 'Global gate for per-product backorder. When false, no product accepts orders below available stock regardless of its per-product backorder flag. When true, products whose backorder flag is set may be ordered into negative stock.',
|
|
114
|
+
groupCode: 'inventory',
|
|
115
|
+
valueType: 'boolean',
|
|
116
|
+
defaultValue: false,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
});
|
|
120
|
+
/** Module-lifecycle manifest (feature 018). */
|
|
121
|
+
export const manifest = defineModuleManifest({
|
|
122
|
+
id: 'inventory',
|
|
123
|
+
name: 'Inventory',
|
|
124
|
+
description: 'Multi-warehouse stock levels, fulfilment strategy, and storefront display modes.',
|
|
125
|
+
version: '1.0.0',
|
|
126
|
+
/**
|
|
127
|
+
* What this module needs from the environment (`specs/117-instance-bring-up/`
|
|
128
|
+
* FR-002). Only what it **owns**: its reads of platform-owned names are
|
|
129
|
+
* satisfied by `packages/platform/src/env/index.ts`.
|
|
130
|
+
*
|
|
131
|
+
* Why each of these is not a Setting is its entry in
|
|
132
|
+
* `backend/scripts/ledgers/module-environment-inputs/inventory.ts`.
|
|
133
|
+
*/
|
|
134
|
+
env: [
|
|
135
|
+
{
|
|
136
|
+
name: 'INVENTORY_LOW_STOCK_RECIPIENT',
|
|
137
|
+
describes: {
|
|
138
|
+
en: 'Who is e-mailed when a product falls below its low-stock threshold, where the Setting of the same name has not been filled in.',
|
|
139
|
+
pl: 'Kto dostaje wiadomość, gdy produkt spadnie poniżej progu niskiego stanu, o ile ustawienie o tej samej nazwie nie zostało wypełnione.',
|
|
140
|
+
},
|
|
141
|
+
requirement: {
|
|
142
|
+
kind: 'optional',
|
|
143
|
+
without: {
|
|
144
|
+
en: 'A product crossing its low-stock threshold alerts nobody, unless the Setting carries an address.',
|
|
145
|
+
pl: 'Produkt przekraczający próg niskiego stanu nikogo nie powiadomi, o ile adres nie znajdzie się w ustawieniu.',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
secret: false,
|
|
149
|
+
generable: false,
|
|
150
|
+
owner: { kind: 'module', moduleId: 'inventory' },
|
|
151
|
+
consumers: ['backend'],
|
|
152
|
+
addressOf: null,
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
// Feature 075, Phase C adds `customer_accounts` and `email`. Both were
|
|
156
|
+
// reached by importing a file rather than resolving a port, so neither
|
|
157
|
+
// appeared here: the availability queue turns a subscription into an e-mail
|
|
158
|
+
// address by reading `CustomerAccount`, and every message this module sends
|
|
159
|
+
// leaves through `email`'s transport. `customer_accounts` belongs in
|
|
160
|
+
// `dependencies` rather than `nonBindingDependencies` for the reason
|
|
161
|
+
// `quick_order` gives — a back-in-stock notice addressed to an account the
|
|
162
|
+
// platform will not identify is worse than a refused subscription.
|
|
163
|
+
//
|
|
164
|
+
// D-94.1 adds `orders`, for the foreign key
|
|
165
|
+
// `stock_allocations_order_item_fk` (`stock_allocations.order_item_id` ->
|
|
166
|
+
// `order_items.id`, `on delete restrict`). AGENTS.md § Migrations item 4: a
|
|
167
|
+
// cross-module foreign key is declared here or the build fails. It is the
|
|
168
|
+
// one edge of the four-site family that closes no cycle — `orders` resolves
|
|
169
|
+
// no port this module owns in `dependencies`, only the two
|
|
170
|
+
// `degrades-without` reads placement makes.
|
|
171
|
+
// `audit_logs` owns `auditReferenceRegistry`, the registry this module pushes
|
|
172
|
+
// its own "what is this audit row called, and where does the admin app show
|
|
173
|
+
// it?" resolver into (feature 075, D-87). The registry is ungated and its
|
|
174
|
+
// owner is non-deactivatable, so the declaration buys install and migration
|
|
175
|
+
// order rather than a flip-time refusal.
|
|
176
|
+
dependencies: [
|
|
177
|
+
'audit_logs',
|
|
178
|
+
'auth',
|
|
179
|
+
'catalog',
|
|
180
|
+
'customer_accounts',
|
|
181
|
+
'dictionaries',
|
|
182
|
+
'email',
|
|
183
|
+
'orders',
|
|
184
|
+
'organizations',
|
|
185
|
+
'sales_channels',
|
|
186
|
+
'settings',
|
|
187
|
+
'transactional_emails',
|
|
188
|
+
],
|
|
189
|
+
// D-44 — real to the container, binding on no operator.
|
|
190
|
+
nonBindingDependencies: [
|
|
191
|
+
{
|
|
192
|
+
moduleId: 'prompt_actions',
|
|
193
|
+
name: 'promptActionToolRegistry',
|
|
194
|
+
kind: 'contributes-to',
|
|
195
|
+
reason: 'A push, from this module’s boot hook, of the warehouse resolver and the ' +
|
|
196
|
+
'`set_stock_level` mutation built over its own services. Nothing is read back: ' +
|
|
197
|
+
'the registry is a plain registration that drops every tool whose owner is not ' +
|
|
198
|
+
'effectively present, so an absent contributor costs the host nothing and an ' +
|
|
199
|
+
'absent host holds a table nobody walks. Declaring the edge would make an ' +
|
|
200
|
+
'optional assistant undeactivatable for as long as stock is tracked.',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
/**
|
|
204
|
+
* The module's own authority (2026-08-29).
|
|
205
|
+
*
|
|
206
|
+
* All 21 admin gates enforced a code somebody else owns — nine reads on
|
|
207
|
+
* `orders:read`, twelve writes on `catalog:write`. So whoever could edit a
|
|
208
|
+
* product description could create, rename and **delete a warehouse**,
|
|
209
|
+
* rewrite a stock count, run a CSV import over every product's stock and bind
|
|
210
|
+
* or unbind a warehouse from a sales channel, which decides what that channel
|
|
211
|
+
* can sell. And whoever could read orders could enumerate every warehouse and
|
|
212
|
+
* its address. Neither code names the data touched, which is the
|
|
213
|
+
* discriminator `payments-permission-ownership.md` §7.2 sets; the sweep
|
|
214
|
+
* applied it per module and `specs/080-f4-real-scope/first-deployment-window.md` §2 re-applies
|
|
215
|
+
* it per route, which is where authority is actually exercised.
|
|
216
|
+
*
|
|
217
|
+
* Nothing could see it. Both codes are real, declared and enforced, so the
|
|
218
|
+
* permission inventory's two directions were clean; D-173's `foreign-gate`
|
|
219
|
+
* sweep passes both sites deliberately, because `catalog` and `orders` are
|
|
220
|
+
* `nonDeactivatable` and the availability coupling that sweep asks about can
|
|
221
|
+
* never bite. `check:action-route-permissions` is the one check that *did*
|
|
222
|
+
* look here — this module declares the `open-inventory` action below — and it
|
|
223
|
+
* agreed, because the action correctly named the code the route enforced.
|
|
224
|
+
* That is the check working: it compares an action to its route and has no
|
|
225
|
+
* opinion about whether the route's code is the right authority.
|
|
226
|
+
*
|
|
227
|
+
* A pair and no third code, spelled `<module id>:<read|write>` like
|
|
228
|
+
* `payment_methods`, `delivery_methods`, `taxes`, `returns` and `invoices`.
|
|
229
|
+
*
|
|
230
|
+
* No data migration: see
|
|
231
|
+
* `test/contract/inventory/permission-authority.test.ts`.
|
|
232
|
+
*/
|
|
233
|
+
permissions: [
|
|
234
|
+
{ code: 'inventory:read', label: 'View stock and warehouses' },
|
|
235
|
+
{ code: 'inventory:write', label: 'Manage stock and warehouses' },
|
|
236
|
+
],
|
|
237
|
+
/**
|
|
238
|
+
* The thirteen error codes this module owns — feature 090 Phase 3
|
|
239
|
+
* (`specs/090-module-owned-error-codes/contracts/error-code-declaration.md`
|
|
240
|
+
* §1.1). This is where the sentence for each is looked up from: `errors.<CODE>`
|
|
241
|
+
* in this module's own `i18n/{en,pl}.json`, which already holds all thirteen in
|
|
242
|
+
* both languages.
|
|
243
|
+
*
|
|
244
|
+
* The list is answer-preserving, not a judgement (§6.2 and §6.5): it is exactly
|
|
245
|
+
* what the prefix chain in `@endora-commerce/mod-i18n` routes here today,
|
|
246
|
+
* copied from the frozen capture at
|
|
247
|
+
* `backend/test/fixtures/error-code-routing/chain-answers.ts` rather than
|
|
248
|
+
* re-derived. Re-routing a code to a better owner is
|
|
249
|
+
* `specs/082-error-code-ownership/rulings.md` §9's remaining work and is
|
|
250
|
+
* deliberately not done here.
|
|
251
|
+
*
|
|
252
|
+
* **Two codes that look like they belong here and do not**, because the chain
|
|
253
|
+
* is ordered and `catalog`'s rule runs before this module's:
|
|
254
|
+
* `PRODUCT_UNMANAGED_STOCK` and `PRODUCT_IN_STOCK` are named in the chain's own
|
|
255
|
+
* `INVENTORY_MISC_ERROR_CODES` set and route to `catalog` regardless, so two of
|
|
256
|
+
* that set's three members are unreachable. An author who wrote this list from
|
|
257
|
+
* the chain's source rather than from its answer would have taken two of
|
|
258
|
+
* `catalog`'s codes.
|
|
259
|
+
*
|
|
260
|
+
* No `tokens`: no code here carries a refusal discriminator, which is derivable
|
|
261
|
+
* from this module's bundles holding no `errors.<CODE>.<token>` key.
|
|
262
|
+
*/
|
|
263
|
+
errorCodes: [
|
|
264
|
+
{ code: 'AVAILABILITY_NOTIFICATION_NOT_FOUND' },
|
|
265
|
+
{ code: 'CHANNEL_NO_WAREHOUSES' },
|
|
266
|
+
{ code: 'CHANNEL_WAREHOUSE_NOT_FOUND' },
|
|
267
|
+
{ code: 'STOCK_IMPORT_INVALID_FILE' },
|
|
268
|
+
{ code: 'STOCK_LEVEL_NOT_FOUND' },
|
|
269
|
+
{ code: 'STOCK_UNAVAILABLE' },
|
|
270
|
+
{ code: 'THRESHOLDS_INVALID' },
|
|
271
|
+
{ code: 'WAREHOUSE_CANNOT_DELETE_DEFAULT' },
|
|
272
|
+
{ code: 'WAREHOUSE_CODE_TAKEN' },
|
|
273
|
+
{ code: 'WAREHOUSE_HAS_STOCK' },
|
|
274
|
+
{ code: 'WAREHOUSE_INVALID_CODE' },
|
|
275
|
+
{ code: 'WAREHOUSE_IS_DEFAULT_FOR_CHANNELS' },
|
|
276
|
+
{ code: 'WAREHOUSE_NOT_FOUND' },
|
|
277
|
+
],
|
|
278
|
+
settings,
|
|
279
|
+
// Feature 073 (Constitution XVII) — the operator's activation control.
|
|
280
|
+
demo,
|
|
281
|
+
activation: { settingCode: 'inventory.enabled', default: true },
|
|
282
|
+
i18n: { bundlesDir: 'i18n' },
|
|
283
|
+
docs: { dir: 'docs' },
|
|
284
|
+
// Feature 047 — admin-editable transactional emails owned by this module.
|
|
285
|
+
transactionalEmails: [
|
|
286
|
+
{
|
|
287
|
+
code: 'low_stock_alert',
|
|
288
|
+
name: 'Low stock alert',
|
|
289
|
+
group: 'inventory',
|
|
290
|
+
variables: [
|
|
291
|
+
{ key: 'product.name', label: 'Product name', sampleValue: 'Widget' },
|
|
292
|
+
{ key: 'product.sku', label: 'Product SKU', sampleValue: 'WID-001' },
|
|
293
|
+
{ key: 'cumulativeOnHand', label: 'Cumulative on-hand', sampleValue: '3' },
|
|
294
|
+
{ key: 'threshold', label: 'Threshold', sampleValue: '5' },
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
code: 'availability_back_in_stock',
|
|
299
|
+
name: 'Back in stock notification',
|
|
300
|
+
group: 'inventory',
|
|
301
|
+
variables: [{ key: 'product.name', label: 'Product name', sampleValue: 'Widget' }],
|
|
302
|
+
},
|
|
303
|
+
],
|
|
304
|
+
actions: [
|
|
305
|
+
{
|
|
306
|
+
id: 'open-inventory',
|
|
307
|
+
labelKey: 'actions.openInventory.label',
|
|
308
|
+
descriptionKey: 'actions.openInventory.description',
|
|
309
|
+
icon: 'Boxes',
|
|
310
|
+
targetRoute: '/inventory',
|
|
311
|
+
// `inventory:read`, the code `GET /api/v1/admin/inventory` now enforces
|
|
312
|
+
// (`routes.admin.ts`). This has been corrected twice for two different
|
|
313
|
+
// reasons and both are worth keeping. Issue #232 replaced a `catalog:write`
|
|
314
|
+
// that was wrong in both directions at once — it hid the screen from
|
|
315
|
+
// operators who can open it and offered it to some who cannot — with
|
|
316
|
+
// `orders:read`, the code the route then enforced. That was right, and it
|
|
317
|
+
// is why `check:action-route-permissions` had nothing to say when the
|
|
318
|
+
// gates themselves were the defect: the check compares an action to its
|
|
319
|
+
// route, which is a derivation, and never asks whether the route's code is
|
|
320
|
+
// the right authority, which is a judgement.
|
|
321
|
+
requiredPermission: 'inventory:read',
|
|
322
|
+
keywords: ['stock', 'inventory', 'warehouse', 'magazyn', 'zapasy'],
|
|
323
|
+
weight: 230,
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
});
|
|
327
|
+
/** Legacy export retained for backward compatibility. */
|
|
328
|
+
export const inventoryManifest = settings;
|
|
329
|
+
/**
|
|
330
|
+
* What this module offers the admin home dashboard's Recent Activity card —
|
|
331
|
+
* feature 080, T042j / D-163.1.
|
|
332
|
+
*
|
|
333
|
+
* The **declaration** axis: eligibility, never a decision. Whether these rows
|
|
334
|
+
* appear is the operator's, held in `inventory.recent_activity_visible` and
|
|
335
|
+
* defaulting to visible, flipped on `/platform/modules` beside this module's
|
|
336
|
+
* activation control. The two are different questions about the same module —
|
|
337
|
+
* "does this client want stock management" and "does this client want stock
|
|
338
|
+
* movements on their home screen" — which is why there are two switches.
|
|
339
|
+
*/
|
|
340
|
+
export const recentActivity = defineModuleRecentActivity({
|
|
341
|
+
entries: [
|
|
342
|
+
{ action: 'warehouse.create', icon: 'Truck', labelKey: 'activity.verb.warehouse.create' },
|
|
343
|
+
{ action: 'warehouse.update', icon: 'Edit', labelKey: 'activity.verb.warehouse.update' },
|
|
344
|
+
{
|
|
345
|
+
action: 'warehouse.deactivate',
|
|
346
|
+
icon: 'Archive',
|
|
347
|
+
labelKey: 'activity.verb.warehouse.deactivate',
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
action: 'warehouse.reactivate',
|
|
351
|
+
icon: 'Truck',
|
|
352
|
+
labelKey: 'activity.verb.warehouse.reactivate',
|
|
353
|
+
},
|
|
354
|
+
{ action: 'stock_level.adjust', icon: 'Box', labelKey: 'activity.verb.stock_level.adjust' },
|
|
355
|
+
{
|
|
356
|
+
action: 'stock_level.bulk_import',
|
|
357
|
+
icon: 'Upload',
|
|
358
|
+
labelKey: 'activity.verb.stock_level.bulk_import',
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
action: 'low_stock_threshold.create',
|
|
362
|
+
icon: 'Tag',
|
|
363
|
+
labelKey: 'activity.verb.low_stock_threshold.create',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
action: 'low_stock_threshold.update',
|
|
367
|
+
icon: 'Edit',
|
|
368
|
+
labelKey: 'activity.verb.low_stock_threshold.update',
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
action: 'low_stock_threshold.delete',
|
|
372
|
+
icon: 'Archive',
|
|
373
|
+
labelKey: 'activity.verb.low_stock_threshold.delete',
|
|
374
|
+
},
|
|
375
|
+
],
|
|
376
|
+
});
|
|
377
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,GAE7B,MAAM,4BAA4B,CAAC;AAGpC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,IAAI,GAAsC;IAC9C,OAAO,EAAE,sDAAsD;IAC/D,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,Q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AM,EAAE,sBAAsB;YAC9B,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,oCAAoC;SAC/C;QACD,EAAE,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,kCAAkC,EAAE;QAC3F;YACE,MAAM,EAAE,yBAAyB;YACjC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,uCAAuC;SAClD;QACD;YACE,MAAM,EAAE,4BAA4B;YACpC,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,0CAA0C;SACrD;QACD;YACE,MAAM,EAAE,4BAA4B;YACpC,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,0CAA0C;SACrD;QACD;YACE,MAAM,EAAE,4BAA4B;YACpC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,0CAA0C;SACrD;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
/**
|
|
3
|
+
* Inventory module — multi-warehouse rewrite (feature 010).
|
|
4
|
+
*
|
|
5
|
+
* What this migration does, in order (data-model.md §10):
|
|
6
|
+
* 1. Create `warehouses` table; seed the `Default` warehouse with
|
|
7
|
+
* deterministic UUID `00000000-0000-4000-8000-00000000d017`.
|
|
8
|
+
* 2. Add `warehouse_id` to `stock_levels`, backfill every existing
|
|
9
|
+
* row to the Default UUID, swap the unique index to include
|
|
10
|
+
* warehouse_id.
|
|
11
|
+
* 3. Create `warehouse_channel_assignments`; for every existing
|
|
12
|
+
* sales channel insert a `(default_warehouse, channel, isDefault=true)`
|
|
13
|
+
* seed row.
|
|
14
|
+
* 4. Extend `availability_notifications` with `email` + `status`
|
|
15
|
+
* columns, relax `customer_account_id` to nullable, add the
|
|
16
|
+
* "at least one recipient" CHECK constraint.
|
|
17
|
+
* 5. (moved) The stock-management columns on `products` and their
|
|
18
|
+
* `products_fulfilment_strategy_check` constraint, and
|
|
19
|
+
* 6. (moved) the three threshold columns on `categories`, are `catalog`'s:
|
|
20
|
+
* its entities map them, and since feature 134
|
|
21
|
+
* (`specs/134-paid-module-extraction/research.md` D15) they are created
|
|
22
|
+
* by `catalog`'s `Migration20260925T125527CatalogInventoryColumns`. This
|
|
23
|
+
* migration keeps its class name and position, and lost only those
|
|
24
|
+
* statements in `up()` and `down()` — with them, a database whose
|
|
25
|
+
* `catalog` migration already ran failed when `inventory` was installed
|
|
26
|
+
* later, and this module's hard uninstall dropped columns it does not own.
|
|
27
|
+
* 7. Create `inventory_thresholds`; insert the global row at
|
|
28
|
+
* foundation defaults (high=100, medium=20, low=1).
|
|
29
|
+
* 8. Create `stock_allocations`.
|
|
30
|
+
*
|
|
31
|
+
* The deterministic seed UUID lets retried migrations stay
|
|
32
|
+
* idempotent and lets other modules' tests reference the Default
|
|
33
|
+
* warehouse by id.
|
|
34
|
+
*/
|
|
35
|
+
export declare class Migration20260503T182812InventoryWorkflow extends Migration {
|
|
36
|
+
up(): Promise<void>;
|
|
37
|
+
down(): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=20260503T182812_inventory_workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20260503T182812_inventory_workflow.d.ts","sourceRoot":"","sources":["../../src/migrations/20260503T182812_inventory_workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,yCAA0C,SAAQ,SAAS;IACvD,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IA2JnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAuBrC"}
|