@acorex-platform/module-asset-management-client 0.0.32 → 0.0.37

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.
Files changed (57) hide show
  1. package/fesm2022/acorex-platform-module-asset-management-client-asset-lifecycle.provider-BDaCpGsv.mjs.map +1 -1
  2. package/fesm2022/acorex-platform-module-asset-management-client-asset-rental-history-status.provider-DwhQPb0-.mjs.map +1 -1
  3. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-rental-history.mjs +536 -0
  4. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-rental-history.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-system-assignment.mjs +294 -0
  6. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-system-assignment.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-system-type.mjs +328 -0
  8. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-system-type.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-system.mjs +316 -0
  10. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-system.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-type-section-component.mjs +348 -0
  12. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-type-section-component.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-type-section.mjs +252 -0
  14. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-type-section.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-type.mjs +476 -0
  16. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-type.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset.mjs +1123 -0
  18. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY-Jlv8czA2.mjs +5 -0
  20. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY-Jlv8czA2.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-acorex-platform-module-asset-management-client-contracts-entity-catalog-zq5ishZC.mjs +131 -0
  22. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-acorex-platform-module-asset-management-client-contracts-entity-catalog-zq5ishZC.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-rental-history.entity-CldKruJ6.mjs +431 -0
  24. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-rental-history.entity-CldKruJ6.mjs.map +1 -0
  25. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-assignment.entity-BVmBaNdk.mjs +189 -0
  26. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-assignment.entity-BVmBaNdk.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-type.entity-CXBtrDgS.mjs +223 -0
  28. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-type.entity-CXBtrDgS.mjs.map +1 -0
  29. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system.entity-Bc8WJQff.mjs +211 -0
  30. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system.entity-Bc8WJQff.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section-component.entity-BJ-kv3eg.mjs +243 -0
  32. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section-component.entity-BJ-kv3eg.mjs.map +1 -0
  33. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section.entity-Bkgb9pRD.mjs +145 -0
  34. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section.entity-Bkgb9pRD.mjs.map +1 -0
  35. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type.entity-9gozE1Z0.mjs +369 -0
  36. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type.entity-9gozE1Z0.mjs.map +1 -0
  37. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.entity-JDs4GpIw.mjs +1016 -0
  38. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.entity-JDs4GpIw.mjs.map +1 -0
  39. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog.mjs +2 -0
  40. package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog.mjs.map +1 -0
  41. package/fesm2022/acorex-platform-module-asset-management-client-contracts.mjs.map +1 -1
  42. package/fesm2022/acorex-platform-module-asset-management-client-local-entities.mjs +36 -0
  43. package/fesm2022/acorex-platform-module-asset-management-client-local-entities.mjs.map +1 -0
  44. package/fesm2022/acorex-platform-module-asset-management-client-recalculate-asset-operational-status.activity-ueTauO_k.mjs.map +1 -1
  45. package/fesm2022/acorex-platform-module-asset-management-client.mjs +1 -1
  46. package/fesm2022/acorex-platform-module-asset-management-client.mjs.map +1 -1
  47. package/package.json +42 -2
  48. package/types/acorex-platform-module-asset-management-client-contracts-entities-asset-rental-history.d.ts +5 -0
  49. package/types/acorex-platform-module-asset-management-client-contracts-entities-asset-system-assignment.d.ts +5 -0
  50. package/types/acorex-platform-module-asset-management-client-contracts-entities-asset-system-type.d.ts +5 -0
  51. package/types/acorex-platform-module-asset-management-client-contracts-entities-asset-system.d.ts +5 -0
  52. package/types/acorex-platform-module-asset-management-client-contracts-entities-asset-type-section-component.d.ts +10 -0
  53. package/types/acorex-platform-module-asset-management-client-contracts-entities-asset-type-section.d.ts +10 -0
  54. package/types/acorex-platform-module-asset-management-client-contracts-entities-asset-type.d.ts +9 -0
  55. package/types/acorex-platform-module-asset-management-client-contracts-entities-asset.d.ts +5 -0
  56. package/types/acorex-platform-module-asset-management-client-contracts-entity-catalog.d.ts +10 -0
  57. package/types/acorex-platform-module-asset-management-client-local-entities.d.ts +12 -0
@@ -0,0 +1,1016 @@
1
+ import { AXPSystemActionType, AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
2
+ import { AXPEntityCommandScope, entityMasterCrudActions, createAllQueryView, entityMasterRecordActions, entityDetailsEditAction, entityDetailsSimpleCondition, entityDetailsCrudActions } from '@acorex-platform/framework-shared/entity';
3
+ import { A as ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY } from './acorex-platform-module-asset-management-client-contracts-entity-catalog-ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY-Jlv8czA2.mjs';
4
+ import { R as RootConfig } from './acorex-platform-module-asset-management-client-contracts-entity-catalog-acorex-platform-module-asset-management-client-contracts-entity-catalog-zq5ishZC.mjs';
5
+
6
+ /** Asset booking catalog scope for questionnaires, question bank items, and workflow definitions. */
7
+ const ASSET_CATALOG_SCOPE_BOOKING = 'asset-management.booking';
8
+
9
+ //#region ---- Command keys ----
10
+ const AXMAssetManagementCommandKeys = {
11
+ AssetRentalHistory: {
12
+ RentFrom: 'AssetManagement.AssetRentalHistory:RentFrom',
13
+ RentTo: 'AssetManagement.AssetRentalHistory:RentTo',
14
+ },
15
+ WorkflowActivity: {
16
+ RecalculateOperationalStatus: 'workflow-activity:recalculate-asset-operational-status',
17
+ },
18
+ };
19
+ //#endregion
20
+
21
+ //#region ---- Rent list actions ----
22
+ /** Type-level create actions for rent-from / rent-to (list and asset related-entity). */
23
+ const assetRentalHistoryRentActions = [
24
+ {
25
+ name: 'rent-from',
26
+ title: '@asset-management:assetRentalHistories.entities.assetRentalHistory.actions.rent-from.title',
27
+ command: {
28
+ name: AXMAssetManagementCommandKeys.AssetRentalHistory.RentFrom,
29
+ options: {
30
+ process: {
31
+ redirect: false,
32
+ canCreateNewOne: true,
33
+ data: { assetId: '{{context.eval("id")}}' },
34
+ },
35
+ },
36
+ },
37
+ priority: 'primary',
38
+ type: AXPSystemActionType.Create,
39
+ scope: AXPEntityCommandScope.TypeLevel,
40
+ },
41
+ {
42
+ name: 'rent-to',
43
+ title: '@asset-management:assetRentalHistories.entities.assetRentalHistory.actions.rent-to.title',
44
+ command: {
45
+ name: AXMAssetManagementCommandKeys.AssetRentalHistory.RentTo,
46
+ options: {
47
+ process: {
48
+ redirect: false,
49
+ canCreateNewOne: true,
50
+ data: { assetId: '{{context.eval("id")}}' },
51
+ },
52
+ },
53
+ },
54
+ priority: 'primary',
55
+ type: AXPSystemActionType.Create,
56
+ scope: AXPEntityCommandScope.TypeLevel,
57
+ },
58
+ ...entityMasterCrudActions({ create: false, view: false }),
59
+ ];
60
+ //#endregion
61
+
62
+ /** Status provider key for `lifecycleStatusId` on AssetManagement.Asset (lifecycle status). */
63
+ const AXM_ASSET_LIFECYCLE_STATUS_DEFINITION_KEY = 'asset-management.status.asset-lifecycle';
64
+
65
+ /** Status provider key for `statusId` on AssetManagement.Asset (operational status). */
66
+ const AXM_ASSET_STATUS_DEFINITION_KEY = 'asset-management.status.asset';
67
+
68
+ //#region ---- Status enum ----
69
+ var AXMAssetLifecycleStatus;
70
+ (function (AXMAssetLifecycleStatus) {
71
+ AXMAssetLifecycleStatus["Created"] = "created";
72
+ AXMAssetLifecycleStatus["Active"] = "active";
73
+ AXMAssetLifecycleStatus["Retired"] = "retired";
74
+ AXMAssetLifecycleStatus["Disposed"] = "disposed";
75
+ })(AXMAssetLifecycleStatus || (AXMAssetLifecycleStatus = {}));
76
+
77
+ //#region ---- Status enum ----
78
+ var AXMAssetStatus;
79
+ (function (AXMAssetStatus) {
80
+ AXMAssetStatus["Available"] = "available";
81
+ AXMAssetStatus["Assigned"] = "assigned";
82
+ AXMAssetStatus["UnderMaintenanceInspection"] = "underMaintenanceInspection";
83
+ AXMAssetStatus["OutOfService"] = "outOfService";
84
+ AXMAssetStatus["Lost"] = "lost";
85
+ })(AXMAssetStatus || (AXMAssetStatus = {}));
86
+ //#endregion
87
+
88
+ //#endregion
89
+ async function factoryAsset() {
90
+ const hideMaintenanceRelatedEntities = '{{ ![true, "true", 1, "1"].includes(context.eval("assetType.hasMaintenance")) && ![true, "true", 1, "1"].includes(context.eval("hasMaintenance")) }}';
91
+ const entityDef = {
92
+ module: RootConfig.module.name,
93
+ name: RootConfig.entities.asset.name,
94
+ title: RootConfig.entities.asset.title,
95
+ icon: RootConfig.entities.asset.icon,
96
+ plugins: [
97
+ { name: 'history' },
98
+ { name: 'compare' },
99
+ { name: 'identifier', options: { field: 'code', rule: 'asset-code' } },
100
+ { name: 'unique-fields', options: { fields: 'code', scope: 'global' } },
101
+ {
102
+ name: 'meta-data-form',
103
+ options: {
104
+ path: 'assetTypeId',
105
+ title: '@asset-management:assets.entities.asset.components.meta-data-form.title',
106
+ display: {
107
+ section: {
108
+ order: 3,
109
+ },
110
+ },
111
+ },
112
+ },
113
+ {
114
+ name: 'status',
115
+ options: {
116
+ field: 'lifecycleStatusId',
117
+ definition: AXM_ASSET_LIFECYCLE_STATUS_DEFINITION_KEY,
118
+ defaultStatus: AXMAssetLifecycleStatus.Created,
119
+ isPrimary: false,
120
+ groupId: 'lifecycle-status',
121
+ title: '@asset-management:assets.entities.asset.fields.lifecycle-status.title',
122
+ showInCreate: false,
123
+ readonly: false,
124
+ generate: { views: { enabled: false } },
125
+ },
126
+ },
127
+ {
128
+ name: 'status',
129
+ options: {
130
+ field: 'statusId',
131
+ definition: AXM_ASSET_STATUS_DEFINITION_KEY,
132
+ defaultStatus: AXMAssetStatus.Available,
133
+ isPrimary: true,
134
+ groupId: 'lifecycle-status',
135
+ title: '@asset-management:assets.entities.asset.fields.status.title',
136
+ showInCreate: false,
137
+ readonly: false,
138
+ generate: { views: { enabled: true } },
139
+ },
140
+ },
141
+ { name: 'tags' },
142
+ {
143
+ name: 'documents',
144
+ options: { documentTypeNames: ['manualEquipment'], order: 50 },
145
+ },
146
+ { name: 'comments', options: { display: 'page', order: 60 } },
147
+ { name: 'reports' },
148
+ ],
149
+ relatedEntities: [
150
+ {
151
+ entity: `${RootConfig.module.name}.${RootConfig.entities.assetRentalHistory.name}`,
152
+ title: RootConfig.entities.assetRentalHistory.titlePlural,
153
+ icon: RootConfig.entities.assetRentalHistory.icon,
154
+ hidden: `{{ !context.eval("id") || ![true, "true", 1, "1"].includes(context.eval("isRented")) }}`,
155
+ conditions: [entityDetailsSimpleCondition('assetId')],
156
+ persistence: { foreignKeyField: 'assetId' },
157
+ excludeProperties: ['assetId'],
158
+ actions: [...assetRentalHistoryRentActions, entityDetailsEditAction()],
159
+ layout: { type: 'page-list', position: 'after', order: 10 },
160
+ },
161
+ {
162
+ entity: 'MaintenanceManagement.MaintenancePlan',
163
+ title: '@asset-management:assets.entities.asset.related-entities.maintenance-plans.title',
164
+ icon: 'fa-light fa-calendar-check',
165
+ hidden: hideMaintenanceRelatedEntities,
166
+ conditions: [entityDetailsSimpleCondition('assetId')],
167
+ actions: [
168
+ {
169
+ title: '@general:actions.create.title',
170
+ command: {
171
+ name: 'Entity:Create',
172
+ options: {
173
+ process: {
174
+ redirect: false,
175
+ canCreateNewOne: true,
176
+ data: {
177
+ assetId: '{{ context.eval("id") }}',
178
+ asset: {
179
+ id: '{{ context.eval("id") }}',
180
+ title: '{{ context.eval("title", { pipes: ["translate"] }) }}',
181
+ assetTypeId: '{{ context.eval("assetTypeId") }}',
182
+ assetType: {
183
+ maintenanceTypeIds: '{{ context.eval("assetType.maintenanceTypeIds") }}',
184
+ },
185
+ },
186
+ },
187
+ },
188
+ },
189
+ },
190
+ priority: 'primary',
191
+ type: AXPSystemActionType.Create,
192
+ scope: AXPEntityCommandScope.TypeLevel,
193
+ },
194
+ ...entityDetailsCrudActions('assetId', { create: false }),
195
+ ],
196
+ layout: { type: 'page-list', position: 'after', order: 15 },
197
+ },
198
+ {
199
+ entity: 'MaintenanceManagement.WorkOrder',
200
+ title: '@asset-management:assets.entities.asset.related-entities.work-orders.title',
201
+ icon: 'fa-light fa-clipboard-check',
202
+ hidden: hideMaintenanceRelatedEntities,
203
+ conditions: [entityDetailsSimpleCondition('assetId')],
204
+ actions: [...entityDetailsCrudActions('assetId', { create: false })],
205
+ layout: { type: 'page-list', position: 'after', order: 20 },
206
+ },
207
+ {
208
+ entity: 'MaintenanceManagement.FailureRegister',
209
+ title: '@maintenance-management:failure-registers.entities.failure-register.plural',
210
+ icon: 'fa-light fa-file-waveform',
211
+ hidden: hideMaintenanceRelatedEntities,
212
+ conditions: [entityDetailsSimpleCondition('assetId')],
213
+ excludeProperties: ['assetId', 'assetSystemId'],
214
+ columns: [
215
+ { name: 'code' },
216
+ { name: 'date' },
217
+ { name: 'failureModeId', options: { dataPath: 'failureMode.title' } },
218
+ {
219
+ name: 'failureDetectionId',
220
+ options: { dataPath: 'failureDetection.title' },
221
+ },
222
+ { name: 'priorityId' },
223
+ {
224
+ name: 'failureSeverityId',
225
+ options: { dataPath: 'failureSeverity.title' },
226
+ },
227
+ { name: 'description' },
228
+ ],
229
+ actions: [...entityDetailsCrudActions('assetId')],
230
+ layout: { type: 'page-list', position: 'after', order: 30 },
231
+ },
232
+ ],
233
+ pages: [
234
+ {
235
+ componentKey: ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY,
236
+ field: 'components',
237
+ title: '@asset-management:assets.entities.asset.components.asset-component.title',
238
+ icon: 'fa-light fa-cubes',
239
+ layout: { order: 2, position: 'after' },
240
+ options: {
241
+ order: 1,
242
+ linkAssetMode: true,
243
+ sourceField: 'components',
244
+ field: 'assetComponents',
245
+ sourceEntity: `${RootConfig.module.name}.${RootConfig.entities.assetType.name}`,
246
+ sourceIdPath: 'assetTypeId',
247
+ targetEntity: `${RootConfig.module.name}.${RootConfig.entities.asset.name}`,
248
+ targetIdPath: 'id',
249
+ allowAddSection: false,
250
+ allowEditSection: false,
251
+ allowAddItems: false,
252
+ allowReorderSections: false,
253
+ },
254
+ },
255
+ ],
256
+ formats: {
257
+ individual: RootConfig.entities.asset.title,
258
+ plural: RootConfig.entities.asset.titlePlural,
259
+ searchResult: { title: '{{ title }}' },
260
+ },
261
+ groups: [
262
+ {
263
+ id: 'basic-info',
264
+ title: '@asset-management:assets.entities.asset.groups.basic-info',
265
+ },
266
+ {
267
+ id: 'qr-code',
268
+ title: '@asset-management:assets.entities.asset.fields.qr-code.title',
269
+ },
270
+ // {
271
+ // id: 'description-info',
272
+ // title:
273
+ // '@asset-management:assets.entities.asset.groups.description-info',
274
+ // },
275
+ {
276
+ id: 'ownership',
277
+ title: '@asset-management:assets.entities.asset.groups.ownership',
278
+ },
279
+ {
280
+ id: 'placement',
281
+ title: '@asset-management:assets.entities.asset.groups.placement',
282
+ },
283
+ {
284
+ id: 'booking',
285
+ title: '@asset-management:assets.entities.asset.groups.booking',
286
+ },
287
+ {
288
+ id: 'rental',
289
+ title: '@asset-management:assets.entities.asset.groups.rental',
290
+ },
291
+ {
292
+ id: 'operation-requirements',
293
+ title: '@asset-management:assets.entities.asset.groups.operation-requirements',
294
+ },
295
+ {
296
+ id: 'lifecycle-status',
297
+ title: '@asset-management:assets.entities.asset.groups.lifecycle-status',
298
+ },
299
+ {
300
+ id: 'media',
301
+ title: '@asset-management:assets.entities.asset.groups.media',
302
+ },
303
+ ],
304
+ properties: [
305
+ {
306
+ name: 'id',
307
+ title: 'ID',
308
+ schema: {
309
+ dataType: 'uuid',
310
+ visible: false,
311
+ nullable: false,
312
+ readonly: true,
313
+ unique: { enabled: true },
314
+ },
315
+ },
316
+ {
317
+ name: 'code',
318
+ title: '@asset-management:assets.entities.asset.fields.code.title',
319
+ groupId: 'basic-info',
320
+ schema: {
321
+ dataType: 'string',
322
+ unique: { enabled: true },
323
+ interface: {
324
+ type: AXPWidgetsCatalog.text,
325
+ options: {
326
+ //disabled: true,
327
+ placeholder: '@asset-management:assets.entities.asset.fields.code.placeholder',
328
+ },
329
+ },
330
+ },
331
+ options: {
332
+ sort: { enabled: true },
333
+ filter: { advance: { enabled: true }, inline: { enabled: true } },
334
+ },
335
+ validations: [{ rule: 'required' }, { rule: 'unique' }],
336
+ },
337
+ {
338
+ name: 'assetTypeId',
339
+ title: '@asset-management:assets.entities.asset.fields.assetTypeId.title',
340
+ groupId: 'basic-info',
341
+ schema: {
342
+ dataType: 'string',
343
+ interface: {
344
+ type: AXPWidgetsCatalog.lookup,
345
+ options: {
346
+ disabled: `{{ !!context.eval('id') }}`,
347
+ look: 'select',
348
+ placeholder: '@asset-management:assets.entities.asset.fields.assetTypeId.placeholder',
349
+ entity: `${RootConfig.module.name}.${RootConfig.entities.assetType.name}`,
350
+ textField: 'title',
351
+ valueField: 'id',
352
+ allowCreate: 'quick',
353
+ expose: [
354
+ { source: 'id', target: 'assetType.id' },
355
+ { source: 'code', target: 'assetType.code' },
356
+ { source: 'title', target: 'assetType.title' },
357
+ { source: 'categoryIds', target: 'assetType.categoryIds' },
358
+ {
359
+ source: 'hasMaintenance',
360
+ target: 'assetType.hasMaintenance',
361
+ },
362
+ {
363
+ source: 'maintenanceTypeIds',
364
+ target: 'assetType.maintenanceTypeIds',
365
+ },
366
+ ],
367
+ },
368
+ triggers: [
369
+ {
370
+ event: '{{ events.context("assetTypeId") }}',
371
+ action: '{{ context.set("hasMaintenance", [true, "true", 1, "1"].includes(context.eval("assetType.hasMaintenance"))) }}',
372
+ },
373
+ ],
374
+ },
375
+ },
376
+ options: {
377
+ sort: { enabled: true },
378
+ filter: { advance: { enabled: true }, inline: { enabled: true } },
379
+ },
380
+ validations: [{ rule: 'required' }],
381
+ },
382
+ {
383
+ name: 'title',
384
+ title: '@asset-management:assets.entities.asset.fields.title.title',
385
+ groupId: 'basic-info',
386
+ schema: {
387
+ dataType: 'string',
388
+ interface: {
389
+ type: AXPWidgetsCatalog.text,
390
+ options: {
391
+ placeholder: '@asset-management:assets.entities.asset.fields.title.placeholder',
392
+ },
393
+ },
394
+ },
395
+ options: {
396
+ sort: { enabled: true },
397
+ filter: { advance: { enabled: true }, inline: { enabled: true } },
398
+ },
399
+ validations: [{ rule: 'required' }],
400
+ },
401
+ {
402
+ name: 'serialNumber',
403
+ title: '@asset-management:assets.entities.asset.fields.serial-number.title',
404
+ groupId: 'basic-info',
405
+ schema: {
406
+ dataType: 'string',
407
+ interface: {
408
+ type: AXPWidgetsCatalog.text,
409
+ options: {
410
+ placeholder: '@asset-management:assets.entities.asset.fields.serial-number.placeholder',
411
+ },
412
+ },
413
+ },
414
+ validations: [{ rule: 'required' }],
415
+ },
416
+ {
417
+ name: 'testTagIdentificationNumber',
418
+ title: '@asset-management:assets.entities.asset.fields.test-tag-identification-number.title',
419
+ groupId: 'basic-info',
420
+ schema: {
421
+ dataType: 'string',
422
+ interface: {
423
+ type: AXPWidgetsCatalog.text,
424
+ options: {
425
+ placeholder: '@asset-management:assets.entities.asset.fields.test-tag-identification-number.placeholder',
426
+ },
427
+ },
428
+ },
429
+ },
430
+ {
431
+ name: 'qrCode',
432
+ title: '@asset-management:assets.entities.asset.fields.qr-code.title',
433
+ groupId: 'qr-code',
434
+ schema: {
435
+ dataType: 'string',
436
+ interface: {
437
+ type: AXPWidgetsCatalog.qrcode,
438
+ options: {
439
+ size: 200,
440
+ outputType: 'canvas',
441
+ readonly: true,
442
+ },
443
+ triggers: [
444
+ {
445
+ event: '{{ events.context("code") }}',
446
+ action: '{{ context.set("qrCode", context.eval("code")) }}',
447
+ },
448
+ ],
449
+ },
450
+ },
451
+ },
452
+ {
453
+ name: 'description',
454
+ title: '@asset-management:assets.entities.asset.fields.description.title',
455
+ groupId: 'basic-info',
456
+ schema: {
457
+ dataType: 'string',
458
+ interface: {
459
+ type: AXPWidgetsCatalog.largeText,
460
+ options: {
461
+ rows: 4,
462
+ placeholder: '@asset-management:assets.entities.asset.fields.description.placeholder',
463
+ },
464
+ },
465
+ },
466
+ options: {
467
+ sort: { enabled: false },
468
+ filter: { advance: { enabled: true }, inline: { enabled: false } },
469
+ },
470
+ },
471
+ {
472
+ name: 'assignedToEmployeeId',
473
+ title: '@asset-management:assets.entities.asset.fields.assigned-to-employee-id.title',
474
+ groupId: 'ownership',
475
+ schema: {
476
+ dataType: 'string',
477
+ interface: {
478
+ type: AXPWidgetsCatalog.lookup,
479
+ options: {
480
+ entity: 'HumanCapitalManagement.Employee',
481
+ textField: 'person.fullName',
482
+ valueField: 'id',
483
+ // columns: ['person.displayName', 'employeeCode'],
484
+ look: 'select',
485
+ expose: [
486
+ { source: 'id', target: 'assignedToEmployee.id' },
487
+ {
488
+ source: 'person.fullName',
489
+ target: 'assignedToEmployee.displayName',
490
+ },
491
+ ],
492
+ },
493
+ },
494
+ },
495
+ options: {
496
+ sort: { enabled: true },
497
+ filter: { advance: { enabled: true }, inline: { enabled: true } },
498
+ },
499
+ },
500
+ {
501
+ name: 'locationId',
502
+ title: '@asset-management:assets.entities.asset.fields.location-id.title',
503
+ groupId: 'placement',
504
+ schema: {
505
+ dataType: 'string',
506
+ interface: {
507
+ type: AXPWidgetsCatalog.lookup,
508
+ options: {
509
+ entity: 'LocationManagement.Location',
510
+ textField: 'title',
511
+ valueField: 'id',
512
+ allowCreate: 'quick',
513
+ look: 'select',
514
+ expose: [
515
+ { source: 'id', target: 'location.id' },
516
+ { source: 'title', target: 'location.title' },
517
+ ],
518
+ },
519
+ },
520
+ },
521
+ options: {
522
+ sort: { enabled: true },
523
+ filter: { advance: { enabled: true }, inline: { enabled: true } },
524
+ },
525
+ },
526
+ {
527
+ name: 'isBookable',
528
+ title: '@asset-management:assets.entities.asset.fields.is-bookable.title',
529
+ groupId: 'booking',
530
+ schema: {
531
+ dataType: 'boolean',
532
+ interface: {
533
+ type: AXPWidgetsCatalog.toggle,
534
+ },
535
+ },
536
+ },
537
+ {
538
+ name: 'preBookQuestionnaireId',
539
+ title: '@asset-management:assets.entities.asset.fields.pre-book-questionnaire-id.title',
540
+ groupId: 'booking',
541
+ schema: {
542
+ dataType: 'string',
543
+ visible: `{{ !!context.eval('isBookable') }}`,
544
+ interface: {
545
+ type: AXPWidgetsCatalog.lookup,
546
+ options: {
547
+ entity: `${'AssessmentManagement'}.${'Questionnaire'}`,
548
+ textField: 'title',
549
+ valueField: 'id',
550
+ look: 'select',
551
+ filter: {
552
+ field: 'catalogScopeKeys',
553
+ operator: { type: 'arrayOverlaps' },
554
+ value: [ASSET_CATALOG_SCOPE_BOOKING],
555
+ },
556
+ expose: [
557
+ { source: 'id', target: 'preBookQuestionnaire.id' },
558
+ { source: 'title', target: 'preBookQuestionnaire.title' },
559
+ ],
560
+ },
561
+ },
562
+ },
563
+ },
564
+ {
565
+ name: 'postBookQuestionnaireId',
566
+ title: '@asset-management:assets.entities.asset.fields.post-book-questionnaire-id.title',
567
+ groupId: 'booking',
568
+ schema: {
569
+ dataType: 'string',
570
+ visible: `{{ !!context.eval('isBookable') }}`,
571
+ interface: {
572
+ type: AXPWidgetsCatalog.lookup,
573
+ options: {
574
+ entity: `${'AssessmentManagement'}.${'Questionnaire'}`,
575
+ textField: 'title',
576
+ valueField: 'id',
577
+ look: 'select',
578
+ filter: {
579
+ field: 'catalogScopeKeys',
580
+ operator: { type: 'arrayOverlaps' },
581
+ value: [ASSET_CATALOG_SCOPE_BOOKING],
582
+ },
583
+ expose: [
584
+ { source: 'id', target: 'postBookQuestionnaire.id' },
585
+ { source: 'title', target: 'postBookQuestionnaire.title' },
586
+ ],
587
+ },
588
+ },
589
+ },
590
+ },
591
+ {
592
+ name: 'isRented',
593
+ title: '@asset-management:assets.entities.asset.fields.is-rented.title',
594
+ groupId: 'rental',
595
+ schema: {
596
+ dataType: 'boolean',
597
+ interface: {
598
+ type: AXPWidgetsCatalog.toggle,
599
+ },
600
+ },
601
+ },
602
+ {
603
+ name: 'licenseTypeId',
604
+ title: '@asset-management:assets.entities.asset.fields.license-type-id.title',
605
+ groupId: 'operation-requirements',
606
+ schema: {
607
+ dataType: 'string',
608
+ interface: {
609
+ type: AXPWidgetsCatalog.lookup,
610
+ options: {
611
+ entity: 'LearningManagement.LicenseType',
612
+ textField: 'title',
613
+ valueField: 'id',
614
+ look: 'select',
615
+ expose: [
616
+ { source: 'id', target: 'licenseType.id' },
617
+ { source: 'title', target: 'licenseType.title' },
618
+ ],
619
+ },
620
+ },
621
+ },
622
+ options: {
623
+ sort: { enabled: true },
624
+ filter: { advance: { enabled: true }, inline: { enabled: true } },
625
+ },
626
+ },
627
+ {
628
+ name: 'images',
629
+ title: '@asset-management:assets.entities.asset.fields.images.title',
630
+ groupId: 'media',
631
+ options: {
632
+ sort: { enabled: false },
633
+ filter: {
634
+ advance: { enabled: false },
635
+ inline: { enabled: false },
636
+ },
637
+ },
638
+ schema: {
639
+ dataType: 'array',
640
+ interface: {
641
+ type: AXPWidgetsCatalog.fileViewer,
642
+ },
643
+ },
644
+ },
645
+ {
646
+ name: 'components',
647
+ title: '@asset-management:assets.entities.asset.components.meta-data-form.title',
648
+ options: {
649
+ sort: { enabled: false },
650
+ filter: { advance: { enabled: false }, inline: { enabled: false } },
651
+ },
652
+ schema: {
653
+ dataType: 'object',
654
+ defaultValue: { sections: [] },
655
+ visible: false,
656
+ nullable: true,
657
+ },
658
+ },
659
+ {
660
+ name: 'assetComponents',
661
+ title: '@asset-management:assets.entities.asset.components.asset-component.title',
662
+ schema: {
663
+ dataType: 'array',
664
+ visible: false,
665
+ nullable: true,
666
+ },
667
+ options: {
668
+ sort: { enabled: false },
669
+ filter: { advance: { enabled: false }, inline: { enabled: false } },
670
+ },
671
+ },
672
+ ],
673
+ columns: [
674
+ { name: 'code', options: { order: 1 } },
675
+ { name: 'title', options: { order: 2 } },
676
+ {
677
+ name: 'assetTypeId',
678
+ options: { dataPath: 'assetType.title', order: 3 },
679
+ },
680
+ { name: 'serialNumber', options: { order: 4 } },
681
+ { name: 'testTagIdentificationNumber', options: { order: 5 } },
682
+ { name: 'qrCode', options: { order: 6 } },
683
+ { name: 'description', options: { order: 7 } },
684
+ { name: 'lifecycleStatusId', options: { order: 8 } },
685
+ {
686
+ name: 'assignedToEmployeeId',
687
+ options: { dataPath: 'assignedToEmployee.displayName', order: 9 },
688
+ },
689
+ { name: 'licenseTypeId', options: { dataPath: 'licenseType.title', order: 10 } },
690
+ { name: 'locationId', options: { dataPath: 'location.title', order: 11 } },
691
+ { name: 'isBookable', options: { order: 13 } },
692
+ { name: 'isRented', options: { order: 14 } },
693
+ ],
694
+ queries: {},
695
+ interfaces: {
696
+ master: {
697
+ create: {
698
+ sections: [
699
+ {
700
+ id: 'basic-info',
701
+ order: 1,
702
+ layout: { positions: { lg: { colSpan: 8, colStart: 1 } } },
703
+ },
704
+ {
705
+ id: 'qr-code',
706
+ order: 2,
707
+ layout: {
708
+ positions: { lg: { colSpan: 4, colStart: 9, rowSpan: 2 } },
709
+ },
710
+ },
711
+ // {
712
+ // id: 'description-info',
713
+ // order: 3,
714
+ // layout: { positions: { lg: { colSpan: 12, colStart: 13 } } },
715
+ // },
716
+ { id: 'ownership', order: 4 },
717
+ { id: 'placement', order: 5 },
718
+ { id: 'booking', order: 6 },
719
+ { id: 'rental', order: 7 },
720
+ { id: 'operation-requirements', order: 8 },
721
+ { id: 'media', order: 9 },
722
+ ],
723
+ properties: [
724
+ {
725
+ name: 'code',
726
+ layout: { positions: { lg: { colSpan: 6, order: 1 } } },
727
+ },
728
+ {
729
+ name: 'assetTypeId',
730
+ layout: { positions: { lg: { colSpan: 6, order: 2 } } },
731
+ },
732
+ {
733
+ name: 'title',
734
+ layout: { positions: { lg: { colSpan: 12, order: 3 } } },
735
+ },
736
+ {
737
+ name: 'serialNumber',
738
+ layout: { positions: { lg: { colSpan: 6, order: 4 } } },
739
+ },
740
+ {
741
+ name: 'testTagIdentificationNumber',
742
+ layout: { positions: { lg: { colSpan: 6, order: 5 } } },
743
+ },
744
+ {
745
+ name: 'description',
746
+ layout: {
747
+ positions: { lg: { colSpan: 12, order: 7 } },
748
+ },
749
+ },
750
+ {
751
+ name: 'assignedToEmployeeId',
752
+ layout: { positions: { lg: { colSpan: 6, order: 8 } } },
753
+ },
754
+ {
755
+ name: 'locationId',
756
+ layout: { positions: { lg: { colSpan: 12, order: 9 } } },
757
+ },
758
+ {
759
+ name: 'isBookable',
760
+ layout: { positions: { lg: { colSpan: 12, order: 10 } } },
761
+ },
762
+ {
763
+ name: 'preBookQuestionnaireId',
764
+ layout: { positions: { lg: { colSpan: 6, order: 11 } } },
765
+ },
766
+ {
767
+ name: 'postBookQuestionnaireId',
768
+ layout: { positions: { lg: { colSpan: 6, order: 12 } } },
769
+ },
770
+ {
771
+ name: 'isRented',
772
+ layout: { positions: { lg: { colSpan: 12, order: 13 } } },
773
+ },
774
+ {
775
+ name: 'licenseTypeId',
776
+ layout: { positions: { lg: { colSpan: 6, order: 14 } } },
777
+ },
778
+ {
779
+ name: 'qrCode',
780
+ layout: {
781
+ label: { visible: false },
782
+ positions: { lg: { colSpan: 14 } },
783
+ },
784
+ },
785
+ {
786
+ name: 'images',
787
+ layout: { positions: { lg: { colSpan: 12, order: 25 } } },
788
+ },
789
+ ],
790
+ },
791
+ update: {
792
+ sections: [
793
+ {
794
+ id: 'basic-info',
795
+ order: 1,
796
+ layout: { positions: { lg: { colSpan: 8, colStart: 1 } } },
797
+ },
798
+ {
799
+ id: 'qr-code',
800
+ order: 2,
801
+ layout: { positions: { lg: { colSpan: 4, colStart: 9 } } },
802
+ },
803
+ // {
804
+ // id: 'description-info',
805
+ // order: 3,
806
+ // layout: { positions: { lg: { colSpan: 12, colStart: 13 } } },
807
+ // },
808
+ { id: 'ownership', order: 4 },
809
+ { id: 'placement', order: 5 },
810
+ { id: 'booking', order: 6 },
811
+ { id: 'rental', order: 7 },
812
+ { id: 'operation-requirements', order: 8 },
813
+ { id: 'media', order: 9 },
814
+ {
815
+ id: 'lifecycle-status',
816
+ order: 10,
817
+ layout: { positions: { lg: { colSpan: 12, colStart: 1 } } },
818
+ },
819
+ ],
820
+ properties: [
821
+ {
822
+ name: 'code',
823
+ layout: { positions: { lg: { colSpan: 6, order: 1 } } },
824
+ },
825
+ {
826
+ name: 'assetTypeId',
827
+ layout: { positions: { lg: { colSpan: 6, order: 2 } } },
828
+ },
829
+ {
830
+ name: 'title',
831
+ layout: { positions: { lg: { colSpan: 12, order: 3 } } },
832
+ },
833
+ {
834
+ name: 'serialNumber',
835
+ layout: { positions: { lg: { colSpan: 6, order: 4 } } },
836
+ },
837
+ {
838
+ name: 'testTagIdentificationNumber',
839
+ layout: { positions: { lg: { colSpan: 6, order: 5 } } },
840
+ },
841
+ {
842
+ name: 'description',
843
+ layout: {
844
+ positions: { lg: { colSpan: 12, order: 7 } },
845
+ // label: { visible: false },
846
+ },
847
+ },
848
+ {
849
+ name: 'assignedToEmployeeId',
850
+ layout: { positions: { lg: { colSpan: 6, order: 8 } } },
851
+ },
852
+ {
853
+ name: 'locationId',
854
+ layout: { positions: { lg: { colSpan: 12, order: 9 } } },
855
+ },
856
+ {
857
+ name: 'isBookable',
858
+ layout: { positions: { lg: { colSpan: 12, order: 10 } } },
859
+ },
860
+ {
861
+ name: 'preBookQuestionnaireId',
862
+ layout: { positions: { lg: { colSpan: 6, order: 11 } } },
863
+ },
864
+ {
865
+ name: 'postBookQuestionnaireId',
866
+ layout: { positions: { lg: { colSpan: 6, order: 12 } } },
867
+ },
868
+ {
869
+ name: 'isRented',
870
+ layout: { positions: { lg: { colSpan: 12, order: 13 } } },
871
+ },
872
+ {
873
+ name: 'licenseTypeId',
874
+ layout: { positions: { lg: { colSpan: 6, order: 14 } } },
875
+ },
876
+ {
877
+ name: 'lifecycleStatusId',
878
+ layout: { positions: { lg: { colSpan: 6, order: 15 } } },
879
+ },
880
+ // {
881
+ // name: 'statusId',
882
+ // layout: { positions: { lg: { colSpan: 6, order: 16 } } },
883
+ // },
884
+ {
885
+ name: 'qrCode',
886
+ layout: {
887
+ label: { visible: false },
888
+ positions: { lg: { colSpan: 14 } },
889
+ },
890
+ },
891
+ {
892
+ name: 'images',
893
+ layout: { positions: { lg: { colSpan: 12, order: 25 } } },
894
+ },
895
+ ],
896
+ },
897
+ single: {
898
+ title: '{{ title }}',
899
+ sections: [
900
+ {
901
+ id: 'basic-info',
902
+ order: 1,
903
+ layout: { positions: { lg: { colSpan: 8, colStart: 1 } } },
904
+ },
905
+ {
906
+ id: 'qr-code',
907
+ order: 2,
908
+ layout: { positions: { lg: { colSpan: 4, colStart: 9 } } },
909
+ },
910
+ // {
911
+ // id: 'description-info',
912
+ // order: 3,
913
+ // layout: { positions: { lg: { colSpan: 12, colStart: 13 } } },
914
+ // },
915
+ { id: 'ownership', order: 4 },
916
+ { id: 'placement', order: 5 },
917
+ { id: 'booking', order: 6 },
918
+ { id: 'rental', order: 7 },
919
+ { id: 'operation-requirements', order: 8 },
920
+ { id: 'media', order: 9 },
921
+ {
922
+ id: 'lifecycle-status',
923
+ order: 10,
924
+ layout: { positions: { lg: { colSpan: 12, colStart: 1 } } },
925
+ },
926
+ ],
927
+ properties: [
928
+ {
929
+ name: 'code',
930
+ layout: { positions: { lg: { colSpan: 6, order: 1 } } },
931
+ },
932
+ {
933
+ name: 'assetTypeId',
934
+ layout: { positions: { lg: { colSpan: 6, order: 2 } } },
935
+ },
936
+ {
937
+ name: 'title',
938
+ layout: { positions: { lg: { colSpan: 12, order: 3 } } },
939
+ },
940
+ {
941
+ name: 'serialNumber',
942
+ layout: { positions: { lg: { colSpan: 6, order: 4 } } },
943
+ },
944
+ {
945
+ name: 'testTagIdentificationNumber',
946
+ layout: { positions: { lg: { colSpan: 6, order: 5 } } },
947
+ },
948
+ {
949
+ name: 'description',
950
+ layout: {
951
+ positions: { lg: { colSpan: 12, order: 7 } },
952
+ // label: { visible: false },
953
+ },
954
+ },
955
+ {
956
+ name: 'assignedToEmployeeId',
957
+ layout: { positions: { lg: { colSpan: 6, order: 8 } } },
958
+ },
959
+ {
960
+ name: 'locationId',
961
+ layout: { positions: { lg: { colSpan: 12, order: 9 } } },
962
+ },
963
+ {
964
+ name: 'isBookable',
965
+ layout: { positions: { lg: { colSpan: 12, order: 10 } } },
966
+ },
967
+ {
968
+ name: 'preBookQuestionnaireId',
969
+ layout: { positions: { lg: { colSpan: 6, order: 11 } } },
970
+ },
971
+ {
972
+ name: 'postBookQuestionnaireId',
973
+ layout: { positions: { lg: { colSpan: 6, order: 12 } } },
974
+ },
975
+ {
976
+ name: 'isRented',
977
+ layout: { positions: { lg: { colSpan: 12, order: 13 } } },
978
+ },
979
+ {
980
+ name: 'licenseTypeId',
981
+ layout: { positions: { lg: { colSpan: 6, order: 14 } } },
982
+ },
983
+ {
984
+ name: 'lifecycleStatusId',
985
+ layout: { positions: { lg: { colSpan: 6, order: 15 } } },
986
+ },
987
+ // {
988
+ // name: 'statusId',
989
+ // layout: { positions: { lg: { colSpan: 6, order: 16 } } },
990
+ // },
991
+ {
992
+ name: 'qrCode',
993
+ layout: {
994
+ label: { visible: false },
995
+ positions: { lg: { colSpan: 14 } },
996
+ },
997
+ },
998
+ {
999
+ name: 'images',
1000
+ layout: { positions: { lg: { colSpan: 12, order: 25 } } },
1001
+ },
1002
+ ],
1003
+ actions: [...entityMasterRecordActions()],
1004
+ },
1005
+ list: {
1006
+ actions: [...entityMasterCrudActions()],
1007
+ views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })],
1008
+ },
1009
+ },
1010
+ },
1011
+ };
1012
+ return entityDef;
1013
+ }
1014
+
1015
+ export { factoryAsset };
1016
+ //# sourceMappingURL=acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.entity-JDs4GpIw.mjs.map