@api-client/core 0.18.20 → 0.18.22
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/build/src/modeling/helpers/Intelisense.d.ts +1 -0
- package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
- package/build/src/modeling/helpers/Intelisense.js +1 -0
- package/build/src/modeling/helpers/Intelisense.js.map +1 -1
- package/build/src/modeling/templates/index.d.ts +21 -0
- package/build/src/modeling/templates/index.d.ts.map +1 -0
- package/build/src/modeling/templates/index.js +176 -0
- package/build/src/modeling/templates/index.js.map +1 -0
- package/build/src/modeling/templates/meta/blog-publishing-platform.json +1 -0
- package/build/src/modeling/templates/meta/ecommerce-platform.json +1 -0
- package/build/src/modeling/templates/meta/education-management-platform.json +1 -0
- package/build/src/modeling/templates/meta/financial-services-platform.json +1 -0
- package/build/src/modeling/templates/meta/gaming-platform.json +1 -0
- package/build/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
- package/build/src/modeling/templates/meta/hospitality-platform.json +1 -0
- package/build/src/modeling/templates/meta/index.d.ts +56 -0
- package/build/src/modeling/templates/meta/index.d.ts.map +1 -0
- package/build/src/modeling/templates/meta/index.js +120 -0
- package/build/src/modeling/templates/meta/index.js.map +1 -0
- package/build/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
- package/build/src/modeling/templates/meta/legal-services-platform.json +1 -0
- package/build/src/modeling/templates/meta/manufacturing-platform.json +1 -0
- package/build/src/modeling/templates/meta/non-profit-platform.json +1 -0
- package/build/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
- package/build/src/modeling/templates/template-registry.d.ts +55 -0
- package/build/src/modeling/templates/template-registry.d.ts.map +1 -0
- package/build/src/modeling/templates/template-registry.js +111 -0
- package/build/src/modeling/templates/template-registry.js.map +1 -0
- package/build/src/modeling/templates/types.d.ts +158 -0
- package/build/src/modeling/templates/types.d.ts.map +1 -1
- package/build/src/modeling/templates/types.js.map +1 -1
- package/build/src/modeling/templates/{ecommerce-domain.d.ts → verticals/business-services/ecommerce-domain.d.ts} +2 -2
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/{ecommerce-domain.js → verticals/business-services/ecommerce-domain.js} +6 -6
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +744 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts +45 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js +797 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/index.d.ts +21 -0
- package/build/src/modeling/templates/verticals/business-services/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/index.js +50 -0
- package/build/src/modeling/templates/verticals/business-services/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts +46 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js +837 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.js +725 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/education-training/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/index.js +21 -0
- package/build/src/modeling/templates/verticals/education-training/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js +859 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js +21 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/index.d.ts +79 -0
- package/build/src/modeling/templates/verticals/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/index.js +186 -0
- package/build/src/modeling/templates/verticals/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js +22 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts +45 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js +710 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/index.js +22 -0
- package/build/src/modeling/templates/verticals/public-sector/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts +47 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js +864 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js +21 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js +727 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js.map +1 -0
- package/build/src/modeling/templates/{blog-domain.d.ts → verticals/technology-media/blog-domain.d.ts} +2 -2
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/{blog-domain.js → verticals/technology-media/blog-domain.js} +5 -5
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts +46 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js +1033 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts +21 -0
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/index.js +42 -0
- package/build/src/modeling/templates/verticals/technology-media/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts +47 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +1027 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +6 -6
- package/package.json +1 -1
- package/src/modeling/helpers/Intelisense.ts +1 -0
- package/src/modeling/templates/meta/blog-publishing-platform.json +1 -0
- package/src/modeling/templates/meta/ecommerce-platform.json +1 -0
- package/src/modeling/templates/meta/education-management-platform.json +1 -0
- package/src/modeling/templates/meta/financial-services-platform.json +1 -0
- package/src/modeling/templates/meta/gaming-platform.json +1 -0
- package/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
- package/src/modeling/templates/meta/hospitality-platform.json +1 -0
- package/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
- package/src/modeling/templates/meta/legal-services-platform.json +1 -0
- package/src/modeling/templates/meta/manufacturing-platform.json +1 -0
- package/src/modeling/templates/meta/non-profit-platform.json +1 -0
- package/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
- package/src/modeling/templates/readme.md +260 -0
- package/src/modeling/templates/template-registry.ts +140 -0
- package/src/modeling/templates/types.ts +166 -0
- package/src/modeling/templates/verticals/README.md +122 -0
- package/src/modeling/templates/{ecommerce-domain.ts → verticals/business-services/ecommerce-domain.ts} +7 -7
- package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +943 -0
- package/src/modeling/templates/verticals/business-services/hospitality-domain.ts +994 -0
- package/src/modeling/templates/verticals/business-services/legal-services-domain.ts +1059 -0
- package/src/modeling/templates/verticals/education-training/education-domain.ts +922 -0
- package/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.ts +1111 -0
- package/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.ts +895 -0
- package/src/modeling/templates/verticals/public-sector/non-profit-domain.ts +1109 -0
- package/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.ts +944 -0
- package/src/modeling/templates/{blog-domain.ts → verticals/technology-media/blog-domain.ts} +6 -6
- package/src/modeling/templates/verticals/technology-media/gaming-domain.ts +1290 -0
- package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +1287 -0
- package/build/src/modeling/templates/blog-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/blog-domain.js.map +0 -1
- package/build/src/modeling/templates/ecommerce-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/ecommerce-domain.js.map +0 -1
package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js
ADDED
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manufacturing Domain Template
|
|
3
|
+
*
|
|
4
|
+
* A comprehensive manufacturing data domain following domain-driven design principles.
|
|
5
|
+
* This template covers the complete manufacturing lifecycle including:
|
|
6
|
+
*
|
|
7
|
+
* - Product Management: Products, SKUs, specifications, BOMs
|
|
8
|
+
* - Inventory Management: Stock levels, warehouses, suppliers
|
|
9
|
+
* - Production Planning: Work orders, scheduling, capacity
|
|
10
|
+
* - Quality Control: Inspections, testing, compliance
|
|
11
|
+
* - Equipment Management: Machinery, maintenance, calibration
|
|
12
|
+
* - Supply Chain: Suppliers, procurement, logistics
|
|
13
|
+
*
|
|
14
|
+
* Key Features:
|
|
15
|
+
* - Complete product lifecycle management
|
|
16
|
+
* - Inventory tracking and warehouse management
|
|
17
|
+
* - Production planning and work order management
|
|
18
|
+
* - Quality control and compliance tracking
|
|
19
|
+
* - Equipment maintenance and calibration
|
|
20
|
+
* - Supplier and procurement management
|
|
21
|
+
* - Supply chain logistics and tracking
|
|
22
|
+
*
|
|
23
|
+
* Use Cases:
|
|
24
|
+
* - Manufacturing companies
|
|
25
|
+
* - Production facilities
|
|
26
|
+
* - Quality management systems
|
|
27
|
+
* - Supply chain management
|
|
28
|
+
* - Equipment maintenance tracking
|
|
29
|
+
*/
|
|
30
|
+
import { DataDomain } from '../../../DataDomain.js';
|
|
31
|
+
import { addIdField, addNameField, addDescriptionField, addEmailField, addPhoneField, addCustomStatusField, addCreatedAtField, addUpdatedAtField, addCurrencyAmountField, } from '../../../helpers/Intelisense.js';
|
|
32
|
+
function createDomain() {
|
|
33
|
+
return new DataDomain({
|
|
34
|
+
info: {
|
|
35
|
+
name: 'Manufacturing Platform',
|
|
36
|
+
displayName: 'Manufacturing Platform',
|
|
37
|
+
description: 'A comprehensive manufacturing platform with product management, inventory control, ' +
|
|
38
|
+
'production planning, quality control, equipment management, and supply chain capabilities',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a comprehensive manufacturing data domain following domain-driven design principles.
|
|
44
|
+
*
|
|
45
|
+
* This function demonstrates the proper hierarchy and organization for a manufacturing platform:
|
|
46
|
+
* 1. Creates the root DataDomain for the manufacturing platform
|
|
47
|
+
* 2. Organizes functionality into logical namespaces (Product Management, Inventory Management, etc.)
|
|
48
|
+
* 3. Groups related entities into models within each namespace
|
|
49
|
+
* 4. Defines entities with proper semantic annotations for manufacturing workflows
|
|
50
|
+
* 5. Establishes associations with appropriate cardinality for manufacturing relationships
|
|
51
|
+
*
|
|
52
|
+
* @returns A fully configured DataDomain with all manufacturing entities and relationships
|
|
53
|
+
*/
|
|
54
|
+
export default function createManufacturingDomain(options = {}) {
|
|
55
|
+
// Ensure the root data domain
|
|
56
|
+
const domain = options.domain ?? createDomain();
|
|
57
|
+
//
|
|
58
|
+
// 1. PRODUCT MANAGEMENT NAMESPACE
|
|
59
|
+
//
|
|
60
|
+
const productManagement = domain.addNamespace({
|
|
61
|
+
info: {
|
|
62
|
+
name: 'ProductManagement',
|
|
63
|
+
displayName: 'Product Management',
|
|
64
|
+
description: 'Product definitions, SKUs, specifications, and bill of materials',
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
// Product Model
|
|
68
|
+
const productModel = productManagement.addModel({
|
|
69
|
+
info: {
|
|
70
|
+
name: 'Products',
|
|
71
|
+
displayName: 'Product Management',
|
|
72
|
+
description: 'Product definitions and specifications',
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
// Product Entity
|
|
76
|
+
const productEntity = productModel.addEntity({
|
|
77
|
+
info: {
|
|
78
|
+
name: 'product',
|
|
79
|
+
displayName: 'Product',
|
|
80
|
+
description: 'Manufactured product with specifications and BOM',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
addIdField(productEntity, { displayName: 'Product ID', description: 'Unique identifier for the product' });
|
|
84
|
+
addNameField(productEntity, { description: 'Product name and title' });
|
|
85
|
+
addDescriptionField(productEntity, { description: 'Product description and specifications' });
|
|
86
|
+
productEntity.addProperty({
|
|
87
|
+
info: { name: 'sku', displayName: 'SKU', description: 'Stock Keeping Unit identifier' },
|
|
88
|
+
type: 'string',
|
|
89
|
+
required: true,
|
|
90
|
+
unique: true,
|
|
91
|
+
});
|
|
92
|
+
productEntity.addProperty({
|
|
93
|
+
info: { name: 'product_type', displayName: 'Product Type', description: 'Type of manufactured product' },
|
|
94
|
+
type: 'string',
|
|
95
|
+
required: true,
|
|
96
|
+
schema: {
|
|
97
|
+
enum: ['finished_good', 'component', 'raw_material', 'sub_assembly'],
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
productEntity.addProperty({
|
|
101
|
+
info: { name: 'unit_of_measure', displayName: 'Unit of Measure', description: 'Standard unit for the product' },
|
|
102
|
+
type: 'string',
|
|
103
|
+
required: true,
|
|
104
|
+
schema: {
|
|
105
|
+
enum: ['pieces', 'kilograms', 'meters', 'liters', 'units'],
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
addCustomStatusField(productEntity, ['active', 'discontinued', 'development'], {
|
|
109
|
+
displayName: 'Product Status',
|
|
110
|
+
description: 'Current status of the product',
|
|
111
|
+
});
|
|
112
|
+
addCreatedAtField(productEntity, { description: 'When the product was created' });
|
|
113
|
+
addUpdatedAtField(productEntity, { description: 'When the product was last updated' });
|
|
114
|
+
// Bill of Materials Entity
|
|
115
|
+
const bomEntity = productModel.addEntity({
|
|
116
|
+
info: {
|
|
117
|
+
name: 'bill_of_materials',
|
|
118
|
+
displayName: 'Bill of Materials',
|
|
119
|
+
description: 'Component list and quantities for product assembly',
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
addIdField(bomEntity, { displayName: 'BOM ID', description: 'Unique identifier for the BOM' });
|
|
123
|
+
addNameField(bomEntity, { description: 'BOM name and description' });
|
|
124
|
+
bomEntity.addProperty({
|
|
125
|
+
info: { name: 'version', displayName: 'Version', description: 'BOM version number' },
|
|
126
|
+
type: 'string',
|
|
127
|
+
required: true,
|
|
128
|
+
});
|
|
129
|
+
bomEntity.addProperty({
|
|
130
|
+
info: { name: 'quantity', displayName: 'Quantity', description: 'Quantity of the main product' },
|
|
131
|
+
type: 'number',
|
|
132
|
+
required: true,
|
|
133
|
+
schema: {
|
|
134
|
+
minimum: 1,
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
addCustomStatusField(bomEntity, ['draft', 'active', 'obsolete'], {
|
|
138
|
+
displayName: 'BOM Status',
|
|
139
|
+
description: 'Current status of the BOM',
|
|
140
|
+
});
|
|
141
|
+
addCreatedAtField(bomEntity, { description: 'When the BOM was created' });
|
|
142
|
+
// BOM-Product Association (Many-to-One)
|
|
143
|
+
bomEntity.addAssociation({ key: productEntity.key }, {
|
|
144
|
+
info: { name: 'product', displayName: 'Product', description: 'Product for this BOM' },
|
|
145
|
+
required: true,
|
|
146
|
+
multiple: false,
|
|
147
|
+
});
|
|
148
|
+
// BOM Component Entity
|
|
149
|
+
const bomComponentEntity = productModel.addEntity({
|
|
150
|
+
info: {
|
|
151
|
+
name: 'bom_component',
|
|
152
|
+
displayName: 'BOM Component',
|
|
153
|
+
description: 'Individual component in a bill of materials',
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
addIdField(bomComponentEntity, { displayName: 'Component ID', description: 'Unique identifier for the component' });
|
|
157
|
+
bomComponentEntity.addProperty({
|
|
158
|
+
info: { name: 'quantity', displayName: 'Quantity', description: 'Required quantity of the component' },
|
|
159
|
+
type: 'number',
|
|
160
|
+
required: true,
|
|
161
|
+
schema: {
|
|
162
|
+
minimum: 0,
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
bomComponentEntity.addProperty({
|
|
166
|
+
info: { name: 'position', displayName: 'Position', description: 'Position in the BOM hierarchy' },
|
|
167
|
+
type: 'number',
|
|
168
|
+
required: true,
|
|
169
|
+
schema: {
|
|
170
|
+
minimum: 1,
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
addCreatedAtField(bomComponentEntity, { description: 'When the component was added' });
|
|
174
|
+
// BOMComponent-BOM Association (Many-to-One)
|
|
175
|
+
bomComponentEntity.addAssociation({ key: bomEntity.key }, {
|
|
176
|
+
info: { name: 'bom', displayName: 'BOM', description: 'BOM for this component' },
|
|
177
|
+
required: true,
|
|
178
|
+
multiple: false,
|
|
179
|
+
});
|
|
180
|
+
// BOMComponent-Product Association (Many-to-One)
|
|
181
|
+
bomComponentEntity.addAssociation({ key: productEntity.key }, {
|
|
182
|
+
info: { name: 'component', displayName: 'Component', description: 'Component product' },
|
|
183
|
+
required: true,
|
|
184
|
+
multiple: false,
|
|
185
|
+
});
|
|
186
|
+
//
|
|
187
|
+
// 2. INVENTORY MANAGEMENT NAMESPACE
|
|
188
|
+
//
|
|
189
|
+
const inventoryManagement = domain.addNamespace({
|
|
190
|
+
info: {
|
|
191
|
+
name: 'InventoryManagement',
|
|
192
|
+
displayName: 'Inventory Management',
|
|
193
|
+
description: 'Stock levels, warehouses, and inventory tracking',
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
// Inventory Model
|
|
197
|
+
const inventoryModel = inventoryManagement.addModel({
|
|
198
|
+
info: {
|
|
199
|
+
name: 'Inventory',
|
|
200
|
+
displayName: 'Inventory Management',
|
|
201
|
+
description: 'Inventory tracking and stock management',
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
// Warehouse Entity
|
|
205
|
+
const warehouseEntity = inventoryModel.addEntity({
|
|
206
|
+
info: {
|
|
207
|
+
name: 'warehouse',
|
|
208
|
+
displayName: 'Warehouse',
|
|
209
|
+
description: 'Storage facility and location',
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
addIdField(warehouseEntity, { displayName: 'Warehouse ID', description: 'Unique identifier for the warehouse' });
|
|
213
|
+
addNameField(warehouseEntity, { description: 'Warehouse name and location' });
|
|
214
|
+
addDescriptionField(warehouseEntity, { description: 'Warehouse description and features' });
|
|
215
|
+
warehouseEntity.addProperty({
|
|
216
|
+
info: { name: 'warehouse_type', displayName: 'Warehouse Type', description: 'Type of warehouse facility' },
|
|
217
|
+
type: 'string',
|
|
218
|
+
required: true,
|
|
219
|
+
schema: {
|
|
220
|
+
enum: ['production', 'distribution', 'raw_materials', 'finished_goods'],
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
warehouseEntity.addProperty({
|
|
224
|
+
info: { name: 'address', displayName: 'Address', description: 'Warehouse physical address' },
|
|
225
|
+
type: 'string',
|
|
226
|
+
required: true,
|
|
227
|
+
});
|
|
228
|
+
addCustomStatusField(warehouseEntity, ['active', 'inactive', 'maintenance'], {
|
|
229
|
+
displayName: 'Warehouse Status',
|
|
230
|
+
description: 'Current status of the warehouse',
|
|
231
|
+
});
|
|
232
|
+
addCreatedAtField(warehouseEntity, { description: 'When the warehouse was created' });
|
|
233
|
+
// Inventory Item Entity
|
|
234
|
+
const inventoryItemEntity = inventoryModel.addEntity({
|
|
235
|
+
info: {
|
|
236
|
+
name: 'inventory_item',
|
|
237
|
+
displayName: 'Inventory Item',
|
|
238
|
+
description: 'Stock item with quantity and location',
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
addIdField(inventoryItemEntity, {
|
|
242
|
+
displayName: 'Inventory ID',
|
|
243
|
+
description: 'Unique identifier for the inventory item',
|
|
244
|
+
});
|
|
245
|
+
inventoryItemEntity.addProperty({
|
|
246
|
+
info: { name: 'quantity', displayName: 'Quantity', description: 'Current stock quantity' },
|
|
247
|
+
type: 'number',
|
|
248
|
+
required: true,
|
|
249
|
+
schema: {
|
|
250
|
+
minimum: 0,
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
inventoryItemEntity.addProperty({
|
|
254
|
+
info: { name: 'minimum_stock', displayName: 'Minimum Stock', description: 'Minimum stock level for reorder' },
|
|
255
|
+
type: 'number',
|
|
256
|
+
required: true,
|
|
257
|
+
schema: {
|
|
258
|
+
minimum: 0,
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
inventoryItemEntity.addProperty({
|
|
262
|
+
info: { name: 'maximum_stock', displayName: 'Maximum Stock', description: 'Maximum stock level' },
|
|
263
|
+
type: 'number',
|
|
264
|
+
required: true,
|
|
265
|
+
schema: {
|
|
266
|
+
minimum: 0,
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
inventoryItemEntity.addProperty({
|
|
270
|
+
info: { name: 'location', displayName: 'Location', description: 'Storage location within warehouse' },
|
|
271
|
+
type: 'string',
|
|
272
|
+
required: true,
|
|
273
|
+
});
|
|
274
|
+
addCustomStatusField(inventoryItemEntity, ['available', 'reserved', 'quarantine', 'expired'], {
|
|
275
|
+
displayName: 'Stock Status',
|
|
276
|
+
description: 'Current status of the inventory item',
|
|
277
|
+
});
|
|
278
|
+
addCreatedAtField(inventoryItemEntity, { description: 'When the inventory item was created' });
|
|
279
|
+
addUpdatedAtField(inventoryItemEntity, { description: 'When the inventory item was last updated' });
|
|
280
|
+
// InventoryItem-Product Association (Many-to-One)
|
|
281
|
+
inventoryItemEntity.addAssociation({ key: productEntity.key }, {
|
|
282
|
+
info: { name: 'product', displayName: 'Product', description: 'Product for this inventory item' },
|
|
283
|
+
required: true,
|
|
284
|
+
multiple: false,
|
|
285
|
+
});
|
|
286
|
+
// InventoryItem-Warehouse Association (Many-to-One)
|
|
287
|
+
inventoryItemEntity.addAssociation({ key: warehouseEntity.key }, {
|
|
288
|
+
info: { name: 'warehouse', displayName: 'Warehouse', description: 'Warehouse for this inventory item' },
|
|
289
|
+
required: true,
|
|
290
|
+
multiple: false,
|
|
291
|
+
});
|
|
292
|
+
//
|
|
293
|
+
// 3. PRODUCTION PLANNING NAMESPACE
|
|
294
|
+
//
|
|
295
|
+
const productionPlanning = domain.addNamespace({
|
|
296
|
+
info: {
|
|
297
|
+
name: 'ProductionPlanning',
|
|
298
|
+
displayName: 'Production Planning',
|
|
299
|
+
description: 'Work orders, scheduling, and production capacity',
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
// Production Model
|
|
303
|
+
const productionModel = productionPlanning.addModel({
|
|
304
|
+
info: {
|
|
305
|
+
name: 'Production',
|
|
306
|
+
displayName: 'Production Management',
|
|
307
|
+
description: 'Production planning and work order management',
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
// Work Order Entity
|
|
311
|
+
const workOrderEntity = productionModel.addEntity({
|
|
312
|
+
info: {
|
|
313
|
+
name: 'work_order',
|
|
314
|
+
displayName: 'Work Order',
|
|
315
|
+
description: 'Production work order with scheduling and routing',
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
addIdField(workOrderEntity, { displayName: 'Work Order ID', description: 'Unique identifier for the work order' });
|
|
319
|
+
addNameField(workOrderEntity, { description: 'Work order name and description' });
|
|
320
|
+
workOrderEntity.addProperty({
|
|
321
|
+
info: { name: 'order_quantity', displayName: 'Order Quantity', description: 'Quantity to be produced' },
|
|
322
|
+
type: 'number',
|
|
323
|
+
required: true,
|
|
324
|
+
schema: {
|
|
325
|
+
minimum: 1,
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
workOrderEntity.addProperty({
|
|
329
|
+
info: { name: 'start_date', displayName: 'Start Date', description: 'Planned start date' },
|
|
330
|
+
type: 'date',
|
|
331
|
+
required: true,
|
|
332
|
+
});
|
|
333
|
+
workOrderEntity.addProperty({
|
|
334
|
+
info: { name: 'due_date', displayName: 'Due Date', description: 'Planned completion date' },
|
|
335
|
+
type: 'date',
|
|
336
|
+
required: true,
|
|
337
|
+
});
|
|
338
|
+
workOrderEntity.addProperty({
|
|
339
|
+
info: { name: 'priority', displayName: 'Priority', description: 'Work order priority level' },
|
|
340
|
+
type: 'string',
|
|
341
|
+
required: true,
|
|
342
|
+
schema: {
|
|
343
|
+
enum: ['low', 'medium', 'high', 'urgent'],
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
addCustomStatusField(workOrderEntity, ['planned', 'in_progress', 'completed', 'cancelled'], {
|
|
347
|
+
displayName: 'Work Order Status',
|
|
348
|
+
description: 'Current status of the work order',
|
|
349
|
+
});
|
|
350
|
+
addCreatedAtField(workOrderEntity, { description: 'When the work order was created' });
|
|
351
|
+
// WorkOrder-Product Association (Many-to-One)
|
|
352
|
+
workOrderEntity.addAssociation({ key: productEntity.key }, {
|
|
353
|
+
info: { name: 'product', displayName: 'Product', description: 'Product to be manufactured' },
|
|
354
|
+
required: true,
|
|
355
|
+
multiple: false,
|
|
356
|
+
});
|
|
357
|
+
// Production Step Entity
|
|
358
|
+
const productionStepEntity = productionModel.addEntity({
|
|
359
|
+
info: {
|
|
360
|
+
name: 'production_step',
|
|
361
|
+
displayName: 'Production Step',
|
|
362
|
+
description: 'Individual step in the production process',
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
addIdField(productionStepEntity, { displayName: 'Step ID', description: 'Unique identifier for the production step' });
|
|
366
|
+
addNameField(productionStepEntity, { description: 'Step name and description' });
|
|
367
|
+
productionStepEntity.addProperty({
|
|
368
|
+
info: { name: 'sequence', displayName: 'Sequence', description: 'Step sequence number' },
|
|
369
|
+
type: 'number',
|
|
370
|
+
required: true,
|
|
371
|
+
schema: {
|
|
372
|
+
minimum: 1,
|
|
373
|
+
},
|
|
374
|
+
});
|
|
375
|
+
productionStepEntity.addProperty({
|
|
376
|
+
info: { name: 'estimated_duration', displayName: 'Estimated Duration', description: 'Estimated time in minutes' },
|
|
377
|
+
type: 'number',
|
|
378
|
+
required: true,
|
|
379
|
+
schema: {
|
|
380
|
+
minimum: 1,
|
|
381
|
+
},
|
|
382
|
+
});
|
|
383
|
+
addCustomStatusField(productionStepEntity, ['pending', 'in_progress', 'completed', 'skipped'], {
|
|
384
|
+
displayName: 'Step Status',
|
|
385
|
+
description: 'Current status of the production step',
|
|
386
|
+
});
|
|
387
|
+
addCreatedAtField(productionStepEntity, { description: 'When the production step was created' });
|
|
388
|
+
// ProductionStep-WorkOrder Association (Many-to-One)
|
|
389
|
+
productionStepEntity.addAssociation({ key: workOrderEntity.key }, {
|
|
390
|
+
info: { name: 'work_order', displayName: 'Work Order', description: 'Work order for this step' },
|
|
391
|
+
required: true,
|
|
392
|
+
multiple: false,
|
|
393
|
+
});
|
|
394
|
+
//
|
|
395
|
+
// 4. QUALITY CONTROL NAMESPACE
|
|
396
|
+
//
|
|
397
|
+
const qualityControl = domain.addNamespace({
|
|
398
|
+
info: {
|
|
399
|
+
name: 'QualityControl',
|
|
400
|
+
displayName: 'Quality Control',
|
|
401
|
+
description: 'Inspections, testing, and compliance tracking',
|
|
402
|
+
},
|
|
403
|
+
});
|
|
404
|
+
// Quality Model
|
|
405
|
+
const qualityModel = qualityControl.addModel({
|
|
406
|
+
info: {
|
|
407
|
+
name: 'Quality',
|
|
408
|
+
displayName: 'Quality Management',
|
|
409
|
+
description: 'Quality control and inspection processes',
|
|
410
|
+
},
|
|
411
|
+
});
|
|
412
|
+
// Quality Inspection Entity
|
|
413
|
+
const qualityInspectionEntity = qualityModel.addEntity({
|
|
414
|
+
info: {
|
|
415
|
+
name: 'quality_inspection',
|
|
416
|
+
displayName: 'Quality Inspection',
|
|
417
|
+
description: 'Quality inspection and testing records',
|
|
418
|
+
},
|
|
419
|
+
});
|
|
420
|
+
addIdField(qualityInspectionEntity, {
|
|
421
|
+
displayName: 'Inspection ID',
|
|
422
|
+
description: 'Unique identifier for the quality inspection',
|
|
423
|
+
});
|
|
424
|
+
addNameField(qualityInspectionEntity, { description: 'Inspection name and description' });
|
|
425
|
+
qualityInspectionEntity.addProperty({
|
|
426
|
+
info: { name: 'inspection_type', displayName: 'Inspection Type', description: 'Type of quality inspection' },
|
|
427
|
+
type: 'string',
|
|
428
|
+
required: true,
|
|
429
|
+
schema: {
|
|
430
|
+
enum: ['incoming', 'in_process', 'final', 'audit'],
|
|
431
|
+
},
|
|
432
|
+
});
|
|
433
|
+
qualityInspectionEntity.addProperty({
|
|
434
|
+
info: { name: 'inspector', displayName: 'Inspector', description: 'Name of the inspector' },
|
|
435
|
+
type: 'string',
|
|
436
|
+
required: true,
|
|
437
|
+
});
|
|
438
|
+
qualityInspectionEntity.addProperty({
|
|
439
|
+
info: { name: 'inspection_date', displayName: 'Inspection Date', description: 'Date of the inspection' },
|
|
440
|
+
type: 'date',
|
|
441
|
+
required: true,
|
|
442
|
+
});
|
|
443
|
+
qualityInspectionEntity.addProperty({
|
|
444
|
+
info: { name: 'sample_size', displayName: 'Sample Size', description: 'Number of items inspected' },
|
|
445
|
+
type: 'number',
|
|
446
|
+
required: true,
|
|
447
|
+
schema: {
|
|
448
|
+
minimum: 1,
|
|
449
|
+
},
|
|
450
|
+
});
|
|
451
|
+
qualityInspectionEntity.addProperty({
|
|
452
|
+
info: { name: 'defects_found', displayName: 'Defects Found', description: 'Number of defects found' },
|
|
453
|
+
type: 'number',
|
|
454
|
+
required: true,
|
|
455
|
+
schema: {
|
|
456
|
+
minimum: 0,
|
|
457
|
+
},
|
|
458
|
+
});
|
|
459
|
+
addCustomStatusField(qualityInspectionEntity, ['pending', 'in_progress', 'passed', 'failed'], {
|
|
460
|
+
displayName: 'Inspection Status',
|
|
461
|
+
description: 'Current status of the quality inspection',
|
|
462
|
+
});
|
|
463
|
+
addCreatedAtField(qualityInspectionEntity, { description: 'When the inspection was created' });
|
|
464
|
+
// QualityInspection-Product Association (Many-to-One)
|
|
465
|
+
qualityInspectionEntity.addAssociation({ key: productEntity.key }, {
|
|
466
|
+
info: { name: 'product', displayName: 'Product', description: 'Product being inspected' },
|
|
467
|
+
required: true,
|
|
468
|
+
multiple: false,
|
|
469
|
+
});
|
|
470
|
+
// QualityInspection-WorkOrder Association (Many-to-One)
|
|
471
|
+
qualityInspectionEntity.addAssociation({ key: workOrderEntity.key }, {
|
|
472
|
+
info: { name: 'work_order', displayName: 'Work Order', description: 'Work order for this inspection' },
|
|
473
|
+
required: false,
|
|
474
|
+
multiple: false,
|
|
475
|
+
});
|
|
476
|
+
//
|
|
477
|
+
// 5. EQUIPMENT MANAGEMENT NAMESPACE
|
|
478
|
+
//
|
|
479
|
+
const equipmentManagement = domain.addNamespace({
|
|
480
|
+
info: {
|
|
481
|
+
name: 'EquipmentManagement',
|
|
482
|
+
displayName: 'Equipment Management',
|
|
483
|
+
description: 'Machinery, maintenance, and calibration tracking',
|
|
484
|
+
},
|
|
485
|
+
});
|
|
486
|
+
// Equipment Model
|
|
487
|
+
const equipmentModel = equipmentManagement.addModel({
|
|
488
|
+
info: {
|
|
489
|
+
name: 'Equipment',
|
|
490
|
+
displayName: 'Equipment Management',
|
|
491
|
+
description: 'Equipment and machinery management',
|
|
492
|
+
},
|
|
493
|
+
});
|
|
494
|
+
// Equipment Entity
|
|
495
|
+
const equipmentEntity = equipmentModel.addEntity({
|
|
496
|
+
info: {
|
|
497
|
+
name: 'equipment',
|
|
498
|
+
displayName: 'Equipment',
|
|
499
|
+
description: 'Manufacturing equipment and machinery',
|
|
500
|
+
},
|
|
501
|
+
});
|
|
502
|
+
addIdField(equipmentEntity, { displayName: 'Equipment ID', description: 'Unique identifier for the equipment' });
|
|
503
|
+
addNameField(equipmentEntity, { description: 'Equipment name and model' });
|
|
504
|
+
addDescriptionField(equipmentEntity, { description: 'Equipment description and specifications' });
|
|
505
|
+
equipmentEntity.addProperty({
|
|
506
|
+
info: { name: 'equipment_type', displayName: 'Equipment Type', description: 'Type of manufacturing equipment' },
|
|
507
|
+
type: 'string',
|
|
508
|
+
required: true,
|
|
509
|
+
schema: {
|
|
510
|
+
enum: ['machine_tool', 'conveyor', 'robot', 'furnace', 'press', 'other'],
|
|
511
|
+
},
|
|
512
|
+
});
|
|
513
|
+
equipmentEntity.addProperty({
|
|
514
|
+
info: { name: 'serial_number', displayName: 'Serial Number', description: 'Equipment serial number' },
|
|
515
|
+
type: 'string',
|
|
516
|
+
required: true,
|
|
517
|
+
unique: true,
|
|
518
|
+
});
|
|
519
|
+
equipmentEntity.addProperty({
|
|
520
|
+
info: { name: 'manufacturer', displayName: 'Manufacturer', description: 'Equipment manufacturer' },
|
|
521
|
+
type: 'string',
|
|
522
|
+
required: true,
|
|
523
|
+
});
|
|
524
|
+
equipmentEntity.addProperty({
|
|
525
|
+
info: { name: 'installation_date', displayName: 'Installation Date', description: 'Date equipment was installed' },
|
|
526
|
+
type: 'date',
|
|
527
|
+
required: true,
|
|
528
|
+
});
|
|
529
|
+
addCustomStatusField(equipmentEntity, ['operational', 'maintenance', 'broken', 'retired'], {
|
|
530
|
+
displayName: 'Equipment Status',
|
|
531
|
+
description: 'Current status of the equipment',
|
|
532
|
+
});
|
|
533
|
+
addCreatedAtField(equipmentEntity, { description: 'When the equipment was created' });
|
|
534
|
+
addUpdatedAtField(equipmentEntity, { description: 'When the equipment was last updated' });
|
|
535
|
+
// Maintenance Record Entity
|
|
536
|
+
const maintenanceRecordEntity = equipmentModel.addEntity({
|
|
537
|
+
info: {
|
|
538
|
+
name: 'maintenance_record',
|
|
539
|
+
displayName: 'Maintenance Record',
|
|
540
|
+
description: 'Equipment maintenance and calibration records',
|
|
541
|
+
},
|
|
542
|
+
});
|
|
543
|
+
addIdField(maintenanceRecordEntity, {
|
|
544
|
+
displayName: 'Maintenance ID',
|
|
545
|
+
description: 'Unique identifier for the maintenance record',
|
|
546
|
+
});
|
|
547
|
+
addNameField(maintenanceRecordEntity, { description: 'Maintenance description and work performed' });
|
|
548
|
+
maintenanceRecordEntity.addProperty({
|
|
549
|
+
info: { name: 'maintenance_type', displayName: 'Maintenance Type', description: 'Type of maintenance performed' },
|
|
550
|
+
type: 'string',
|
|
551
|
+
required: true,
|
|
552
|
+
schema: {
|
|
553
|
+
enum: ['preventive', 'corrective', 'calibration', 'inspection'],
|
|
554
|
+
},
|
|
555
|
+
});
|
|
556
|
+
maintenanceRecordEntity.addProperty({
|
|
557
|
+
info: { name: 'technician', displayName: 'Technician', description: 'Name of the maintenance technician' },
|
|
558
|
+
type: 'string',
|
|
559
|
+
required: true,
|
|
560
|
+
});
|
|
561
|
+
maintenanceRecordEntity.addProperty({
|
|
562
|
+
info: { name: 'maintenance_date', displayName: 'Maintenance Date', description: 'Date of maintenance' },
|
|
563
|
+
type: 'date',
|
|
564
|
+
required: true,
|
|
565
|
+
});
|
|
566
|
+
maintenanceRecordEntity.addProperty({
|
|
567
|
+
info: { name: 'duration_hours', displayName: 'Duration Hours', description: 'Maintenance duration in hours' },
|
|
568
|
+
type: 'number',
|
|
569
|
+
required: true,
|
|
570
|
+
schema: {
|
|
571
|
+
minimum: 0,
|
|
572
|
+
},
|
|
573
|
+
});
|
|
574
|
+
addCustomStatusField(maintenanceRecordEntity, ['scheduled', 'in_progress', 'completed', 'cancelled'], {
|
|
575
|
+
displayName: 'Maintenance Status',
|
|
576
|
+
description: 'Current status of the maintenance',
|
|
577
|
+
});
|
|
578
|
+
addCreatedAtField(maintenanceRecordEntity, { description: 'When the maintenance record was created' });
|
|
579
|
+
// MaintenanceRecord-Equipment Association (Many-to-One)
|
|
580
|
+
maintenanceRecordEntity.addAssociation({ key: equipmentEntity.key }, {
|
|
581
|
+
info: { name: 'equipment', displayName: 'Equipment', description: 'Equipment for this maintenance' },
|
|
582
|
+
required: true,
|
|
583
|
+
multiple: false,
|
|
584
|
+
});
|
|
585
|
+
//
|
|
586
|
+
// 6. SUPPLY CHAIN NAMESPACE
|
|
587
|
+
//
|
|
588
|
+
const supplyChain = domain.addNamespace({
|
|
589
|
+
info: {
|
|
590
|
+
name: 'SupplyChain',
|
|
591
|
+
displayName: 'Supply Chain',
|
|
592
|
+
description: 'Suppliers, procurement, and logistics management',
|
|
593
|
+
},
|
|
594
|
+
});
|
|
595
|
+
// Supply Chain Model
|
|
596
|
+
const supplyChainModel = supplyChain.addModel({
|
|
597
|
+
info: {
|
|
598
|
+
name: 'SupplyChain',
|
|
599
|
+
displayName: 'Supply Chain Management',
|
|
600
|
+
description: 'Supplier and procurement management',
|
|
601
|
+
},
|
|
602
|
+
});
|
|
603
|
+
// Supplier Entity
|
|
604
|
+
const supplierEntity = supplyChainModel.addEntity({
|
|
605
|
+
info: {
|
|
606
|
+
name: 'supplier',
|
|
607
|
+
displayName: 'Supplier',
|
|
608
|
+
description: 'Material and component suppliers',
|
|
609
|
+
},
|
|
610
|
+
});
|
|
611
|
+
addIdField(supplierEntity, { displayName: 'Supplier ID', description: 'Unique identifier for the supplier' });
|
|
612
|
+
addNameField(supplierEntity, { description: 'Supplier name and company' });
|
|
613
|
+
addDescriptionField(supplierEntity, { description: 'Supplier description and capabilities' });
|
|
614
|
+
addEmailField(supplierEntity, { description: 'Supplier email address' });
|
|
615
|
+
addPhoneField(supplierEntity, { description: 'Supplier phone number' });
|
|
616
|
+
supplierEntity.addProperty({
|
|
617
|
+
info: { name: 'supplier_type', displayName: 'Supplier Type', description: 'Type of supplier' },
|
|
618
|
+
type: 'string',
|
|
619
|
+
required: true,
|
|
620
|
+
schema: {
|
|
621
|
+
enum: ['raw_materials', 'components', 'services', 'equipment'],
|
|
622
|
+
},
|
|
623
|
+
});
|
|
624
|
+
supplierEntity.addProperty({
|
|
625
|
+
info: { name: 'address', displayName: 'Address', description: 'Supplier address' },
|
|
626
|
+
type: 'string',
|
|
627
|
+
required: true,
|
|
628
|
+
});
|
|
629
|
+
addCustomStatusField(supplierEntity, ['active', 'inactive', 'suspended'], {
|
|
630
|
+
displayName: 'Supplier Status',
|
|
631
|
+
description: 'Current status of the supplier',
|
|
632
|
+
});
|
|
633
|
+
addCreatedAtField(supplierEntity, { description: 'When the supplier was created' });
|
|
634
|
+
addUpdatedAtField(supplierEntity, { description: 'When the supplier was last updated' });
|
|
635
|
+
// Purchase Order Entity
|
|
636
|
+
const purchaseOrderEntity = supplyChainModel.addEntity({
|
|
637
|
+
info: {
|
|
638
|
+
name: 'purchase_order',
|
|
639
|
+
displayName: 'Purchase Order',
|
|
640
|
+
description: 'Purchase orders for materials and components',
|
|
641
|
+
},
|
|
642
|
+
});
|
|
643
|
+
addIdField(purchaseOrderEntity, { displayName: 'PO ID', description: 'Unique identifier for the purchase order' });
|
|
644
|
+
addNameField(purchaseOrderEntity, { description: 'Purchase order description' });
|
|
645
|
+
purchaseOrderEntity.addProperty({
|
|
646
|
+
info: { name: 'order_date', displayName: 'Order Date', description: 'Date the order was placed' },
|
|
647
|
+
type: 'date',
|
|
648
|
+
required: true,
|
|
649
|
+
});
|
|
650
|
+
purchaseOrderEntity.addProperty({
|
|
651
|
+
info: { name: 'expected_delivery', displayName: 'Expected Delivery', description: 'Expected delivery date' },
|
|
652
|
+
type: 'date',
|
|
653
|
+
required: true,
|
|
654
|
+
});
|
|
655
|
+
addCurrencyAmountField(purchaseOrderEntity, 'total_amount', 'Total Amount', {
|
|
656
|
+
description: 'Total purchase order amount',
|
|
657
|
+
});
|
|
658
|
+
addCustomStatusField(purchaseOrderEntity, ['draft', 'sent', 'confirmed', 'received', 'cancelled'], {
|
|
659
|
+
displayName: 'PO Status',
|
|
660
|
+
description: 'Current status of the purchase order',
|
|
661
|
+
});
|
|
662
|
+
addCreatedAtField(purchaseOrderEntity, { description: 'When the purchase order was created' });
|
|
663
|
+
// PurchaseOrder-Supplier Association (Many-to-One)
|
|
664
|
+
purchaseOrderEntity.addAssociation({ key: supplierEntity.key }, {
|
|
665
|
+
info: { name: 'supplier', displayName: 'Supplier', description: 'Supplier for this purchase order' },
|
|
666
|
+
required: true,
|
|
667
|
+
multiple: false,
|
|
668
|
+
});
|
|
669
|
+
// Purchase Order Item Entity
|
|
670
|
+
const purchaseOrderItemEntity = supplyChainModel.addEntity({
|
|
671
|
+
info: {
|
|
672
|
+
name: 'purchase_order_item',
|
|
673
|
+
displayName: 'Purchase Order Item',
|
|
674
|
+
description: 'Individual items in a purchase order',
|
|
675
|
+
},
|
|
676
|
+
});
|
|
677
|
+
addIdField(purchaseOrderItemEntity, {
|
|
678
|
+
displayName: 'Item ID',
|
|
679
|
+
description: 'Unique identifier for the purchase order item',
|
|
680
|
+
});
|
|
681
|
+
purchaseOrderItemEntity.addProperty({
|
|
682
|
+
info: { name: 'quantity', displayName: 'Quantity', description: 'Ordered quantity' },
|
|
683
|
+
type: 'number',
|
|
684
|
+
required: true,
|
|
685
|
+
schema: {
|
|
686
|
+
minimum: 1,
|
|
687
|
+
},
|
|
688
|
+
});
|
|
689
|
+
addCurrencyAmountField(purchaseOrderItemEntity, 'unit_price', 'Unit Price', {
|
|
690
|
+
description: 'Unit price for the item',
|
|
691
|
+
});
|
|
692
|
+
addCurrencyAmountField(purchaseOrderItemEntity, 'total_price', 'Total Price', {
|
|
693
|
+
description: 'Total price for this item',
|
|
694
|
+
});
|
|
695
|
+
addCreatedAtField(purchaseOrderItemEntity, { description: 'When the purchase order item was created' });
|
|
696
|
+
// PurchaseOrderItem-PurchaseOrder Association (Many-to-One)
|
|
697
|
+
purchaseOrderItemEntity.addAssociation({ key: purchaseOrderEntity.key }, {
|
|
698
|
+
info: { name: 'purchase_order', displayName: 'Purchase Order', description: 'Purchase order for this item' },
|
|
699
|
+
required: true,
|
|
700
|
+
multiple: false,
|
|
701
|
+
});
|
|
702
|
+
// PurchaseOrderItem-Product Association (Many-to-One)
|
|
703
|
+
purchaseOrderItemEntity.addAssociation({ key: productEntity.key }, {
|
|
704
|
+
info: { name: 'product', displayName: 'Product', description: 'Product for this purchase order item' },
|
|
705
|
+
required: true,
|
|
706
|
+
multiple: false,
|
|
707
|
+
});
|
|
708
|
+
return domain;
|
|
709
|
+
}
|
|
710
|
+
//# sourceMappingURL=manufacturing-domain.js.map
|