@flusys/nestjs-event-manager 7.0.2 → 8.0.0-beta.1
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/adapters/event-manager.adapter.d.ts +2 -2
- package/adapters/index.d.ts +1 -1
- package/config/index.d.ts +3 -3
- package/controllers/event.controller.d.ts +3 -3
- package/controllers/index.d.ts +1 -1
- package/docs/event-manager-swagger.config.d.ts +2 -2
- package/docs/index.d.ts +1 -1
- package/dtos/calendar-query.dto.d.ts +1 -1
- package/dtos/event.dto.d.ts +1 -1
- package/dtos/index.d.ts +3 -3
- package/entities/event-with-company.entity.d.ts +1 -1
- package/entities/index.d.ts +8 -8
- package/fesm/477.js +1798 -0
- package/fesm/833.js +840 -0
- package/fesm/adapters/index.js +884 -1
- package/fesm/config/index.js +87 -3
- package/fesm/controllers/index.js +365 -1
- package/fesm/docs/index.js +155 -2
- package/fesm/dtos/index.js +720 -3
- package/fesm/entities/index.js +350 -11
- package/fesm/index.js +121 -9
- package/fesm/interfaces/index.js +16 -2
- package/fesm/modules/index.js +13 -1
- package/fesm/runtime.js +85 -0
- package/fesm/services/index.js +272 -4
- package/index.d.ts +9 -9
- package/interfaces/event-manager-module.interface.d.ts +3 -3
- package/interfaces/event.interface.d.ts +1 -1
- package/interfaces/index.d.ts +2 -2
- package/modules/event-manager.module.d.ts +2 -2
- package/modules/index.d.ts +1 -1
- package/package.json +29 -39
- package/services/event-manager-config.service.d.ts +3 -3
- package/services/event-manager-datasource.provider.d.ts +3 -3
- package/services/event-manager-helper.service.d.ts +3 -3
- package/services/event.service.d.ts +7 -7
- package/services/index.d.ts +4 -4
- package/cjs/adapters/event-manager.adapter.js +0 -65
- package/cjs/adapters/event-manager.adapter.spec.js +0 -104
- package/cjs/adapters/index.js +0 -18
- package/cjs/config/event-actions.js +0 -31
- package/cjs/config/event-manager.constants.js +0 -13
- package/cjs/config/index.js +0 -20
- package/cjs/config/message-keys.js +0 -27
- package/cjs/controllers/event.controller.js +0 -190
- package/cjs/controllers/event.controller.spec.js +0 -156
- package/cjs/controllers/index.js +0 -18
- package/cjs/docs/event-manager-swagger.config.js +0 -125
- package/cjs/docs/event-manager-swagger.config.spec.js +0 -65
- package/cjs/docs/index.js +0 -21
- package/cjs/dtos/calendar-query.dto.js +0 -212
- package/cjs/dtos/event-participant.dto.js +0 -181
- package/cjs/dtos/event.dto.js +0 -343
- package/cjs/dtos/index.js +0 -20
- package/cjs/entities/event-participant.entity.js +0 -89
- package/cjs/entities/event-with-company.entity.js +0 -56
- package/cjs/entities/event.entity.js +0 -156
- package/cjs/entities/index.js +0 -55
- package/cjs/entities/index.spec.js +0 -18
- package/cjs/index.js +0 -27
- package/cjs/interfaces/event-manager-module.interface.js +0 -4
- package/cjs/interfaces/event.interface.js +0 -4
- package/cjs/interfaces/index.js +0 -19
- package/cjs/modules/event-manager.module.js +0 -132
- package/cjs/modules/event-manager.module.spec.js +0 -146
- package/cjs/modules/index.js +0 -18
- package/cjs/services/event-manager-config.service.js +0 -76
- package/cjs/services/event-manager-config.service.spec.js +0 -111
- package/cjs/services/event-manager-datasource.provider.js +0 -84
- package/cjs/services/event-manager-datasource.provider.spec.js +0 -198
- package/cjs/services/event-manager-helper.service.js +0 -235
- package/cjs/services/event-manager-helper.service.spec.js +0 -327
- package/cjs/services/event.service.js +0 -481
- package/cjs/services/event.service.spec.js +0 -929
- package/cjs/services/index.js +0 -21
- package/fesm/adapters/event-manager.adapter.js +0 -55
- package/fesm/adapters/event-manager.adapter.spec.js +0 -100
- package/fesm/config/event-actions.js +0 -10
- package/fesm/config/event-manager.constants.js +0 -3
- package/fesm/config/message-keys.js +0 -9
- package/fesm/controllers/event.controller.js +0 -180
- package/fesm/controllers/event.controller.spec.js +0 -152
- package/fesm/docs/event-manager-swagger.config.js +0 -118
- package/fesm/docs/event-manager-swagger.config.spec.js +0 -61
- package/fesm/dtos/calendar-query.dto.js +0 -194
- package/fesm/dtos/event-participant.dto.js +0 -157
- package/fesm/dtos/event.dto.js +0 -322
- package/fesm/entities/event-participant.entity.js +0 -79
- package/fesm/entities/event-with-company.entity.js +0 -46
- package/fesm/entities/event.entity.js +0 -146
- package/fesm/entities/index.spec.js +0 -14
- package/fesm/interfaces/event-manager-module.interface.js +0 -3
- package/fesm/interfaces/event.interface.js +0 -1
- package/fesm/modules/event-manager.module.js +0 -122
- package/fesm/modules/event-manager.module.spec.js +0 -142
- package/fesm/services/event-manager-config.service.js +0 -66
- package/fesm/services/event-manager-config.service.spec.js +0 -107
- package/fesm/services/event-manager-datasource.provider.js +0 -74
- package/fesm/services/event-manager-datasource.provider.spec.js +0 -194
- package/fesm/services/event-manager-helper.service.js +0 -225
- package/fesm/services/event-manager-helper.service.spec.js +0 -323
- package/fesm/services/event.service.js +0 -471
- package/fesm/services/event.service.spec.js +0 -925
package/fesm/833.js
ADDED
|
@@ -0,0 +1,840 @@
|
|
|
1
|
+
import { ListResponseDto, SingleResponseDto } from "@flusys/nestjs-shared/dtos";
|
|
2
|
+
import { JwtAuthGuard, PermissionGuard } from "@flusys/nestjs-shared/guards";
|
|
3
|
+
import * as __rspack_external__flusys_nestjs_shared_interfaces_413f2706 from "@flusys/nestjs-shared/interfaces";
|
|
4
|
+
export const __rspack_esm_id = 833;
|
|
5
|
+
export const __rspack_esm_ids = [833];
|
|
6
|
+
export const __webpack_modules__ = {
|
|
7
|
+
219(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
8
|
+
|
|
9
|
+
// EXPORTS
|
|
10
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
$: () => (/* reexport */ EventManagerAdapter)
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// EXTERNAL MODULE: external "@nestjs/common"
|
|
15
|
+
var common_ = __webpack_require__(157);
|
|
16
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/services/event-manager-helper.service.ts
|
|
17
|
+
var event_manager_helper_service = __webpack_require__(605);
|
|
18
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/adapters/event-manager.adapter.ts
|
|
19
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
20
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
21
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
22
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
23
|
+
} else {
|
|
24
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
25
|
+
if (d = decorators[i]) {
|
|
26
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
31
|
+
}
|
|
32
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
33
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
34
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function _ts_param(paramIndex, decorator) {
|
|
38
|
+
return function(target, key) {
|
|
39
|
+
decorator(target, key, paramIndex);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class EventManagerAdapter {
|
|
45
|
+
eventManagerHelper;
|
|
46
|
+
constructor(eventManagerHelper){
|
|
47
|
+
this.eventManagerHelper = eventManagerHelper;
|
|
48
|
+
}
|
|
49
|
+
async createEvent(options) {
|
|
50
|
+
return this.eventManagerHelper.createEvent(options);
|
|
51
|
+
}
|
|
52
|
+
async updateParticipantStatus(participantId, status) {
|
|
53
|
+
await this.eventManagerHelper.updateParticipantStatus(participantId, status);
|
|
54
|
+
}
|
|
55
|
+
async getEventsForUser(userId, startDate, endDate, companyId) {
|
|
56
|
+
return this.eventManagerHelper.getEventsForUser(userId, startDate.toISOString().split('T')[0], endDate.toISOString().split('T')[0], companyId);
|
|
57
|
+
}
|
|
58
|
+
async getEventById(eventId) {
|
|
59
|
+
return this.eventManagerHelper.getEventById(eventId);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
EventManagerAdapter = _ts_decorate([
|
|
63
|
+
(0,common_.Injectable)(),
|
|
64
|
+
_ts_param(0, (0,common_.Inject)(event_manager_helper_service/* .EventManagerHelperService */.x)),
|
|
65
|
+
_ts_metadata("design:type", Function),
|
|
66
|
+
_ts_metadata("design:paramtypes", [
|
|
67
|
+
typeof event_manager_helper_service/* .EventManagerHelperService */.x === "undefined" ? Object : event_manager_helper_service/* .EventManagerHelperService */.x
|
|
68
|
+
])
|
|
69
|
+
], EventManagerAdapter);
|
|
70
|
+
|
|
71
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/adapters/index.ts
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
},
|
|
76
|
+
558(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
77
|
+
|
|
78
|
+
// EXPORTS
|
|
79
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
80
|
+
d: () => (/* reexport */ EventController)
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/classes"
|
|
84
|
+
var classes_ = __webpack_require__(937);
|
|
85
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/decorators"
|
|
86
|
+
var decorators_ = __webpack_require__(265);
|
|
87
|
+
;// CONCATENATED MODULE: external "@flusys/nestjs-shared/dtos"
|
|
88
|
+
|
|
89
|
+
;// CONCATENATED MODULE: external "@flusys/nestjs-shared/guards"
|
|
90
|
+
|
|
91
|
+
// EXTERNAL MODULE: external "@nestjs/common"
|
|
92
|
+
var common_ = __webpack_require__(157);
|
|
93
|
+
// EXTERNAL MODULE: external "@nestjs/swagger"
|
|
94
|
+
var swagger_ = __webpack_require__(176);
|
|
95
|
+
// EXTERNAL MODULE: external "class-transformer"
|
|
96
|
+
var external_class_transformer_ = __webpack_require__(812);
|
|
97
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/config/message-keys.ts
|
|
98
|
+
var message_keys = __webpack_require__(401);
|
|
99
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/docs/index.ts + 1 modules
|
|
100
|
+
var docs = __webpack_require__(283);
|
|
101
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/dtos/index.ts + 4 modules
|
|
102
|
+
var dtos = __webpack_require__(178);
|
|
103
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/services/event.service.ts + 1 modules
|
|
104
|
+
var event_service = __webpack_require__(332);
|
|
105
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/controllers/event.controller.ts
|
|
106
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
107
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
108
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
109
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
110
|
+
} else {
|
|
111
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
112
|
+
if (d = decorators[i]) {
|
|
113
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
118
|
+
}
|
|
119
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
120
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
121
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function _ts_param(paramIndex, decorator) {
|
|
125
|
+
return function(target, key) {
|
|
126
|
+
decorator(target, key, paramIndex);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class EventController extends (0,classes_.createApiController)(dtos/* .CreateEventDto */.wJ, dtos/* .UpdateEventDto */.XJ, dtos/* .EventResponseDto */.XZ, {
|
|
141
|
+
entityName: 'event',
|
|
142
|
+
security: {
|
|
143
|
+
insert: {
|
|
144
|
+
level: 'permission',
|
|
145
|
+
permissions: [
|
|
146
|
+
docs/* .EVENT_PERMISSIONS.CREATE */.U.CREATE
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
insertMany: {
|
|
150
|
+
level: 'permission',
|
|
151
|
+
permissions: [
|
|
152
|
+
docs/* .EVENT_PERMISSIONS.CREATE */.U.CREATE
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
getById: {
|
|
156
|
+
level: 'permission',
|
|
157
|
+
permissions: [
|
|
158
|
+
docs/* .EVENT_PERMISSIONS.READ */.U.READ
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
getAll: {
|
|
162
|
+
level: 'permission',
|
|
163
|
+
permissions: [
|
|
164
|
+
docs/* .EVENT_PERMISSIONS.READ */.U.READ
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
update: {
|
|
168
|
+
level: 'permission',
|
|
169
|
+
permissions: [
|
|
170
|
+
docs/* .EVENT_PERMISSIONS.UPDATE */.U.UPDATE
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
updateMany: {
|
|
174
|
+
level: 'permission',
|
|
175
|
+
permissions: [
|
|
176
|
+
docs/* .EVENT_PERMISSIONS.UPDATE */.U.UPDATE
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
delete: {
|
|
180
|
+
level: 'permission',
|
|
181
|
+
permissions: [
|
|
182
|
+
docs/* .EVENT_PERMISSIONS.DELETE */.U.DELETE
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}) {
|
|
187
|
+
eventService;
|
|
188
|
+
constructor(eventService){
|
|
189
|
+
super(eventService), this.eventService = eventService;
|
|
190
|
+
}
|
|
191
|
+
async getCalendarEvents(dto, user) {
|
|
192
|
+
const events = await this.eventService.getEventsForCalendarRange(dto, user);
|
|
193
|
+
const plainOptions = {
|
|
194
|
+
excludeExtraneousValues: true
|
|
195
|
+
};
|
|
196
|
+
const data = (0,external_class_transformer_.plainToInstance)(dtos/* .CalendarEventResponseDto */.hh, events, plainOptions);
|
|
197
|
+
return {
|
|
198
|
+
success: true,
|
|
199
|
+
message: 'Calendar events retrieved successfully',
|
|
200
|
+
messageKey: message_keys/* .EVENT_MESSAGES.GET_ALL_SUCCESS */.G.GET_ALL_SUCCESS,
|
|
201
|
+
data,
|
|
202
|
+
meta: {
|
|
203
|
+
total: data.length,
|
|
204
|
+
page: 0,
|
|
205
|
+
pageSize: data.length,
|
|
206
|
+
count: data.length
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
async updateParticipantStatus(dto, user) {
|
|
211
|
+
const participant = await this.eventService.updateParticipantStatus(dto, user);
|
|
212
|
+
const plainOptions = {
|
|
213
|
+
excludeExtraneousValues: true
|
|
214
|
+
};
|
|
215
|
+
return {
|
|
216
|
+
success: true,
|
|
217
|
+
message: 'Participant status updated successfully',
|
|
218
|
+
messageKey: message_keys/* .EVENT_PARTICIPANT_MESSAGES.STATUS_UPDATE_SUCCESS */.C.STATUS_UPDATE_SUCCESS,
|
|
219
|
+
data: (0,external_class_transformer_.plainToInstance)(dtos/* .EventParticipantResponseDto */.KA, participant, plainOptions)
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
_ts_decorate([
|
|
224
|
+
(0,common_.Post)('calendar'),
|
|
225
|
+
(0,common_.UseGuards)(JwtAuthGuard),
|
|
226
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
227
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
228
|
+
(0,swagger_.ApiOperation)({
|
|
229
|
+
summary: 'Get events for calendar range with recurrence expansion'
|
|
230
|
+
}),
|
|
231
|
+
(0,swagger_.ApiBody)({
|
|
232
|
+
type: dtos/* .CalendarQueryDto */.it
|
|
233
|
+
}),
|
|
234
|
+
(0,swagger_.ApiResponse)({
|
|
235
|
+
status: 200,
|
|
236
|
+
description: 'Calendar events retrieved successfully',
|
|
237
|
+
type: ListResponseDto
|
|
238
|
+
}),
|
|
239
|
+
_ts_param(0, (0,common_.Body)()),
|
|
240
|
+
_ts_param(1, (0,decorators_.CurrentUser)()),
|
|
241
|
+
_ts_metadata("design:type", Function),
|
|
242
|
+
_ts_metadata("design:paramtypes", [
|
|
243
|
+
typeof dtos/* .CalendarQueryDto */.it === "undefined" ? Object : dtos/* .CalendarQueryDto */.it,
|
|
244
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
245
|
+
]),
|
|
246
|
+
_ts_metadata("design:returntype", Promise)
|
|
247
|
+
], EventController.prototype, "getCalendarEvents", null);
|
|
248
|
+
_ts_decorate([
|
|
249
|
+
(0,common_.Post)('update-participant-status'),
|
|
250
|
+
(0,common_.UseGuards)(JwtAuthGuard, PermissionGuard),
|
|
251
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
252
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
253
|
+
(0,decorators_.RequirePermission)(docs/* .EVENT_PERMISSIONS.UPDATE */.U.UPDATE),
|
|
254
|
+
(0,swagger_.ApiOperation)({
|
|
255
|
+
summary: 'Update participant status (accept/decline/tentative)'
|
|
256
|
+
}),
|
|
257
|
+
(0,swagger_.ApiBody)({
|
|
258
|
+
type: dtos/* .UpdateParticipantStatusDto */.Wk
|
|
259
|
+
}),
|
|
260
|
+
(0,swagger_.ApiResponse)({
|
|
261
|
+
status: 200,
|
|
262
|
+
type: SingleResponseDto
|
|
263
|
+
}),
|
|
264
|
+
_ts_param(0, (0,common_.Body)()),
|
|
265
|
+
_ts_param(1, (0,decorators_.CurrentUser)()),
|
|
266
|
+
_ts_metadata("design:type", Function),
|
|
267
|
+
_ts_metadata("design:paramtypes", [
|
|
268
|
+
typeof dtos/* .UpdateParticipantStatusDto */.Wk === "undefined" ? Object : dtos/* .UpdateParticipantStatusDto */.Wk,
|
|
269
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
270
|
+
]),
|
|
271
|
+
_ts_metadata("design:returntype", Promise)
|
|
272
|
+
], EventController.prototype, "updateParticipantStatus", null);
|
|
273
|
+
EventController = _ts_decorate([
|
|
274
|
+
(0,swagger_.ApiTags)('Events'),
|
|
275
|
+
(0,common_.Controller)('event-manager/event'),
|
|
276
|
+
_ts_param(0, (0,common_.Inject)(event_service/* .EventService */.U)),
|
|
277
|
+
_ts_metadata("design:type", Function),
|
|
278
|
+
_ts_metadata("design:paramtypes", [
|
|
279
|
+
typeof event_service/* .EventService */.U === "undefined" ? Object : event_service/* .EventService */.U
|
|
280
|
+
])
|
|
281
|
+
], EventController);
|
|
282
|
+
|
|
283
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/controllers/index.ts
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
},
|
|
288
|
+
283(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
289
|
+
|
|
290
|
+
// EXPORTS
|
|
291
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
292
|
+
U: () => (/* reexport */ nestjs_shared_.EVENT_PERMISSIONS),
|
|
293
|
+
S: () => (/* reexport */ eventManagerSwaggerConfig)
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared"
|
|
297
|
+
var nestjs_shared_ = __webpack_require__(422);
|
|
298
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/docs/event-manager-swagger.config.ts
|
|
299
|
+
/** Schema properties to exclude when company feature is disabled */ const COMPANY_SCHEMA_EXCLUSIONS = [
|
|
300
|
+
{
|
|
301
|
+
schemaName: 'EventResponseDto',
|
|
302
|
+
properties: [
|
|
303
|
+
'companyId'
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
schemaName: 'CalendarEventResponseDto',
|
|
308
|
+
properties: [
|
|
309
|
+
'companyId'
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
];
|
|
313
|
+
function buildDescription(enableCompanyFeature, isMultiTenant) {
|
|
314
|
+
const multiTenantNote = isMultiTenant ? `\n> **Multi-Tenant Mode**: Include \`x-tenant-id\` header to target a specific tenant database.\n` : '';
|
|
315
|
+
const companyFeatures = enableCompanyFeature ? '\n- **Company-scoped events**' : '';
|
|
316
|
+
const companyIsolation = enableCompanyFeature ? '\n- **Company isolation**' : '';
|
|
317
|
+
const multiTenantSection = enableCompanyFeature ? `
|
|
318
|
+
## Multi-Tenant Support
|
|
319
|
+
|
|
320
|
+
Events are automatically isolated by:
|
|
321
|
+
- **Company ID**: Events belong to specific companies
|
|
322
|
+
- **User Context**: Participants are company members
|
|
323
|
+
|
|
324
|
+
All queries automatically filter by current user's company context.
|
|
325
|
+
` : '';
|
|
326
|
+
return `
|
|
327
|
+
# Event Manager API
|
|
328
|
+
${multiTenantNote}
|
|
329
|
+
Calendar event management with recurrence support${enableCompanyFeature ? ' and multi-tenant capabilities' : ''}.
|
|
330
|
+
|
|
331
|
+
## Features
|
|
332
|
+
|
|
333
|
+
### 📅 Event Management
|
|
334
|
+
- Create, read, update, delete events
|
|
335
|
+
- Color-coded events
|
|
336
|
+
- All-day event support${companyFeatures}
|
|
337
|
+
|
|
338
|
+
### 🔄 Recurrence Support
|
|
339
|
+
- **None**: Single occurrence
|
|
340
|
+
- **Daily**: Every day
|
|
341
|
+
- **Weekly**: Specific days of the week
|
|
342
|
+
- **Biweekly**: Every two weeks
|
|
343
|
+
- **Monthly**: Same day each month
|
|
344
|
+
|
|
345
|
+
### 👥 Participant Management
|
|
346
|
+
- Status tracking (pending, accepted, declined, tentative)
|
|
347
|
+
- Organizer designation
|
|
348
|
+
|
|
349
|
+
### 📆 Calendar Queries
|
|
350
|
+
- Date range queries
|
|
351
|
+
- Automatic recurrence expansion
|
|
352
|
+
- Filter by user participation
|
|
353
|
+
- Include/exclude participants in response
|
|
354
|
+
|
|
355
|
+
### 🔒 Security
|
|
356
|
+
- JWT authentication required
|
|
357
|
+
- Permission-based access control${companyIsolation}
|
|
358
|
+
|
|
359
|
+
## Recurrence Patterns
|
|
360
|
+
|
|
361
|
+
### Weekly Recurrence
|
|
362
|
+
Use the \`weekDays\` array to specify which days repeat:
|
|
363
|
+
- \`"SUN"\` = Sunday
|
|
364
|
+
- \`"MON"\` = Monday
|
|
365
|
+
- \`"TUE"\` = Tuesday
|
|
366
|
+
- \`"WED"\` = Wednesday
|
|
367
|
+
- \`"THU"\` = Thursday
|
|
368
|
+
- \`"FRI"\` = Friday
|
|
369
|
+
- \`"SAT"\` = Saturday
|
|
370
|
+
|
|
371
|
+
Example: \`{ "weekDays": ["MON", "WED", "FRI"] }\` = Monday, Wednesday, Friday
|
|
372
|
+
|
|
373
|
+
### Recurrence Expansion
|
|
374
|
+
Calendar queries automatically expand recurring events into individual instances.
|
|
375
|
+
Each instance includes:
|
|
376
|
+
- \`isRecurrenceInstance: true\`
|
|
377
|
+
- \`originalEventId\`: Reference to parent event
|
|
378
|
+
${multiTenantSection}
|
|
379
|
+
## API Endpoints
|
|
380
|
+
|
|
381
|
+
All endpoints use POST method (RPC style):
|
|
382
|
+
|
|
383
|
+
### Events
|
|
384
|
+
- \`/event-manager/event/insert\` - Create event
|
|
385
|
+
- \`/event-manager/event/get/:id\` - Get by ID
|
|
386
|
+
- \`/event-manager/event/get-all\` - List with pagination
|
|
387
|
+
- \`/event-manager/event/update\` - Update event
|
|
388
|
+
- \`/event-manager/event/delete\` - Soft delete
|
|
389
|
+
- \`/event-manager/event/calendar\` - Calendar query with expansion
|
|
390
|
+
|
|
391
|
+
### Participant Operations (via Event endpoints)
|
|
392
|
+
- \`/event-manager/event/update-participant-status\` - Update status
|
|
393
|
+
|
|
394
|
+
## Getting Started
|
|
395
|
+
|
|
396
|
+
1. **Authenticate**: Obtain JWT token from /auth/login
|
|
397
|
+
2. **Create Event**: POST to /event-manager/event/insert
|
|
398
|
+
3. **Query Calendar**: POST to /event-manager/event/calendar with date range
|
|
399
|
+
`;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Event Manager Module Swagger Configuration
|
|
403
|
+
* Use this with setupSwaggerDocs() from @flusys/nestjs-core
|
|
404
|
+
*/ function eventManagerSwaggerConfig(bootstrapConfig) {
|
|
405
|
+
const enableCompanyFeature = bootstrapConfig?.enableCompanyFeature ?? true;
|
|
406
|
+
const isMultiTenant = bootstrapConfig?.databaseMode === 'multi-tenant';
|
|
407
|
+
return {
|
|
408
|
+
title: 'Event Manager API',
|
|
409
|
+
description: buildDescription(enableCompanyFeature, isMultiTenant),
|
|
410
|
+
version: '1.0',
|
|
411
|
+
path: 'api/docs/event-manager',
|
|
412
|
+
bearerAuth: true,
|
|
413
|
+
excludeTags: [],
|
|
414
|
+
excludeSchemaProperties: enableCompanyFeature ? undefined : COMPANY_SCHEMA_EXCLUSIONS
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/docs/index.ts
|
|
419
|
+
// Re-export permissions from shared for convenience
|
|
420
|
+
|
|
421
|
+
// Swagger configuration
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
},
|
|
426
|
+
120(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
427
|
+
|
|
428
|
+
// EXPORTS
|
|
429
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
430
|
+
_: () => (/* reexport */ EventManagerModule)
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/modules"
|
|
434
|
+
var modules_ = __webpack_require__(236);
|
|
435
|
+
;// CONCATENATED MODULE: external "@flusys/nestjs-shared/interfaces"
|
|
436
|
+
|
|
437
|
+
// EXTERNAL MODULE: external "@nestjs/common"
|
|
438
|
+
var common_ = __webpack_require__(157);
|
|
439
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/config/event-manager.constants.ts
|
|
440
|
+
var event_manager_constants = __webpack_require__(890);
|
|
441
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/controllers/index.ts + 3 modules
|
|
442
|
+
var controllers = __webpack_require__(558);
|
|
443
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/adapters/index.ts + 1 modules
|
|
444
|
+
var adapters = __webpack_require__(219);
|
|
445
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/services/index.ts
|
|
446
|
+
var services = __webpack_require__(965);
|
|
447
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/modules/event-manager.module.ts
|
|
448
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
449
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
450
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
451
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
452
|
+
} else {
|
|
453
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
454
|
+
if (d = decorators[i]) {
|
|
455
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
const CONTROLLERS = [
|
|
469
|
+
controllers/* .EventController */.d
|
|
470
|
+
];
|
|
471
|
+
const EXPORTED_SERVICES = [
|
|
472
|
+
services/* .EventManagerConfigService */.$_,
|
|
473
|
+
services/* .EventManagerDataSourceProvider */.a1,
|
|
474
|
+
services/* .EventManagerHelperService */.x_,
|
|
475
|
+
services/* .EventService */.US
|
|
476
|
+
];
|
|
477
|
+
const ADAPTER_PROVIDER = {
|
|
478
|
+
provide: __rspack_external__flusys_nestjs_shared_interfaces_413f2706.EVENT_MANAGER_ADAPTER,
|
|
479
|
+
useClass: adapters/* .EventManagerAdapter */.$
|
|
480
|
+
};
|
|
481
|
+
class EventManagerModule {
|
|
482
|
+
static forRoot(options) {
|
|
483
|
+
return {
|
|
484
|
+
module: EventManagerModule,
|
|
485
|
+
global: options.global ?? false,
|
|
486
|
+
imports: [
|
|
487
|
+
modules_.CacheModule,
|
|
488
|
+
modules_.UtilsModule
|
|
489
|
+
],
|
|
490
|
+
controllers: options.includeController !== false ? CONTROLLERS : [],
|
|
491
|
+
providers: [
|
|
492
|
+
...this.buildProviders(options),
|
|
493
|
+
adapters/* .EventManagerAdapter */.$,
|
|
494
|
+
ADAPTER_PROVIDER
|
|
495
|
+
],
|
|
496
|
+
exports: [
|
|
497
|
+
...EXPORTED_SERVICES,
|
|
498
|
+
__rspack_external__flusys_nestjs_shared_interfaces_413f2706.EVENT_MANAGER_ADAPTER
|
|
499
|
+
]
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
static forRootAsync(options) {
|
|
503
|
+
return {
|
|
504
|
+
module: EventManagerModule,
|
|
505
|
+
global: options.global ?? false,
|
|
506
|
+
imports: [
|
|
507
|
+
...options.imports || [],
|
|
508
|
+
modules_.CacheModule,
|
|
509
|
+
modules_.UtilsModule
|
|
510
|
+
],
|
|
511
|
+
controllers: options.includeController !== false ? CONTROLLERS : [],
|
|
512
|
+
providers: [
|
|
513
|
+
...this.createAsyncProviders(options),
|
|
514
|
+
...this.buildProviders(),
|
|
515
|
+
adapters/* .EventManagerAdapter */.$,
|
|
516
|
+
ADAPTER_PROVIDER
|
|
517
|
+
],
|
|
518
|
+
exports: [
|
|
519
|
+
...EXPORTED_SERVICES,
|
|
520
|
+
__rspack_external__flusys_nestjs_shared_interfaces_413f2706.EVENT_MANAGER_ADAPTER
|
|
521
|
+
]
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
// Private Helpers
|
|
525
|
+
static buildProviders(options) {
|
|
526
|
+
const providers = [
|
|
527
|
+
...EXPORTED_SERVICES
|
|
528
|
+
];
|
|
529
|
+
if (options) {
|
|
530
|
+
providers.unshift({
|
|
531
|
+
provide: event_manager_constants/* .EVENT_MANAGER_MODULE_OPTIONS */.D,
|
|
532
|
+
useValue: options
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
providers.push((0,modules_.createModuleEventsProvider)('event-manager', event_manager_constants/* .EVENT_MANAGER_MODULE_OPTIONS */.D));
|
|
536
|
+
return providers;
|
|
537
|
+
}
|
|
538
|
+
static createAsyncProviders(options) {
|
|
539
|
+
if (options.useFactory) {
|
|
540
|
+
return [
|
|
541
|
+
{
|
|
542
|
+
provide: event_manager_constants/* .EVENT_MANAGER_MODULE_OPTIONS */.D,
|
|
543
|
+
useFactory: async (...args)=>({
|
|
544
|
+
...options,
|
|
545
|
+
config: await options.useFactory(...args)
|
|
546
|
+
}),
|
|
547
|
+
inject: options.inject || []
|
|
548
|
+
}
|
|
549
|
+
];
|
|
550
|
+
}
|
|
551
|
+
const factoryClass = options.useClass || options.useExisting;
|
|
552
|
+
if (!factoryClass) return [];
|
|
553
|
+
const providers = [
|
|
554
|
+
{
|
|
555
|
+
provide: event_manager_constants/* .EVENT_MANAGER_MODULE_OPTIONS */.D,
|
|
556
|
+
useFactory: async (factory)=>({
|
|
557
|
+
...options,
|
|
558
|
+
config: await factory.createEventManagerOptions()
|
|
559
|
+
}),
|
|
560
|
+
inject: [
|
|
561
|
+
factoryClass
|
|
562
|
+
]
|
|
563
|
+
}
|
|
564
|
+
];
|
|
565
|
+
if (options.useClass) {
|
|
566
|
+
providers.push({
|
|
567
|
+
provide: options.useClass,
|
|
568
|
+
useClass: options.useClass
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
return providers;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
EventManagerModule = _ts_decorate([
|
|
575
|
+
(0,common_.Module)({})
|
|
576
|
+
], EventManagerModule);
|
|
577
|
+
|
|
578
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/modules/index.ts
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
},
|
|
583
|
+
605(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
584
|
+
/* import */ var _config_index_js__rspack_import_9 = __webpack_require__(401);
|
|
585
|
+
/* import */ var _nestjs_common__rspack_import_0 = __webpack_require__(157);
|
|
586
|
+
/* import */ var typeorm__rspack_import_1 = __webpack_require__(158);
|
|
587
|
+
/* import */ var _flusys_nestjs_shared_classes__rspack_import_2 = __webpack_require__(937);
|
|
588
|
+
/* import */ var _flusys_nestjs_shared_decorators__rspack_import_3 = __webpack_require__(265);
|
|
589
|
+
/* import */ var _flusys_nestjs_shared_modules__rspack_import_4 = __webpack_require__(236);
|
|
590
|
+
/* import */ var _flusys_nestjs_shared__rspack_import_5 = __webpack_require__(422);
|
|
591
|
+
/* import */ var _event_manager_config_service_js__rspack_import_6 = __webpack_require__(619);
|
|
592
|
+
/* import */ var _event_manager_datasource_provider_js__rspack_import_7 = __webpack_require__(324);
|
|
593
|
+
/* import */ var _entities_index_js__rspack_import_8 = __webpack_require__(80);
|
|
594
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
595
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
596
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
597
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
598
|
+
} else {
|
|
599
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
600
|
+
if (d = decorators[i]) {
|
|
601
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
606
|
+
}
|
|
607
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
608
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
609
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function _ts_param(paramIndex, decorator) {
|
|
613
|
+
return function(target, key) {
|
|
614
|
+
decorator(target, key, paramIndex);
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
class EventManagerHelperService {
|
|
628
|
+
cacheManager;
|
|
629
|
+
utilsService;
|
|
630
|
+
configService;
|
|
631
|
+
dataSourceProvider;
|
|
632
|
+
eventEntityName = 'event';
|
|
633
|
+
dataSource = null;
|
|
634
|
+
constructor(cacheManager, utilsService, configService, dataSourceProvider){
|
|
635
|
+
this.cacheManager = cacheManager;
|
|
636
|
+
this.utilsService = utilsService;
|
|
637
|
+
this.configService = configService;
|
|
638
|
+
this.dataSourceProvider = dataSourceProvider;
|
|
639
|
+
}
|
|
640
|
+
async getDataSource() {
|
|
641
|
+
if (!this.dataSource) {
|
|
642
|
+
this.dataSource = await this.dataSourceProvider.getDataSource();
|
|
643
|
+
}
|
|
644
|
+
return this.dataSource;
|
|
645
|
+
}
|
|
646
|
+
async getEventRepository() {
|
|
647
|
+
const ds = await this.getDataSource();
|
|
648
|
+
const EntityClass = this.configService.isCompanyFeatureEnabled() ? _entities_index_js__rspack_import_8/* .EventWithCompany */.QO : _entities_index_js__rspack_import_8/* .Event */.Jh;
|
|
649
|
+
return ds.getRepository(EntityClass);
|
|
650
|
+
}
|
|
651
|
+
async getParticipantRepository() {
|
|
652
|
+
const ds = await this.getDataSource();
|
|
653
|
+
return ds.getRepository(_entities_index_js__rspack_import_8/* .EventParticipant */.ek);
|
|
654
|
+
}
|
|
655
|
+
async createEvent(options) {
|
|
656
|
+
const repo = await this.getEventRepository();
|
|
657
|
+
const isAllDay = options.isAllDay ?? false;
|
|
658
|
+
const entity = {
|
|
659
|
+
title: options.title,
|
|
660
|
+
description: options.description ?? null,
|
|
661
|
+
eventDate: options.eventDate,
|
|
662
|
+
startTime: isAllDay ? '00:00' : options.startTime,
|
|
663
|
+
endTime: isAllDay ? '23:59' : options.endTime,
|
|
664
|
+
isAllDay,
|
|
665
|
+
recurrenceType: options.recurrenceType ?? _flusys_nestjs_shared__rspack_import_5.RecurrenceType.NONE,
|
|
666
|
+
recurrenceEndDate: options.recurrenceEndDate ?? null,
|
|
667
|
+
weekDays: options.weekDays ?? null,
|
|
668
|
+
color: options.color ?? this.configService.getDefaultColor(),
|
|
669
|
+
meetingLink: options.meetingLink ?? null,
|
|
670
|
+
isActive: true
|
|
671
|
+
};
|
|
672
|
+
if (this.configService.isCompanyFeatureEnabled() && options.companyId) {
|
|
673
|
+
entity.companyId = options.companyId;
|
|
674
|
+
}
|
|
675
|
+
const saved = await repo.save(entity);
|
|
676
|
+
await this.addEventParticipants(saved.id, options.participantIds ?? [], options.organizerId);
|
|
677
|
+
await this.clearCache();
|
|
678
|
+
return this.toEventResult(saved);
|
|
679
|
+
}
|
|
680
|
+
async updateParticipantStatus(participantId, status) {
|
|
681
|
+
const participantRepo = await this.getParticipantRepository();
|
|
682
|
+
const participant = await participantRepo.findOne({
|
|
683
|
+
where: {
|
|
684
|
+
id: participantId,
|
|
685
|
+
deletedAt: (0,typeorm__rspack_import_1.IsNull)()
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
if (!participant) {
|
|
689
|
+
throw new _nestjs_common__rspack_import_0.NotFoundException({
|
|
690
|
+
message: 'Event participant not found',
|
|
691
|
+
messageKey: _config_index_js__rspack_import_9/* .EVENT_PARTICIPANT_MESSAGES.NOT_FOUND */.C.NOT_FOUND
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
participant.status = status;
|
|
695
|
+
await participantRepo.save(participant);
|
|
696
|
+
}
|
|
697
|
+
async getEventsForUser(userId, startDate, endDate, companyId) {
|
|
698
|
+
const eventRepo = await this.getEventRepository();
|
|
699
|
+
const participantRepo = await this.getParticipantRepository();
|
|
700
|
+
const participantEvents = await participantRepo.createQueryBuilder('ep').select('ep.eventId').where('ep.userId = :userId', {
|
|
701
|
+
userId
|
|
702
|
+
}).andWhere('ep.deletedAt IS NULL').getRawMany();
|
|
703
|
+
const eventIds = participantEvents.map((p)=>p.ep_event_id);
|
|
704
|
+
if (eventIds.length === 0) {
|
|
705
|
+
return [];
|
|
706
|
+
}
|
|
707
|
+
const query = eventRepo.createQueryBuilder('event').where('event.id IN (:...eventIds)', {
|
|
708
|
+
eventIds
|
|
709
|
+
}).andWhere('event.deletedAt IS NULL').andWhere('event.isActive = :isActive', {
|
|
710
|
+
isActive: true
|
|
711
|
+
}).andWhere('event.eventDate <= :endDate', {
|
|
712
|
+
endDate
|
|
713
|
+
}).andWhere('event.eventDate >= :startDate', {
|
|
714
|
+
startDate
|
|
715
|
+
});
|
|
716
|
+
if (this.configService.isCompanyFeatureEnabled() && companyId) {
|
|
717
|
+
query.andWhere('event.companyId = :companyId', {
|
|
718
|
+
companyId
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
const events = await query.getMany();
|
|
722
|
+
return events.map((e)=>this.toEventResult(e));
|
|
723
|
+
}
|
|
724
|
+
async getEventById(eventId) {
|
|
725
|
+
const repo = await this.getEventRepository();
|
|
726
|
+
const event = await repo.findOne({
|
|
727
|
+
where: {
|
|
728
|
+
id: eventId,
|
|
729
|
+
deletedAt: (0,typeorm__rspack_import_1.IsNull)()
|
|
730
|
+
}
|
|
731
|
+
});
|
|
732
|
+
return event ? this.toEventResult(event) : null;
|
|
733
|
+
}
|
|
734
|
+
async addEventParticipants(eventId, participantIds, organizerId) {
|
|
735
|
+
if (!organizerId && participantIds.length === 0) return;
|
|
736
|
+
const participantRepo = await this.getParticipantRepository();
|
|
737
|
+
const allUserIds = new Set([
|
|
738
|
+
...organizerId ? [
|
|
739
|
+
organizerId
|
|
740
|
+
] : [],
|
|
741
|
+
...participantIds
|
|
742
|
+
]);
|
|
743
|
+
const participants = Array.from(allUserIds).map((userId)=>({
|
|
744
|
+
eventId,
|
|
745
|
+
userId,
|
|
746
|
+
status: _flusys_nestjs_shared__rspack_import_5.ParticipantStatus.PENDING,
|
|
747
|
+
isOrganizer: userId === organizerId
|
|
748
|
+
}));
|
|
749
|
+
await participantRepo.save(participants);
|
|
750
|
+
}
|
|
751
|
+
toEventResult(event) {
|
|
752
|
+
const eventExt = event;
|
|
753
|
+
return {
|
|
754
|
+
id: event.id,
|
|
755
|
+
title: event.title,
|
|
756
|
+
description: event.description,
|
|
757
|
+
eventDate: event.eventDate,
|
|
758
|
+
startTime: event.startTime,
|
|
759
|
+
endTime: event.endTime,
|
|
760
|
+
isAllDay: event.isAllDay,
|
|
761
|
+
recurrenceType: event.recurrenceType,
|
|
762
|
+
recurrenceEndDate: event.recurrenceEndDate,
|
|
763
|
+
weekDays: event.weekDays,
|
|
764
|
+
color: event.color,
|
|
765
|
+
meetingLink: event.meetingLink ?? null,
|
|
766
|
+
isActive: event.isActive,
|
|
767
|
+
companyId: eventExt.companyId ?? null,
|
|
768
|
+
createdAt: event.createdAt,
|
|
769
|
+
updatedAt: event.updatedAt
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
async clearCache() {
|
|
773
|
+
await this.utilsService.clearCache(this.eventEntityName, this.cacheManager);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
_ts_decorate([
|
|
777
|
+
(0,_flusys_nestjs_shared_decorators__rspack_import_3.LogAction)({
|
|
778
|
+
action: 'event.create',
|
|
779
|
+
module: 'event-manager'
|
|
780
|
+
}),
|
|
781
|
+
_ts_metadata("design:type", Function),
|
|
782
|
+
_ts_metadata("design:paramtypes", [
|
|
783
|
+
typeof CreateEventOptions === "undefined" ? Object : CreateEventOptions
|
|
784
|
+
]),
|
|
785
|
+
_ts_metadata("design:returntype", Promise)
|
|
786
|
+
], EventManagerHelperService.prototype, "createEvent", null);
|
|
787
|
+
_ts_decorate([
|
|
788
|
+
(0,_flusys_nestjs_shared_decorators__rspack_import_3.LogAction)({
|
|
789
|
+
action: 'eventParticipant.updateStatus',
|
|
790
|
+
module: 'event-manager'
|
|
791
|
+
}),
|
|
792
|
+
_ts_metadata("design:type", Function),
|
|
793
|
+
_ts_metadata("design:paramtypes", [
|
|
794
|
+
String,
|
|
795
|
+
typeof _flusys_nestjs_shared__rspack_import_5.ParticipantStatus === "undefined" ? Object : _flusys_nestjs_shared__rspack_import_5.ParticipantStatus
|
|
796
|
+
]),
|
|
797
|
+
_ts_metadata("design:returntype", Promise)
|
|
798
|
+
], EventManagerHelperService.prototype, "updateParticipantStatus", null);
|
|
799
|
+
EventManagerHelperService = _ts_decorate([
|
|
800
|
+
(0,_nestjs_common__rspack_import_0.Injectable)(),
|
|
801
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_0.Inject)('CACHE_INSTANCE')),
|
|
802
|
+
_ts_param(1, (0,_nestjs_common__rspack_import_0.Inject)(_flusys_nestjs_shared_modules__rspack_import_4.UtilsService)),
|
|
803
|
+
_ts_param(2, (0,_nestjs_common__rspack_import_0.Inject)(_event_manager_config_service_js__rspack_import_6/* .EventManagerConfigService */.$)),
|
|
804
|
+
_ts_param(3, (0,_nestjs_common__rspack_import_0.Inject)(_event_manager_datasource_provider_js__rspack_import_7/* .EventManagerDataSourceProvider */.a)),
|
|
805
|
+
_ts_metadata("design:type", Function),
|
|
806
|
+
_ts_metadata("design:paramtypes", [
|
|
807
|
+
typeof _flusys_nestjs_shared_classes__rspack_import_2.HybridCache === "undefined" ? Object : _flusys_nestjs_shared_classes__rspack_import_2.HybridCache,
|
|
808
|
+
typeof _flusys_nestjs_shared_modules__rspack_import_4.UtilsService === "undefined" ? Object : _flusys_nestjs_shared_modules__rspack_import_4.UtilsService,
|
|
809
|
+
typeof _event_manager_config_service_js__rspack_import_6/* .EventManagerConfigService */.$ === "undefined" ? Object : _event_manager_config_service_js__rspack_import_6/* .EventManagerConfigService */.$,
|
|
810
|
+
typeof _event_manager_datasource_provider_js__rspack_import_7/* .EventManagerDataSourceProvider */.a === "undefined" ? Object : _event_manager_datasource_provider_js__rspack_import_7/* .EventManagerDataSourceProvider */.a
|
|
811
|
+
])
|
|
812
|
+
], EventManagerHelperService);
|
|
813
|
+
|
|
814
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
815
|
+
x: () => (EventManagerHelperService)
|
|
816
|
+
});
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
},
|
|
820
|
+
965(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
821
|
+
/* import */ var _event_manager_config_service_js__rspack_import_0 = __webpack_require__(619);
|
|
822
|
+
/* import */ var _event_manager_datasource_provider_js__rspack_import_1 = __webpack_require__(324);
|
|
823
|
+
/* import */ var _event_manager_helper_service_js__rspack_import_2 = __webpack_require__(605);
|
|
824
|
+
/* import */ var _event_service_js__rspack_import_3 = __webpack_require__(332);
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
831
|
+
$_: () => (/* reexport safe */ _event_manager_config_service_js__rspack_import_0.$),
|
|
832
|
+
US: () => (/* reexport safe */ _event_service_js__rspack_import_3.U),
|
|
833
|
+
a1: () => (/* reexport safe */ _event_manager_datasource_provider_js__rspack_import_1.a),
|
|
834
|
+
x_: () => (/* reexport safe */ _event_manager_helper_service_js__rspack_import_2.x)
|
|
835
|
+
});
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
},
|
|
839
|
+
|
|
840
|
+
};
|