@acorex/modules 20.7.19 → 20.7.21
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/asset-management/index.d.ts +24 -33
- package/dashboard-management/index.d.ts +40 -5
- package/document-management/index.d.ts +1 -26
- package/fesm2022/acorex-modules-asset-management-asset.entity-D_w4zjNb.mjs +612 -0
- package/fesm2022/acorex-modules-asset-management-asset.entity-D_w4zjNb.mjs.map +1 -0
- package/fesm2022/acorex-modules-asset-management-manual-asset-category.entity-DyIV_vbE.mjs +267 -0
- package/fesm2022/acorex-modules-asset-management-manual-asset-category.entity-DyIV_vbE.mjs.map +1 -0
- package/fesm2022/acorex-modules-asset-management.mjs +59 -117
- package/fesm2022/acorex-modules-asset-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-dashboard-management.mjs +454 -116
- package/fesm2022/acorex-modules-dashboard-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-data-management.mjs +4 -2
- package/fesm2022/acorex-modules-data-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-document-management.mjs +40 -99
- package/fesm2022/acorex-modules-document-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-maintenance-management.mjs +194 -103
- package/fesm2022/acorex-modules-maintenance-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-notification-management.mjs +21 -6
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-reservation-management-acorex-modules-reservation-management-CkHGIQ38.mjs +2135 -0
- package/fesm2022/acorex-modules-reservation-management-acorex-modules-reservation-management-CkHGIQ38.mjs.map +1 -0
- package/fesm2022/acorex-modules-reservation-management-reservation-class-status.entity-Clyj7r2x.mjs +263 -0
- package/fesm2022/acorex-modules-reservation-management-reservation-class-status.entity-Clyj7r2x.mjs.map +1 -0
- package/fesm2022/acorex-modules-reservation-management-reservation-resource-type.entity-BXb0FTQ5.mjs +184 -0
- package/fesm2022/acorex-modules-reservation-management-reservation-resource-type.entity-BXb0FTQ5.mjs.map +1 -0
- package/fesm2022/acorex-modules-reservation-management-reservation-status-transition.entity-BT8GQ9MC.mjs +247 -0
- package/fesm2022/acorex-modules-reservation-management-reservation-status-transition.entity-BT8GQ9MC.mjs.map +1 -0
- package/fesm2022/acorex-modules-reservation-management.mjs +1 -3325
- package/fesm2022/acorex-modules-reservation-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-task-management-task-board.page-BOOY3qla.mjs → acorex-modules-task-management-task-board.page-BBKB4yir.mjs} +114 -62
- package/fesm2022/acorex-modules-task-management-task-board.page-BBKB4yir.mjs.map +1 -0
- package/fesm2022/acorex-modules-task-management.mjs +43 -13
- package/fesm2022/acorex-modules-task-management.mjs.map +1 -1
- package/maintenance-management/index.d.ts +7 -3
- package/package.json +10 -10
- package/reservation-management/index.d.ts +84 -338
- package/fesm2022/acorex-modules-asset-management-asset.entity-C57iN3Bo.mjs +0 -357
- package/fesm2022/acorex-modules-asset-management-asset.entity-C57iN3Bo.mjs.map +0 -1
- package/fesm2022/acorex-modules-asset-management-inspection.entity-CpDuN-qj.mjs +0 -198
- package/fesm2022/acorex-modules-asset-management-inspection.entity-CpDuN-qj.mjs.map +0 -1
- package/fesm2022/acorex-modules-task-management-task-board.page-BOOY3qla.mjs.map +0 -1
|
@@ -1,3326 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { createAllQueryView, AXPEntityQueryType, AXPEntityCommandScope, AXP_MENU_PROVIDER, AXP_SEARCH_PROVIDER, AXPSearchCommandProvider } from '@acorex/platform/common';
|
|
3
|
-
import { AXMEntityCrudServiceImpl, entityMasterCrudActions, entityMasterRecordActions, AXP_ENTITY_ACTION_PLUGIN, AXPEntityService, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
|
|
4
|
-
import * as i1$1 from '@acorex/platform/layout/widget-core';
|
|
5
|
-
import { AXPWidgetsCatalog, AXPValueWidgetComponent, createStringProperty, createBooleanProperty, createNumberProperty, AXPWidgetGroupEnum, AXP_WIDGETS_ADVANCE_CATEGORY, AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
|
|
6
|
-
import * as i0 from '@angular/core';
|
|
7
|
-
import { Injectable, NgModule, inject, Injector, computed, signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
8
|
-
import { AXPSystemActionType, AXP_MODULE_MANIFEST_PROVIDER, provideLazyProvider } from '@acorex/platform/core';
|
|
9
|
-
import { AXDataSource } from '@acorex/cdk/common';
|
|
10
|
-
import * as i2 from '@acorex/components/button';
|
|
11
|
-
import { AXButtonModule } from '@acorex/components/button';
|
|
12
|
-
import * as i3 from '@acorex/components/check-box';
|
|
13
|
-
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
|
14
|
-
import * as i4 from '@acorex/components/data-table';
|
|
15
|
-
import { AXDataTableModule } from '@acorex/components/data-table';
|
|
16
|
-
import * as i5 from '@acorex/components/datetime-box';
|
|
17
|
-
import { AXDateTimeBoxModule } from '@acorex/components/datetime-box';
|
|
18
|
-
import * as i6 from '@acorex/components/label';
|
|
19
|
-
import { AXLabelModule } from '@acorex/components/label';
|
|
20
|
-
import * as i7 from '@acorex/components/select-box';
|
|
21
|
-
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
|
22
|
-
import { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';
|
|
23
|
-
import * as i8 from '@angular/common';
|
|
24
|
-
import { CommonModule, DatePipe } from '@angular/common';
|
|
25
|
-
import * as i1 from '@angular/forms';
|
|
26
|
-
import { FormsModule } from '@angular/forms';
|
|
27
|
-
import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY, AXP_BEHAVIOR_PROPERTY_GROUP } from '@acorex/platform/layout/widgets';
|
|
28
|
-
import { AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex/platform/auth';
|
|
29
|
-
|
|
30
|
-
//#region ---- Root Configuration ----
|
|
31
|
-
const config = {
|
|
32
|
-
i18n: 'reservation-management',
|
|
33
|
-
module: 'ReservationManagement',
|
|
34
|
-
route: 'reservation-management',
|
|
35
|
-
};
|
|
36
|
-
const RootConfig = {
|
|
37
|
-
config,
|
|
38
|
-
module: {
|
|
39
|
-
route: config.route,
|
|
40
|
-
name: config.module,
|
|
41
|
-
title: '@reservation-management:module.title',
|
|
42
|
-
icon: 'fa-light fa-calendar-check',
|
|
43
|
-
},
|
|
44
|
-
entities: {
|
|
45
|
-
reservationType: {
|
|
46
|
-
name: 'ReservationType',
|
|
47
|
-
source: `${config.module}.ReservationType`,
|
|
48
|
-
title: '@reservation-management:reservation-types.entities.reservation-type.title',
|
|
49
|
-
titlePlural: '@reservation-management:reservation-types.entities.reservation-type.plural',
|
|
50
|
-
icon: 'fa-light fa-list',
|
|
51
|
-
},
|
|
52
|
-
reservationStatus: {
|
|
53
|
-
name: 'ReservationStatus',
|
|
54
|
-
source: `${config.module}.ReservationStatus`,
|
|
55
|
-
title: '@reservation-management:reservation-statuses.entities.reservation-status.title',
|
|
56
|
-
titlePlural: '@reservation-management:reservation-statuses.entities.reservation-status.plural',
|
|
57
|
-
icon: 'fa-light fa-flag',
|
|
58
|
-
},
|
|
59
|
-
reservationClass: {
|
|
60
|
-
name: 'ReservationClass',
|
|
61
|
-
source: `${config.module}.ReservationClass`,
|
|
62
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.title',
|
|
63
|
-
titlePlural: '@reservation-management:reservation-classes.entities.reservation-class.plural',
|
|
64
|
-
icon: 'fa-light fa-tag',
|
|
65
|
-
},
|
|
66
|
-
reservation: {
|
|
67
|
-
name: 'Reservation',
|
|
68
|
-
source: `${config.module}.Reservation`,
|
|
69
|
-
title: '@reservation-management:reservations.entities.reservation.title',
|
|
70
|
-
titlePlural: '@reservation-management:reservations.entities.reservation.plural',
|
|
71
|
-
icon: 'fa-light fa-calendar-check',
|
|
72
|
-
},
|
|
73
|
-
reservationEvent: {
|
|
74
|
-
name: 'ReservationEvent',
|
|
75
|
-
source: `${config.module}.ReservationEvent`,
|
|
76
|
-
title: '@reservation-management:reservation-events.entities.reservation-event.title',
|
|
77
|
-
titlePlural: '@reservation-management:reservation-events.entities.reservation-event.plural',
|
|
78
|
-
icon: 'fa-light fa-calendar-alt',
|
|
79
|
-
},
|
|
80
|
-
reservationHold: {
|
|
81
|
-
name: 'ReservationHold',
|
|
82
|
-
source: `${config.module}.ReservationHold`,
|
|
83
|
-
title: '@reservation-management:reservation-holds.entities.reservation-hold.title',
|
|
84
|
-
titlePlural: '@reservation-management:reservation-holds.entities.reservation-hold.plural',
|
|
85
|
-
icon: 'fa-light fa-pause-circle',
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
//#endregion
|
|
90
|
-
|
|
91
|
-
class AXPReservationManagementReservationService extends AXMEntityCrudServiceImpl {
|
|
92
|
-
}
|
|
93
|
-
class AXPReservationManagementReservationServiceImpl extends AXPReservationManagementReservationService {
|
|
94
|
-
constructor() {
|
|
95
|
-
super(`${RootConfig.module.name}.${RootConfig.entities.reservation.name}`);
|
|
96
|
-
}
|
|
97
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
98
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationServiceImpl, providedIn: 'root' }); }
|
|
99
|
-
}
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationServiceImpl, decorators: [{
|
|
101
|
-
type: Injectable,
|
|
102
|
-
args: [{ providedIn: 'root' }]
|
|
103
|
-
}], ctorParameters: () => [] });
|
|
104
|
-
|
|
105
|
-
//#region ---- Imports ----
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region ---- Entity Factory ----
|
|
108
|
-
async function reservationFactory(injector) {
|
|
109
|
-
const dataService = injector.get(AXPReservationManagementReservationService);
|
|
110
|
-
const i18n = RootConfig.config.i18n;
|
|
111
|
-
const entityDef = {
|
|
112
|
-
module: RootConfig.module.name,
|
|
113
|
-
name: RootConfig.entities.reservation.name,
|
|
114
|
-
title: RootConfig.entities.reservation.title,
|
|
115
|
-
icon: RootConfig.entities.reservation.icon,
|
|
116
|
-
formats: {
|
|
117
|
-
individual: RootConfig.entities.reservation.title,
|
|
118
|
-
plural: RootConfig.entities.reservation.titlePlural,
|
|
119
|
-
searchResult: {
|
|
120
|
-
title: '{{ title }}',
|
|
121
|
-
description: '{{ code }}',
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
groups: [
|
|
125
|
-
{
|
|
126
|
-
id: 'reservation-information',
|
|
127
|
-
title: '@reservation-management:reservations.entities.reservation.groups.reservation-information',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
id: 'approve-information',
|
|
131
|
-
title: '@reservation-management:reservations.entities.reservation.groups.approve-information',
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
properties: [
|
|
135
|
-
{
|
|
136
|
-
name: 'id',
|
|
137
|
-
title: '@general:terms.common.id',
|
|
138
|
-
schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: 'reservationTypeId',
|
|
142
|
-
title: '@reservation-management:reservations.entities.reservation.fields.reservation-type-id',
|
|
143
|
-
groupId: 'reservation-information',
|
|
144
|
-
schema: {
|
|
145
|
-
dataType: 'string',
|
|
146
|
-
interface: {
|
|
147
|
-
type: AXPWidgetsCatalog.lookup,
|
|
148
|
-
options: {
|
|
149
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.reservationType.name}`,
|
|
150
|
-
textField: 'title',
|
|
151
|
-
valueField: 'id',
|
|
152
|
-
columns: ['code', 'title'],
|
|
153
|
-
expose: [
|
|
154
|
-
{ source: 'id', target: 'reservationType.id' },
|
|
155
|
-
{ source: 'title', target: 'reservationType.title' },
|
|
156
|
-
{ source: 'code', target: 'reservationType.code' },
|
|
157
|
-
],
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
options: {
|
|
162
|
-
sort: { enabled: true },
|
|
163
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
164
|
-
},
|
|
165
|
-
validations: [{ rule: 'required' }],
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: 'reservationClassId',
|
|
169
|
-
title: '@reservation-management:reservations.entities.reservation.fields.reservation-class-id',
|
|
170
|
-
groupId: 'reservation-information',
|
|
171
|
-
schema: {
|
|
172
|
-
dataType: 'string',
|
|
173
|
-
interface: {
|
|
174
|
-
type: AXPWidgetsCatalog.lookup,
|
|
175
|
-
options: {
|
|
176
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.reservationClass.name}`,
|
|
177
|
-
textField: 'title',
|
|
178
|
-
valueField: 'id',
|
|
179
|
-
columns: ['code', 'title'],
|
|
180
|
-
expose: [
|
|
181
|
-
{ source: 'id', target: 'reservationClass.id' },
|
|
182
|
-
{ source: 'title', target: 'reservationClass.title' },
|
|
183
|
-
{ source: 'code', target: 'reservationClass.code' },
|
|
184
|
-
],
|
|
185
|
-
triggers: [
|
|
186
|
-
{
|
|
187
|
-
event: "{{ events.context('reservationTypeId') }}",
|
|
188
|
-
action: `{{ widget.refresh() }}`,
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
options: {
|
|
195
|
-
sort: { enabled: true },
|
|
196
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
197
|
-
},
|
|
198
|
-
validations: [{ rule: 'required' }],
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
name: 'reservationStatusId',
|
|
202
|
-
title: '@reservation-management:reservations.entities.reservation.fields.reservation-status-id',
|
|
203
|
-
groupId: 'reservation-information',
|
|
204
|
-
schema: {
|
|
205
|
-
dataType: 'string',
|
|
206
|
-
interface: {
|
|
207
|
-
type: AXPWidgetsCatalog.lookup,
|
|
208
|
-
options: {
|
|
209
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.reservationStatus.name}`,
|
|
210
|
-
textField: 'title',
|
|
211
|
-
valueField: 'id',
|
|
212
|
-
columns: ['code', 'title', 'color'],
|
|
213
|
-
expose: [
|
|
214
|
-
{ source: 'id', target: 'reservationStatus.id' },
|
|
215
|
-
{ source: 'title', target: 'reservationStatus.title' },
|
|
216
|
-
{ source: 'code', target: 'reservationStatus.code' },
|
|
217
|
-
{ source: 'color', target: 'reservationStatus.color' },
|
|
218
|
-
],
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
options: {
|
|
223
|
-
sort: { enabled: true },
|
|
224
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
225
|
-
},
|
|
226
|
-
validations: [{ rule: 'required' }],
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
name: 'resourceEntityId',
|
|
230
|
-
title: '@reservation-management:reservations.entities.reservation.fields.resource-entity-id',
|
|
231
|
-
groupId: 'reservation-information',
|
|
232
|
-
schema: {
|
|
233
|
-
dataType: 'string',
|
|
234
|
-
interface: {
|
|
235
|
-
type: AXPWidgetsList.Editors.TextBox,
|
|
236
|
-
options: {
|
|
237
|
-
placeholder: '@reservation-management:reservations.entities.reservation.fields.resource-entity-id.placeholder',
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
options: {
|
|
242
|
-
sort: { enabled: true },
|
|
243
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
244
|
-
},
|
|
245
|
-
validations: [{ rule: 'required' }],
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
name: 'resourceId',
|
|
249
|
-
title: '@reservation-management:reservations.entities.reservation.fields.resource-id',
|
|
250
|
-
groupId: 'reservation-information',
|
|
251
|
-
schema: {
|
|
252
|
-
dataType: 'string',
|
|
253
|
-
interface: {
|
|
254
|
-
type: AXPWidgetsCatalog.lookup,
|
|
255
|
-
options: {
|
|
256
|
-
// Dynamic entity based on resourceEntityId
|
|
257
|
-
// Will be resolved based on resourceEntityId value
|
|
258
|
-
entity: `PlatformManagement.EntityRegistry`, // Placeholder - will be dynamic
|
|
259
|
-
textField: 'title',
|
|
260
|
-
valueField: 'id',
|
|
261
|
-
columns: ['title'],
|
|
262
|
-
expose: [
|
|
263
|
-
{ source: 'id', target: 'resource.id' },
|
|
264
|
-
{ source: 'title', target: 'resource.title' },
|
|
265
|
-
],
|
|
266
|
-
triggers: [
|
|
267
|
-
{
|
|
268
|
-
event: "{{ events.context('resourceEntityId') }}",
|
|
269
|
-
action: `{{ widget.refresh() }}`,
|
|
270
|
-
},
|
|
271
|
-
],
|
|
272
|
-
},
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
options: {
|
|
276
|
-
sort: { enabled: true },
|
|
277
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
278
|
-
},
|
|
279
|
-
validations: [{ rule: 'required' }],
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
name: 'startDate',
|
|
283
|
-
title: '@reservation-management:reservations.entities.reservation.fields.start-date',
|
|
284
|
-
groupId: 'reservation-information',
|
|
285
|
-
schema: {
|
|
286
|
-
dataType: 'date',
|
|
287
|
-
interface: {
|
|
288
|
-
type: AXPWidgetsCatalog.dateTime,
|
|
289
|
-
options: {
|
|
290
|
-
format: 'datetime',
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
options: {
|
|
295
|
-
sort: { enabled: true },
|
|
296
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
297
|
-
},
|
|
298
|
-
validations: [{ rule: 'required' }],
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
name: 'endDate',
|
|
302
|
-
title: '@reservation-management:reservations.entities.reservation.fields.end-date',
|
|
303
|
-
groupId: 'reservation-information',
|
|
304
|
-
schema: {
|
|
305
|
-
dataType: 'date',
|
|
306
|
-
interface: {
|
|
307
|
-
type: AXPWidgetsCatalog.dateTime,
|
|
308
|
-
options: {
|
|
309
|
-
format: 'datetime',
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
|
-
options: {
|
|
314
|
-
sort: { enabled: true },
|
|
315
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
316
|
-
},
|
|
317
|
-
validations: [{ rule: 'required' }],
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
name: 'note',
|
|
321
|
-
title: '@reservation-management:reservations.entities.reservation.fields.note',
|
|
322
|
-
groupId: 'reservation-information',
|
|
323
|
-
schema: {
|
|
324
|
-
dataType: 'string',
|
|
325
|
-
interface: {
|
|
326
|
-
type: AXPWidgetsList.Editors.LargeTextBox,
|
|
327
|
-
options: {
|
|
328
|
-
rows: 4,
|
|
329
|
-
},
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
options: {
|
|
333
|
-
sort: { enabled: false },
|
|
334
|
-
filter: { advance: { enabled: true }, inline: { enabled: false } },
|
|
335
|
-
},
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
name: 'requestedById',
|
|
339
|
-
title: '@reservation-management:reservations.entities.reservation.fields.requested-by-id',
|
|
340
|
-
groupId: 'approve-information',
|
|
341
|
-
schema: {
|
|
342
|
-
dataType: 'string',
|
|
343
|
-
interface: {
|
|
344
|
-
type: AXPWidgetsCatalog.lookup,
|
|
345
|
-
options: {
|
|
346
|
-
entity: 'SecurityManagement.User',
|
|
347
|
-
textField: 'displayName',
|
|
348
|
-
valueField: 'id',
|
|
349
|
-
columns: ['displayName', 'email'],
|
|
350
|
-
expose: [
|
|
351
|
-
{ source: 'id', target: 'requestedBy.id' },
|
|
352
|
-
{ source: 'displayName', target: 'requestedBy.displayName' },
|
|
353
|
-
],
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
},
|
|
357
|
-
options: {
|
|
358
|
-
sort: { enabled: true },
|
|
359
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
360
|
-
},
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
name: 'approvedById',
|
|
364
|
-
title: '@reservation-management:reservations.entities.reservation.fields.approved-by-id',
|
|
365
|
-
groupId: 'approve-information',
|
|
366
|
-
schema: {
|
|
367
|
-
dataType: 'string',
|
|
368
|
-
interface: {
|
|
369
|
-
type: AXPWidgetsCatalog.lookup,
|
|
370
|
-
options: {
|
|
371
|
-
entity: 'SecurityManagement.User',
|
|
372
|
-
textField: 'displayName',
|
|
373
|
-
valueField: 'id',
|
|
374
|
-
columns: ['displayName', 'email'],
|
|
375
|
-
expose: [
|
|
376
|
-
{ source: 'id', target: 'approvedBy.id' },
|
|
377
|
-
{ source: 'displayName', target: 'approvedBy.displayName' },
|
|
378
|
-
],
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
options: {
|
|
383
|
-
sort: { enabled: true },
|
|
384
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
385
|
-
},
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
name: 'approvedDate',
|
|
389
|
-
title: '@reservation-management:reservations.entities.reservation.fields.approved-date',
|
|
390
|
-
groupId: 'approve-information',
|
|
391
|
-
schema: {
|
|
392
|
-
dataType: 'date',
|
|
393
|
-
interface: {
|
|
394
|
-
type: AXPWidgetsCatalog.dateTime,
|
|
395
|
-
options: {
|
|
396
|
-
format: 'datetime',
|
|
397
|
-
},
|
|
398
|
-
},
|
|
399
|
-
},
|
|
400
|
-
options: {
|
|
401
|
-
sort: { enabled: true },
|
|
402
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
name: 'isBlocking',
|
|
407
|
-
title: '@reservation-management:reservations.entities.reservation.fields.is-blocking',
|
|
408
|
-
groupId: 'reservation-information',
|
|
409
|
-
schema: {
|
|
410
|
-
dataType: 'boolean',
|
|
411
|
-
interface: {
|
|
412
|
-
type: AXPWidgetsList.Editors.ToggleSwitch,
|
|
413
|
-
},
|
|
414
|
-
},
|
|
415
|
-
options: {
|
|
416
|
-
sort: { enabled: true },
|
|
417
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
name: 'reservationKind',
|
|
422
|
-
title: '@reservation-management:reservations.entities.reservation.fields.reservation-kind',
|
|
423
|
-
groupId: 'reservation-information',
|
|
424
|
-
schema: {
|
|
425
|
-
dataType: 'string',
|
|
426
|
-
interface: {
|
|
427
|
-
type: AXPWidgetsList.Editors.SelectBox,
|
|
428
|
-
options: {
|
|
429
|
-
valueField: 'value',
|
|
430
|
-
textField: 'text',
|
|
431
|
-
dataSource: [
|
|
432
|
-
{ value: 'reservation', text: '@reservation-management:reservations.entities.reservation.fields.reservation-kind.options.reservation' },
|
|
433
|
-
{ value: 'hold', text: '@reservation-management:reservations.entities.reservation.fields.reservation-kind.options.hold' },
|
|
434
|
-
],
|
|
435
|
-
},
|
|
436
|
-
},
|
|
437
|
-
},
|
|
438
|
-
options: {
|
|
439
|
-
sort: { enabled: true },
|
|
440
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
441
|
-
},
|
|
442
|
-
validations: [{ rule: 'required' }],
|
|
443
|
-
},
|
|
444
|
-
],
|
|
445
|
-
columns: [
|
|
446
|
-
{ name: 'reservationTypeId', options: { dataPath: 'reservationType' } },
|
|
447
|
-
{ name: 'reservationClassId', options: { dataPath: 'reservationClass' } },
|
|
448
|
-
{ name: 'resourceId', options: { dataPath: 'resource' } },
|
|
449
|
-
{ name: 'startDate' },
|
|
450
|
-
{ name: 'endDate' },
|
|
451
|
-
{ name: 'reservationStatusId', options: { dataPath: 'reservationStatus' } },
|
|
452
|
-
{ name: 'requestedById', options: { dataPath: 'requestedBy' } },
|
|
453
|
-
{ name: 'isBlocking' },
|
|
454
|
-
],
|
|
455
|
-
commands: {
|
|
456
|
-
create: {
|
|
457
|
-
execute: async (data) => {
|
|
458
|
-
return { id: await dataService.insertOne(data) };
|
|
459
|
-
},
|
|
460
|
-
},
|
|
461
|
-
update: {
|
|
462
|
-
execute: async (data) => {
|
|
463
|
-
return await dataService.updateOne(data.id, data);
|
|
464
|
-
},
|
|
465
|
-
},
|
|
466
|
-
delete: {
|
|
467
|
-
execute: async (id) => {
|
|
468
|
-
return await dataService.deleteOne(id);
|
|
469
|
-
},
|
|
470
|
-
},
|
|
471
|
-
},
|
|
472
|
-
queries: {
|
|
473
|
-
byKey: {
|
|
474
|
-
execute: async (id) => {
|
|
475
|
-
return await dataService.getOne(id);
|
|
476
|
-
},
|
|
477
|
-
type: AXPEntityQueryType.Single,
|
|
478
|
-
},
|
|
479
|
-
list: {
|
|
480
|
-
execute: async (e) => {
|
|
481
|
-
return await dataService.query({
|
|
482
|
-
skip: e.skip,
|
|
483
|
-
take: e.take,
|
|
484
|
-
filter: e.filter,
|
|
485
|
-
sort: e.sort,
|
|
486
|
-
});
|
|
487
|
-
},
|
|
488
|
-
type: AXPEntityQueryType.List,
|
|
489
|
-
},
|
|
490
|
-
},
|
|
491
|
-
interfaces: {
|
|
492
|
-
master: {
|
|
493
|
-
create: {
|
|
494
|
-
sections: [
|
|
495
|
-
{ id: 'reservation-information', order: 1, layout: { positions: { lg: { colSpan: 12 } } } },
|
|
496
|
-
{ id: 'approve-information', order: 2, layout: { positions: { lg: { colSpan: 12 } } } },
|
|
497
|
-
],
|
|
498
|
-
properties: [
|
|
499
|
-
{ name: 'reservationTypeId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
500
|
-
{ name: 'reservationClassId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
501
|
-
{ name: 'reservationStatusId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
502
|
-
{ name: 'resourceEntityId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
503
|
-
{ name: 'resourceId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
504
|
-
{ name: 'startDate', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
505
|
-
{ name: 'endDate', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
506
|
-
{ name: 'reservationKind', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
507
|
-
{ name: 'isBlocking', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
508
|
-
{ name: 'note', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
509
|
-
{ name: 'requestedById', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
510
|
-
{ name: 'approvedById', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
511
|
-
{ name: 'approvedDate', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
512
|
-
],
|
|
513
|
-
},
|
|
514
|
-
update: {
|
|
515
|
-
sections: [
|
|
516
|
-
{ id: 'reservation-information', order: 1, layout: { positions: { lg: { colSpan: 12 } } } },
|
|
517
|
-
{ id: 'approve-information', order: 2, layout: { positions: { lg: { colSpan: 12 } } } },
|
|
518
|
-
],
|
|
519
|
-
properties: [
|
|
520
|
-
{ name: 'reservationTypeId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
521
|
-
{ name: 'reservationClassId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
522
|
-
{ name: 'reservationStatusId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
523
|
-
{ name: 'resourceEntityId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
524
|
-
{ name: 'resourceId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
525
|
-
{ name: 'startDate', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
526
|
-
{ name: 'endDate', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
527
|
-
{ name: 'reservationKind', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
528
|
-
{ name: 'isBlocking', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
529
|
-
{ name: 'note', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
530
|
-
{ name: 'requestedById', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
531
|
-
{ name: 'approvedById', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
532
|
-
{ name: 'approvedDate', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
533
|
-
],
|
|
534
|
-
},
|
|
535
|
-
single: {
|
|
536
|
-
title: '{{ title }}',
|
|
537
|
-
sections: [
|
|
538
|
-
{ id: 'reservation-information', order: 1, layout: { positions: { lg: { colSpan: 12 } } } },
|
|
539
|
-
{ id: 'approve-information', order: 2, layout: { positions: { lg: { colSpan: 12 } } } },
|
|
540
|
-
],
|
|
541
|
-
properties: [
|
|
542
|
-
{ name: 'reservationTypeId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
543
|
-
{ name: 'reservationClassId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
544
|
-
{ name: 'reservationStatusId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
545
|
-
{ name: 'resourceEntityId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
546
|
-
{ name: 'resourceId', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
547
|
-
{ name: 'startDate', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
548
|
-
{ name: 'endDate', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
549
|
-
{ name: 'reservationKind', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
550
|
-
{ name: 'isBlocking', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
551
|
-
{ name: 'note', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
552
|
-
{ name: 'requestedById', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
553
|
-
{ name: 'approvedById', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
554
|
-
{ name: 'approvedDate', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
555
|
-
],
|
|
556
|
-
actions: [...entityMasterRecordActions()],
|
|
557
|
-
},
|
|
558
|
-
list: {
|
|
559
|
-
actions: [...entityMasterCrudActions()],
|
|
560
|
-
views: [
|
|
561
|
-
createAllQueryView({
|
|
562
|
-
sorts: [{ name: 'startDate', dir: 'desc' }],
|
|
563
|
-
}),
|
|
564
|
-
],
|
|
565
|
-
},
|
|
566
|
-
},
|
|
567
|
-
},
|
|
568
|
-
};
|
|
569
|
-
return entityDef;
|
|
570
|
-
}
|
|
571
|
-
//#endregion
|
|
572
|
-
|
|
573
|
-
var reservation_entity = /*#__PURE__*/Object.freeze({
|
|
574
|
-
__proto__: null,
|
|
575
|
-
reservationFactory: reservationFactory
|
|
576
|
-
});
|
|
577
|
-
|
|
578
|
-
class AXPReservationManagementReservationEntityModule {
|
|
579
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
580
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEntityModule }); }
|
|
581
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEntityModule, providers: [
|
|
582
|
-
{
|
|
583
|
-
provide: AXPReservationManagementReservationService,
|
|
584
|
-
useClass: AXPReservationManagementReservationServiceImpl,
|
|
585
|
-
},
|
|
586
|
-
] }); }
|
|
587
|
-
}
|
|
588
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEntityModule, decorators: [{
|
|
589
|
-
type: NgModule,
|
|
590
|
-
args: [{
|
|
591
|
-
providers: [
|
|
592
|
-
{
|
|
593
|
-
provide: AXPReservationManagementReservationService,
|
|
594
|
-
useClass: AXPReservationManagementReservationServiceImpl,
|
|
595
|
-
},
|
|
596
|
-
],
|
|
597
|
-
}]
|
|
598
|
-
}] });
|
|
599
|
-
|
|
600
|
-
class AXPReservationManagementReservationClassService extends AXMEntityCrudServiceImpl {
|
|
601
|
-
}
|
|
602
|
-
class AXPReservationManagementReservationClassServiceImpl extends AXPReservationManagementReservationClassService {
|
|
603
|
-
constructor() {
|
|
604
|
-
super(`${RootConfig.module.name}.${RootConfig.entities.reservationClass.name}`);
|
|
605
|
-
}
|
|
606
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationClassServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
607
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationClassServiceImpl }); }
|
|
608
|
-
}
|
|
609
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationClassServiceImpl, decorators: [{
|
|
610
|
-
type: Injectable
|
|
611
|
-
}], ctorParameters: () => [] });
|
|
612
|
-
|
|
613
|
-
//#region ---- Imports ----
|
|
614
|
-
//#endregion
|
|
615
|
-
//#region ---- Entity Factory ----
|
|
616
|
-
async function reservationClassFactory(injector) {
|
|
617
|
-
const dataService = injector.get(AXPReservationManagementReservationClassService);
|
|
618
|
-
const i18n = RootConfig.config.i18n;
|
|
619
|
-
const entityDef = {
|
|
620
|
-
module: RootConfig.module.name,
|
|
621
|
-
name: RootConfig.entities.reservationClass.name,
|
|
622
|
-
title: RootConfig.entities.reservationClass.title,
|
|
623
|
-
icon: RootConfig.entities.reservationClass.icon,
|
|
624
|
-
plugins: [{ name: 'archive' }],
|
|
625
|
-
formats: {
|
|
626
|
-
individual: RootConfig.entities.reservationClass.title,
|
|
627
|
-
plural: RootConfig.entities.reservationClass.titlePlural,
|
|
628
|
-
searchResult: {
|
|
629
|
-
title: '{{ title }}',
|
|
630
|
-
description: '{{ code }}',
|
|
631
|
-
},
|
|
632
|
-
},
|
|
633
|
-
groups: [
|
|
634
|
-
{
|
|
635
|
-
id: 'general',
|
|
636
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.groups.general',
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
id: 'policy',
|
|
640
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.groups.policy',
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
id: 'allowed-statuses',
|
|
644
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.groups.allowed-statuses',
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
id: 'transitions',
|
|
648
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.groups.transitions',
|
|
649
|
-
},
|
|
650
|
-
],
|
|
651
|
-
properties: [
|
|
652
|
-
{
|
|
653
|
-
name: 'id',
|
|
654
|
-
title: '@general:terms.common.id',
|
|
655
|
-
schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
|
|
656
|
-
},
|
|
657
|
-
{
|
|
658
|
-
name: 'reservationTypeId',
|
|
659
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.reservation-type-id.title',
|
|
660
|
-
groupId: 'general',
|
|
661
|
-
schema: {
|
|
662
|
-
dataType: 'string',
|
|
663
|
-
interface: {
|
|
664
|
-
type: AXPWidgetsCatalog.lookup,
|
|
665
|
-
options: {
|
|
666
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.reservationType.name}`,
|
|
667
|
-
textField: 'title',
|
|
668
|
-
valueField: 'id',
|
|
669
|
-
columns: ['code', 'title'],
|
|
670
|
-
expose: [
|
|
671
|
-
{ source: 'id', target: 'reservationType.id' },
|
|
672
|
-
{ source: 'title', target: 'reservationType.title' },
|
|
673
|
-
{ source: 'code', target: 'reservationType.code' },
|
|
674
|
-
],
|
|
675
|
-
},
|
|
676
|
-
},
|
|
677
|
-
},
|
|
678
|
-
options: {
|
|
679
|
-
sort: { enabled: true },
|
|
680
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
681
|
-
},
|
|
682
|
-
validations: [{ rule: 'required' }],
|
|
683
|
-
},
|
|
684
|
-
{
|
|
685
|
-
name: 'code',
|
|
686
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.code.title',
|
|
687
|
-
groupId: 'general',
|
|
688
|
-
schema: {
|
|
689
|
-
dataType: 'string',
|
|
690
|
-
interface: {
|
|
691
|
-
type: AXPWidgetsList.Editors.TextBox,
|
|
692
|
-
options: {
|
|
693
|
-
placeholder: '@reservation-management:reservation-classes.entities.reservation-class.fields.code.placeholder',
|
|
694
|
-
},
|
|
695
|
-
},
|
|
696
|
-
},
|
|
697
|
-
options: {
|
|
698
|
-
sort: { enabled: true },
|
|
699
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
700
|
-
},
|
|
701
|
-
validations: [{ rule: 'required' }, { rule: 'unique', options: { scope: 'reservationTypeId' } }],
|
|
702
|
-
},
|
|
703
|
-
{
|
|
704
|
-
name: 'title',
|
|
705
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.title.title',
|
|
706
|
-
groupId: 'general',
|
|
707
|
-
schema: {
|
|
708
|
-
dataType: 'string',
|
|
709
|
-
interface: {
|
|
710
|
-
type: AXPWidgetsList.Editors.TextBox,
|
|
711
|
-
options: {
|
|
712
|
-
placeholder: '@reservation-management:reservation-classes.entities.reservation-class.fields.title.placeholder',
|
|
713
|
-
},
|
|
714
|
-
},
|
|
715
|
-
},
|
|
716
|
-
options: {
|
|
717
|
-
sort: { enabled: true },
|
|
718
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
719
|
-
},
|
|
720
|
-
validations: [{ rule: 'required' }],
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
name: 'requiresApproval',
|
|
724
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.requires-approval.title',
|
|
725
|
-
groupId: 'policy',
|
|
726
|
-
schema: {
|
|
727
|
-
dataType: 'boolean',
|
|
728
|
-
interface: {
|
|
729
|
-
type: AXPWidgetsList.Editors.CheckBox,
|
|
730
|
-
},
|
|
731
|
-
},
|
|
732
|
-
options: {
|
|
733
|
-
sort: { enabled: true },
|
|
734
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
735
|
-
},
|
|
736
|
-
},
|
|
737
|
-
{
|
|
738
|
-
name: 'allowAutoApprove',
|
|
739
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.allow-auto-approve.title',
|
|
740
|
-
groupId: 'policy',
|
|
741
|
-
schema: {
|
|
742
|
-
dataType: 'boolean',
|
|
743
|
-
visible: `{{ context.eval('requiresApproval') === true }}`,
|
|
744
|
-
interface: {
|
|
745
|
-
type: AXPWidgetsList.Editors.CheckBox,
|
|
746
|
-
},
|
|
747
|
-
},
|
|
748
|
-
options: {
|
|
749
|
-
sort: { enabled: false },
|
|
750
|
-
filter: { advance: { enabled: true }, inline: { enabled: false } },
|
|
751
|
-
},
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
name: 'conflictPolicy',
|
|
755
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.conflict-policy.title',
|
|
756
|
-
groupId: 'policy',
|
|
757
|
-
schema: {
|
|
758
|
-
dataType: 'string',
|
|
759
|
-
interface: {
|
|
760
|
-
type: AXPWidgetsList.Editors.SelectBox,
|
|
761
|
-
options: {
|
|
762
|
-
valueField: 'value',
|
|
763
|
-
textField: 'text',
|
|
764
|
-
dataSource: [
|
|
765
|
-
{
|
|
766
|
-
value: 'strict',
|
|
767
|
-
text: '@reservation-management:reservation-classes.entities.reservation-class.fields.conflict-policy.options.strict',
|
|
768
|
-
},
|
|
769
|
-
{
|
|
770
|
-
value: 'soft',
|
|
771
|
-
text: '@reservation-management:reservation-classes.entities.reservation-class.fields.conflict-policy.options.soft',
|
|
772
|
-
},
|
|
773
|
-
],
|
|
774
|
-
},
|
|
775
|
-
},
|
|
776
|
-
},
|
|
777
|
-
options: {
|
|
778
|
-
sort: { enabled: true },
|
|
779
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
780
|
-
},
|
|
781
|
-
validations: [{ rule: 'required' }],
|
|
782
|
-
},
|
|
783
|
-
{
|
|
784
|
-
name: 'allowHold',
|
|
785
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.allow-hold.title',
|
|
786
|
-
groupId: 'policy',
|
|
787
|
-
schema: {
|
|
788
|
-
dataType: 'boolean',
|
|
789
|
-
interface: {
|
|
790
|
-
type: AXPWidgetsList.Editors.CheckBox,
|
|
791
|
-
},
|
|
792
|
-
},
|
|
793
|
-
options: {
|
|
794
|
-
sort: { enabled: true },
|
|
795
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
796
|
-
},
|
|
797
|
-
},
|
|
798
|
-
{
|
|
799
|
-
name: 'allowedStatuses',
|
|
800
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.allowed-statuses.title',
|
|
801
|
-
groupId: 'allowed-statuses',
|
|
802
|
-
schema: {
|
|
803
|
-
dataType: 'array',
|
|
804
|
-
interface: {
|
|
805
|
-
type: AXPWidgetsList.Editors.ConnectedListsEditor,
|
|
806
|
-
options: {
|
|
807
|
-
leftListTitle: '@reservation-management:reservation-classes.entities.reservation-class.fields.allowed-statuses.options.available-statuses',
|
|
808
|
-
rightListTitle: '@reservation-management:reservation-classes.entities.reservation-class.fields.allowed-statuses.options.allowed-statuses',
|
|
809
|
-
sourceEntity: `${RootConfig.module.name}.${RootConfig.entities.reservationStatus.name}`,
|
|
810
|
-
sourceTextField: 'title',
|
|
811
|
-
sourceValueField: 'id',
|
|
812
|
-
targetFields: [
|
|
813
|
-
{
|
|
814
|
-
name: 'isInitial',
|
|
815
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.allowed-statuses.fields.is-initial',
|
|
816
|
-
type: 'boolean',
|
|
817
|
-
},
|
|
818
|
-
{
|
|
819
|
-
name: 'isFinal',
|
|
820
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.allowed-statuses.fields.is-final',
|
|
821
|
-
type: 'boolean',
|
|
822
|
-
},
|
|
823
|
-
{
|
|
824
|
-
name: 'order',
|
|
825
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.allowed-statuses.fields.order',
|
|
826
|
-
type: 'number',
|
|
827
|
-
},
|
|
828
|
-
],
|
|
829
|
-
},
|
|
830
|
-
},
|
|
831
|
-
},
|
|
832
|
-
},
|
|
833
|
-
{
|
|
834
|
-
name: 'transitions',
|
|
835
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.transitions.title',
|
|
836
|
-
groupId: 'transitions',
|
|
837
|
-
schema: {
|
|
838
|
-
dataType: 'array',
|
|
839
|
-
interface: {
|
|
840
|
-
type: AXPWidgetsList.Editors.InlineDataTable,
|
|
841
|
-
options: {
|
|
842
|
-
columns: [
|
|
843
|
-
{
|
|
844
|
-
name: 'fromStatusId',
|
|
845
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.transitions.fields.from-status-id.title',
|
|
846
|
-
type: 'lookup',
|
|
847
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.reservationStatus.name}`,
|
|
848
|
-
textField: 'title',
|
|
849
|
-
valueField: 'id',
|
|
850
|
-
},
|
|
851
|
-
{
|
|
852
|
-
name: 'toStatusId',
|
|
853
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.transitions.fields.to-status-id.title',
|
|
854
|
-
type: 'lookup',
|
|
855
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.reservationStatus.name}`,
|
|
856
|
-
textField: 'title',
|
|
857
|
-
valueField: 'id',
|
|
858
|
-
},
|
|
859
|
-
{
|
|
860
|
-
name: 'title',
|
|
861
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.transitions.fields.title.title',
|
|
862
|
-
type: 'text',
|
|
863
|
-
},
|
|
864
|
-
{
|
|
865
|
-
name: 'requiresPermission',
|
|
866
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.transitions.fields.requires-permission.title',
|
|
867
|
-
type: 'text',
|
|
868
|
-
},
|
|
869
|
-
{
|
|
870
|
-
name: 'order',
|
|
871
|
-
title: '@reservation-management:reservation-classes.entities.reservation-class.fields.transitions.fields.order.title',
|
|
872
|
-
type: 'number',
|
|
873
|
-
},
|
|
874
|
-
],
|
|
875
|
-
},
|
|
876
|
-
},
|
|
877
|
-
},
|
|
878
|
-
},
|
|
879
|
-
],
|
|
880
|
-
columns: [
|
|
881
|
-
{ name: 'code' },
|
|
882
|
-
{ name: 'title' },
|
|
883
|
-
{ name: 'reservationTypeId', options: { dataPath: 'reservationType.title' } },
|
|
884
|
-
{ name: 'requiresApproval' },
|
|
885
|
-
{ name: 'conflictPolicy' },
|
|
886
|
-
{ name: 'allowHold' },
|
|
887
|
-
],
|
|
888
|
-
commands: {
|
|
889
|
-
create: {
|
|
890
|
-
execute: async (data) => {
|
|
891
|
-
return { id: await dataService.insertOne(data) };
|
|
892
|
-
},
|
|
893
|
-
},
|
|
894
|
-
update: {
|
|
895
|
-
execute: async (data) => {
|
|
896
|
-
return await dataService.updateOne(data.id, data);
|
|
897
|
-
},
|
|
898
|
-
},
|
|
899
|
-
delete: {
|
|
900
|
-
execute: async (id) => {
|
|
901
|
-
return await dataService.deleteOne(id);
|
|
902
|
-
},
|
|
903
|
-
},
|
|
904
|
-
},
|
|
905
|
-
queries: {
|
|
906
|
-
byKey: {
|
|
907
|
-
execute: async (id) => {
|
|
908
|
-
return await dataService.getOne(id);
|
|
909
|
-
},
|
|
910
|
-
type: AXPEntityQueryType.Single,
|
|
911
|
-
},
|
|
912
|
-
list: {
|
|
913
|
-
execute: async (e) => {
|
|
914
|
-
return await dataService.query({
|
|
915
|
-
skip: e.skip,
|
|
916
|
-
take: e.take,
|
|
917
|
-
filter: e.filter,
|
|
918
|
-
sort: e.sort,
|
|
919
|
-
});
|
|
920
|
-
},
|
|
921
|
-
type: AXPEntityQueryType.List,
|
|
922
|
-
},
|
|
923
|
-
},
|
|
924
|
-
interfaces: {
|
|
925
|
-
master: {
|
|
926
|
-
create: {
|
|
927
|
-
sections: [
|
|
928
|
-
{ id: 'general', order: 1 },
|
|
929
|
-
{ id: 'policy', order: 2 },
|
|
930
|
-
{ id: 'allowed-statuses', order: 3 },
|
|
931
|
-
{ id: 'transitions', order: 4 },
|
|
932
|
-
],
|
|
933
|
-
properties: [
|
|
934
|
-
{ name: 'reservationTypeId', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
935
|
-
{ name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
936
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
937
|
-
{ name: 'requiresApproval', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
938
|
-
{ name: 'allowAutoApprove', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
939
|
-
{ name: 'conflictPolicy', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
940
|
-
{ name: 'allowHold', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
941
|
-
{ name: 'allowedStatuses', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
942
|
-
{ name: 'transitions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
943
|
-
],
|
|
944
|
-
},
|
|
945
|
-
update: {
|
|
946
|
-
sections: [
|
|
947
|
-
{ id: 'general', order: 1 },
|
|
948
|
-
{ id: 'policy', order: 2 },
|
|
949
|
-
{ id: 'allowed-statuses', order: 3 },
|
|
950
|
-
{ id: 'transitions', order: 4 },
|
|
951
|
-
],
|
|
952
|
-
properties: [
|
|
953
|
-
{ name: 'reservationTypeId', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
954
|
-
{ name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
955
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
956
|
-
{ name: 'requiresApproval', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
957
|
-
{ name: 'allowAutoApprove', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
958
|
-
{ name: 'conflictPolicy', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
959
|
-
{ name: 'allowHold', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
960
|
-
{ name: 'allowedStatuses', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
961
|
-
{ name: 'transitions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
962
|
-
],
|
|
963
|
-
},
|
|
964
|
-
single: {
|
|
965
|
-
title: '{{ title }}',
|
|
966
|
-
sections: [
|
|
967
|
-
{ id: 'general', order: 1 },
|
|
968
|
-
{ id: 'policy', order: 2 },
|
|
969
|
-
{ id: 'allowed-statuses', order: 3 },
|
|
970
|
-
{ id: 'transitions', order: 4 },
|
|
971
|
-
],
|
|
972
|
-
properties: [
|
|
973
|
-
{ name: 'reservationTypeId', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
974
|
-
{ name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
975
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
976
|
-
{ name: 'requiresApproval', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
977
|
-
{ name: 'allowAutoApprove', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
978
|
-
{ name: 'conflictPolicy', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
979
|
-
{ name: 'allowHold', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
980
|
-
{ name: 'allowedStatuses', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
981
|
-
{ name: 'transitions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
982
|
-
],
|
|
983
|
-
actions: [...entityMasterRecordActions()],
|
|
984
|
-
},
|
|
985
|
-
list: {
|
|
986
|
-
actions: [
|
|
987
|
-
...entityMasterCrudActions(),
|
|
988
|
-
{
|
|
989
|
-
title: '@general:actions.archive.title',
|
|
990
|
-
command: 'archive-entity',
|
|
991
|
-
priority: 'secondary',
|
|
992
|
-
type: AXPSystemActionType.Archive,
|
|
993
|
-
scope: AXPEntityCommandScope.Individual,
|
|
994
|
-
},
|
|
995
|
-
],
|
|
996
|
-
views: [
|
|
997
|
-
createAllQueryView({
|
|
998
|
-
sorts: [{ name: 'code', dir: 'asc' }],
|
|
999
|
-
}),
|
|
1000
|
-
],
|
|
1001
|
-
},
|
|
1002
|
-
},
|
|
1003
|
-
},
|
|
1004
|
-
};
|
|
1005
|
-
return entityDef;
|
|
1006
|
-
}
|
|
1007
|
-
//#endregion
|
|
1008
|
-
|
|
1009
|
-
var reservationClass_entity = /*#__PURE__*/Object.freeze({
|
|
1010
|
-
__proto__: null,
|
|
1011
|
-
reservationClassFactory: reservationClassFactory
|
|
1012
|
-
});
|
|
1013
|
-
|
|
1014
|
-
class AXPReservationManagementReservationEventService extends AXMEntityCrudServiceImpl {
|
|
1015
|
-
}
|
|
1016
|
-
class AXPReservationManagementReservationEventServiceImpl extends AXPReservationManagementReservationEventService {
|
|
1017
|
-
constructor() {
|
|
1018
|
-
super(`${RootConfig.module.name}.${RootConfig.entities.reservationEvent.name}`);
|
|
1019
|
-
}
|
|
1020
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEventServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1021
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEventServiceImpl }); }
|
|
1022
|
-
}
|
|
1023
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEventServiceImpl, decorators: [{
|
|
1024
|
-
type: Injectable
|
|
1025
|
-
}], ctorParameters: () => [] });
|
|
1026
|
-
|
|
1027
|
-
//#region ---- Imports ----
|
|
1028
|
-
//#endregion
|
|
1029
|
-
//#region ---- Entity Factory ----
|
|
1030
|
-
async function reservationEventFactory(injector) {
|
|
1031
|
-
const dataService = injector.get(AXPReservationManagementReservationEventService);
|
|
1032
|
-
const i18n = RootConfig.config.i18n;
|
|
1033
|
-
const entityDef = {
|
|
1034
|
-
module: RootConfig.module.name,
|
|
1035
|
-
name: RootConfig.entities.reservationEvent.name,
|
|
1036
|
-
title: RootConfig.entities.reservationEvent.title,
|
|
1037
|
-
icon: RootConfig.entities.reservationEvent.icon,
|
|
1038
|
-
formats: {
|
|
1039
|
-
individual: RootConfig.entities.reservationEvent.title,
|
|
1040
|
-
plural: RootConfig.entities.reservationEvent.titlePlural,
|
|
1041
|
-
searchResult: {
|
|
1042
|
-
title: '',
|
|
1043
|
-
},
|
|
1044
|
-
},
|
|
1045
|
-
// Property groups
|
|
1046
|
-
groups: [
|
|
1047
|
-
{
|
|
1048
|
-
id: 'basic-information',
|
|
1049
|
-
title: '@reservation-management:reservation-events.entities.reservation-event.groups.basic-information',
|
|
1050
|
-
},
|
|
1051
|
-
],
|
|
1052
|
-
// Entity properties
|
|
1053
|
-
properties: [
|
|
1054
|
-
{
|
|
1055
|
-
name: 'id',
|
|
1056
|
-
title: '@general:terms.common.id',
|
|
1057
|
-
groupId: 'basic-information',
|
|
1058
|
-
options: {
|
|
1059
|
-
sort: { enabled: true },
|
|
1060
|
-
filter: {
|
|
1061
|
-
advance: { enabled: true },
|
|
1062
|
-
inline: { enabled: true },
|
|
1063
|
-
},
|
|
1064
|
-
},
|
|
1065
|
-
schema: {
|
|
1066
|
-
dataType: 'string',
|
|
1067
|
-
visible: false,
|
|
1068
|
-
interface: {
|
|
1069
|
-
type: AXPWidgetsList.Editors.TextBox,
|
|
1070
|
-
options: {
|
|
1071
|
-
readonly: true,
|
|
1072
|
-
visible: false,
|
|
1073
|
-
},
|
|
1074
|
-
},
|
|
1075
|
-
},
|
|
1076
|
-
},
|
|
1077
|
-
{
|
|
1078
|
-
name: 'reservationId',
|
|
1079
|
-
title: '@ ',
|
|
1080
|
-
groupId: 'basic-information',
|
|
1081
|
-
options: {
|
|
1082
|
-
sort: { enabled: true },
|
|
1083
|
-
filter: {
|
|
1084
|
-
advance: { enabled: true },
|
|
1085
|
-
inline: { enabled: true },
|
|
1086
|
-
},
|
|
1087
|
-
},
|
|
1088
|
-
schema: {
|
|
1089
|
-
dataType: 'object',
|
|
1090
|
-
interface: {
|
|
1091
|
-
type: AXPWidgetsList.Editors.LookupBox,
|
|
1092
|
-
options: {
|
|
1093
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.reservation.name}`,
|
|
1094
|
-
expose: [
|
|
1095
|
-
{ source: 'id', target: 'reservation.{id}' },
|
|
1096
|
-
{ source: 'resource', target: 'reservation.{resource}' },
|
|
1097
|
-
],
|
|
1098
|
-
},
|
|
1099
|
-
},
|
|
1100
|
-
},
|
|
1101
|
-
validations: [{ rule: 'required' }],
|
|
1102
|
-
},
|
|
1103
|
-
],
|
|
1104
|
-
// Columns for list views
|
|
1105
|
-
columns: [
|
|
1106
|
-
{ name: 'reservationId', options: { dataPath: 'reservation' } },
|
|
1107
|
-
{ name: 'reservationEventId', options: { dataPath: 'reservationEvent' } },
|
|
1108
|
-
{ name: 'eventDate' },
|
|
1109
|
-
{ name: 'actorId', options: { dataPath: 'actor' } },
|
|
1110
|
-
{ name: 'fromStatusId', options: { dataPath: 'fromStatus' } },
|
|
1111
|
-
{ name: 'toStatusId', options: { dataPath: 'toStatus' } },
|
|
1112
|
-
],
|
|
1113
|
-
// Commands
|
|
1114
|
-
commands: {
|
|
1115
|
-
create: {
|
|
1116
|
-
execute: async (data) => {
|
|
1117
|
-
return await dataService.insertOne(data);
|
|
1118
|
-
},
|
|
1119
|
-
},
|
|
1120
|
-
update: {
|
|
1121
|
-
execute: async (data) => {
|
|
1122
|
-
return await dataService.updateOne(data.id, data);
|
|
1123
|
-
},
|
|
1124
|
-
},
|
|
1125
|
-
delete: {
|
|
1126
|
-
execute: async (id) => {
|
|
1127
|
-
return await dataService.deleteOne(id);
|
|
1128
|
-
},
|
|
1129
|
-
},
|
|
1130
|
-
},
|
|
1131
|
-
// Queries
|
|
1132
|
-
queries: {
|
|
1133
|
-
byKey: {
|
|
1134
|
-
execute: async (id) => {
|
|
1135
|
-
return await dataService.getOne(id);
|
|
1136
|
-
},
|
|
1137
|
-
type: AXPEntityQueryType.Single,
|
|
1138
|
-
},
|
|
1139
|
-
list: {
|
|
1140
|
-
execute: async (e) => {
|
|
1141
|
-
return await dataService.query({
|
|
1142
|
-
skip: e.skip,
|
|
1143
|
-
take: e.take,
|
|
1144
|
-
filter: e.filter,
|
|
1145
|
-
});
|
|
1146
|
-
},
|
|
1147
|
-
type: AXPEntityQueryType.List,
|
|
1148
|
-
},
|
|
1149
|
-
},
|
|
1150
|
-
// Interfaces
|
|
1151
|
-
interfaces: {
|
|
1152
|
-
master: {
|
|
1153
|
-
create: {
|
|
1154
|
-
sections: [{ id: 'basic-information', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],
|
|
1155
|
-
properties: [
|
|
1156
|
-
{
|
|
1157
|
-
name: 'id',
|
|
1158
|
-
layout: { positions: { lg: { colSpan: 6 } } },
|
|
1159
|
-
},
|
|
1160
|
-
{
|
|
1161
|
-
name: 'reservationId',
|
|
1162
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1163
|
-
},
|
|
1164
|
-
{
|
|
1165
|
-
name: 'reservationEventId',
|
|
1166
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1167
|
-
},
|
|
1168
|
-
{
|
|
1169
|
-
name: 'eventDate',
|
|
1170
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1171
|
-
},
|
|
1172
|
-
{
|
|
1173
|
-
name: 'actorId',
|
|
1174
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1175
|
-
},
|
|
1176
|
-
{
|
|
1177
|
-
name: 'fromStatusId',
|
|
1178
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1179
|
-
},
|
|
1180
|
-
{
|
|
1181
|
-
name: 'toStatusId',
|
|
1182
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1183
|
-
},
|
|
1184
|
-
],
|
|
1185
|
-
},
|
|
1186
|
-
update: {
|
|
1187
|
-
sections: [{ id: 'basic-information', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],
|
|
1188
|
-
properties: [
|
|
1189
|
-
{
|
|
1190
|
-
name: 'id',
|
|
1191
|
-
layout: { positions: { lg: { colSpan: 6 } } },
|
|
1192
|
-
},
|
|
1193
|
-
{
|
|
1194
|
-
name: 'reservationId',
|
|
1195
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1196
|
-
},
|
|
1197
|
-
{
|
|
1198
|
-
name: 'reservationEventId',
|
|
1199
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1200
|
-
},
|
|
1201
|
-
{
|
|
1202
|
-
name: 'eventDate',
|
|
1203
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1204
|
-
},
|
|
1205
|
-
{
|
|
1206
|
-
name: 'actorId',
|
|
1207
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1208
|
-
},
|
|
1209
|
-
{
|
|
1210
|
-
name: 'fromStatusId',
|
|
1211
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1212
|
-
},
|
|
1213
|
-
{
|
|
1214
|
-
name: 'toStatusId',
|
|
1215
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1216
|
-
},
|
|
1217
|
-
],
|
|
1218
|
-
},
|
|
1219
|
-
single: {
|
|
1220
|
-
title: '{{ resource }}',
|
|
1221
|
-
sections: [{ id: 'basic-information', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],
|
|
1222
|
-
properties: [
|
|
1223
|
-
{
|
|
1224
|
-
name: 'id',
|
|
1225
|
-
layout: { positions: { lg: { colSpan: 6 } } },
|
|
1226
|
-
},
|
|
1227
|
-
{
|
|
1228
|
-
name: 'reservationId',
|
|
1229
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1230
|
-
},
|
|
1231
|
-
{
|
|
1232
|
-
name: 'reservationEventId',
|
|
1233
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1234
|
-
},
|
|
1235
|
-
{
|
|
1236
|
-
name: 'eventDate',
|
|
1237
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1238
|
-
},
|
|
1239
|
-
{
|
|
1240
|
-
name: 'actorId',
|
|
1241
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1242
|
-
},
|
|
1243
|
-
{
|
|
1244
|
-
name: 'fromStatusId',
|
|
1245
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1246
|
-
},
|
|
1247
|
-
{
|
|
1248
|
-
name: 'toStatusId',
|
|
1249
|
-
layout: { positions: { lg: { colSpan: 12 } } },
|
|
1250
|
-
},
|
|
1251
|
-
],
|
|
1252
|
-
actions: [
|
|
1253
|
-
{
|
|
1254
|
-
title: '@general:actions.edit.title',
|
|
1255
|
-
command: 'quick-modify-entity',
|
|
1256
|
-
priority: 'primary',
|
|
1257
|
-
type: 'update',
|
|
1258
|
-
scope: AXPEntityCommandScope.Individual,
|
|
1259
|
-
},
|
|
1260
|
-
],
|
|
1261
|
-
},
|
|
1262
|
-
list: {
|
|
1263
|
-
actions: [
|
|
1264
|
-
{
|
|
1265
|
-
title: '@general:actions.create.title',
|
|
1266
|
-
command: 'create-entity',
|
|
1267
|
-
priority: 'primary',
|
|
1268
|
-
type: 'create',
|
|
1269
|
-
scope: AXPEntityCommandScope.TypeLevel,
|
|
1270
|
-
},
|
|
1271
|
-
{
|
|
1272
|
-
title: '@general:actions.edit.title',
|
|
1273
|
-
command: 'quick-modify-entity',
|
|
1274
|
-
priority: 'primary',
|
|
1275
|
-
type: 'update',
|
|
1276
|
-
scope: AXPEntityCommandScope.Individual,
|
|
1277
|
-
default: true, // Enable double-click to open edit mode
|
|
1278
|
-
},
|
|
1279
|
-
{
|
|
1280
|
-
title: '@general:actions.delete.title',
|
|
1281
|
-
command: 'delete-entity',
|
|
1282
|
-
priority: 'secondary',
|
|
1283
|
-
type: 'delete',
|
|
1284
|
-
scope: AXPEntityCommandScope.Individual,
|
|
1285
|
-
},
|
|
1286
|
-
],
|
|
1287
|
-
views: [
|
|
1288
|
-
createAllQueryView({
|
|
1289
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
1290
|
-
}),
|
|
1291
|
-
],
|
|
1292
|
-
},
|
|
1293
|
-
},
|
|
1294
|
-
},
|
|
1295
|
-
};
|
|
1296
|
-
return entityDef;
|
|
1297
|
-
}
|
|
1298
|
-
//#endregion
|
|
1299
|
-
|
|
1300
|
-
var reservationEvent_entity = /*#__PURE__*/Object.freeze({
|
|
1301
|
-
__proto__: null,
|
|
1302
|
-
reservationEventFactory: reservationEventFactory
|
|
1303
|
-
});
|
|
1304
|
-
|
|
1305
|
-
//#region ---- Imports ----
|
|
1306
|
-
//#endregion
|
|
1307
|
-
//#region ---- Service ----
|
|
1308
|
-
class AXPReservationManagementReservationStatusService extends AXMEntityCrudServiceImpl {
|
|
1309
|
-
}
|
|
1310
|
-
class AXPReservationManagementReservationStatusServiceImpl extends AXPReservationManagementReservationStatusService {
|
|
1311
|
-
constructor() {
|
|
1312
|
-
super(`${RootConfig.module.name}.${RootConfig.entities.reservationStatus.name}`);
|
|
1313
|
-
}
|
|
1314
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationStatusServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1315
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationStatusServiceImpl, providedIn: 'root' }); }
|
|
1316
|
-
}
|
|
1317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationStatusServiceImpl, decorators: [{
|
|
1318
|
-
type: Injectable,
|
|
1319
|
-
args: [{
|
|
1320
|
-
providedIn: 'root',
|
|
1321
|
-
}]
|
|
1322
|
-
}], ctorParameters: () => [] });
|
|
1323
|
-
|
|
1324
|
-
//#region ---- Imports ----
|
|
1325
|
-
//#endregion
|
|
1326
|
-
//#region ---- Entity Factory ----
|
|
1327
|
-
async function reservationStatusFactory(injector) {
|
|
1328
|
-
const dataService = injector.get(AXPReservationManagementReservationStatusService);
|
|
1329
|
-
const i18n = RootConfig.config.i18n;
|
|
1330
|
-
const entityDef = {
|
|
1331
|
-
module: RootConfig.module.name,
|
|
1332
|
-
name: RootConfig.entities.reservationStatus.name,
|
|
1333
|
-
title: RootConfig.entities.reservationStatus.title,
|
|
1334
|
-
icon: RootConfig.entities.reservationStatus.icon,
|
|
1335
|
-
formats: {
|
|
1336
|
-
individual: RootConfig.entities.reservationStatus.title,
|
|
1337
|
-
plural: RootConfig.entities.reservationStatus.titlePlural,
|
|
1338
|
-
searchResult: {
|
|
1339
|
-
title: '{{ title }}',
|
|
1340
|
-
description: '{{ code }}',
|
|
1341
|
-
},
|
|
1342
|
-
},
|
|
1343
|
-
groups: [
|
|
1344
|
-
{
|
|
1345
|
-
id: 'basic-information',
|
|
1346
|
-
title: '@reservation-management:reservation-statuses.entities.reservation-status.groups.basic-information',
|
|
1347
|
-
},
|
|
1348
|
-
],
|
|
1349
|
-
properties: [
|
|
1350
|
-
{
|
|
1351
|
-
name: 'id',
|
|
1352
|
-
title: '@general:terms.common.id',
|
|
1353
|
-
schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
|
|
1354
|
-
},
|
|
1355
|
-
{
|
|
1356
|
-
name: 'code',
|
|
1357
|
-
title: '@reservation-management:reservation-statuses.entities.reservation-status.fields.code.title',
|
|
1358
|
-
groupId: 'basic-information',
|
|
1359
|
-
schema: {
|
|
1360
|
-
dataType: 'string',
|
|
1361
|
-
interface: {
|
|
1362
|
-
type: AXPWidgetsList.Editors.TextBox,
|
|
1363
|
-
options: {
|
|
1364
|
-
placeholder: '@reservation-management:reservation-statuses.entities.reservation-status.fields.code.placeholder',
|
|
1365
|
-
},
|
|
1366
|
-
},
|
|
1367
|
-
},
|
|
1368
|
-
options: {
|
|
1369
|
-
sort: { enabled: true },
|
|
1370
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
1371
|
-
},
|
|
1372
|
-
validations: [{ rule: 'required' }, { rule: 'unique' }],
|
|
1373
|
-
},
|
|
1374
|
-
{
|
|
1375
|
-
name: 'title',
|
|
1376
|
-
title: '@reservation-management:reservation-statuses.entities.reservation-status.fields.title.title',
|
|
1377
|
-
groupId: 'basic-information',
|
|
1378
|
-
schema: {
|
|
1379
|
-
dataType: 'string',
|
|
1380
|
-
interface: {
|
|
1381
|
-
type: AXPWidgetsList.Editors.TextBox,
|
|
1382
|
-
options: {
|
|
1383
|
-
placeholder: '@reservation-management:reservation-statuses.entities.reservation-status.fields.title.placeholder',
|
|
1384
|
-
},
|
|
1385
|
-
},
|
|
1386
|
-
},
|
|
1387
|
-
options: {
|
|
1388
|
-
sort: { enabled: true },
|
|
1389
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
1390
|
-
},
|
|
1391
|
-
validations: [{ rule: 'required' }],
|
|
1392
|
-
},
|
|
1393
|
-
{
|
|
1394
|
-
name: 'color',
|
|
1395
|
-
title: '@reservation-management:reservation-statuses.entities.reservation-status.fields.color.title',
|
|
1396
|
-
groupId: 'basic-information',
|
|
1397
|
-
schema: {
|
|
1398
|
-
dataType: 'string',
|
|
1399
|
-
interface: {
|
|
1400
|
-
type: AXPWidgetsList.Editors.ColorPalette,
|
|
1401
|
-
options: {},
|
|
1402
|
-
},
|
|
1403
|
-
},
|
|
1404
|
-
options: {
|
|
1405
|
-
sort: { enabled: false },
|
|
1406
|
-
filter: { advance: { enabled: true }, inline: { enabled: false } },
|
|
1407
|
-
},
|
|
1408
|
-
validations: [{ rule: 'required' }],
|
|
1409
|
-
},
|
|
1410
|
-
{
|
|
1411
|
-
name: 'order',
|
|
1412
|
-
title: '@reservation-management:reservation-statuses.entities.reservation-status.fields.order.title',
|
|
1413
|
-
groupId: 'basic-information',
|
|
1414
|
-
schema: {
|
|
1415
|
-
dataType: 'number',
|
|
1416
|
-
interface: {
|
|
1417
|
-
type: AXPWidgetsList.Editors.NumberBox,
|
|
1418
|
-
options: {
|
|
1419
|
-
minValue: 0,
|
|
1420
|
-
},
|
|
1421
|
-
},
|
|
1422
|
-
},
|
|
1423
|
-
options: {
|
|
1424
|
-
sort: { enabled: true },
|
|
1425
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
1426
|
-
},
|
|
1427
|
-
},
|
|
1428
|
-
],
|
|
1429
|
-
columns: [{ name: 'code' }, { name: 'title' }, { name: 'color' }],
|
|
1430
|
-
commands: {
|
|
1431
|
-
create: {
|
|
1432
|
-
execute: async (data) => {
|
|
1433
|
-
return { id: await dataService.insertOne(data) };
|
|
1434
|
-
},
|
|
1435
|
-
},
|
|
1436
|
-
update: {
|
|
1437
|
-
execute: async (data) => {
|
|
1438
|
-
return await dataService.updateOne(data.id, data);
|
|
1439
|
-
},
|
|
1440
|
-
},
|
|
1441
|
-
delete: {
|
|
1442
|
-
execute: async (id) => {
|
|
1443
|
-
return await dataService.deleteOne(id);
|
|
1444
|
-
},
|
|
1445
|
-
},
|
|
1446
|
-
},
|
|
1447
|
-
queries: {
|
|
1448
|
-
byKey: {
|
|
1449
|
-
execute: async (id) => {
|
|
1450
|
-
return await dataService.getOne(id);
|
|
1451
|
-
},
|
|
1452
|
-
type: AXPEntityQueryType.Single,
|
|
1453
|
-
},
|
|
1454
|
-
list: {
|
|
1455
|
-
execute: async (e) => {
|
|
1456
|
-
return await dataService.query({
|
|
1457
|
-
skip: e.skip,
|
|
1458
|
-
take: e.take,
|
|
1459
|
-
filter: e.filter,
|
|
1460
|
-
sort: e.sort,
|
|
1461
|
-
});
|
|
1462
|
-
},
|
|
1463
|
-
type: AXPEntityQueryType.List,
|
|
1464
|
-
},
|
|
1465
|
-
},
|
|
1466
|
-
interfaces: {
|
|
1467
|
-
master: {
|
|
1468
|
-
create: {
|
|
1469
|
-
sections: [{ id: 'basic-information' }],
|
|
1470
|
-
properties: [
|
|
1471
|
-
{ name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1472
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1473
|
-
{ name: 'color', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1474
|
-
{ name: 'order', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1475
|
-
],
|
|
1476
|
-
},
|
|
1477
|
-
update: {
|
|
1478
|
-
sections: [{ id: 'basic-information' }],
|
|
1479
|
-
properties: [
|
|
1480
|
-
{ name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1481
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1482
|
-
{ name: 'color', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1483
|
-
{ name: 'order', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1484
|
-
],
|
|
1485
|
-
},
|
|
1486
|
-
single: {
|
|
1487
|
-
title: '{{ title }}',
|
|
1488
|
-
sections: [{ id: 'basic-information' }],
|
|
1489
|
-
properties: [
|
|
1490
|
-
{ name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1491
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1492
|
-
{ name: 'color', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1493
|
-
{ name: 'order', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1494
|
-
],
|
|
1495
|
-
actions: [...entityMasterRecordActions()],
|
|
1496
|
-
},
|
|
1497
|
-
list: {
|
|
1498
|
-
actions: [...entityMasterCrudActions()],
|
|
1499
|
-
views: [
|
|
1500
|
-
createAllQueryView({
|
|
1501
|
-
sorts: [
|
|
1502
|
-
{ name: 'order', dir: 'asc' },
|
|
1503
|
-
{ name: 'code', dir: 'asc' },
|
|
1504
|
-
],
|
|
1505
|
-
}),
|
|
1506
|
-
],
|
|
1507
|
-
},
|
|
1508
|
-
},
|
|
1509
|
-
},
|
|
1510
|
-
};
|
|
1511
|
-
return entityDef;
|
|
1512
|
-
}
|
|
1513
|
-
//#endregion
|
|
1514
|
-
|
|
1515
|
-
var reservationStatus_entity = /*#__PURE__*/Object.freeze({
|
|
1516
|
-
__proto__: null,
|
|
1517
|
-
reservationStatusFactory: reservationStatusFactory
|
|
1518
|
-
});
|
|
1519
|
-
|
|
1520
|
-
//#region ---- Imports ----
|
|
1521
|
-
//#endregion
|
|
1522
|
-
//#region ---- Reservation Status Entity Module ----
|
|
1523
|
-
class AXPReservationManagementReservationStatusEntityModule {
|
|
1524
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationStatusEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1525
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationStatusEntityModule }); }
|
|
1526
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationStatusEntityModule, providers: [
|
|
1527
|
-
{
|
|
1528
|
-
provide: AXPReservationManagementReservationStatusService,
|
|
1529
|
-
useClass: AXPReservationManagementReservationStatusServiceImpl,
|
|
1530
|
-
},
|
|
1531
|
-
] }); }
|
|
1532
|
-
}
|
|
1533
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationStatusEntityModule, decorators: [{
|
|
1534
|
-
type: NgModule,
|
|
1535
|
-
args: [{
|
|
1536
|
-
providers: [
|
|
1537
|
-
{
|
|
1538
|
-
provide: AXPReservationManagementReservationStatusService,
|
|
1539
|
-
useClass: AXPReservationManagementReservationStatusServiceImpl,
|
|
1540
|
-
},
|
|
1541
|
-
],
|
|
1542
|
-
}]
|
|
1543
|
-
}] });
|
|
1544
|
-
|
|
1545
|
-
//#region ---- Imports ----
|
|
1546
|
-
//#endregion
|
|
1547
|
-
//#region ---- Service ----
|
|
1548
|
-
class AXPReservationManagementReservationTypeService extends AXMEntityCrudServiceImpl {
|
|
1549
|
-
}
|
|
1550
|
-
class AXPReservationManagementReservationTypeServiceImpl extends AXPReservationManagementReservationTypeService {
|
|
1551
|
-
constructor() {
|
|
1552
|
-
super(`${RootConfig.module.name}.${RootConfig.entities.reservationType.name}`);
|
|
1553
|
-
}
|
|
1554
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationTypeServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1555
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationTypeServiceImpl, providedIn: 'root' }); }
|
|
1556
|
-
}
|
|
1557
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationTypeServiceImpl, decorators: [{
|
|
1558
|
-
type: Injectable,
|
|
1559
|
-
args: [{
|
|
1560
|
-
providedIn: 'root',
|
|
1561
|
-
}]
|
|
1562
|
-
}], ctorParameters: () => [] });
|
|
1563
|
-
|
|
1564
|
-
//#region ---- Imports ----
|
|
1565
|
-
//#endregion
|
|
1566
|
-
//#region ---- Entity Factory ----
|
|
1567
|
-
async function reservationTypeFactory(injector) {
|
|
1568
|
-
const dataService = injector.get(AXPReservationManagementReservationTypeService);
|
|
1569
|
-
const i18n = RootConfig.config.i18n;
|
|
1570
|
-
const entityDef = {
|
|
1571
|
-
module: RootConfig.module.name,
|
|
1572
|
-
name: RootConfig.entities.reservationType.name,
|
|
1573
|
-
title: RootConfig.entities.reservationType.title,
|
|
1574
|
-
icon: RootConfig.entities.reservationType.icon,
|
|
1575
|
-
plugins: [{ name: 'archive' }],
|
|
1576
|
-
formats: {
|
|
1577
|
-
individual: RootConfig.entities.reservationType.title,
|
|
1578
|
-
plural: RootConfig.entities.reservationType.titlePlural,
|
|
1579
|
-
searchResult: {
|
|
1580
|
-
title: '{{ title }}',
|
|
1581
|
-
description: '{{ code }}',
|
|
1582
|
-
},
|
|
1583
|
-
},
|
|
1584
|
-
groups: [
|
|
1585
|
-
{
|
|
1586
|
-
id: 'basic-information',
|
|
1587
|
-
title: '@reservation-management:reservation-types.entities.reservation-type.groups.basic-information',
|
|
1588
|
-
},
|
|
1589
|
-
],
|
|
1590
|
-
properties: [
|
|
1591
|
-
{
|
|
1592
|
-
name: 'id',
|
|
1593
|
-
title: '@general:terms.common.id',
|
|
1594
|
-
schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
|
|
1595
|
-
},
|
|
1596
|
-
{
|
|
1597
|
-
name: 'code',
|
|
1598
|
-
title: '@reservation-management:reservation-types.entities.reservation-type.fields.code.title',
|
|
1599
|
-
groupId: 'basic-information',
|
|
1600
|
-
schema: {
|
|
1601
|
-
dataType: 'number',
|
|
1602
|
-
interface: {
|
|
1603
|
-
type: AXPWidgetsList.Editors.TextBox,
|
|
1604
|
-
options: {
|
|
1605
|
-
placeholder: '@reservation-management:reservation-types.entities.reservation-type.fields.code.placeholder',
|
|
1606
|
-
},
|
|
1607
|
-
},
|
|
1608
|
-
},
|
|
1609
|
-
options: {
|
|
1610
|
-
sort: { enabled: true },
|
|
1611
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
1612
|
-
},
|
|
1613
|
-
validations: [{ rule: 'required' }],
|
|
1614
|
-
},
|
|
1615
|
-
{
|
|
1616
|
-
name: 'title',
|
|
1617
|
-
title: '@reservation-management:reservation-types.entities.reservation-type.fields.title.title',
|
|
1618
|
-
groupId: 'basic-information',
|
|
1619
|
-
schema: {
|
|
1620
|
-
dataType: 'string',
|
|
1621
|
-
interface: {
|
|
1622
|
-
type: AXPWidgetsList.Editors.TextBox,
|
|
1623
|
-
options: {
|
|
1624
|
-
placeholder: '@reservation-management:reservation-types.entities.reservation-type.fields.title.placeholder',
|
|
1625
|
-
},
|
|
1626
|
-
},
|
|
1627
|
-
},
|
|
1628
|
-
options: {
|
|
1629
|
-
sort: { enabled: true },
|
|
1630
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
1631
|
-
},
|
|
1632
|
-
validations: [{ rule: 'required' }],
|
|
1633
|
-
},
|
|
1634
|
-
{
|
|
1635
|
-
name: 'resourceEntityIds',
|
|
1636
|
-
title: '@reservation-management:reservation-types.entities.reservation-type.fields.resource-entity-ids.title',
|
|
1637
|
-
groupId: 'basic-information',
|
|
1638
|
-
schema: {
|
|
1639
|
-
dataType: 'array',
|
|
1640
|
-
interface: {
|
|
1641
|
-
type: AXPWidgetsCatalog.lookup,
|
|
1642
|
-
options: {
|
|
1643
|
-
// TODO: Replace with actual Registry entity path when available
|
|
1644
|
-
// For now using a placeholder - this should be a lookup to system entity registry
|
|
1645
|
-
entity: 'PlatformManagement.EntityRegistry', // Placeholder - adjust as needed
|
|
1646
|
-
multiple: true,
|
|
1647
|
-
look: 'tagbox',
|
|
1648
|
-
textField: 'entityId',
|
|
1649
|
-
valueField: 'entityId',
|
|
1650
|
-
columns: ['entityId', 'module', 'title'],
|
|
1651
|
-
},
|
|
1652
|
-
},
|
|
1653
|
-
},
|
|
1654
|
-
options: {
|
|
1655
|
-
sort: { enabled: false },
|
|
1656
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
1657
|
-
},
|
|
1658
|
-
},
|
|
1659
|
-
],
|
|
1660
|
-
columns: [{ name: 'code' }, { name: 'title' }, { name: 'resourceEntityIds' }],
|
|
1661
|
-
commands: {
|
|
1662
|
-
create: {
|
|
1663
|
-
execute: async (data) => {
|
|
1664
|
-
return { id: await dataService.insertOne(data) };
|
|
1665
|
-
},
|
|
1666
|
-
},
|
|
1667
|
-
update: {
|
|
1668
|
-
execute: async (data) => {
|
|
1669
|
-
return await dataService.updateOne(data.id, data);
|
|
1670
|
-
},
|
|
1671
|
-
},
|
|
1672
|
-
delete: {
|
|
1673
|
-
execute: async (id) => {
|
|
1674
|
-
return await dataService.deleteOne(id);
|
|
1675
|
-
},
|
|
1676
|
-
},
|
|
1677
|
-
},
|
|
1678
|
-
queries: {
|
|
1679
|
-
byKey: {
|
|
1680
|
-
execute: async (id) => {
|
|
1681
|
-
return await dataService.getOne(id);
|
|
1682
|
-
},
|
|
1683
|
-
type: AXPEntityQueryType.Single,
|
|
1684
|
-
},
|
|
1685
|
-
list: {
|
|
1686
|
-
execute: async (e) => {
|
|
1687
|
-
return await dataService.query({
|
|
1688
|
-
skip: e.skip,
|
|
1689
|
-
take: e.take,
|
|
1690
|
-
filter: e.filter,
|
|
1691
|
-
sort: e.sort,
|
|
1692
|
-
});
|
|
1693
|
-
},
|
|
1694
|
-
type: AXPEntityQueryType.List,
|
|
1695
|
-
},
|
|
1696
|
-
},
|
|
1697
|
-
interfaces: {
|
|
1698
|
-
master: {
|
|
1699
|
-
create: {
|
|
1700
|
-
sections: [{ id: 'basic-information' }],
|
|
1701
|
-
properties: [
|
|
1702
|
-
{ name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1703
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1704
|
-
{ name: 'resourceEntityIds', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
1705
|
-
],
|
|
1706
|
-
},
|
|
1707
|
-
update: {
|
|
1708
|
-
sections: [{ id: 'basic-information' }],
|
|
1709
|
-
properties: [
|
|
1710
|
-
{ name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1711
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1712
|
-
{ name: 'resourceEntityIds', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
1713
|
-
],
|
|
1714
|
-
},
|
|
1715
|
-
single: {
|
|
1716
|
-
title: '{{ title }}',
|
|
1717
|
-
sections: [{ id: 'basic-information' }],
|
|
1718
|
-
properties: [
|
|
1719
|
-
{ name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1720
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
1721
|
-
{ name: 'resourceEntityIds', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
1722
|
-
],
|
|
1723
|
-
actions: [...entityMasterRecordActions()],
|
|
1724
|
-
},
|
|
1725
|
-
list: {
|
|
1726
|
-
actions: [
|
|
1727
|
-
...entityMasterCrudActions(),
|
|
1728
|
-
{
|
|
1729
|
-
title: '@general:actions.archive.title',
|
|
1730
|
-
command: 'archive-entity',
|
|
1731
|
-
priority: 'secondary',
|
|
1732
|
-
type: AXPSystemActionType.Archive,
|
|
1733
|
-
scope: AXPEntityCommandScope.Individual,
|
|
1734
|
-
},
|
|
1735
|
-
],
|
|
1736
|
-
views: [
|
|
1737
|
-
createAllQueryView({
|
|
1738
|
-
sorts: [{ name: 'code', dir: 'asc' }],
|
|
1739
|
-
}),
|
|
1740
|
-
],
|
|
1741
|
-
},
|
|
1742
|
-
},
|
|
1743
|
-
},
|
|
1744
|
-
};
|
|
1745
|
-
return entityDef;
|
|
1746
|
-
}
|
|
1747
|
-
//#endregion
|
|
1748
|
-
|
|
1749
|
-
var reservationType_entity = /*#__PURE__*/Object.freeze({
|
|
1750
|
-
__proto__: null,
|
|
1751
|
-
reservationTypeFactory: reservationTypeFactory
|
|
1752
|
-
});
|
|
1753
|
-
|
|
1754
|
-
//#region ---- Imports ----
|
|
1755
|
-
//#endregion
|
|
1756
|
-
//#region ---- Reservation Type Entity Module ----
|
|
1757
|
-
class AXPReservationManagementReservationTypeEntityModule {
|
|
1758
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationTypeEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1759
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationTypeEntityModule }); }
|
|
1760
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationTypeEntityModule, providers: [
|
|
1761
|
-
{
|
|
1762
|
-
provide: AXPReservationManagementReservationTypeService,
|
|
1763
|
-
useClass: AXPReservationManagementReservationTypeServiceImpl,
|
|
1764
|
-
},
|
|
1765
|
-
] }); }
|
|
1766
|
-
}
|
|
1767
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationTypeEntityModule, decorators: [{
|
|
1768
|
-
type: NgModule,
|
|
1769
|
-
args: [{
|
|
1770
|
-
providers: [
|
|
1771
|
-
{
|
|
1772
|
-
provide: AXPReservationManagementReservationTypeService,
|
|
1773
|
-
useClass: AXPReservationManagementReservationTypeServiceImpl,
|
|
1774
|
-
},
|
|
1775
|
-
],
|
|
1776
|
-
}]
|
|
1777
|
-
}] });
|
|
1778
|
-
|
|
1779
|
-
class AXMReservationManagementEntityProvider {
|
|
1780
|
-
constructor() {
|
|
1781
|
-
this.injector = inject(Injector);
|
|
1782
|
-
}
|
|
1783
|
-
preload() {
|
|
1784
|
-
const module = RootConfig.module.name;
|
|
1785
|
-
return Array.from(Object.values(RootConfig.entities)).map((entity) => ({
|
|
1786
|
-
module: module,
|
|
1787
|
-
entity: entity.name,
|
|
1788
|
-
}));
|
|
1789
|
-
}
|
|
1790
|
-
async get(moduleName, entityName) {
|
|
1791
|
-
if (moduleName == RootConfig.module.name) {
|
|
1792
|
-
switch (entityName) {
|
|
1793
|
-
case RootConfig.entities.reservationType.name:
|
|
1794
|
-
return (await Promise.resolve().then(function () { return reservationType_entity; })).reservationTypeFactory(this.injector);
|
|
1795
|
-
case RootConfig.entities.reservationStatus.name:
|
|
1796
|
-
return (await Promise.resolve().then(function () { return reservationStatus_entity; })).reservationStatusFactory(this.injector);
|
|
1797
|
-
case RootConfig.entities.reservationClass.name:
|
|
1798
|
-
return (await Promise.resolve().then(function () { return reservationClass_entity; })).reservationClassFactory(this.injector);
|
|
1799
|
-
case RootConfig.entities.reservationEvent.name:
|
|
1800
|
-
return (await Promise.resolve().then(function () { return reservationEvent_entity; })).reservationEventFactory(this.injector);
|
|
1801
|
-
case RootConfig.entities.reservation.name:
|
|
1802
|
-
return (await Promise.resolve().then(function () { return reservation_entity; })).reservationFactory(this.injector);
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
return null;
|
|
1806
|
-
}
|
|
1807
|
-
async list() {
|
|
1808
|
-
const m = RootConfig.module.name;
|
|
1809
|
-
return Promise.resolve(Object.values(RootConfig.entities).map((e) => ({ name: e.name, module: m })));
|
|
1810
|
-
}
|
|
1811
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMReservationManagementEntityProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1812
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMReservationManagementEntityProvider }); }
|
|
1813
|
-
}
|
|
1814
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMReservationManagementEntityProvider, decorators: [{
|
|
1815
|
-
type: Injectable
|
|
1816
|
-
}] });
|
|
1817
|
-
|
|
1818
|
-
var entity_provider = /*#__PURE__*/Object.freeze({
|
|
1819
|
-
__proto__: null,
|
|
1820
|
-
AXMReservationManagementEntityProvider: AXMReservationManagementEntityProvider
|
|
1821
|
-
});
|
|
1822
|
-
|
|
1823
|
-
//#region ---- Imports ----
|
|
1824
|
-
//#endregion
|
|
1825
|
-
//#region ---- Service ----
|
|
1826
|
-
class AXPReservationService {
|
|
1827
|
-
constructor() {
|
|
1828
|
-
this.reservationService = inject(AXPReservationManagementReservationService);
|
|
1829
|
-
this.reservationClassService = inject(AXPReservationManagementReservationClassService);
|
|
1830
|
-
this.reservationTypeService = inject(AXPReservationManagementReservationTypeService);
|
|
1831
|
-
this.reservationStatusService = inject(AXPReservationManagementReservationStatusService);
|
|
1832
|
-
}
|
|
1833
|
-
/**
|
|
1834
|
-
* Get available reservation classes for a resource type
|
|
1835
|
-
*/
|
|
1836
|
-
async getAvailableClasses(reservationTypeId) {
|
|
1837
|
-
const result = await this.reservationClassService.query({
|
|
1838
|
-
skip: 0,
|
|
1839
|
-
take: 100,
|
|
1840
|
-
filter: {
|
|
1841
|
-
logic: 'and',
|
|
1842
|
-
filters: [
|
|
1843
|
-
{
|
|
1844
|
-
field: 'reservationTypeId',
|
|
1845
|
-
operator: { type: 'equal' },
|
|
1846
|
-
value: reservationTypeId,
|
|
1847
|
-
},
|
|
1848
|
-
{
|
|
1849
|
-
field: 'isActive',
|
|
1850
|
-
operator: { type: 'equal' },
|
|
1851
|
-
value: true,
|
|
1852
|
-
},
|
|
1853
|
-
],
|
|
1854
|
-
},
|
|
1855
|
-
});
|
|
1856
|
-
return result.items || [];
|
|
1857
|
-
}
|
|
1858
|
-
/**
|
|
1859
|
-
* Get reservations for a resource
|
|
1860
|
-
*/
|
|
1861
|
-
async getReservations(resourceEntityId, resourceId, startDate, endDate) {
|
|
1862
|
-
const filter = {
|
|
1863
|
-
logic: 'and',
|
|
1864
|
-
filters: [
|
|
1865
|
-
{
|
|
1866
|
-
field: 'resourceEntityId',
|
|
1867
|
-
operator: { type: 'equal' },
|
|
1868
|
-
value: resourceEntityId,
|
|
1869
|
-
},
|
|
1870
|
-
{
|
|
1871
|
-
field: 'resourceId',
|
|
1872
|
-
operator: { type: 'equal' },
|
|
1873
|
-
value: resourceId,
|
|
1874
|
-
},
|
|
1875
|
-
],
|
|
1876
|
-
};
|
|
1877
|
-
if (startDate && endDate) {
|
|
1878
|
-
filter.filters.push({
|
|
1879
|
-
logic: 'or',
|
|
1880
|
-
filters: [
|
|
1881
|
-
{
|
|
1882
|
-
field: 'startDate',
|
|
1883
|
-
operator: { type: 'between' },
|
|
1884
|
-
value: [startDate, endDate],
|
|
1885
|
-
},
|
|
1886
|
-
{
|
|
1887
|
-
field: 'endDate',
|
|
1888
|
-
operator: { type: 'between' },
|
|
1889
|
-
value: [startDate, endDate],
|
|
1890
|
-
},
|
|
1891
|
-
],
|
|
1892
|
-
});
|
|
1893
|
-
}
|
|
1894
|
-
const result = await this.reservationService.query({
|
|
1895
|
-
skip: 0,
|
|
1896
|
-
take: 1000,
|
|
1897
|
-
filter,
|
|
1898
|
-
sort: [{ field: 'startDate', dir: 'asc' }],
|
|
1899
|
-
});
|
|
1900
|
-
return result.items || [];
|
|
1901
|
-
}
|
|
1902
|
-
/**
|
|
1903
|
-
* Check for conflicts
|
|
1904
|
-
*/
|
|
1905
|
-
async checkConflict(resourceEntityId, resourceId, startDate, endDate, excludeReservationId) {
|
|
1906
|
-
const reservations = await this.getReservations(resourceEntityId, resourceId, startDate, endDate);
|
|
1907
|
-
const conflicts = [];
|
|
1908
|
-
for (const reservation of reservations) {
|
|
1909
|
-
if (excludeReservationId && reservation.id === excludeReservationId) {
|
|
1910
|
-
continue;
|
|
1911
|
-
}
|
|
1912
|
-
// Check if dates overlap
|
|
1913
|
-
if ((reservation.startDate <= startDate && reservation.endDate >= startDate) ||
|
|
1914
|
-
(reservation.startDate <= endDate && reservation.endDate >= endDate) ||
|
|
1915
|
-
(reservation.startDate >= startDate && reservation.endDate <= endDate)) {
|
|
1916
|
-
// If it's a blocking hold, always conflict
|
|
1917
|
-
if (reservation.reservationKind === 'hold' && reservation.isBlocking) {
|
|
1918
|
-
conflicts.push({
|
|
1919
|
-
reservationId: reservation.id,
|
|
1920
|
-
startDate: reservation.startDate,
|
|
1921
|
-
endDate: reservation.endDate,
|
|
1922
|
-
kind: reservation.reservationKind,
|
|
1923
|
-
isBlocking: reservation.isBlocking,
|
|
1924
|
-
});
|
|
1925
|
-
}
|
|
1926
|
-
else if (reservation.reservationKind === 'reservation') {
|
|
1927
|
-
// Check conflict policy from class
|
|
1928
|
-
// For now, treat all reservations as potential conflicts
|
|
1929
|
-
conflicts.push({
|
|
1930
|
-
reservationId: reservation.id,
|
|
1931
|
-
startDate: reservation.startDate,
|
|
1932
|
-
endDate: reservation.endDate,
|
|
1933
|
-
kind: reservation.reservationKind,
|
|
1934
|
-
isBlocking: false,
|
|
1935
|
-
});
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
}
|
|
1939
|
-
return conflicts;
|
|
1940
|
-
}
|
|
1941
|
-
/**
|
|
1942
|
-
* Create a reservation
|
|
1943
|
-
*/
|
|
1944
|
-
async createReservation(data, resourceEntityId, resourceId) {
|
|
1945
|
-
const reservationData = {
|
|
1946
|
-
reservationClassId: data.reservationClassId,
|
|
1947
|
-
resourceEntityId,
|
|
1948
|
-
resourceId,
|
|
1949
|
-
startDate: data.startDateTime,
|
|
1950
|
-
endDate: data.endDateTime,
|
|
1951
|
-
note: data.note,
|
|
1952
|
-
reservationKind: 'reservation',
|
|
1953
|
-
// Get initial status from class
|
|
1954
|
-
// This should be set based on class allowed statuses
|
|
1955
|
-
};
|
|
1956
|
-
return await this.reservationService.insertOne(reservationData);
|
|
1957
|
-
}
|
|
1958
|
-
/**
|
|
1959
|
-
* Create a hold
|
|
1960
|
-
*/
|
|
1961
|
-
async createHold(data, resourceEntityId, resourceId) {
|
|
1962
|
-
const holdData = {
|
|
1963
|
-
resourceEntityId,
|
|
1964
|
-
resourceId,
|
|
1965
|
-
startDate: data.startDateTime,
|
|
1966
|
-
endDate: data.endDateTime,
|
|
1967
|
-
isBlocking: data.isBlocking,
|
|
1968
|
-
note: data.holdReason,
|
|
1969
|
-
reservationKind: 'hold',
|
|
1970
|
-
// Hold type should be stored in a field
|
|
1971
|
-
};
|
|
1972
|
-
return await this.reservationService.insertOne(holdData);
|
|
1973
|
-
}
|
|
1974
|
-
/**
|
|
1975
|
-
* Get available transitions for a reservation
|
|
1976
|
-
*/
|
|
1977
|
-
async getAvailableTransitions(reservationId) {
|
|
1978
|
-
// Get reservation to find its class
|
|
1979
|
-
const reservation = await this.reservationService.getOne(reservationId);
|
|
1980
|
-
if (!reservation || !reservation.reservationClassId) {
|
|
1981
|
-
return [];
|
|
1982
|
-
}
|
|
1983
|
-
// Get class to find transitions
|
|
1984
|
-
const reservationClass = await this.reservationClassService.getOne(reservation.reservationClassId);
|
|
1985
|
-
if (!reservationClass || !reservationClass.transitions) {
|
|
1986
|
-
return [];
|
|
1987
|
-
}
|
|
1988
|
-
// Filter active transitions that match current status
|
|
1989
|
-
return reservationClass.transitions.filter((t) => t.isActive && t.fromStatusId === reservation.reservationStatusId);
|
|
1990
|
-
}
|
|
1991
|
-
/**
|
|
1992
|
-
* Execute a transition
|
|
1993
|
-
*/
|
|
1994
|
-
async executeTransition(data) {
|
|
1995
|
-
// Get transition details
|
|
1996
|
-
const reservation = await this.reservationService.getOne(data.reservationId);
|
|
1997
|
-
if (!reservation) {
|
|
1998
|
-
throw new Error('Reservation not found');
|
|
1999
|
-
}
|
|
2000
|
-
const reservationClass = await this.reservationClassService.getOne(reservation.reservationClassId);
|
|
2001
|
-
if (!reservationClass || !reservationClass.transitions) {
|
|
2002
|
-
throw new Error('Transition not found');
|
|
2003
|
-
}
|
|
2004
|
-
const transition = reservationClass.transitions.find((t) => t.id === data.transitionId);
|
|
2005
|
-
if (!transition) {
|
|
2006
|
-
throw new Error('Transition not found');
|
|
2007
|
-
}
|
|
2008
|
-
// Update reservation status
|
|
2009
|
-
await this.reservationService.updateOne(data.reservationId, {
|
|
2010
|
-
reservationStatusId: transition.toStatusId,
|
|
2011
|
-
});
|
|
2012
|
-
// Create event record
|
|
2013
|
-
// This should be done through ReservationEvent entity
|
|
2014
|
-
}
|
|
2015
|
-
/**
|
|
2016
|
-
* Resolve reservation type from code
|
|
2017
|
-
*/
|
|
2018
|
-
async resolveReservationType(code) {
|
|
2019
|
-
const result = await this.reservationTypeService.query({
|
|
2020
|
-
skip: 0,
|
|
2021
|
-
take: 1,
|
|
2022
|
-
filter: {
|
|
2023
|
-
logic: 'and',
|
|
2024
|
-
filters: [
|
|
2025
|
-
{
|
|
2026
|
-
field: 'code',
|
|
2027
|
-
operator: { type: 'equal' },
|
|
2028
|
-
value: code,
|
|
2029
|
-
},
|
|
2030
|
-
],
|
|
2031
|
-
},
|
|
2032
|
-
});
|
|
2033
|
-
if (result.items && result.items.length > 0) {
|
|
2034
|
-
return result.items[0].id;
|
|
2035
|
-
}
|
|
2036
|
-
return null;
|
|
2037
|
-
}
|
|
2038
|
-
/**
|
|
2039
|
-
* Get widget context (statuses, transitions, policy)
|
|
2040
|
-
*/
|
|
2041
|
-
async getWidgetContext(params) {
|
|
2042
|
-
const { classId, reservationTypeId } = params;
|
|
2043
|
-
// If classId is provided, get statuses and transitions from class
|
|
2044
|
-
if (classId) {
|
|
2045
|
-
const reservationClass = await this.reservationClassService.getOne(classId);
|
|
2046
|
-
if (reservationClass) {
|
|
2047
|
-
// Get allowed statuses
|
|
2048
|
-
const allowedStatusIds = reservationClass.allowedStatuses?.map((s) => s.reservationStatusId).filter(Boolean) || [];
|
|
2049
|
-
const statuses = allowedStatusIds.length
|
|
2050
|
-
? await Promise.all(allowedStatusIds.map((id) => this.reservationStatusService.getOne(id).catch(() => null)))
|
|
2051
|
-
: [];
|
|
2052
|
-
// Get transitions
|
|
2053
|
-
const transitions = reservationClass.transitions?.filter((t) => t.isActive) || [];
|
|
2054
|
-
return {
|
|
2055
|
-
statuses: statuses.filter(Boolean),
|
|
2056
|
-
transitions,
|
|
2057
|
-
policy: {
|
|
2058
|
-
conflictPolicy: reservationClass.conflictPolicy,
|
|
2059
|
-
allowHold: reservationClass.allowHold,
|
|
2060
|
-
requiresApproval: reservationClass.requiresApproval,
|
|
2061
|
-
},
|
|
2062
|
-
};
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
// Fallback: get all active statuses
|
|
2066
|
-
const allStatusesResult = await this.reservationStatusService.query({
|
|
2067
|
-
skip: 0,
|
|
2068
|
-
take: 100,
|
|
2069
|
-
filter: {
|
|
2070
|
-
logic: 'and',
|
|
2071
|
-
filters: [
|
|
2072
|
-
{
|
|
2073
|
-
field: 'isActive',
|
|
2074
|
-
operator: { type: 'equal' },
|
|
2075
|
-
value: true,
|
|
2076
|
-
},
|
|
2077
|
-
],
|
|
2078
|
-
},
|
|
2079
|
-
sort: [{ field: 'order', dir: 'asc' }],
|
|
2080
|
-
});
|
|
2081
|
-
return {
|
|
2082
|
-
statuses: allStatusesResult.items || [],
|
|
2083
|
-
transitions: [],
|
|
2084
|
-
policy: {},
|
|
2085
|
-
};
|
|
2086
|
-
}
|
|
2087
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2088
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationService, providedIn: 'root' }); }
|
|
2089
|
-
}
|
|
2090
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationService, decorators: [{
|
|
2091
|
-
type: Injectable,
|
|
2092
|
-
args: [{ providedIn: 'root' }]
|
|
2093
|
-
}] });
|
|
2094
|
-
|
|
2095
|
-
//#region ---- Imports ----
|
|
2096
|
-
function normalizeReservation(r) {
|
|
2097
|
-
return {
|
|
2098
|
-
id: r.id,
|
|
2099
|
-
kind: (r.kind ?? r.reservationKind),
|
|
2100
|
-
statusId: r.statusId ?? r.reservationStatusId,
|
|
2101
|
-
status: r.status ?? r.reservationStatus,
|
|
2102
|
-
startDate: r.startDate instanceof Date ? r.startDate : new Date(r.startDate),
|
|
2103
|
-
endDate: r.endDate instanceof Date ? r.endDate : new Date(r.endDate),
|
|
2104
|
-
requestedBy: r.requestedByRef ?? r.requestedBy,
|
|
2105
|
-
approvedBy: r.approvedByRef ?? r.approvedBy,
|
|
2106
|
-
note: r.note ?? '',
|
|
2107
|
-
isBlocking: r.isBlocking,
|
|
2108
|
-
};
|
|
2109
|
-
}
|
|
2110
|
-
//#endregion
|
|
2111
|
-
//#region ---- Component ----
|
|
2112
|
-
class AXPReservationPanelWidgetComponent extends AXPValueWidgetComponent {
|
|
2113
|
-
//#endregion
|
|
2114
|
-
//#region ---- Effects ----
|
|
2115
|
-
constructor() {
|
|
2116
|
-
super();
|
|
2117
|
-
//#region ---- Services & Dependencies ----
|
|
2118
|
-
this.reservationService = inject(AXPReservationService);
|
|
2119
|
-
//#endregion
|
|
2120
|
-
//#region ---- Computed Properties from Options ----
|
|
2121
|
-
this.resourceEntityId = computed(() => {
|
|
2122
|
-
const opts = this.options();
|
|
2123
|
-
return opts?.resourceEntityId || '';
|
|
2124
|
-
}, ...(ngDevMode ? [{ debugName: "resourceEntityId" }] : []));
|
|
2125
|
-
this.resourceId = computed(() => {
|
|
2126
|
-
const opts = this.options();
|
|
2127
|
-
const resourceIdOption = opts?.resourceId;
|
|
2128
|
-
if (typeof resourceIdOption === 'string' && resourceIdOption.includes('{{')) {
|
|
2129
|
-
try {
|
|
2130
|
-
const contextId = this.contextService.getValue(this.fullPath()?.split('.').slice(0, -1).join('.') + '.id');
|
|
2131
|
-
if (contextId)
|
|
2132
|
-
return contextId;
|
|
2133
|
-
return this.contextService.getValue('id') || '';
|
|
2134
|
-
}
|
|
2135
|
-
catch {
|
|
2136
|
-
return '';
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
return resourceIdOption || this.contextService.getValue('id') || '';
|
|
2140
|
-
}, ...(ngDevMode ? [{ debugName: "resourceId" }] : []));
|
|
2141
|
-
this.resourceRef = computed(() => {
|
|
2142
|
-
const opts = this.options();
|
|
2143
|
-
return opts?.resourceRef;
|
|
2144
|
-
}, ...(ngDevMode ? [{ debugName: "resourceRef" }] : []));
|
|
2145
|
-
this.reservationTypeId = computed(() => {
|
|
2146
|
-
const opts = this.options();
|
|
2147
|
-
return opts?.reservationTypeId;
|
|
2148
|
-
}, ...(ngDevMode ? [{ debugName: "reservationTypeId" }] : []));
|
|
2149
|
-
this.reservationTypeCode = computed(() => {
|
|
2150
|
-
const opts = this.options();
|
|
2151
|
-
return opts?.reservationTypeCode;
|
|
2152
|
-
}, ...(ngDevMode ? [{ debugName: "reservationTypeCode" }] : []));
|
|
2153
|
-
this.defaultClassId = computed(() => {
|
|
2154
|
-
const opts = this.options();
|
|
2155
|
-
return opts?.defaultClassId;
|
|
2156
|
-
}, ...(ngDevMode ? [{ debugName: "defaultClassId" }] : []));
|
|
2157
|
-
this.displayMode = computed(() => {
|
|
2158
|
-
const opts = this.options();
|
|
2159
|
-
return opts?.mode || 'both';
|
|
2160
|
-
}, ...(ngDevMode ? [{ debugName: "displayMode" }] : []));
|
|
2161
|
-
this.readonly = computed(() => {
|
|
2162
|
-
const opts = this.options();
|
|
2163
|
-
return opts?.readonly || false;
|
|
2164
|
-
}, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
|
|
2165
|
-
this.dateRangeDays = computed(() => {
|
|
2166
|
-
const opts = this.options();
|
|
2167
|
-
return opts?.dateRangeDays || 30;
|
|
2168
|
-
}, ...(ngDevMode ? [{ debugName: "dateRangeDays" }] : []));
|
|
2169
|
-
this.allowHold = computed(() => {
|
|
2170
|
-
const opts = this.options();
|
|
2171
|
-
return opts?.allowHold;
|
|
2172
|
-
}, ...(ngDevMode ? [{ debugName: "allowHold" }] : []));
|
|
2173
|
-
//#endregion
|
|
2174
|
-
//#region ---- State ----
|
|
2175
|
-
this.viewMode = signal('split', ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
|
|
2176
|
-
this.selectedClassId = signal(null, ...(ngDevMode ? [{ debugName: "selectedClassId" }] : []));
|
|
2177
|
-
this.dateFrom = signal(new Date(), ...(ngDevMode ? [{ debugName: "dateFrom" }] : []));
|
|
2178
|
-
this.dateTo = signal(new Date(), ...(ngDevMode ? [{ debugName: "dateTo" }] : []));
|
|
2179
|
-
this.showReservations = signal(true, ...(ngDevMode ? [{ debugName: "showReservations" }] : []));
|
|
2180
|
-
this.showHolds = signal(true, ...(ngDevMode ? [{ debugName: "showHolds" }] : []));
|
|
2181
|
-
this.selectedStatusIds = signal([], ...(ngDevMode ? [{ debugName: "selectedStatusIds" }] : []));
|
|
2182
|
-
this.reservations = signal([], ...(ngDevMode ? [{ debugName: "reservations" }] : []));
|
|
2183
|
-
this.availableClasses = signal([], ...(ngDevMode ? [{ debugName: "availableClasses" }] : []));
|
|
2184
|
-
this.availableStatuses = signal([], ...(ngDevMode ? [{ debugName: "availableStatuses" }] : []));
|
|
2185
|
-
this.transitions = signal([], ...(ngDevMode ? [{ debugName: "transitions" }] : []));
|
|
2186
|
-
this.policy = signal({}, ...(ngDevMode ? [{ debugName: "policy" }] : []));
|
|
2187
|
-
//#endregion
|
|
2188
|
-
//#region ---- Computed ----
|
|
2189
|
-
this.filteredReservations = computed(() => {
|
|
2190
|
-
let filtered = this.reservations();
|
|
2191
|
-
if (!this.showReservations()) {
|
|
2192
|
-
filtered = filtered.filter((r) => r.kind !== 'reservation');
|
|
2193
|
-
}
|
|
2194
|
-
if (!this.showHolds()) {
|
|
2195
|
-
filtered = filtered.filter((r) => r.kind !== 'hold');
|
|
2196
|
-
}
|
|
2197
|
-
const statusIds = this.selectedStatusIds();
|
|
2198
|
-
if (statusIds.length > 0) {
|
|
2199
|
-
filtered = filtered.filter((r) => statusIds.includes(r.statusId));
|
|
2200
|
-
}
|
|
2201
|
-
return filtered;
|
|
2202
|
-
}, ...(ngDevMode ? [{ debugName: "filteredReservations" }] : []));
|
|
2203
|
-
this.classDataSource = computed(() => {
|
|
2204
|
-
return this.availableClasses().map((c) => ({ id: c.id, title: c.title }));
|
|
2205
|
-
}, ...(ngDevMode ? [{ debugName: "classDataSource" }] : []));
|
|
2206
|
-
this.statusDataSource = computed(() => {
|
|
2207
|
-
return this.availableStatuses().map((s) => ({ id: s.id, title: s.title, color: s.color }));
|
|
2208
|
-
}, ...(ngDevMode ? [{ debugName: "statusDataSource" }] : []));
|
|
2209
|
-
this.tableDataSource = computed(() => {
|
|
2210
|
-
const items = this.filteredReservations().map((r) => ({
|
|
2211
|
-
...r,
|
|
2212
|
-
startDate: r.startDate.toISOString(),
|
|
2213
|
-
endDate: r.endDate.toISOString(),
|
|
2214
|
-
statusTitle: r.status?.title || 'Unknown',
|
|
2215
|
-
requestedByName: r.requestedBy?.displayName || r.requestedBy?.name || '-',
|
|
2216
|
-
approvedByName: r.approvedBy?.displayName || r.approvedBy?.name || '-',
|
|
2217
|
-
}));
|
|
2218
|
-
return new AXDataSource({
|
|
2219
|
-
load: async () => ({
|
|
2220
|
-
items,
|
|
2221
|
-
total: items.length,
|
|
2222
|
-
}),
|
|
2223
|
-
pageSize: items.length || 1,
|
|
2224
|
-
key: 'id',
|
|
2225
|
-
});
|
|
2226
|
-
}, ...(ngDevMode ? [{ debugName: "tableDataSource" }] : []));
|
|
2227
|
-
this.timelineDays = computed(() => {
|
|
2228
|
-
const reservations = this.filteredReservations();
|
|
2229
|
-
const days = new Map();
|
|
2230
|
-
reservations.forEach((res) => {
|
|
2231
|
-
const start = new Date(res.startDate);
|
|
2232
|
-
const end = new Date(res.endDate);
|
|
2233
|
-
const current = new Date(start);
|
|
2234
|
-
while (current <= end) {
|
|
2235
|
-
const key = current.toISOString().split('T')[0];
|
|
2236
|
-
if (!days.has(key)) {
|
|
2237
|
-
days.set(key, []);
|
|
2238
|
-
}
|
|
2239
|
-
days.get(key).push(res);
|
|
2240
|
-
current.setDate(current.getDate() + 1);
|
|
2241
|
-
}
|
|
2242
|
-
});
|
|
2243
|
-
return Array.from(days.entries())
|
|
2244
|
-
.map(([dateStr, resList]) => ({
|
|
2245
|
-
date: new Date(dateStr),
|
|
2246
|
-
reservations: resList,
|
|
2247
|
-
}))
|
|
2248
|
-
.sort((a, b) => a.date.getTime() - b.date.getTime());
|
|
2249
|
-
}, ...(ngDevMode ? [{ debugName: "timelineDays" }] : []));
|
|
2250
|
-
// Initialize date range
|
|
2251
|
-
const today = new Date();
|
|
2252
|
-
const days = this.dateRangeDays();
|
|
2253
|
-
this.dateFrom.set(new Date(today.getTime() - days * 24 * 60 * 60 * 1000));
|
|
2254
|
-
this.dateTo.set(new Date(today.getTime() + days * 24 * 60 * 60 * 1000));
|
|
2255
|
-
// Set view mode based on input
|
|
2256
|
-
effect(() => {
|
|
2257
|
-
const mode = this.displayMode();
|
|
2258
|
-
if (mode === 'calendar') {
|
|
2259
|
-
this.viewMode.set('calendar');
|
|
2260
|
-
}
|
|
2261
|
-
else if (mode === 'list') {
|
|
2262
|
-
this.viewMode.set('list');
|
|
2263
|
-
}
|
|
2264
|
-
});
|
|
2265
|
-
// Reactive data loading
|
|
2266
|
-
effect(() => {
|
|
2267
|
-
const resourceId = this.resourceId();
|
|
2268
|
-
const resourceEntityId = this.resourceEntityId();
|
|
2269
|
-
const classId = this.selectedClassId();
|
|
2270
|
-
const from = this.dateFrom();
|
|
2271
|
-
const to = this.dateTo();
|
|
2272
|
-
if (resourceId && resourceEntityId) {
|
|
2273
|
-
this.loadData();
|
|
2274
|
-
}
|
|
2275
|
-
});
|
|
2276
|
-
}
|
|
2277
|
-
//#endregion
|
|
2278
|
-
//#region ---- Methods ----
|
|
2279
|
-
async loadData() {
|
|
2280
|
-
// Resolve reservation type
|
|
2281
|
-
let typeId = this.reservationTypeId();
|
|
2282
|
-
if (!typeId && this.reservationTypeCode()) {
|
|
2283
|
-
typeId = (await this.reservationService.resolveReservationType(this.reservationTypeCode())) || undefined;
|
|
2284
|
-
}
|
|
2285
|
-
if (!typeId) {
|
|
2286
|
-
return;
|
|
2287
|
-
}
|
|
2288
|
-
// Load classes
|
|
2289
|
-
const classes = await this.reservationService.getAvailableClasses(typeId);
|
|
2290
|
-
this.availableClasses.set(classes);
|
|
2291
|
-
// Auto-select class if only one
|
|
2292
|
-
if (classes.length === 1 && !this.selectedClassId()) {
|
|
2293
|
-
this.selectedClassId.set(classes[0].id);
|
|
2294
|
-
}
|
|
2295
|
-
else if (this.defaultClassId() && !this.selectedClassId()) {
|
|
2296
|
-
this.selectedClassId.set(this.defaultClassId());
|
|
2297
|
-
}
|
|
2298
|
-
const classId = this.selectedClassId();
|
|
2299
|
-
const resourceId = this.resourceId();
|
|
2300
|
-
const resourceEntityId = this.resourceEntityId();
|
|
2301
|
-
if (!classId || !resourceId || !resourceEntityId) {
|
|
2302
|
-
return;
|
|
2303
|
-
}
|
|
2304
|
-
// Load context (statuses, transitions, policy)
|
|
2305
|
-
const context = await this.reservationService.getWidgetContext({
|
|
2306
|
-
resourceEntityId,
|
|
2307
|
-
resourceId,
|
|
2308
|
-
reservationTypeId: typeId,
|
|
2309
|
-
classId,
|
|
2310
|
-
});
|
|
2311
|
-
this.availableStatuses.set(context.statuses);
|
|
2312
|
-
this.transitions.set(context.transitions);
|
|
2313
|
-
this.policy.set(context.policy);
|
|
2314
|
-
// Load reservations
|
|
2315
|
-
const reservations = await this.reservationService.getReservations(resourceEntityId, resourceId, this.dateFrom(), this.dateTo());
|
|
2316
|
-
const normalized = reservations.map(normalizeReservation);
|
|
2317
|
-
// Enrich with status data
|
|
2318
|
-
const enriched = normalized.map((res) => ({
|
|
2319
|
-
...res,
|
|
2320
|
-
status: this.availableStatuses().find((s) => s.id === res.statusId),
|
|
2321
|
-
}));
|
|
2322
|
-
this.reservations.set(enriched);
|
|
2323
|
-
}
|
|
2324
|
-
setDateRange(range) {
|
|
2325
|
-
const today = new Date();
|
|
2326
|
-
let from;
|
|
2327
|
-
let to;
|
|
2328
|
-
switch (range) {
|
|
2329
|
-
case 'today':
|
|
2330
|
-
from = new Date(today);
|
|
2331
|
-
to = new Date(today);
|
|
2332
|
-
break;
|
|
2333
|
-
case 'week':
|
|
2334
|
-
from = new Date(today);
|
|
2335
|
-
from.setDate(today.getDate() - today.getDay());
|
|
2336
|
-
to = new Date(from);
|
|
2337
|
-
to.setDate(from.getDate() + 6);
|
|
2338
|
-
break;
|
|
2339
|
-
case 'month':
|
|
2340
|
-
from = new Date(today.getFullYear(), today.getMonth(), 1);
|
|
2341
|
-
to = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
|
2342
|
-
break;
|
|
2343
|
-
}
|
|
2344
|
-
this.dateFrom.set(from);
|
|
2345
|
-
this.dateTo.set(to);
|
|
2346
|
-
}
|
|
2347
|
-
getAvailableTransitions(reservation) {
|
|
2348
|
-
return this.transitions().filter((t) => t.fromStatusId === reservation.statusId && t.isActive);
|
|
2349
|
-
}
|
|
2350
|
-
openCreateReservationModal() {
|
|
2351
|
-
console.log('Open create reservation modal');
|
|
2352
|
-
}
|
|
2353
|
-
openCreateHoldModal() {
|
|
2354
|
-
console.log('Open create hold modal');
|
|
2355
|
-
}
|
|
2356
|
-
openReservationDetails(reservationId) {
|
|
2357
|
-
console.log('Open reservation details:', reservationId);
|
|
2358
|
-
}
|
|
2359
|
-
openTransitionModal(reservationId, transitionId) {
|
|
2360
|
-
console.log('Open transition modal:', reservationId, transitionId);
|
|
2361
|
-
}
|
|
2362
|
-
getCommandItems() {
|
|
2363
|
-
return [
|
|
2364
|
-
{ name: 'view', text: 'View', icon: 'fa-light fa-eye' },
|
|
2365
|
-
// Transitions will be added dynamically per row
|
|
2366
|
-
];
|
|
2367
|
-
}
|
|
2368
|
-
handleCommandClick(event) {
|
|
2369
|
-
const item = event.item || event;
|
|
2370
|
-
const row = event.row || event.dataItem || event.data;
|
|
2371
|
-
if (item.name === 'view') {
|
|
2372
|
-
this.openReservationDetails(row.id);
|
|
2373
|
-
}
|
|
2374
|
-
else if (item.name?.startsWith('transition-')) {
|
|
2375
|
-
const transitionId = item.name.replace('transition-', '');
|
|
2376
|
-
this.openTransitionModal(row.id, transitionId);
|
|
2377
|
-
}
|
|
2378
|
-
}
|
|
2379
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationPanelWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2380
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: AXPReservationPanelWidgetComponent, isStandalone: true, selector: "axp-reservation-panel", usesInheritance: true, ngImport: i0, template: `
|
|
2381
|
-
<div class="ax-flex ax-flex-col ax-h-full">
|
|
2382
|
-
<!-- Header Toolbar -->
|
|
2383
|
-
<div class="ax-flex ax-items-center ax-justify-between ax-gap-4 ax-p-4 ax-border-b">
|
|
2384
|
-
<div class="ax-flex ax-items-center ax-gap-2">
|
|
2385
|
-
<!-- Class Selector -->
|
|
2386
|
-
@if (availableClasses().length > 1) {
|
|
2387
|
-
<ax-select-box
|
|
2388
|
-
class="ax-w-64"
|
|
2389
|
-
[dataSource]="classDataSource()"
|
|
2390
|
-
[ngModel]="selectedClassId() ?? ''"
|
|
2391
|
-
(ngModelChange)="selectedClassId.set($event || null)"
|
|
2392
|
-
valueField="id"
|
|
2393
|
-
textField="title"
|
|
2394
|
-
placeholder="Select Class"
|
|
2395
|
-
look="outline"
|
|
2396
|
-
></ax-select-box>
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
<!-- View Toggle -->
|
|
2400
|
-
@if (displayMode() === 'both') {
|
|
2401
|
-
<div class="ax-flex ax-gap-1 ax-border ax-rounded">
|
|
2402
|
-
<ax-button
|
|
2403
|
-
[class.ax-bg-primary]="viewMode() === 'calendar'"
|
|
2404
|
-
[class.ax-text-white]="viewMode() === 'calendar'"
|
|
2405
|
-
(onClick)="viewMode.set('calendar')"
|
|
2406
|
-
look="blank"
|
|
2407
|
-
size="sm"
|
|
2408
|
-
>
|
|
2409
|
-
Calendar
|
|
2410
|
-
</ax-button>
|
|
2411
|
-
<ax-button
|
|
2412
|
-
[class.ax-bg-primary]="viewMode() === 'list'"
|
|
2413
|
-
[class.ax-text-white]="viewMode() === 'list'"
|
|
2414
|
-
(onClick)="viewMode.set('list')"
|
|
2415
|
-
look="blank"
|
|
2416
|
-
size="sm"
|
|
2417
|
-
>
|
|
2418
|
-
List
|
|
2419
|
-
</ax-button>
|
|
2420
|
-
<ax-button
|
|
2421
|
-
[class.ax-bg-primary]="viewMode() === 'split'"
|
|
2422
|
-
[class.ax-text-white]="viewMode() === 'split'"
|
|
2423
|
-
(onClick)="viewMode.set('split')"
|
|
2424
|
-
look="blank"
|
|
2425
|
-
size="sm"
|
|
2426
|
-
>
|
|
2427
|
-
Split
|
|
2428
|
-
</ax-button>
|
|
2429
|
-
</div>
|
|
2430
|
-
}
|
|
2431
|
-
</div>
|
|
2432
|
-
|
|
2433
|
-
<div class="ax-flex ax-items-center ax-gap-2">
|
|
2434
|
-
<!-- Date Range Controller -->
|
|
2435
|
-
<ax-button (onClick)="setDateRange('today')" look="outline" size="sm">Today</ax-button>
|
|
2436
|
-
<ax-button (onClick)="setDateRange('week')" look="outline" size="sm">Week</ax-button>
|
|
2437
|
-
<ax-button (onClick)="setDateRange('month')" look="outline" size="sm">Month</ax-button>
|
|
2438
|
-
<ax-datetime-box
|
|
2439
|
-
class="ax-w-40"
|
|
2440
|
-
[ngModel]="dateFrom()"
|
|
2441
|
-
(ngModelChange)="dateFrom.set($event)"
|
|
2442
|
-
[format]="'yyyy-MM-dd'"
|
|
2443
|
-
look="outline"
|
|
2444
|
-
size="sm"
|
|
2445
|
-
></ax-datetime-box>
|
|
2446
|
-
<span class="ax-text-muted">-</span>
|
|
2447
|
-
<ax-datetime-box
|
|
2448
|
-
class="ax-w-40"
|
|
2449
|
-
[ngModel]="dateTo()"
|
|
2450
|
-
(ngModelChange)="dateTo.set($event)"
|
|
2451
|
-
[format]="'yyyy-MM-dd'"
|
|
2452
|
-
look="outline"
|
|
2453
|
-
size="sm"
|
|
2454
|
-
></ax-datetime-box>
|
|
2455
|
-
</div>
|
|
2456
|
-
|
|
2457
|
-
<div class="ax-flex ax-items-center ax-gap-2">
|
|
2458
|
-
<!-- Filters -->
|
|
2459
|
-
<ax-check-box [ngModel]="showReservations()" (ngModelChange)="showReservations.set($event)">
|
|
2460
|
-
<ax-label>Reservations</ax-label>
|
|
2461
|
-
</ax-check-box>
|
|
2462
|
-
<ax-check-box [ngModel]="showHolds()" (ngModelChange)="showHolds.set($event)">
|
|
2463
|
-
<ax-label>Holds</ax-label>
|
|
2464
|
-
</ax-check-box>
|
|
2465
|
-
<ax-select-box
|
|
2466
|
-
class="ax-w-48"
|
|
2467
|
-
[dataSource]="statusDataSource()"
|
|
2468
|
-
[ngModel]="selectedStatusIds()"
|
|
2469
|
-
(ngModelChange)="selectedStatusIds.set($event)"
|
|
2470
|
-
valueField="id"
|
|
2471
|
-
textField="title"
|
|
2472
|
-
[multiple]="true"
|
|
2473
|
-
placeholder="Filter by Status"
|
|
2474
|
-
look="outline"
|
|
2475
|
-
size="sm"
|
|
2476
|
-
></ax-select-box>
|
|
2477
|
-
|
|
2478
|
-
<!-- Actions -->
|
|
2479
|
-
@if (!readonly()) {
|
|
2480
|
-
<ax-button (onClick)="openCreateReservationModal()" look="primary" size="sm"> + New Reservation </ax-button>
|
|
2481
|
-
@if (allowHold()) {
|
|
2482
|
-
<ax-button (onClick)="openCreateHoldModal()" look="outline" size="sm">+ New Hold</ax-button>
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
</div>
|
|
2486
|
-
</div>
|
|
2487
|
-
|
|
2488
|
-
<!-- Body -->
|
|
2489
|
-
<div class="ax-flex-1 ax-overflow-auto ax-p-4">
|
|
2490
|
-
@if (viewMode() === 'calendar' || viewMode() === 'split') {
|
|
2491
|
-
<div class="calendar-view ax-mb-4">
|
|
2492
|
-
@if (viewMode() === 'split') {
|
|
2493
|
-
<h3 class="ax-text-lg ax-font-semibold ax-mb-2">Calendar</h3>
|
|
2494
|
-
}
|
|
2495
|
-
<!-- Timeline View -->
|
|
2496
|
-
<div class="timeline-view">
|
|
2497
|
-
@for (day of timelineDays(); track day.date.getTime()) {
|
|
2498
|
-
<div class="ax-border-b ax-pb-2 ax-mb-2">
|
|
2499
|
-
<div class="ax-font-semibold ax-mb-2">
|
|
2500
|
-
{{ day.date | date: 'EEEE, MMMM d, y' }}
|
|
2501
|
-
</div>
|
|
2502
|
-
<div class="ax-flex ax-flex-col ax-gap-1">
|
|
2503
|
-
@for (reservation of day.reservations; track reservation.id) {
|
|
2504
|
-
<div
|
|
2505
|
-
class="ax-p-2 ax-rounded ax-border"
|
|
2506
|
-
[style.border-left-color]="reservation.status?.color || '#ccc'"
|
|
2507
|
-
[style.border-left-width]="'4px'"
|
|
2508
|
-
>
|
|
2509
|
-
<div class="ax-flex ax-items-center ax-gap-2">
|
|
2510
|
-
<span
|
|
2511
|
-
class="ax-px-2 ax-py-1 ax-rounded ax-text-xs ax-font-semibold"
|
|
2512
|
-
[class.ax-bg-success]="reservation.kind === 'reservation'"
|
|
2513
|
-
[class.ax-bg-danger]="reservation.kind === 'hold'"
|
|
2514
|
-
[class.ax-text-white]="true"
|
|
2515
|
-
>
|
|
2516
|
-
{{ reservation.kind }}
|
|
2517
|
-
</span>
|
|
2518
|
-
<span
|
|
2519
|
-
class="ax-px-2 ax-py-1 ax-rounded ax-text-xs"
|
|
2520
|
-
[style.background-color]="reservation.status?.color || '#ccc'"
|
|
2521
|
-
[style.color]="'white'"
|
|
2522
|
-
>
|
|
2523
|
-
{{ reservation.status?.title || 'Unknown' }}
|
|
2524
|
-
</span>
|
|
2525
|
-
<span class="ax-text-sm ax-text-muted">
|
|
2526
|
-
{{ reservation.startDate | date: 'shortTime' }} -
|
|
2527
|
-
{{ reservation.endDate | date: 'shortTime' }}
|
|
2528
|
-
</span>
|
|
2529
|
-
</div>
|
|
2530
|
-
@if (reservation.note) {
|
|
2531
|
-
<div class="ax-text-sm ax-mt-1 ax-text-muted">{{ reservation.note }}</div>
|
|
2532
|
-
}
|
|
2533
|
-
</div>
|
|
2534
|
-
}
|
|
2535
|
-
@if (day.reservations.length === 0) {
|
|
2536
|
-
<div class="ax-text-sm ax-text-muted ax-p-2">No reservations</div>
|
|
2537
|
-
}
|
|
2538
|
-
</div>
|
|
2539
|
-
</div>
|
|
2540
|
-
}
|
|
2541
|
-
</div>
|
|
2542
|
-
</div>
|
|
2543
|
-
}
|
|
2544
|
-
|
|
2545
|
-
@if (viewMode() === 'list' || viewMode() === 'split') {
|
|
2546
|
-
<div class="list-view">
|
|
2547
|
-
@if (viewMode() === 'split') {
|
|
2548
|
-
<h3 class="ax-text-lg ax-font-semibold ax-mb-2">List</h3>
|
|
2549
|
-
}
|
|
2550
|
-
<ax-data-table [dataSource]="tableDataSource()" [showFooter]="false" [paging]="false">
|
|
2551
|
-
<ax-text-column dataField="kind" [width]="'100px'" caption="Kind"></ax-text-column>
|
|
2552
|
-
<ax-text-column dataField="startDate" [width]="'150px'" caption="Start"></ax-text-column>
|
|
2553
|
-
<ax-text-column dataField="endDate" [width]="'150px'" caption="End"></ax-text-column>
|
|
2554
|
-
<ax-text-column dataField="statusTitle" [width]="'120px'" caption="Status"></ax-text-column>
|
|
2555
|
-
<ax-text-column dataField="requestedByName" [width]="'150px'" caption="Requested By"></ax-text-column>
|
|
2556
|
-
<ax-text-column dataField="approvedByName" [width]="'150px'" caption="Approved By"></ax-text-column>
|
|
2557
|
-
<ax-text-column dataField="note" caption="Note"></ax-text-column>
|
|
2558
|
-
<ax-command-column
|
|
2559
|
-
fixed="end"
|
|
2560
|
-
[width]="'200px'"
|
|
2561
|
-
[items]="getCommandItems()"
|
|
2562
|
-
(onItemClick)="handleCommandClick($event)"
|
|
2563
|
-
></ax-command-column>
|
|
2564
|
-
</ax-data-table>
|
|
2565
|
-
</div>
|
|
2566
|
-
}
|
|
2567
|
-
</div>
|
|
2568
|
-
</div>
|
|
2569
|
-
`, isInline: true, styles: [".timeline-view{max-height:600px;overflow-y:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "component", type: i3.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "isLoading", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i4.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "selectedRows", "parentField", "rowDetailsTemplate", "rowTemplate", "emptyTemplate", "noDataTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged", "onPageChanged"] }, { kind: "component", type: i4.AXDataTableTextColumnComponent, selector: "ax-text-column", inputs: ["width", "caption", "allowSorting", "allowResizing", "fixed", "customExpandIcon", "customCollapseIcon", "dataField", "expandHandler", "wrapText", "cellTemplate", "footerTemplate", "headerTemplate", "format", "formatOptions"] }, { kind: "component", type: i4.AXRowCommandColumnComponent, selector: "ax-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDateTimeBoxModule }, { kind: "component", type: i5.AXDateTimeBoxComponent, selector: "ax-datetime-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "depth", "id", "type", "look", "holidayDates", "allowTyping", "picker", "calendar", "weekend", "weekdays", "format"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "onOpened", "onClosed", "readonlyChange", "disabledChange", "formatChange"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i6.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i7.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "itemHeight", "maxVisibleItems", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i8.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2570
|
-
}
|
|
2571
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationPanelWidgetComponent, decorators: [{
|
|
2572
|
-
type: Component,
|
|
2573
|
-
args: [{ selector: 'axp-reservation-panel', standalone: true, imports: [
|
|
2574
|
-
CommonModule,
|
|
2575
|
-
FormsModule,
|
|
2576
|
-
DatePipe,
|
|
2577
|
-
AXButtonModule,
|
|
2578
|
-
AXCheckBoxModule,
|
|
2579
|
-
AXDataTableModule,
|
|
2580
|
-
AXDateTimeBoxModule,
|
|
2581
|
-
AXLabelModule,
|
|
2582
|
-
AXSelectBoxModule,
|
|
2583
|
-
AXTranslationModule,
|
|
2584
|
-
], template: `
|
|
2585
|
-
<div class="ax-flex ax-flex-col ax-h-full">
|
|
2586
|
-
<!-- Header Toolbar -->
|
|
2587
|
-
<div class="ax-flex ax-items-center ax-justify-between ax-gap-4 ax-p-4 ax-border-b">
|
|
2588
|
-
<div class="ax-flex ax-items-center ax-gap-2">
|
|
2589
|
-
<!-- Class Selector -->
|
|
2590
|
-
@if (availableClasses().length > 1) {
|
|
2591
|
-
<ax-select-box
|
|
2592
|
-
class="ax-w-64"
|
|
2593
|
-
[dataSource]="classDataSource()"
|
|
2594
|
-
[ngModel]="selectedClassId() ?? ''"
|
|
2595
|
-
(ngModelChange)="selectedClassId.set($event || null)"
|
|
2596
|
-
valueField="id"
|
|
2597
|
-
textField="title"
|
|
2598
|
-
placeholder="Select Class"
|
|
2599
|
-
look="outline"
|
|
2600
|
-
></ax-select-box>
|
|
2601
|
-
}
|
|
2602
|
-
|
|
2603
|
-
<!-- View Toggle -->
|
|
2604
|
-
@if (displayMode() === 'both') {
|
|
2605
|
-
<div class="ax-flex ax-gap-1 ax-border ax-rounded">
|
|
2606
|
-
<ax-button
|
|
2607
|
-
[class.ax-bg-primary]="viewMode() === 'calendar'"
|
|
2608
|
-
[class.ax-text-white]="viewMode() === 'calendar'"
|
|
2609
|
-
(onClick)="viewMode.set('calendar')"
|
|
2610
|
-
look="blank"
|
|
2611
|
-
size="sm"
|
|
2612
|
-
>
|
|
2613
|
-
Calendar
|
|
2614
|
-
</ax-button>
|
|
2615
|
-
<ax-button
|
|
2616
|
-
[class.ax-bg-primary]="viewMode() === 'list'"
|
|
2617
|
-
[class.ax-text-white]="viewMode() === 'list'"
|
|
2618
|
-
(onClick)="viewMode.set('list')"
|
|
2619
|
-
look="blank"
|
|
2620
|
-
size="sm"
|
|
2621
|
-
>
|
|
2622
|
-
List
|
|
2623
|
-
</ax-button>
|
|
2624
|
-
<ax-button
|
|
2625
|
-
[class.ax-bg-primary]="viewMode() === 'split'"
|
|
2626
|
-
[class.ax-text-white]="viewMode() === 'split'"
|
|
2627
|
-
(onClick)="viewMode.set('split')"
|
|
2628
|
-
look="blank"
|
|
2629
|
-
size="sm"
|
|
2630
|
-
>
|
|
2631
|
-
Split
|
|
2632
|
-
</ax-button>
|
|
2633
|
-
</div>
|
|
2634
|
-
}
|
|
2635
|
-
</div>
|
|
2636
|
-
|
|
2637
|
-
<div class="ax-flex ax-items-center ax-gap-2">
|
|
2638
|
-
<!-- Date Range Controller -->
|
|
2639
|
-
<ax-button (onClick)="setDateRange('today')" look="outline" size="sm">Today</ax-button>
|
|
2640
|
-
<ax-button (onClick)="setDateRange('week')" look="outline" size="sm">Week</ax-button>
|
|
2641
|
-
<ax-button (onClick)="setDateRange('month')" look="outline" size="sm">Month</ax-button>
|
|
2642
|
-
<ax-datetime-box
|
|
2643
|
-
class="ax-w-40"
|
|
2644
|
-
[ngModel]="dateFrom()"
|
|
2645
|
-
(ngModelChange)="dateFrom.set($event)"
|
|
2646
|
-
[format]="'yyyy-MM-dd'"
|
|
2647
|
-
look="outline"
|
|
2648
|
-
size="sm"
|
|
2649
|
-
></ax-datetime-box>
|
|
2650
|
-
<span class="ax-text-muted">-</span>
|
|
2651
|
-
<ax-datetime-box
|
|
2652
|
-
class="ax-w-40"
|
|
2653
|
-
[ngModel]="dateTo()"
|
|
2654
|
-
(ngModelChange)="dateTo.set($event)"
|
|
2655
|
-
[format]="'yyyy-MM-dd'"
|
|
2656
|
-
look="outline"
|
|
2657
|
-
size="sm"
|
|
2658
|
-
></ax-datetime-box>
|
|
2659
|
-
</div>
|
|
2660
|
-
|
|
2661
|
-
<div class="ax-flex ax-items-center ax-gap-2">
|
|
2662
|
-
<!-- Filters -->
|
|
2663
|
-
<ax-check-box [ngModel]="showReservations()" (ngModelChange)="showReservations.set($event)">
|
|
2664
|
-
<ax-label>Reservations</ax-label>
|
|
2665
|
-
</ax-check-box>
|
|
2666
|
-
<ax-check-box [ngModel]="showHolds()" (ngModelChange)="showHolds.set($event)">
|
|
2667
|
-
<ax-label>Holds</ax-label>
|
|
2668
|
-
</ax-check-box>
|
|
2669
|
-
<ax-select-box
|
|
2670
|
-
class="ax-w-48"
|
|
2671
|
-
[dataSource]="statusDataSource()"
|
|
2672
|
-
[ngModel]="selectedStatusIds()"
|
|
2673
|
-
(ngModelChange)="selectedStatusIds.set($event)"
|
|
2674
|
-
valueField="id"
|
|
2675
|
-
textField="title"
|
|
2676
|
-
[multiple]="true"
|
|
2677
|
-
placeholder="Filter by Status"
|
|
2678
|
-
look="outline"
|
|
2679
|
-
size="sm"
|
|
2680
|
-
></ax-select-box>
|
|
2681
|
-
|
|
2682
|
-
<!-- Actions -->
|
|
2683
|
-
@if (!readonly()) {
|
|
2684
|
-
<ax-button (onClick)="openCreateReservationModal()" look="primary" size="sm"> + New Reservation </ax-button>
|
|
2685
|
-
@if (allowHold()) {
|
|
2686
|
-
<ax-button (onClick)="openCreateHoldModal()" look="outline" size="sm">+ New Hold</ax-button>
|
|
2687
|
-
}
|
|
2688
|
-
}
|
|
2689
|
-
</div>
|
|
2690
|
-
</div>
|
|
2691
|
-
|
|
2692
|
-
<!-- Body -->
|
|
2693
|
-
<div class="ax-flex-1 ax-overflow-auto ax-p-4">
|
|
2694
|
-
@if (viewMode() === 'calendar' || viewMode() === 'split') {
|
|
2695
|
-
<div class="calendar-view ax-mb-4">
|
|
2696
|
-
@if (viewMode() === 'split') {
|
|
2697
|
-
<h3 class="ax-text-lg ax-font-semibold ax-mb-2">Calendar</h3>
|
|
2698
|
-
}
|
|
2699
|
-
<!-- Timeline View -->
|
|
2700
|
-
<div class="timeline-view">
|
|
2701
|
-
@for (day of timelineDays(); track day.date.getTime()) {
|
|
2702
|
-
<div class="ax-border-b ax-pb-2 ax-mb-2">
|
|
2703
|
-
<div class="ax-font-semibold ax-mb-2">
|
|
2704
|
-
{{ day.date | date: 'EEEE, MMMM d, y' }}
|
|
2705
|
-
</div>
|
|
2706
|
-
<div class="ax-flex ax-flex-col ax-gap-1">
|
|
2707
|
-
@for (reservation of day.reservations; track reservation.id) {
|
|
2708
|
-
<div
|
|
2709
|
-
class="ax-p-2 ax-rounded ax-border"
|
|
2710
|
-
[style.border-left-color]="reservation.status?.color || '#ccc'"
|
|
2711
|
-
[style.border-left-width]="'4px'"
|
|
2712
|
-
>
|
|
2713
|
-
<div class="ax-flex ax-items-center ax-gap-2">
|
|
2714
|
-
<span
|
|
2715
|
-
class="ax-px-2 ax-py-1 ax-rounded ax-text-xs ax-font-semibold"
|
|
2716
|
-
[class.ax-bg-success]="reservation.kind === 'reservation'"
|
|
2717
|
-
[class.ax-bg-danger]="reservation.kind === 'hold'"
|
|
2718
|
-
[class.ax-text-white]="true"
|
|
2719
|
-
>
|
|
2720
|
-
{{ reservation.kind }}
|
|
2721
|
-
</span>
|
|
2722
|
-
<span
|
|
2723
|
-
class="ax-px-2 ax-py-1 ax-rounded ax-text-xs"
|
|
2724
|
-
[style.background-color]="reservation.status?.color || '#ccc'"
|
|
2725
|
-
[style.color]="'white'"
|
|
2726
|
-
>
|
|
2727
|
-
{{ reservation.status?.title || 'Unknown' }}
|
|
2728
|
-
</span>
|
|
2729
|
-
<span class="ax-text-sm ax-text-muted">
|
|
2730
|
-
{{ reservation.startDate | date: 'shortTime' }} -
|
|
2731
|
-
{{ reservation.endDate | date: 'shortTime' }}
|
|
2732
|
-
</span>
|
|
2733
|
-
</div>
|
|
2734
|
-
@if (reservation.note) {
|
|
2735
|
-
<div class="ax-text-sm ax-mt-1 ax-text-muted">{{ reservation.note }}</div>
|
|
2736
|
-
}
|
|
2737
|
-
</div>
|
|
2738
|
-
}
|
|
2739
|
-
@if (day.reservations.length === 0) {
|
|
2740
|
-
<div class="ax-text-sm ax-text-muted ax-p-2">No reservations</div>
|
|
2741
|
-
}
|
|
2742
|
-
</div>
|
|
2743
|
-
</div>
|
|
2744
|
-
}
|
|
2745
|
-
</div>
|
|
2746
|
-
</div>
|
|
2747
|
-
}
|
|
2748
|
-
|
|
2749
|
-
@if (viewMode() === 'list' || viewMode() === 'split') {
|
|
2750
|
-
<div class="list-view">
|
|
2751
|
-
@if (viewMode() === 'split') {
|
|
2752
|
-
<h3 class="ax-text-lg ax-font-semibold ax-mb-2">List</h3>
|
|
2753
|
-
}
|
|
2754
|
-
<ax-data-table [dataSource]="tableDataSource()" [showFooter]="false" [paging]="false">
|
|
2755
|
-
<ax-text-column dataField="kind" [width]="'100px'" caption="Kind"></ax-text-column>
|
|
2756
|
-
<ax-text-column dataField="startDate" [width]="'150px'" caption="Start"></ax-text-column>
|
|
2757
|
-
<ax-text-column dataField="endDate" [width]="'150px'" caption="End"></ax-text-column>
|
|
2758
|
-
<ax-text-column dataField="statusTitle" [width]="'120px'" caption="Status"></ax-text-column>
|
|
2759
|
-
<ax-text-column dataField="requestedByName" [width]="'150px'" caption="Requested By"></ax-text-column>
|
|
2760
|
-
<ax-text-column dataField="approvedByName" [width]="'150px'" caption="Approved By"></ax-text-column>
|
|
2761
|
-
<ax-text-column dataField="note" caption="Note"></ax-text-column>
|
|
2762
|
-
<ax-command-column
|
|
2763
|
-
fixed="end"
|
|
2764
|
-
[width]="'200px'"
|
|
2765
|
-
[items]="getCommandItems()"
|
|
2766
|
-
(onItemClick)="handleCommandClick($event)"
|
|
2767
|
-
></ax-command-column>
|
|
2768
|
-
</ax-data-table>
|
|
2769
|
-
</div>
|
|
2770
|
-
}
|
|
2771
|
-
</div>
|
|
2772
|
-
</div>
|
|
2773
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".timeline-view{max-height:600px;overflow-y:auto}\n"] }]
|
|
2774
|
-
}], ctorParameters: () => [] });
|
|
2775
|
-
|
|
2776
|
-
var reservationPanelWidget_component = /*#__PURE__*/Object.freeze({
|
|
2777
|
-
__proto__: null,
|
|
2778
|
-
AXPReservationPanelWidgetComponent: AXPReservationPanelWidgetComponent
|
|
2779
|
-
});
|
|
2780
|
-
|
|
2781
|
-
//#region ---- Imports ----
|
|
2782
|
-
//#endregion
|
|
2783
|
-
//#region ---- Widget Config ----
|
|
2784
|
-
const AXPReservationPanelWidget = {
|
|
2785
|
-
name: 'reservation-panel-widget',
|
|
2786
|
-
title: 'Reservation Panel',
|
|
2787
|
-
description: 'Displays and manages reservations for a resource',
|
|
2788
|
-
icon: 'fa-light fa-calendar-check',
|
|
2789
|
-
categories: AXP_WIDGETS_ADVANCE_CATEGORY,
|
|
2790
|
-
groups: [AXPWidgetGroupEnum.EntityWidget],
|
|
2791
|
-
type: 'editor',
|
|
2792
|
-
properties: [
|
|
2793
|
-
AXP_NAME_PROPERTY,
|
|
2794
|
-
AXP_DATA_PATH_PROPERTY,
|
|
2795
|
-
AXP_DISABLED_PROPERTY,
|
|
2796
|
-
createStringProperty({
|
|
2797
|
-
name: 'resourceEntityId',
|
|
2798
|
-
title: 'Resource Entity ID',
|
|
2799
|
-
path: 'options.resourceEntityId',
|
|
2800
|
-
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
|
2801
|
-
}),
|
|
2802
|
-
createStringProperty({
|
|
2803
|
-
name: 'resourceIdPath',
|
|
2804
|
-
title: 'Resource ID Path',
|
|
2805
|
-
path: 'options.resourceId',
|
|
2806
|
-
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
|
2807
|
-
defaultValue: 'id',
|
|
2808
|
-
}),
|
|
2809
|
-
createStringProperty({
|
|
2810
|
-
name: 'reservationTypeCode',
|
|
2811
|
-
title: 'Reservation Type Code',
|
|
2812
|
-
path: 'options.reservationTypeCode',
|
|
2813
|
-
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
|
2814
|
-
}),
|
|
2815
|
-
createStringProperty({
|
|
2816
|
-
name: 'defaultClassId',
|
|
2817
|
-
title: 'Default Class ID',
|
|
2818
|
-
path: 'options.defaultClassId',
|
|
2819
|
-
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
|
2820
|
-
}),
|
|
2821
|
-
createStringProperty({
|
|
2822
|
-
name: 'mode',
|
|
2823
|
-
title: 'Display Mode',
|
|
2824
|
-
path: 'options.mode',
|
|
2825
|
-
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
|
2826
|
-
defaultValue: 'both',
|
|
2827
|
-
}),
|
|
2828
|
-
createBooleanProperty({
|
|
2829
|
-
name: 'readonly',
|
|
2830
|
-
title: 'Readonly',
|
|
2831
|
-
path: 'options.readonly',
|
|
2832
|
-
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
|
2833
|
-
defaultValue: false,
|
|
2834
|
-
}),
|
|
2835
|
-
createBooleanProperty({
|
|
2836
|
-
name: 'allowHold',
|
|
2837
|
-
title: 'Allow Hold',
|
|
2838
|
-
path: 'options.allowHold',
|
|
2839
|
-
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
|
2840
|
-
}),
|
|
2841
|
-
createNumberProperty({
|
|
2842
|
-
name: 'dateRangeDays',
|
|
2843
|
-
title: 'Date Range Days',
|
|
2844
|
-
path: 'options.dateRangeDays',
|
|
2845
|
-
group: AXP_BEHAVIOR_PROPERTY_GROUP,
|
|
2846
|
-
defaultValue: 30,
|
|
2847
|
-
}),
|
|
2848
|
-
],
|
|
2849
|
-
components: {
|
|
2850
|
-
view: {
|
|
2851
|
-
component: () => Promise.resolve().then(function () { return reservationPanelWidget_component; }).then((c) => c.AXPReservationPanelWidgetComponent),
|
|
2852
|
-
},
|
|
2853
|
-
edit: {
|
|
2854
|
-
component: () => Promise.resolve().then(function () { return reservationPanelWidget_component; }).then((c) => c.AXPReservationPanelWidgetComponent),
|
|
2855
|
-
},
|
|
2856
|
-
designer: {
|
|
2857
|
-
component: () => Promise.resolve().then(function () { return reservationPanelWidget_component; }).then((c) => c.AXPReservationPanelWidgetComponent),
|
|
2858
|
-
},
|
|
2859
|
-
},
|
|
2860
|
-
};
|
|
2861
|
-
//#endregion
|
|
2862
|
-
|
|
2863
|
-
//#region ---- Imports ----
|
|
2864
|
-
//#endregion
|
|
2865
|
-
//#region ---- Plugin ----
|
|
2866
|
-
const reservationPlugin = {
|
|
2867
|
-
name: 'reservation',
|
|
2868
|
-
order: 80,
|
|
2869
|
-
apply: (ctx, options) => {
|
|
2870
|
-
const groupId = options?.groupId ?? 'reservations';
|
|
2871
|
-
const title = options?.title ?? '@reservation-management:reservation-plugin.property.title';
|
|
2872
|
-
//#region ---- Ensure Reservations Group ----
|
|
2873
|
-
const groups = ctx.groups.list() ?? [];
|
|
2874
|
-
if (!groups.some((g) => g.id === groupId)) {
|
|
2875
|
-
ctx.groups.add({
|
|
2876
|
-
id: groupId,
|
|
2877
|
-
title: '@reservation-management:reservation-plugin.group.title',
|
|
2878
|
-
});
|
|
2879
|
-
}
|
|
2880
|
-
//#endregion
|
|
2881
|
-
//#region ---- Add Reservation Property ----
|
|
2882
|
-
const props = ctx.properties.list();
|
|
2883
|
-
if (!props.some((p) => p.name === 'reservations')) {
|
|
2884
|
-
ctx.properties.add({
|
|
2885
|
-
name: 'reservations',
|
|
2886
|
-
title,
|
|
2887
|
-
groupId,
|
|
2888
|
-
schema: {
|
|
2889
|
-
dataType: 'object',
|
|
2890
|
-
interface: {
|
|
2891
|
-
type: 'reservation-panel-widget',
|
|
2892
|
-
options: {
|
|
2893
|
-
resourceEntityId: `${ctx.entity.module}.${ctx.entity.name}`,
|
|
2894
|
-
resourceId: '{{ context.eval("id") }}',
|
|
2895
|
-
resourceRef: {
|
|
2896
|
-
title: '{{ context.eval("title") }}',
|
|
2897
|
-
code: '{{ context.eval("code") }}',
|
|
2898
|
-
},
|
|
2899
|
-
reservationTypeId: options?.reservationTypeId,
|
|
2900
|
-
reservationTypeCode: options?.reservationTypeCode,
|
|
2901
|
-
defaultClassId: options?.defaultClassId,
|
|
2902
|
-
mode: options?.mode ?? 'both',
|
|
2903
|
-
readonly: options?.readonly ?? false,
|
|
2904
|
-
dateRangeDays: options?.dateRangeDays ?? 30,
|
|
2905
|
-
allowHold: options?.allowHold,
|
|
2906
|
-
},
|
|
2907
|
-
},
|
|
2908
|
-
},
|
|
2909
|
-
options: {
|
|
2910
|
-
sort: { enabled: false },
|
|
2911
|
-
filter: {
|
|
2912
|
-
advance: { enabled: false },
|
|
2913
|
-
inline: { enabled: false },
|
|
2914
|
-
},
|
|
2915
|
-
},
|
|
2916
|
-
});
|
|
2917
|
-
}
|
|
2918
|
-
//#endregion
|
|
2919
|
-
//#region ---- Update Interface Layouts ----
|
|
2920
|
-
const ensureLayoutProperty = (layout) => {
|
|
2921
|
-
layout.sections = layout.sections ?? [];
|
|
2922
|
-
if (!layout.sections.some((s) => s.id === groupId)) {
|
|
2923
|
-
layout.sections.push({ id: groupId, order: 100 });
|
|
2924
|
-
}
|
|
2925
|
-
layout.properties = layout.properties ?? [];
|
|
2926
|
-
if (!layout.properties.some((p) => p.name === 'reservations')) {
|
|
2927
|
-
layout.properties.push({
|
|
2928
|
-
name: 'reservations',
|
|
2929
|
-
layout: {
|
|
2930
|
-
positions: { lg: { colSpan: 12, order: 100 } },
|
|
2931
|
-
},
|
|
2932
|
-
});
|
|
2933
|
-
}
|
|
2934
|
-
return layout;
|
|
2935
|
-
};
|
|
2936
|
-
ctx.interfaces.master.create.update((create) => ensureLayoutProperty((create ?? { sections: [], properties: [] })));
|
|
2937
|
-
ctx.interfaces.master.modify.update((modify) => ensureLayoutProperty((modify ?? { sections: [], properties: [] })));
|
|
2938
|
-
ctx.interfaces.master.single.update((single) => ensureLayoutProperty((single ?? { title: ctx.entity.title, sections: [], properties: [] })));
|
|
2939
|
-
//#endregion
|
|
2940
|
-
},
|
|
2941
|
-
};
|
|
2942
|
-
//#endregion
|
|
2943
|
-
|
|
2944
|
-
//#region ---- Imports ----
|
|
2945
|
-
//#endregion
|
|
2946
|
-
//#region ---- Module ----
|
|
2947
|
-
class AXPReservationPluginModule {
|
|
2948
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationPluginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2949
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationPluginModule, imports: [i1$1.AXPWidgetCoreModule] }); }
|
|
2950
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationPluginModule, providers: [{ provide: AXP_ENTITY_ACTION_PLUGIN, multi: true, useValue: reservationPlugin }], imports: [AXPWidgetCoreModule.forChild({
|
|
2951
|
-
widgets: [AXPReservationPanelWidget],
|
|
2952
|
-
})] }); }
|
|
2953
|
-
}
|
|
2954
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationPluginModule, decorators: [{
|
|
2955
|
-
type: NgModule,
|
|
2956
|
-
args: [{
|
|
2957
|
-
imports: [
|
|
2958
|
-
AXPWidgetCoreModule.forChild({
|
|
2959
|
-
widgets: [AXPReservationPanelWidget],
|
|
2960
|
-
}),
|
|
2961
|
-
],
|
|
2962
|
-
providers: [{ provide: AXP_ENTITY_ACTION_PLUGIN, multi: true, useValue: reservationPlugin }],
|
|
2963
|
-
}]
|
|
2964
|
-
}] });
|
|
2965
|
-
|
|
2966
|
-
//#region ---- Types ----
|
|
2967
|
-
//#endregion
|
|
2968
|
-
|
|
2969
|
-
const AXMReservationManagementMenuKeys = {
|
|
2970
|
-
ReservationTypes: 'reservation-management:Menu:ReservationTypes',
|
|
2971
|
-
ReservationStatuses: 'reservation-management:Menu:ReservationStatuses',
|
|
2972
|
-
ReservationClasses: 'reservation-management:Menu:ReservationClasses',
|
|
2973
|
-
Reservations: 'reservation-management:Menu:Reservations',
|
|
2974
|
-
};
|
|
2975
|
-
|
|
2976
|
-
const AXMPermissionsKeys = {
|
|
2977
|
-
ReservationManagement: {
|
|
2978
|
-
Management: 'ReservationManagement:Permission:Management',
|
|
2979
|
-
ReservationType: {
|
|
2980
|
-
Management: 'ReservationManagement:Permission:ReservationType.Management',
|
|
2981
|
-
},
|
|
2982
|
-
ReservationStatus: {
|
|
2983
|
-
Management: 'ReservationManagement:Permission:ReservationStatus.Management',
|
|
2984
|
-
},
|
|
2985
|
-
ReservationClass: {
|
|
2986
|
-
Management: 'ReservationManagement:Permission:ReservationClass.Management',
|
|
2987
|
-
},
|
|
2988
|
-
Reservation: {
|
|
2989
|
-
Management: 'ReservationManagement:Permission:Reservation.Management',
|
|
2990
|
-
},
|
|
2991
|
-
},
|
|
2992
|
-
};
|
|
2993
|
-
|
|
2994
|
-
//#region ---- Imports ----
|
|
2995
|
-
//#endregion
|
|
2996
|
-
//#region ---- Menu Provider ----
|
|
2997
|
-
class AXMReservationManagementMenuProvider {
|
|
2998
|
-
constructor() {
|
|
2999
|
-
this.entityService = inject(AXPEntityService);
|
|
3000
|
-
}
|
|
3001
|
-
async provide(context) {
|
|
3002
|
-
const module = RootConfig.module;
|
|
3003
|
-
const keys = AXMPermissionsKeys.ReservationManagement;
|
|
3004
|
-
// Configuration > Reservation: Types, Statuses, Classes
|
|
3005
|
-
const reservationConfigMenu = context.find(AXPCommonMenuKeys.ReservationConfig);
|
|
3006
|
-
if (!reservationConfigMenu.exists) {
|
|
3007
|
-
context.find(AXPCommonMenuKeys.Configuration).addItems([
|
|
3008
|
-
{
|
|
3009
|
-
name: AXPCommonMenuKeys.ReservationConfig,
|
|
3010
|
-
priority: 8942,
|
|
3011
|
-
text: '@general:menus.reservation.title',
|
|
3012
|
-
icon: module.icon,
|
|
3013
|
-
type: 'menu',
|
|
3014
|
-
children: [],
|
|
3015
|
-
policy: {
|
|
3016
|
-
features: [module.name],
|
|
3017
|
-
},
|
|
3018
|
-
},
|
|
3019
|
-
]);
|
|
3020
|
-
}
|
|
3021
|
-
context.find(AXPCommonMenuKeys.ReservationConfig).addItems([
|
|
3022
|
-
{
|
|
3023
|
-
name: AXMReservationManagementMenuKeys.ReservationTypes,
|
|
3024
|
-
text: '@reservation-management:reservation-types.menus.reservation-types.title',
|
|
3025
|
-
path: this.entityService.createPath(module.name, RootConfig.entities.reservationType.name),
|
|
3026
|
-
icon: 'fa-light fa-list',
|
|
3027
|
-
priority: 1,
|
|
3028
|
-
policy: {
|
|
3029
|
-
permissions: [keys.ReservationType.Management],
|
|
3030
|
-
},
|
|
3031
|
-
},
|
|
3032
|
-
{
|
|
3033
|
-
name: AXMReservationManagementMenuKeys.ReservationStatuses,
|
|
3034
|
-
text: '@reservation-management:reservation-statuses.menus.reservation-statuses.title',
|
|
3035
|
-
path: this.entityService.createPath(module.name, RootConfig.entities.reservationStatus.name),
|
|
3036
|
-
icon: 'fa-light fa-flag',
|
|
3037
|
-
priority: 2,
|
|
3038
|
-
policy: {
|
|
3039
|
-
permissions: [keys.ReservationStatus.Management],
|
|
3040
|
-
},
|
|
3041
|
-
},
|
|
3042
|
-
{
|
|
3043
|
-
name: AXMReservationManagementMenuKeys.ReservationClasses,
|
|
3044
|
-
text: '@reservation-management:reservation-classes.menus.reservation-classes.title',
|
|
3045
|
-
path: this.entityService.createPath(module.name, RootConfig.entities.reservationClass.name),
|
|
3046
|
-
icon: 'fa-light fa-tag',
|
|
3047
|
-
priority: 3,
|
|
3048
|
-
policy: {
|
|
3049
|
-
permissions: [keys.ReservationClass.Management],
|
|
3050
|
-
},
|
|
3051
|
-
},
|
|
3052
|
-
]);
|
|
3053
|
-
// Root under MODULES: Reservations (operational)
|
|
3054
|
-
context.addItems([
|
|
3055
|
-
{
|
|
3056
|
-
name: AXMReservationManagementMenuKeys.Reservations,
|
|
3057
|
-
priority: 9051,
|
|
3058
|
-
text: '@general:menus.reservations.title',
|
|
3059
|
-
icon: RootConfig.entities.reservation.icon,
|
|
3060
|
-
path: this.entityService.createPath(module.name, RootConfig.entities.reservation.name),
|
|
3061
|
-
policy: {
|
|
3062
|
-
features: [module.name],
|
|
3063
|
-
permissions: [keys.Reservation.Management],
|
|
3064
|
-
},
|
|
3065
|
-
},
|
|
3066
|
-
]);
|
|
3067
|
-
}
|
|
3068
|
-
}
|
|
3069
|
-
//#endregion
|
|
3070
|
-
|
|
3071
|
-
var menu_provider = /*#__PURE__*/Object.freeze({
|
|
3072
|
-
__proto__: null,
|
|
3073
|
-
AXMReservationManagementMenuProvider: AXMReservationManagementMenuProvider
|
|
3074
|
-
});
|
|
3075
|
-
|
|
3076
|
-
class AXMReservationManagementPermissionDefinitionProvider {
|
|
3077
|
-
constructor() {
|
|
3078
|
-
this.translateService = inject(AXTranslationService);
|
|
3079
|
-
}
|
|
3080
|
-
async define(context) {
|
|
3081
|
-
const scope = RootConfig.config.i18n;
|
|
3082
|
-
const moduleTitle = await this.translateService.translateAsync(`@${scope}:module.title`);
|
|
3083
|
-
const typeTrans = async (key, field = 'title') => await this.translateService.translateAsync(`@${scope}:reservation-types.permissions.${key}.${field}`);
|
|
3084
|
-
const statusTrans = async (key, field = 'title') => await this.translateService.translateAsync(`@${scope}:reservation-statuses.permissions.${key}.${field}`);
|
|
3085
|
-
const classTrans = async (key, field = 'title') => await this.translateService.translateAsync(`@${scope}:reservation-classes.permissions.${key}.${field}`);
|
|
3086
|
-
const reservationTitle = await this.translateService.translateAsync(`@${scope}:reservations.permissions.reservations.title`);
|
|
3087
|
-
const reservationDesc = await this.translateService.translateAsync(`@${scope}:reservations.permissions.reservations.description`);
|
|
3088
|
-
const keys = AXMPermissionsKeys.ReservationManagement;
|
|
3089
|
-
context
|
|
3090
|
-
.addGroup(RootConfig.module.name, moduleTitle)
|
|
3091
|
-
.addPermission(keys.ReservationType.Management, await typeTrans('manage'), await typeTrans('manage', 'description'))
|
|
3092
|
-
.endPermission()
|
|
3093
|
-
.addPermission(keys.ReservationStatus.Management, await statusTrans('manage'), await statusTrans('manage', 'description'))
|
|
3094
|
-
.endPermission()
|
|
3095
|
-
.addPermission(keys.ReservationClass.Management, await classTrans('manage'), await classTrans('manage', 'description'))
|
|
3096
|
-
.endPermission()
|
|
3097
|
-
.addPermission(keys.Reservation.Management, reservationTitle, reservationDesc)
|
|
3098
|
-
.endPermission()
|
|
3099
|
-
.endGroup();
|
|
3100
|
-
}
|
|
3101
|
-
}
|
|
3102
|
-
|
|
3103
|
-
var permissionDefinition_provider = /*#__PURE__*/Object.freeze({
|
|
3104
|
-
__proto__: null,
|
|
3105
|
-
AXMReservationManagementPermissionDefinitionProvider: AXMReservationManagementPermissionDefinitionProvider
|
|
3106
|
-
});
|
|
3107
|
-
|
|
3108
|
-
//#region ---- Imports ----
|
|
3109
|
-
//#endregion
|
|
3110
|
-
//#region ---- Event Type Entity Module ----
|
|
3111
|
-
class AXPReservationManagementReservationClassEntityModule {
|
|
3112
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationClassEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3113
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationClassEntityModule }); }
|
|
3114
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationClassEntityModule, providers: [
|
|
3115
|
-
{
|
|
3116
|
-
provide: AXPReservationManagementReservationClassService,
|
|
3117
|
-
useClass: AXPReservationManagementReservationClassServiceImpl,
|
|
3118
|
-
},
|
|
3119
|
-
] }); }
|
|
3120
|
-
}
|
|
3121
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationClassEntityModule, decorators: [{
|
|
3122
|
-
type: NgModule,
|
|
3123
|
-
args: [{
|
|
3124
|
-
providers: [
|
|
3125
|
-
{
|
|
3126
|
-
provide: AXPReservationManagementReservationClassService,
|
|
3127
|
-
useClass: AXPReservationManagementReservationClassServiceImpl,
|
|
3128
|
-
},
|
|
3129
|
-
],
|
|
3130
|
-
}]
|
|
3131
|
-
}] });
|
|
3132
|
-
|
|
3133
|
-
//#region ---- Imports ----
|
|
3134
|
-
//#endregion
|
|
3135
|
-
//#region ---- Hold Type Entity Module ----
|
|
3136
|
-
class AXPReservationManagementReservationEventEntityModule {
|
|
3137
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEventEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3138
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEventEntityModule }); }
|
|
3139
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEventEntityModule, providers: [
|
|
3140
|
-
{
|
|
3141
|
-
provide: AXPReservationManagementReservationEventService,
|
|
3142
|
-
useClass: AXPReservationManagementReservationEventServiceImpl,
|
|
3143
|
-
},
|
|
3144
|
-
] }); }
|
|
3145
|
-
}
|
|
3146
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPReservationManagementReservationEventEntityModule, decorators: [{
|
|
3147
|
-
type: NgModule,
|
|
3148
|
-
args: [{
|
|
3149
|
-
providers: [
|
|
3150
|
-
{
|
|
3151
|
-
provide: AXPReservationManagementReservationEventService,
|
|
3152
|
-
useClass: AXPReservationManagementReservationEventServiceImpl,
|
|
3153
|
-
},
|
|
3154
|
-
],
|
|
3155
|
-
}]
|
|
3156
|
-
}] });
|
|
3157
|
-
|
|
3158
|
-
//#region ---- Imports ----
|
|
3159
|
-
//#endregion
|
|
3160
|
-
//#region ---- Manifest Definition ----
|
|
3161
|
-
/**
|
|
3162
|
-
* Reservation Management Module Manifest.
|
|
3163
|
-
* Defines module metadata, features, and provider references.
|
|
3164
|
-
*/
|
|
3165
|
-
const ReservationManagementManifest = {
|
|
3166
|
-
name: RootConfig.module.name,
|
|
3167
|
-
version: '1.0.0',
|
|
3168
|
-
title: RootConfig.module.title,
|
|
3169
|
-
icon: RootConfig.module.icon,
|
|
3170
|
-
i18n: RootConfig.config.i18n,
|
|
3171
|
-
required: false,
|
|
3172
|
-
// Module dependencies (optional)
|
|
3173
|
-
};
|
|
3174
|
-
//#endregion
|
|
3175
|
-
|
|
3176
|
-
//#region ---- Imports ----
|
|
3177
|
-
//#endregion
|
|
3178
|
-
//#region ---- Module ----
|
|
3179
|
-
class AXMReservationManagementModule {
|
|
3180
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMReservationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3181
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: AXMReservationManagementModule, imports: [AXPReservationManagementReservationTypeEntityModule,
|
|
3182
|
-
AXPReservationManagementReservationStatusEntityModule,
|
|
3183
|
-
AXPReservationManagementReservationClassEntityModule,
|
|
3184
|
-
AXPReservationManagementReservationEventEntityModule,
|
|
3185
|
-
AXPReservationManagementReservationEntityModule,
|
|
3186
|
-
AXPReservationPluginModule] }); }
|
|
3187
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMReservationManagementModule, providers: [
|
|
3188
|
-
// Module Manifest Provider
|
|
3189
|
-
{
|
|
3190
|
-
provide: AXP_MODULE_MANIFEST_PROVIDER,
|
|
3191
|
-
useValue: ReservationManagementManifest,
|
|
3192
|
-
multi: true,
|
|
3193
|
-
},
|
|
3194
|
-
// Provider references (now using tokens)
|
|
3195
|
-
provideLazyProvider(AXP_PERMISSION_DEFINITION_PROVIDER, () => Promise.resolve().then(function () { return permissionDefinition_provider; }).then((m) => m.AXMReservationManagementPermissionDefinitionProvider)),
|
|
3196
|
-
provideLazyProvider(AXP_MENU_PROVIDER, () => Promise.resolve().then(function () { return menu_provider; }).then((m) => m.AXMReservationManagementMenuProvider)),
|
|
3197
|
-
provideLazyProvider(AXP_ENTITY_DEFINITION_LOADER, () => Promise.resolve().then(function () { return entity_provider; }).then((m) => m.AXMReservationManagementEntityProvider)),
|
|
3198
|
-
provideLazyProvider(AXP_SEARCH_PROVIDER, () => Promise.resolve().then(function () { return search_provider; }).then((m) => m.AXMReservationManagementSearchCommandProvider)),
|
|
3199
|
-
], imports: [AXPReservationManagementReservationTypeEntityModule,
|
|
3200
|
-
AXPReservationManagementReservationStatusEntityModule,
|
|
3201
|
-
AXPReservationManagementReservationClassEntityModule,
|
|
3202
|
-
AXPReservationManagementReservationEventEntityModule,
|
|
3203
|
-
AXPReservationManagementReservationEntityModule,
|
|
3204
|
-
AXPReservationPluginModule] }); }
|
|
3205
|
-
}
|
|
3206
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMReservationManagementModule, decorators: [{
|
|
3207
|
-
type: NgModule,
|
|
3208
|
-
args: [{
|
|
3209
|
-
imports: [
|
|
3210
|
-
AXPReservationManagementReservationTypeEntityModule,
|
|
3211
|
-
AXPReservationManagementReservationStatusEntityModule,
|
|
3212
|
-
AXPReservationManagementReservationClassEntityModule,
|
|
3213
|
-
AXPReservationManagementReservationEventEntityModule,
|
|
3214
|
-
AXPReservationManagementReservationEntityModule,
|
|
3215
|
-
AXPReservationPluginModule,
|
|
3216
|
-
],
|
|
3217
|
-
providers: [
|
|
3218
|
-
// Module Manifest Provider
|
|
3219
|
-
{
|
|
3220
|
-
provide: AXP_MODULE_MANIFEST_PROVIDER,
|
|
3221
|
-
useValue: ReservationManagementManifest,
|
|
3222
|
-
multi: true,
|
|
3223
|
-
},
|
|
3224
|
-
// Provider references (now using tokens)
|
|
3225
|
-
provideLazyProvider(AXP_PERMISSION_DEFINITION_PROVIDER, () => Promise.resolve().then(function () { return permissionDefinition_provider; }).then((m) => m.AXMReservationManagementPermissionDefinitionProvider)),
|
|
3226
|
-
provideLazyProvider(AXP_MENU_PROVIDER, () => Promise.resolve().then(function () { return menu_provider; }).then((m) => m.AXMReservationManagementMenuProvider)),
|
|
3227
|
-
provideLazyProvider(AXP_ENTITY_DEFINITION_LOADER, () => Promise.resolve().then(function () { return entity_provider; }).then((m) => m.AXMReservationManagementEntityProvider)),
|
|
3228
|
-
provideLazyProvider(AXP_SEARCH_PROVIDER, () => Promise.resolve().then(function () { return search_provider; }).then((m) => m.AXMReservationManagementSearchCommandProvider)),
|
|
3229
|
-
],
|
|
3230
|
-
}]
|
|
3231
|
-
}] });
|
|
3232
|
-
|
|
3233
|
-
class AXMSearchCommandProvider extends AXPSearchCommandProvider {
|
|
3234
|
-
constructor() {
|
|
3235
|
-
super(...arguments);
|
|
3236
|
-
this.commands = [
|
|
3237
|
-
// {
|
|
3238
|
-
// group: 'command',
|
|
3239
|
-
// title: 'New Form Template',
|
|
3240
|
-
// icon: RootConfig.entities.template.icon,
|
|
3241
|
-
// description: 'Create a new form template for designing reusable forms.', // Added description
|
|
3242
|
-
// commands: {
|
|
3243
|
-
// 'create-entity': {
|
|
3244
|
-
// entity: `${RootConfig.module.name}.${RootConfig.entities.template.name}`,
|
|
3245
|
-
// },
|
|
3246
|
-
// },
|
|
3247
|
-
// }
|
|
3248
|
-
];
|
|
3249
|
-
}
|
|
3250
|
-
}
|
|
3251
|
-
|
|
3252
|
-
//#region ---- Imports ----
|
|
3253
|
-
//#endregion
|
|
3254
|
-
//#region ---- Search Provider ----
|
|
3255
|
-
class AXMReservationManagementSearchCommandProvider extends AXPSearchCommandProvider {
|
|
3256
|
-
constructor() {
|
|
3257
|
-
super(...arguments);
|
|
3258
|
-
this.commands = [
|
|
3259
|
-
{
|
|
3260
|
-
group: 'entity',
|
|
3261
|
-
title: '@reservation-management:assets.search.create-asset.title',
|
|
3262
|
-
icon: RootConfig.entities.reservation.icon,
|
|
3263
|
-
description: '@reservation-management:assets.search.create-asset.description',
|
|
3264
|
-
command: {
|
|
3265
|
-
name: 'create-entity',
|
|
3266
|
-
options: {
|
|
3267
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.reservation.name}`,
|
|
3268
|
-
},
|
|
3269
|
-
},
|
|
3270
|
-
},
|
|
3271
|
-
// {
|
|
3272
|
-
// group: 'entity',
|
|
3273
|
-
// title: '@asset-management:asset-statuses.search.create-asset-status.title',
|
|
3274
|
-
// icon: RootConfig.entities.assetStatus.icon,
|
|
3275
|
-
// description: '@asset-management:asset-statuses.search.create-asset-status.description',
|
|
3276
|
-
// command: {
|
|
3277
|
-
// name: 'create-entity',
|
|
3278
|
-
// options: {
|
|
3279
|
-
// entity: `${RootConfig.module.name}.${RootConfig.entities.assetStatus.name}`,
|
|
3280
|
-
// },
|
|
3281
|
-
// },
|
|
3282
|
-
// },
|
|
3283
|
-
];
|
|
3284
|
-
}
|
|
3285
|
-
}
|
|
3286
|
-
//#endregion
|
|
3287
|
-
|
|
3288
|
-
var search_provider = /*#__PURE__*/Object.freeze({
|
|
3289
|
-
__proto__: null,
|
|
3290
|
-
AXMReservationManagementSearchCommandProvider: AXMReservationManagementSearchCommandProvider
|
|
3291
|
-
});
|
|
3292
|
-
|
|
3293
|
-
class AXMSettingProvider {
|
|
3294
|
-
async provide(context) {
|
|
3295
|
-
// context
|
|
3296
|
-
// // Add Form Template Group
|
|
3297
|
-
// .addGroup('form-template', 'Form Template', 'Settings related to form templates.', RootConfig.module.icon)
|
|
3298
|
-
// // Start Interface Section
|
|
3299
|
-
// .addSection('interface', 'UI Interface', 'Customize the user interface for forms.')
|
|
3300
|
-
// .addSetting({
|
|
3301
|
-
// key: 'history-panel',
|
|
3302
|
-
// title: 'Show History Panel',
|
|
3303
|
-
// scope: 'U',
|
|
3304
|
-
// isInherited: true,
|
|
3305
|
-
// defaultValue: false,
|
|
3306
|
-
// widget: {
|
|
3307
|
-
// type: AXPWidgetsCatalog.toggle,
|
|
3308
|
-
// },
|
|
3309
|
-
// description: 'Enable or disable the history panel for forms.',
|
|
3310
|
-
// validationRules: [
|
|
3311
|
-
// {
|
|
3312
|
-
// rule: 'required',
|
|
3313
|
-
// },
|
|
3314
|
-
// ],
|
|
3315
|
-
// })
|
|
3316
|
-
// .endSection()
|
|
3317
|
-
// .endGroup();
|
|
3318
|
-
}
|
|
3319
|
-
}
|
|
3320
|
-
|
|
3321
|
-
/**
|
|
3322
|
-
* Generated bundle index. Do not edit.
|
|
3323
|
-
*/
|
|
3324
|
-
|
|
3325
|
-
export { AXMPermissionsKeys, AXMReservationManagementEntityProvider, AXMReservationManagementMenuKeys, AXMReservationManagementMenuProvider, AXMReservationManagementModule, AXMReservationManagementPermissionDefinitionProvider, AXMReservationManagementSearchCommandProvider, AXMSearchCommandProvider, AXMSettingProvider, AXPReservationManagementReservationClassService, AXPReservationManagementReservationClassServiceImpl, AXPReservationManagementReservationEntityModule, AXPReservationManagementReservationEventService, AXPReservationManagementReservationEventServiceImpl, AXPReservationManagementReservationService, AXPReservationManagementReservationServiceImpl, AXPReservationManagementReservationStatusEntityModule, AXPReservationManagementReservationStatusService, AXPReservationManagementReservationStatusServiceImpl, AXPReservationManagementReservationTypeEntityModule, AXPReservationManagementReservationTypeService, AXPReservationManagementReservationTypeServiceImpl, AXPReservationPanelWidget, AXPReservationPanelWidgetComponent, AXPReservationPluginModule, AXPReservationService, RootConfig, reservationClassFactory, reservationEventFactory, reservationFactory, reservationPlugin, reservationStatusFactory, reservationTypeFactory };
|
|
1
|
+
export { y as AXMPermissionsKeys, u as AXMReservationManagementEntityProvider, v as AXMReservationManagementMenuKeys, w as AXMReservationManagementMenuProvider, z as AXMReservationManagementModule, x as AXMReservationManagementPermissionDefinitionProvider, C as AXMReservationManagementSearchCommandProvider, B as AXMSearchCommandProvider, D as AXMSettingProvider, g as AXPReservationManagementReservationClassService, h as AXPReservationManagementReservationClassServiceImpl, c as AXPReservationManagementReservationEntityModule, j as AXPReservationManagementReservationEventService, k as AXPReservationManagementReservationEventServiceImpl, d as AXPReservationManagementReservationService, e as AXPReservationManagementReservationServiceImpl, m as AXPReservationManagementReservationStatusEntityModule, n as AXPReservationManagementReservationStatusService, o as AXPReservationManagementReservationStatusServiceImpl, q as AXPReservationManagementReservationTypeEntityModule, s as AXPReservationManagementReservationTypeService, t as AXPReservationManagementReservationTypeServiceImpl, R as RootConfig, f as reservationClassFactory, i as reservationEventFactory, r as reservationFactory, l as reservationStatusFactory, p as reservationTypeFactory } from './acorex-modules-reservation-management-acorex-modules-reservation-management-CkHGIQ38.mjs';
|
|
3326
2
|
//# sourceMappingURL=acorex-modules-reservation-management.mjs.map
|