@flusys/nestjs-event-manager 7.1.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/477.js
ADDED
|
@@ -0,0 +1,1798 @@
|
|
|
1
|
+
import * as __rspack_external__flusys_nestjs_shared_393d2cae from "@flusys/nestjs-shared";
|
|
2
|
+
import * as __rspack_external__flusys_nestjs_shared_classes_6076a329 from "@flusys/nestjs-shared/classes";
|
|
3
|
+
import * as __rspack_external__flusys_nestjs_shared_decorators_c129b601 from "@flusys/nestjs-shared/decorators";
|
|
4
|
+
import * as __rspack_external__flusys_nestjs_shared_enums_327421f8 from "@flusys/nestjs-shared/enums";
|
|
5
|
+
import * as __rspack_external__flusys_nestjs_shared_modules_24702bee from "@flusys/nestjs-shared/modules";
|
|
6
|
+
import * as __rspack_external__nestjs_common_a04939da from "@nestjs/common";
|
|
7
|
+
import * as __rspack_external__nestjs_swagger_7cd450b5 from "@nestjs/swagger";
|
|
8
|
+
import * as __rspack_external_class_transformer_c5a479fb from "class-transformer";
|
|
9
|
+
import * as __rspack_external_typeorm from "typeorm";
|
|
10
|
+
import * as __rspack_external__nestjs_core_d7b00a1a from "@nestjs/core";
|
|
11
|
+
import * as __rspack_external__flusys_nestjs_shared_entities_420e6d19 from "@flusys/nestjs-shared/entities";
|
|
12
|
+
import * as __rspack_external_class_validator_7b99ef4d from "class-validator";
|
|
13
|
+
import * as __rspack_external__flusys_nestjs_shared_utils_9125c1f1 from "@flusys/nestjs-shared/utils";
|
|
14
|
+
export const __rspack_esm_id = 477;
|
|
15
|
+
export const __rspack_esm_ids = [477];
|
|
16
|
+
export const __webpack_modules__ = {
|
|
17
|
+
782(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
18
|
+
/**
|
|
19
|
+
* Domain event actions published by the event manager module, alongside the CRUD
|
|
20
|
+
* lifecycle actions every ApiService emits.
|
|
21
|
+
*/ const EVENT_MANAGER_EVENT_ACTIONS = {
|
|
22
|
+
PARTICIPANT_STATUS_CHANGED: 'participant-status-changed'
|
|
23
|
+
};
|
|
24
|
+
/** Every entity the event manager module publishes under */ const EVENT_MANAGER_EVENT_ENTITIES = {
|
|
25
|
+
EVENT: 'event'
|
|
26
|
+
};
|
|
27
|
+
const EVENT_MANAGER_EVENT_MODULE = 'event-manager';
|
|
28
|
+
|
|
29
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
30
|
+
}, {
|
|
31
|
+
i2: EVENT_MANAGER_EVENT_ACTIONS,
|
|
32
|
+
sI: EVENT_MANAGER_EVENT_ENTITIES,
|
|
33
|
+
vR: EVENT_MANAGER_EVENT_MODULE
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
},
|
|
38
|
+
890(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
39
|
+
/**
|
|
40
|
+
* Event Manager Module Constants
|
|
41
|
+
*/ const EVENT_MANAGER_MODULE_OPTIONS = 'EVENT_MANAGER_MODULE_OPTIONS';
|
|
42
|
+
|
|
43
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
44
|
+
}, {
|
|
45
|
+
D: EVENT_MANAGER_MODULE_OPTIONS
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
},
|
|
50
|
+
401(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
51
|
+
// ==================== EVENT MANAGER MODULE MESSAGE KEYS ====================
|
|
52
|
+
const EVENT_MESSAGES = {
|
|
53
|
+
GET_ALL_SUCCESS: 'event.get.all.success',
|
|
54
|
+
NOT_FOUND: 'event.not.found'
|
|
55
|
+
};
|
|
56
|
+
const EVENT_PARTICIPANT_MESSAGES = {
|
|
57
|
+
NOT_FOUND: 'event.participant.not.found',
|
|
58
|
+
STATUS_UPDATE_SUCCESS: 'event.participant.status.update.success'
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
62
|
+
}, {
|
|
63
|
+
C: EVENT_PARTICIPANT_MESSAGES,
|
|
64
|
+
G: EVENT_MESSAGES
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
},
|
|
69
|
+
178(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
70
|
+
|
|
71
|
+
// EXPORTS
|
|
72
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
73
|
+
hh: () => (/* reexport */ CalendarEventResponseDto),
|
|
74
|
+
it: () => (/* reexport */ CalendarQueryDto),
|
|
75
|
+
wJ: () => (/* reexport */ CreateEventDto),
|
|
76
|
+
nx: () => (/* reexport */ CreateEventParticipantDto),
|
|
77
|
+
KA: () => (/* reexport */ EventParticipantResponseDto),
|
|
78
|
+
XZ: () => (/* reexport */ EventResponseDto),
|
|
79
|
+
XJ: () => (/* reexport */ UpdateEventDto),
|
|
80
|
+
mF: () => (/* reexport */ UpdateEventParticipantDto),
|
|
81
|
+
Wk: () => (/* reexport */ UpdateParticipantStatusDto)
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/enums"
|
|
85
|
+
var enums_ = __webpack_require__(471);
|
|
86
|
+
// EXTERNAL MODULE: external "@nestjs/swagger"
|
|
87
|
+
var swagger_ = __webpack_require__(176);
|
|
88
|
+
// EXTERNAL MODULE: external "class-transformer"
|
|
89
|
+
var external_class_transformer_ = __webpack_require__(812);
|
|
90
|
+
;// CONCATENATED MODULE: external "class-validator"
|
|
91
|
+
|
|
92
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/dtos/event-participant.dto.ts
|
|
93
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
94
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
95
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
96
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
97
|
+
} else {
|
|
98
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
99
|
+
if (d = decorators[i]) {
|
|
100
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
105
|
+
}
|
|
106
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
107
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
108
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class CreateEventParticipantDto {
|
|
116
|
+
eventId;
|
|
117
|
+
userId;
|
|
118
|
+
status;
|
|
119
|
+
isOrganizer;
|
|
120
|
+
}
|
|
121
|
+
_ts_decorate([
|
|
122
|
+
(0,swagger_.ApiProperty)({
|
|
123
|
+
description: 'Event ID',
|
|
124
|
+
example: 'f2e9c8d0-7a2a-11eb-9439-0242ac130002'
|
|
125
|
+
}),
|
|
126
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
127
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsUUID)(),
|
|
128
|
+
_ts_metadata("design:type", String)
|
|
129
|
+
], CreateEventParticipantDto.prototype, "eventId", void 0);
|
|
130
|
+
_ts_decorate([
|
|
131
|
+
(0,swagger_.ApiProperty)({
|
|
132
|
+
description: 'User ID',
|
|
133
|
+
example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
|
|
134
|
+
}),
|
|
135
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
136
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsUUID)(),
|
|
137
|
+
_ts_metadata("design:type", String)
|
|
138
|
+
], CreateEventParticipantDto.prototype, "userId", void 0);
|
|
139
|
+
_ts_decorate([
|
|
140
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
141
|
+
description: 'Participation status',
|
|
142
|
+
enum: enums_.ParticipantStatus,
|
|
143
|
+
default: enums_.ParticipantStatus.PENDING
|
|
144
|
+
}),
|
|
145
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
146
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsEnum)(enums_.ParticipantStatus),
|
|
147
|
+
_ts_metadata("design:type", typeof enums_.ParticipantStatus === "undefined" ? Object : enums_.ParticipantStatus)
|
|
148
|
+
], CreateEventParticipantDto.prototype, "status", void 0);
|
|
149
|
+
_ts_decorate([
|
|
150
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
151
|
+
description: 'Is the organizer of the event',
|
|
152
|
+
default: false
|
|
153
|
+
}),
|
|
154
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
155
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsBoolean)(),
|
|
156
|
+
_ts_metadata("design:type", Boolean)
|
|
157
|
+
], CreateEventParticipantDto.prototype, "isOrganizer", void 0);
|
|
158
|
+
class UpdateEventParticipantDto extends (0,swagger_.PartialType)(CreateEventParticipantDto) {
|
|
159
|
+
id;
|
|
160
|
+
}
|
|
161
|
+
_ts_decorate([
|
|
162
|
+
(0,swagger_.ApiProperty)({
|
|
163
|
+
description: 'Event Participant ID',
|
|
164
|
+
example: 'f2e9c8d0-7a2a-11eb-9439-0242ac130002'
|
|
165
|
+
}),
|
|
166
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsUUID)(),
|
|
167
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
168
|
+
_ts_metadata("design:type", String)
|
|
169
|
+
], UpdateEventParticipantDto.prototype, "id", void 0);
|
|
170
|
+
class EventParticipantResponseDto {
|
|
171
|
+
id;
|
|
172
|
+
eventId;
|
|
173
|
+
userId;
|
|
174
|
+
status;
|
|
175
|
+
isOrganizer;
|
|
176
|
+
createdAt;
|
|
177
|
+
updatedAt;
|
|
178
|
+
}
|
|
179
|
+
_ts_decorate([
|
|
180
|
+
(0,external_class_transformer_.Expose)(),
|
|
181
|
+
(0,swagger_.ApiProperty)(),
|
|
182
|
+
_ts_metadata("design:type", String)
|
|
183
|
+
], EventParticipantResponseDto.prototype, "id", void 0);
|
|
184
|
+
_ts_decorate([
|
|
185
|
+
(0,external_class_transformer_.Expose)(),
|
|
186
|
+
(0,swagger_.ApiProperty)(),
|
|
187
|
+
_ts_metadata("design:type", String)
|
|
188
|
+
], EventParticipantResponseDto.prototype, "eventId", void 0);
|
|
189
|
+
_ts_decorate([
|
|
190
|
+
(0,external_class_transformer_.Expose)(),
|
|
191
|
+
(0,swagger_.ApiProperty)(),
|
|
192
|
+
_ts_metadata("design:type", String)
|
|
193
|
+
], EventParticipantResponseDto.prototype, "userId", void 0);
|
|
194
|
+
_ts_decorate([
|
|
195
|
+
(0,external_class_transformer_.Expose)(),
|
|
196
|
+
(0,swagger_.ApiProperty)({
|
|
197
|
+
enum: enums_.ParticipantStatus
|
|
198
|
+
}),
|
|
199
|
+
_ts_metadata("design:type", String)
|
|
200
|
+
], EventParticipantResponseDto.prototype, "status", void 0);
|
|
201
|
+
_ts_decorate([
|
|
202
|
+
(0,external_class_transformer_.Expose)(),
|
|
203
|
+
(0,swagger_.ApiProperty)(),
|
|
204
|
+
_ts_metadata("design:type", Boolean)
|
|
205
|
+
], EventParticipantResponseDto.prototype, "isOrganizer", void 0);
|
|
206
|
+
_ts_decorate([
|
|
207
|
+
(0,external_class_transformer_.Expose)(),
|
|
208
|
+
(0,swagger_.ApiProperty)(),
|
|
209
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
210
|
+
], EventParticipantResponseDto.prototype, "createdAt", void 0);
|
|
211
|
+
_ts_decorate([
|
|
212
|
+
(0,external_class_transformer_.Expose)(),
|
|
213
|
+
(0,swagger_.ApiProperty)(),
|
|
214
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
215
|
+
], EventParticipantResponseDto.prototype, "updatedAt", void 0);
|
|
216
|
+
class UpdateParticipantStatusDto {
|
|
217
|
+
id;
|
|
218
|
+
status;
|
|
219
|
+
}
|
|
220
|
+
_ts_decorate([
|
|
221
|
+
(0,swagger_.ApiProperty)({
|
|
222
|
+
description: 'Event Participant ID',
|
|
223
|
+
example: 'f2e9c8d0-7a2a-11eb-9439-0242ac130002'
|
|
224
|
+
}),
|
|
225
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsUUID)(),
|
|
226
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
227
|
+
_ts_metadata("design:type", String)
|
|
228
|
+
], UpdateParticipantStatusDto.prototype, "id", void 0);
|
|
229
|
+
_ts_decorate([
|
|
230
|
+
(0,swagger_.ApiProperty)({
|
|
231
|
+
description: 'New participation status',
|
|
232
|
+
enum: enums_.ParticipantStatus
|
|
233
|
+
}),
|
|
234
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
235
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsEnum)(enums_.ParticipantStatus),
|
|
236
|
+
_ts_metadata("design:type", typeof enums_.ParticipantStatus === "undefined" ? Object : enums_.ParticipantStatus)
|
|
237
|
+
], UpdateParticipantStatusDto.prototype, "status", void 0);
|
|
238
|
+
|
|
239
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/dtos/event.dto.ts
|
|
240
|
+
function event_dto_ts_decorate(decorators, target, key, desc) {
|
|
241
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
242
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
243
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
244
|
+
} else {
|
|
245
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
246
|
+
if (d = decorators[i]) {
|
|
247
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
252
|
+
}
|
|
253
|
+
function event_dto_ts_metadata(metadataKey, metadataValue) {
|
|
254
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
255
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
class CreateEventDto {
|
|
264
|
+
title;
|
|
265
|
+
description;
|
|
266
|
+
eventDate;
|
|
267
|
+
startTime;
|
|
268
|
+
endTime;
|
|
269
|
+
isAllDay;
|
|
270
|
+
recurrenceType;
|
|
271
|
+
recurrenceEndDate;
|
|
272
|
+
weekDays;
|
|
273
|
+
color;
|
|
274
|
+
isActive;
|
|
275
|
+
meetingLink;
|
|
276
|
+
participantIds;
|
|
277
|
+
}
|
|
278
|
+
event_dto_ts_decorate([
|
|
279
|
+
(0,swagger_.ApiProperty)({
|
|
280
|
+
description: 'Event title',
|
|
281
|
+
example: 'Team Meeting',
|
|
282
|
+
maxLength: 255
|
|
283
|
+
}),
|
|
284
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
285
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
286
|
+
(0,__rspack_external_class_validator_7b99ef4d.MaxLength)(255),
|
|
287
|
+
event_dto_ts_metadata("design:type", String)
|
|
288
|
+
], CreateEventDto.prototype, "title", void 0);
|
|
289
|
+
event_dto_ts_decorate([
|
|
290
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
291
|
+
description: 'Event description'
|
|
292
|
+
}),
|
|
293
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
294
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
295
|
+
event_dto_ts_metadata("design:type", String)
|
|
296
|
+
], CreateEventDto.prototype, "description", void 0);
|
|
297
|
+
event_dto_ts_decorate([
|
|
298
|
+
(0,swagger_.ApiProperty)({
|
|
299
|
+
description: 'Event date (YYYY-MM-DD)',
|
|
300
|
+
example: '2024-01-15'
|
|
301
|
+
}),
|
|
302
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
303
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
304
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
305
|
+
message: 'eventDate must be in YYYY-MM-DD format'
|
|
306
|
+
}),
|
|
307
|
+
event_dto_ts_metadata("design:type", String)
|
|
308
|
+
], CreateEventDto.prototype, "eventDate", void 0);
|
|
309
|
+
event_dto_ts_decorate([
|
|
310
|
+
(0,swagger_.ApiProperty)({
|
|
311
|
+
description: 'Start time (HH:mm)',
|
|
312
|
+
example: '09:00'
|
|
313
|
+
}),
|
|
314
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
315
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
316
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{2}:\d{2}$/, {
|
|
317
|
+
message: 'startTime must be in HH:mm format'
|
|
318
|
+
}),
|
|
319
|
+
event_dto_ts_metadata("design:type", String)
|
|
320
|
+
], CreateEventDto.prototype, "startTime", void 0);
|
|
321
|
+
event_dto_ts_decorate([
|
|
322
|
+
(0,swagger_.ApiProperty)({
|
|
323
|
+
description: 'End time (HH:mm)',
|
|
324
|
+
example: '10:00'
|
|
325
|
+
}),
|
|
326
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
327
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
328
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{2}:\d{2}$/, {
|
|
329
|
+
message: 'endTime must be in HH:mm format'
|
|
330
|
+
}),
|
|
331
|
+
event_dto_ts_metadata("design:type", String)
|
|
332
|
+
], CreateEventDto.prototype, "endTime", void 0);
|
|
333
|
+
event_dto_ts_decorate([
|
|
334
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
335
|
+
description: 'All day event flag',
|
|
336
|
+
default: false
|
|
337
|
+
}),
|
|
338
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
339
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsBoolean)(),
|
|
340
|
+
event_dto_ts_metadata("design:type", Boolean)
|
|
341
|
+
], CreateEventDto.prototype, "isAllDay", void 0);
|
|
342
|
+
event_dto_ts_decorate([
|
|
343
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
344
|
+
description: 'Recurrence type',
|
|
345
|
+
enum: enums_.RecurrenceType,
|
|
346
|
+
default: enums_.RecurrenceType.NONE
|
|
347
|
+
}),
|
|
348
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
349
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsEnum)(enums_.RecurrenceType),
|
|
350
|
+
event_dto_ts_metadata("design:type", typeof enums_.RecurrenceType === "undefined" ? Object : enums_.RecurrenceType)
|
|
351
|
+
], CreateEventDto.prototype, "recurrenceType", void 0);
|
|
352
|
+
event_dto_ts_decorate([
|
|
353
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
354
|
+
description: 'Recurrence end date (YYYY-MM-DD)',
|
|
355
|
+
example: '2024-12-31'
|
|
356
|
+
}),
|
|
357
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
358
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
359
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
360
|
+
message: 'recurrenceEndDate must be in YYYY-MM-DD format'
|
|
361
|
+
}),
|
|
362
|
+
event_dto_ts_metadata("design:type", Object)
|
|
363
|
+
], CreateEventDto.prototype, "recurrenceEndDate", void 0);
|
|
364
|
+
event_dto_ts_decorate([
|
|
365
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
366
|
+
description: 'Selected weekdays for WEEKLY recurrence (e.g. ["MON","WED"])',
|
|
367
|
+
type: [
|
|
368
|
+
String
|
|
369
|
+
]
|
|
370
|
+
}),
|
|
371
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
372
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsArray)(),
|
|
373
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)({
|
|
374
|
+
each: true
|
|
375
|
+
}),
|
|
376
|
+
event_dto_ts_metadata("design:type", Object)
|
|
377
|
+
], CreateEventDto.prototype, "weekDays", void 0);
|
|
378
|
+
event_dto_ts_decorate([
|
|
379
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
380
|
+
description: 'Event color (hex)',
|
|
381
|
+
example: '#3B82F6',
|
|
382
|
+
default: '#3B82F6'
|
|
383
|
+
}),
|
|
384
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
385
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
386
|
+
(0,__rspack_external_class_validator_7b99ef4d.MaxLength)(7),
|
|
387
|
+
event_dto_ts_metadata("design:type", String)
|
|
388
|
+
], CreateEventDto.prototype, "color", void 0);
|
|
389
|
+
event_dto_ts_decorate([
|
|
390
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
391
|
+
description: 'Active status',
|
|
392
|
+
default: true
|
|
393
|
+
}),
|
|
394
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
395
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsBoolean)(),
|
|
396
|
+
event_dto_ts_metadata("design:type", Boolean)
|
|
397
|
+
], CreateEventDto.prototype, "isActive", void 0);
|
|
398
|
+
event_dto_ts_decorate([
|
|
399
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
400
|
+
description: 'Meeting link URL (e.g. video call)',
|
|
401
|
+
example: 'https://meet.google.com/abc-def-ghi'
|
|
402
|
+
}),
|
|
403
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
404
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
405
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsUrl)({}, {
|
|
406
|
+
message: 'meetingLink must be a valid URL'
|
|
407
|
+
}),
|
|
408
|
+
(0,__rspack_external_class_validator_7b99ef4d.MaxLength)(500),
|
|
409
|
+
event_dto_ts_metadata("design:type", Object)
|
|
410
|
+
], CreateEventDto.prototype, "meetingLink", void 0);
|
|
411
|
+
event_dto_ts_decorate([
|
|
412
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
413
|
+
description: 'Participant user IDs',
|
|
414
|
+
type: [
|
|
415
|
+
String
|
|
416
|
+
]
|
|
417
|
+
}),
|
|
418
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
419
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsArray)(),
|
|
420
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsUUID)('4', {
|
|
421
|
+
each: true
|
|
422
|
+
}),
|
|
423
|
+
event_dto_ts_metadata("design:type", Array)
|
|
424
|
+
], CreateEventDto.prototype, "participantIds", void 0);
|
|
425
|
+
class UpdateEventDto extends (0,swagger_.PartialType)(CreateEventDto) {
|
|
426
|
+
id;
|
|
427
|
+
}
|
|
428
|
+
event_dto_ts_decorate([
|
|
429
|
+
(0,swagger_.ApiProperty)({
|
|
430
|
+
description: 'Event ID',
|
|
431
|
+
example: 'f2e9c8d0-7a2a-11eb-9439-0242ac130002'
|
|
432
|
+
}),
|
|
433
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsUUID)(),
|
|
434
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
435
|
+
event_dto_ts_metadata("design:type", String)
|
|
436
|
+
], UpdateEventDto.prototype, "id", void 0);
|
|
437
|
+
class EventResponseDto {
|
|
438
|
+
id;
|
|
439
|
+
title;
|
|
440
|
+
description;
|
|
441
|
+
eventDate;
|
|
442
|
+
startTime;
|
|
443
|
+
endTime;
|
|
444
|
+
isAllDay;
|
|
445
|
+
recurrenceType;
|
|
446
|
+
recurrenceEndDate;
|
|
447
|
+
weekDays;
|
|
448
|
+
color;
|
|
449
|
+
meetingLink;
|
|
450
|
+
isActive;
|
|
451
|
+
companyId;
|
|
452
|
+
createdAt;
|
|
453
|
+
updatedAt;
|
|
454
|
+
participants;
|
|
455
|
+
}
|
|
456
|
+
event_dto_ts_decorate([
|
|
457
|
+
(0,external_class_transformer_.Expose)(),
|
|
458
|
+
(0,swagger_.ApiProperty)(),
|
|
459
|
+
event_dto_ts_metadata("design:type", String)
|
|
460
|
+
], EventResponseDto.prototype, "id", void 0);
|
|
461
|
+
event_dto_ts_decorate([
|
|
462
|
+
(0,external_class_transformer_.Expose)(),
|
|
463
|
+
(0,swagger_.ApiProperty)(),
|
|
464
|
+
event_dto_ts_metadata("design:type", String)
|
|
465
|
+
], EventResponseDto.prototype, "title", void 0);
|
|
466
|
+
event_dto_ts_decorate([
|
|
467
|
+
(0,external_class_transformer_.Expose)(),
|
|
468
|
+
(0,swagger_.ApiPropertyOptional)(),
|
|
469
|
+
event_dto_ts_metadata("design:type", Object)
|
|
470
|
+
], EventResponseDto.prototype, "description", void 0);
|
|
471
|
+
event_dto_ts_decorate([
|
|
472
|
+
(0,external_class_transformer_.Expose)(),
|
|
473
|
+
(0,swagger_.ApiProperty)(),
|
|
474
|
+
event_dto_ts_metadata("design:type", String)
|
|
475
|
+
], EventResponseDto.prototype, "eventDate", void 0);
|
|
476
|
+
event_dto_ts_decorate([
|
|
477
|
+
(0,external_class_transformer_.Expose)(),
|
|
478
|
+
(0,swagger_.ApiProperty)(),
|
|
479
|
+
event_dto_ts_metadata("design:type", String)
|
|
480
|
+
], EventResponseDto.prototype, "startTime", void 0);
|
|
481
|
+
event_dto_ts_decorate([
|
|
482
|
+
(0,external_class_transformer_.Expose)(),
|
|
483
|
+
(0,swagger_.ApiProperty)(),
|
|
484
|
+
event_dto_ts_metadata("design:type", String)
|
|
485
|
+
], EventResponseDto.prototype, "endTime", void 0);
|
|
486
|
+
event_dto_ts_decorate([
|
|
487
|
+
(0,external_class_transformer_.Expose)(),
|
|
488
|
+
(0,swagger_.ApiProperty)(),
|
|
489
|
+
event_dto_ts_metadata("design:type", Boolean)
|
|
490
|
+
], EventResponseDto.prototype, "isAllDay", void 0);
|
|
491
|
+
event_dto_ts_decorate([
|
|
492
|
+
(0,external_class_transformer_.Expose)(),
|
|
493
|
+
(0,swagger_.ApiProperty)({
|
|
494
|
+
enum: enums_.RecurrenceType
|
|
495
|
+
}),
|
|
496
|
+
event_dto_ts_metadata("design:type", String)
|
|
497
|
+
], EventResponseDto.prototype, "recurrenceType", void 0);
|
|
498
|
+
event_dto_ts_decorate([
|
|
499
|
+
(0,external_class_transformer_.Expose)(),
|
|
500
|
+
(0,swagger_.ApiPropertyOptional)(),
|
|
501
|
+
event_dto_ts_metadata("design:type", Object)
|
|
502
|
+
], EventResponseDto.prototype, "recurrenceEndDate", void 0);
|
|
503
|
+
event_dto_ts_decorate([
|
|
504
|
+
(0,external_class_transformer_.Expose)(),
|
|
505
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
506
|
+
type: [
|
|
507
|
+
String
|
|
508
|
+
]
|
|
509
|
+
}),
|
|
510
|
+
event_dto_ts_metadata("design:type", Object)
|
|
511
|
+
], EventResponseDto.prototype, "weekDays", void 0);
|
|
512
|
+
event_dto_ts_decorate([
|
|
513
|
+
(0,external_class_transformer_.Expose)(),
|
|
514
|
+
(0,swagger_.ApiProperty)(),
|
|
515
|
+
event_dto_ts_metadata("design:type", String)
|
|
516
|
+
], EventResponseDto.prototype, "color", void 0);
|
|
517
|
+
event_dto_ts_decorate([
|
|
518
|
+
(0,external_class_transformer_.Expose)(),
|
|
519
|
+
(0,swagger_.ApiPropertyOptional)(),
|
|
520
|
+
event_dto_ts_metadata("design:type", Object)
|
|
521
|
+
], EventResponseDto.prototype, "meetingLink", void 0);
|
|
522
|
+
event_dto_ts_decorate([
|
|
523
|
+
(0,external_class_transformer_.Expose)(),
|
|
524
|
+
(0,swagger_.ApiProperty)(),
|
|
525
|
+
event_dto_ts_metadata("design:type", Boolean)
|
|
526
|
+
], EventResponseDto.prototype, "isActive", void 0);
|
|
527
|
+
event_dto_ts_decorate([
|
|
528
|
+
(0,external_class_transformer_.Expose)(),
|
|
529
|
+
(0,swagger_.ApiPropertyOptional)(),
|
|
530
|
+
event_dto_ts_metadata("design:type", Object)
|
|
531
|
+
], EventResponseDto.prototype, "companyId", void 0);
|
|
532
|
+
event_dto_ts_decorate([
|
|
533
|
+
(0,external_class_transformer_.Expose)(),
|
|
534
|
+
(0,swagger_.ApiProperty)(),
|
|
535
|
+
event_dto_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
536
|
+
], EventResponseDto.prototype, "createdAt", void 0);
|
|
537
|
+
event_dto_ts_decorate([
|
|
538
|
+
(0,external_class_transformer_.Expose)(),
|
|
539
|
+
(0,swagger_.ApiProperty)(),
|
|
540
|
+
event_dto_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
541
|
+
], EventResponseDto.prototype, "updatedAt", void 0);
|
|
542
|
+
event_dto_ts_decorate([
|
|
543
|
+
(0,external_class_transformer_.Expose)(),
|
|
544
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
545
|
+
type: ()=>[
|
|
546
|
+
EventParticipantResponseDto
|
|
547
|
+
]
|
|
548
|
+
}),
|
|
549
|
+
(0,external_class_transformer_.Type)(()=>EventParticipantResponseDto),
|
|
550
|
+
event_dto_ts_metadata("design:type", Array)
|
|
551
|
+
], EventResponseDto.prototype, "participants", void 0);
|
|
552
|
+
|
|
553
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/dtos/calendar-query.dto.ts
|
|
554
|
+
function calendar_query_dto_ts_decorate(decorators, target, key, desc) {
|
|
555
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
556
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
557
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
558
|
+
} else {
|
|
559
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
560
|
+
if (d = decorators[i]) {
|
|
561
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
566
|
+
}
|
|
567
|
+
function calendar_query_dto_ts_metadata(metadataKey, metadataValue) {
|
|
568
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
569
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
class CalendarQueryDto {
|
|
577
|
+
startDate;
|
|
578
|
+
endDate;
|
|
579
|
+
includeParticipants;
|
|
580
|
+
userId;
|
|
581
|
+
activeOnly;
|
|
582
|
+
}
|
|
583
|
+
calendar_query_dto_ts_decorate([
|
|
584
|
+
(0,swagger_.ApiProperty)({
|
|
585
|
+
description: 'Start date for calendar range (YYYY-MM-DD)',
|
|
586
|
+
example: '2024-01-01'
|
|
587
|
+
}),
|
|
588
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
589
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
590
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
591
|
+
message: 'startDate must be in YYYY-MM-DD format'
|
|
592
|
+
}),
|
|
593
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
594
|
+
], CalendarQueryDto.prototype, "startDate", void 0);
|
|
595
|
+
calendar_query_dto_ts_decorate([
|
|
596
|
+
(0,swagger_.ApiProperty)({
|
|
597
|
+
description: 'End date for calendar range (YYYY-MM-DD)',
|
|
598
|
+
example: '2024-01-31'
|
|
599
|
+
}),
|
|
600
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
601
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
602
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
603
|
+
message: 'endDate must be in YYYY-MM-DD format'
|
|
604
|
+
}),
|
|
605
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
606
|
+
], CalendarQueryDto.prototype, "endDate", void 0);
|
|
607
|
+
calendar_query_dto_ts_decorate([
|
|
608
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
609
|
+
description: 'Include participant details',
|
|
610
|
+
default: false
|
|
611
|
+
}),
|
|
612
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
613
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsBoolean)(),
|
|
614
|
+
calendar_query_dto_ts_metadata("design:type", Boolean)
|
|
615
|
+
], CalendarQueryDto.prototype, "includeParticipants", void 0);
|
|
616
|
+
calendar_query_dto_ts_decorate([
|
|
617
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
618
|
+
description: 'Filter by specific user ID'
|
|
619
|
+
}),
|
|
620
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
621
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsUUID)(),
|
|
622
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
623
|
+
], CalendarQueryDto.prototype, "userId", void 0);
|
|
624
|
+
calendar_query_dto_ts_decorate([
|
|
625
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
626
|
+
description: 'Include only active events',
|
|
627
|
+
default: true
|
|
628
|
+
}),
|
|
629
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsOptional)(),
|
|
630
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsBoolean)(),
|
|
631
|
+
calendar_query_dto_ts_metadata("design:type", Boolean)
|
|
632
|
+
], CalendarQueryDto.prototype, "activeOnly", void 0);
|
|
633
|
+
class CalendarEventResponseDto {
|
|
634
|
+
id;
|
|
635
|
+
title;
|
|
636
|
+
description;
|
|
637
|
+
eventDate;
|
|
638
|
+
startTime;
|
|
639
|
+
endTime;
|
|
640
|
+
isAllDay;
|
|
641
|
+
recurrenceType;
|
|
642
|
+
recurrenceEndDate;
|
|
643
|
+
weekDays;
|
|
644
|
+
color;
|
|
645
|
+
meetingLink;
|
|
646
|
+
isActive;
|
|
647
|
+
originalEventId;
|
|
648
|
+
isRecurrenceInstance;
|
|
649
|
+
participants;
|
|
650
|
+
}
|
|
651
|
+
calendar_query_dto_ts_decorate([
|
|
652
|
+
(0,external_class_transformer_.Expose)(),
|
|
653
|
+
(0,swagger_.ApiProperty)(),
|
|
654
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
655
|
+
], CalendarEventResponseDto.prototype, "id", void 0);
|
|
656
|
+
calendar_query_dto_ts_decorate([
|
|
657
|
+
(0,external_class_transformer_.Expose)(),
|
|
658
|
+
(0,swagger_.ApiProperty)(),
|
|
659
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
660
|
+
], CalendarEventResponseDto.prototype, "title", void 0);
|
|
661
|
+
calendar_query_dto_ts_decorate([
|
|
662
|
+
(0,external_class_transformer_.Expose)(),
|
|
663
|
+
(0,swagger_.ApiPropertyOptional)(),
|
|
664
|
+
calendar_query_dto_ts_metadata("design:type", Object)
|
|
665
|
+
], CalendarEventResponseDto.prototype, "description", void 0);
|
|
666
|
+
calendar_query_dto_ts_decorate([
|
|
667
|
+
(0,external_class_transformer_.Expose)(),
|
|
668
|
+
(0,swagger_.ApiProperty)(),
|
|
669
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
670
|
+
], CalendarEventResponseDto.prototype, "eventDate", void 0);
|
|
671
|
+
calendar_query_dto_ts_decorate([
|
|
672
|
+
(0,external_class_transformer_.Expose)(),
|
|
673
|
+
(0,swagger_.ApiProperty)(),
|
|
674
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
675
|
+
], CalendarEventResponseDto.prototype, "startTime", void 0);
|
|
676
|
+
calendar_query_dto_ts_decorate([
|
|
677
|
+
(0,external_class_transformer_.Expose)(),
|
|
678
|
+
(0,swagger_.ApiProperty)(),
|
|
679
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
680
|
+
], CalendarEventResponseDto.prototype, "endTime", void 0);
|
|
681
|
+
calendar_query_dto_ts_decorate([
|
|
682
|
+
(0,external_class_transformer_.Expose)(),
|
|
683
|
+
(0,swagger_.ApiProperty)(),
|
|
684
|
+
calendar_query_dto_ts_metadata("design:type", Boolean)
|
|
685
|
+
], CalendarEventResponseDto.prototype, "isAllDay", void 0);
|
|
686
|
+
calendar_query_dto_ts_decorate([
|
|
687
|
+
(0,external_class_transformer_.Expose)(),
|
|
688
|
+
(0,swagger_.ApiProperty)(),
|
|
689
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
690
|
+
], CalendarEventResponseDto.prototype, "recurrenceType", void 0);
|
|
691
|
+
calendar_query_dto_ts_decorate([
|
|
692
|
+
(0,external_class_transformer_.Expose)(),
|
|
693
|
+
(0,swagger_.ApiPropertyOptional)(),
|
|
694
|
+
calendar_query_dto_ts_metadata("design:type", Object)
|
|
695
|
+
], CalendarEventResponseDto.prototype, "recurrenceEndDate", void 0);
|
|
696
|
+
calendar_query_dto_ts_decorate([
|
|
697
|
+
(0,external_class_transformer_.Expose)(),
|
|
698
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
699
|
+
type: [
|
|
700
|
+
String
|
|
701
|
+
]
|
|
702
|
+
}),
|
|
703
|
+
calendar_query_dto_ts_metadata("design:type", Object)
|
|
704
|
+
], CalendarEventResponseDto.prototype, "weekDays", void 0);
|
|
705
|
+
calendar_query_dto_ts_decorate([
|
|
706
|
+
(0,external_class_transformer_.Expose)(),
|
|
707
|
+
(0,swagger_.ApiProperty)(),
|
|
708
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
709
|
+
], CalendarEventResponseDto.prototype, "color", void 0);
|
|
710
|
+
calendar_query_dto_ts_decorate([
|
|
711
|
+
(0,external_class_transformer_.Expose)(),
|
|
712
|
+
(0,swagger_.ApiPropertyOptional)(),
|
|
713
|
+
calendar_query_dto_ts_metadata("design:type", Object)
|
|
714
|
+
], CalendarEventResponseDto.prototype, "meetingLink", void 0);
|
|
715
|
+
calendar_query_dto_ts_decorate([
|
|
716
|
+
(0,external_class_transformer_.Expose)(),
|
|
717
|
+
(0,swagger_.ApiProperty)(),
|
|
718
|
+
calendar_query_dto_ts_metadata("design:type", Boolean)
|
|
719
|
+
], CalendarEventResponseDto.prototype, "isActive", void 0);
|
|
720
|
+
calendar_query_dto_ts_decorate([
|
|
721
|
+
(0,external_class_transformer_.Expose)(),
|
|
722
|
+
(0,swagger_.ApiPropertyOptional)(),
|
|
723
|
+
calendar_query_dto_ts_metadata("design:type", String)
|
|
724
|
+
], CalendarEventResponseDto.prototype, "originalEventId", void 0);
|
|
725
|
+
calendar_query_dto_ts_decorate([
|
|
726
|
+
(0,external_class_transformer_.Expose)(),
|
|
727
|
+
(0,swagger_.ApiPropertyOptional)(),
|
|
728
|
+
calendar_query_dto_ts_metadata("design:type", Boolean)
|
|
729
|
+
], CalendarEventResponseDto.prototype, "isRecurrenceInstance", void 0);
|
|
730
|
+
calendar_query_dto_ts_decorate([
|
|
731
|
+
(0,external_class_transformer_.Expose)(),
|
|
732
|
+
(0,swagger_.ApiPropertyOptional)({
|
|
733
|
+
type: ()=>[
|
|
734
|
+
EventParticipantResponseDto
|
|
735
|
+
]
|
|
736
|
+
}),
|
|
737
|
+
(0,external_class_transformer_.Type)(()=>EventParticipantResponseDto),
|
|
738
|
+
calendar_query_dto_ts_metadata("design:type", Array)
|
|
739
|
+
], CalendarEventResponseDto.prototype, "participants", void 0);
|
|
740
|
+
|
|
741
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/dtos/index.ts
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
},
|
|
748
|
+
80(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
749
|
+
|
|
750
|
+
// EXPORTS
|
|
751
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
752
|
+
Jh: () => (/* reexport */ Event),
|
|
753
|
+
_d: () => (/* reexport */ Event),
|
|
754
|
+
Mi: () => (/* binding */ EventManagerCompanyEntities),
|
|
755
|
+
WB: () => (/* binding */ EventManagerCoreEntities),
|
|
756
|
+
ek: () => (/* reexport */ EventParticipant),
|
|
757
|
+
lo: () => (/* reexport */ EventParticipant),
|
|
758
|
+
QO: () => (/* reexport */ EventWithCompany),
|
|
759
|
+
E1: () => (/* binding */ getEventManagerEntitiesByConfig)
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared"
|
|
763
|
+
var nestjs_shared_ = __webpack_require__(422);
|
|
764
|
+
;// CONCATENATED MODULE: external "@flusys/nestjs-shared/entities"
|
|
765
|
+
|
|
766
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/enums"
|
|
767
|
+
var enums_ = __webpack_require__(471);
|
|
768
|
+
// EXTERNAL MODULE: external "typeorm"
|
|
769
|
+
var external_typeorm_ = __webpack_require__(158);
|
|
770
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/entities/event.entity.ts
|
|
771
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
772
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
773
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
774
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
775
|
+
} else {
|
|
776
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
777
|
+
if (d = decorators[i]) {
|
|
778
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
783
|
+
}
|
|
784
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
785
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
786
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
class Event extends __rspack_external__flusys_nestjs_shared_entities_420e6d19.Identity {
|
|
794
|
+
title;
|
|
795
|
+
description;
|
|
796
|
+
eventDate;
|
|
797
|
+
startTime;
|
|
798
|
+
endTime;
|
|
799
|
+
isAllDay;
|
|
800
|
+
recurrenceType;
|
|
801
|
+
recurrenceEndDate;
|
|
802
|
+
weekDays;
|
|
803
|
+
color;
|
|
804
|
+
meetingLink;
|
|
805
|
+
isActive;
|
|
806
|
+
}
|
|
807
|
+
_ts_decorate([
|
|
808
|
+
(0,external_typeorm_.Column)({
|
|
809
|
+
type: 'varchar',
|
|
810
|
+
length: 255,
|
|
811
|
+
nullable: false
|
|
812
|
+
}),
|
|
813
|
+
_ts_metadata("design:type", String)
|
|
814
|
+
], Event.prototype, "title", void 0);
|
|
815
|
+
_ts_decorate([
|
|
816
|
+
(0,external_typeorm_.Column)({
|
|
817
|
+
type: 'text',
|
|
818
|
+
nullable: true
|
|
819
|
+
}),
|
|
820
|
+
_ts_metadata("design:type", Object)
|
|
821
|
+
], Event.prototype, "description", void 0);
|
|
822
|
+
_ts_decorate([
|
|
823
|
+
(0,external_typeorm_.Column)({
|
|
824
|
+
name: 'event_date',
|
|
825
|
+
type: 'date',
|
|
826
|
+
nullable: false
|
|
827
|
+
}),
|
|
828
|
+
_ts_metadata("design:type", String)
|
|
829
|
+
], Event.prototype, "eventDate", void 0);
|
|
830
|
+
_ts_decorate([
|
|
831
|
+
(0,external_typeorm_.Column)({
|
|
832
|
+
name: 'start_time',
|
|
833
|
+
type: 'varchar',
|
|
834
|
+
length: 5,
|
|
835
|
+
nullable: false,
|
|
836
|
+
default: '00:00'
|
|
837
|
+
}),
|
|
838
|
+
_ts_metadata("design:type", String)
|
|
839
|
+
], Event.prototype, "startTime", void 0);
|
|
840
|
+
_ts_decorate([
|
|
841
|
+
(0,external_typeorm_.Column)({
|
|
842
|
+
name: 'end_time',
|
|
843
|
+
type: 'varchar',
|
|
844
|
+
length: 5,
|
|
845
|
+
nullable: false,
|
|
846
|
+
default: '23:59'
|
|
847
|
+
}),
|
|
848
|
+
_ts_metadata("design:type", String)
|
|
849
|
+
], Event.prototype, "endTime", void 0);
|
|
850
|
+
_ts_decorate([
|
|
851
|
+
(0,external_typeorm_.Column)({
|
|
852
|
+
name: 'is_all_day',
|
|
853
|
+
type: 'boolean',
|
|
854
|
+
nullable: false,
|
|
855
|
+
default: false
|
|
856
|
+
}),
|
|
857
|
+
_ts_metadata("design:type", Boolean)
|
|
858
|
+
], Event.prototype, "isAllDay", void 0);
|
|
859
|
+
_ts_decorate([
|
|
860
|
+
(0,external_typeorm_.Column)({
|
|
861
|
+
name: 'recurrence_type',
|
|
862
|
+
type: 'varchar',
|
|
863
|
+
length: 20,
|
|
864
|
+
nullable: false,
|
|
865
|
+
default: enums_.RecurrenceType.NONE
|
|
866
|
+
}),
|
|
867
|
+
_ts_metadata("design:type", String)
|
|
868
|
+
], Event.prototype, "recurrenceType", void 0);
|
|
869
|
+
_ts_decorate([
|
|
870
|
+
(0,external_typeorm_.Column)({
|
|
871
|
+
name: 'recurrence_end_date',
|
|
872
|
+
type: 'date',
|
|
873
|
+
nullable: true
|
|
874
|
+
}),
|
|
875
|
+
_ts_metadata("design:type", Object)
|
|
876
|
+
], Event.prototype, "recurrenceEndDate", void 0);
|
|
877
|
+
_ts_decorate([
|
|
878
|
+
(0,external_typeorm_.Column)({
|
|
879
|
+
type: (0,nestjs_shared_.getJsonColumnType)(),
|
|
880
|
+
nullable: true
|
|
881
|
+
}),
|
|
882
|
+
_ts_metadata("design:type", Object)
|
|
883
|
+
], Event.prototype, "weekDays", void 0);
|
|
884
|
+
_ts_decorate([
|
|
885
|
+
(0,external_typeorm_.Column)({
|
|
886
|
+
type: 'varchar',
|
|
887
|
+
length: 7,
|
|
888
|
+
nullable: false,
|
|
889
|
+
default: '#3B82F6'
|
|
890
|
+
}),
|
|
891
|
+
_ts_metadata("design:type", String)
|
|
892
|
+
], Event.prototype, "color", void 0);
|
|
893
|
+
_ts_decorate([
|
|
894
|
+
(0,external_typeorm_.Column)({
|
|
895
|
+
name: 'meeting_link',
|
|
896
|
+
type: 'varchar',
|
|
897
|
+
length: 500,
|
|
898
|
+
nullable: true
|
|
899
|
+
}),
|
|
900
|
+
_ts_metadata("design:type", Object)
|
|
901
|
+
], Event.prototype, "meetingLink", void 0);
|
|
902
|
+
_ts_decorate([
|
|
903
|
+
(0,external_typeorm_.Column)({
|
|
904
|
+
name: 'is_active',
|
|
905
|
+
type: 'boolean',
|
|
906
|
+
nullable: false,
|
|
907
|
+
default: true
|
|
908
|
+
}),
|
|
909
|
+
_ts_metadata("design:type", Boolean)
|
|
910
|
+
], Event.prototype, "isActive", void 0);
|
|
911
|
+
Event = _ts_decorate([
|
|
912
|
+
(0,external_typeorm_.Entity)({
|
|
913
|
+
name: 'event'
|
|
914
|
+
}),
|
|
915
|
+
(0,external_typeorm_.Index)([
|
|
916
|
+
'eventDate'
|
|
917
|
+
]),
|
|
918
|
+
(0,external_typeorm_.Index)([
|
|
919
|
+
'isActive'
|
|
920
|
+
])
|
|
921
|
+
], Event);
|
|
922
|
+
|
|
923
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/entities/event-participant.entity.ts
|
|
924
|
+
function event_participant_entity_ts_decorate(decorators, target, key, desc) {
|
|
925
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
926
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
927
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
928
|
+
} else {
|
|
929
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
930
|
+
if (d = decorators[i]) {
|
|
931
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
936
|
+
}
|
|
937
|
+
function event_participant_entity_ts_metadata(metadataKey, metadataValue) {
|
|
938
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
939
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
class EventParticipant extends __rspack_external__flusys_nestjs_shared_entities_420e6d19.Identity {
|
|
946
|
+
eventId;
|
|
947
|
+
userId;
|
|
948
|
+
status;
|
|
949
|
+
isOrganizer;
|
|
950
|
+
}
|
|
951
|
+
event_participant_entity_ts_decorate([
|
|
952
|
+
(0,external_typeorm_.Index)(),
|
|
953
|
+
(0,external_typeorm_.Column)({
|
|
954
|
+
name: 'event_id',
|
|
955
|
+
type: 'uuid',
|
|
956
|
+
nullable: false
|
|
957
|
+
}),
|
|
958
|
+
event_participant_entity_ts_metadata("design:type", String)
|
|
959
|
+
], EventParticipant.prototype, "eventId", void 0);
|
|
960
|
+
event_participant_entity_ts_decorate([
|
|
961
|
+
(0,external_typeorm_.Column)({
|
|
962
|
+
name: 'user_id',
|
|
963
|
+
type: 'uuid',
|
|
964
|
+
nullable: false
|
|
965
|
+
}),
|
|
966
|
+
event_participant_entity_ts_metadata("design:type", String)
|
|
967
|
+
], EventParticipant.prototype, "userId", void 0);
|
|
968
|
+
event_participant_entity_ts_decorate([
|
|
969
|
+
(0,external_typeorm_.Column)({
|
|
970
|
+
type: 'varchar',
|
|
971
|
+
length: 50,
|
|
972
|
+
nullable: false,
|
|
973
|
+
default: enums_.ParticipantStatus.PENDING
|
|
974
|
+
}),
|
|
975
|
+
event_participant_entity_ts_metadata("design:type", String)
|
|
976
|
+
], EventParticipant.prototype, "status", void 0);
|
|
977
|
+
event_participant_entity_ts_decorate([
|
|
978
|
+
(0,external_typeorm_.Column)({
|
|
979
|
+
name: 'is_organizer',
|
|
980
|
+
type: 'boolean',
|
|
981
|
+
nullable: false,
|
|
982
|
+
default: false
|
|
983
|
+
}),
|
|
984
|
+
event_participant_entity_ts_metadata("design:type", Boolean)
|
|
985
|
+
], EventParticipant.prototype, "isOrganizer", void 0);
|
|
986
|
+
EventParticipant = event_participant_entity_ts_decorate([
|
|
987
|
+
(0,external_typeorm_.Entity)({
|
|
988
|
+
name: 'event_participant'
|
|
989
|
+
}),
|
|
990
|
+
(0,external_typeorm_.Index)([
|
|
991
|
+
'eventId',
|
|
992
|
+
'userId'
|
|
993
|
+
], {
|
|
994
|
+
unique: true
|
|
995
|
+
}),
|
|
996
|
+
(0,external_typeorm_.Index)([
|
|
997
|
+
'userId'
|
|
998
|
+
])
|
|
999
|
+
], EventParticipant);
|
|
1000
|
+
|
|
1001
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/entities/event-with-company.entity.ts
|
|
1002
|
+
function event_with_company_entity_ts_decorate(decorators, target, key, desc) {
|
|
1003
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1004
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1005
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1006
|
+
} else {
|
|
1007
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
1008
|
+
if (d = decorators[i]) {
|
|
1009
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1014
|
+
}
|
|
1015
|
+
function event_with_company_entity_ts_metadata(metadataKey, metadataValue) {
|
|
1016
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
1017
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
class EventWithCompany extends Event {
|
|
1023
|
+
companyId;
|
|
1024
|
+
}
|
|
1025
|
+
event_with_company_entity_ts_decorate([
|
|
1026
|
+
(0,external_typeorm_.Column)({
|
|
1027
|
+
name: 'company_id',
|
|
1028
|
+
type: 'uuid',
|
|
1029
|
+
nullable: true
|
|
1030
|
+
}),
|
|
1031
|
+
event_with_company_entity_ts_metadata("design:type", Object)
|
|
1032
|
+
], EventWithCompany.prototype, "companyId", void 0);
|
|
1033
|
+
EventWithCompany = event_with_company_entity_ts_decorate([
|
|
1034
|
+
(0,external_typeorm_.Entity)({
|
|
1035
|
+
name: 'event'
|
|
1036
|
+
}),
|
|
1037
|
+
(0,external_typeorm_.Index)([
|
|
1038
|
+
'companyId',
|
|
1039
|
+
'isActive'
|
|
1040
|
+
])
|
|
1041
|
+
], EventWithCompany);
|
|
1042
|
+
|
|
1043
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/entities/index.ts
|
|
1044
|
+
// Entities without company feature
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
// Entities with company feature
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
// Core entities (no company feature)
|
|
1053
|
+
const EventManagerCoreEntities = [
|
|
1054
|
+
Event,
|
|
1055
|
+
EventParticipant
|
|
1056
|
+
];
|
|
1057
|
+
// Company-specific entities (EventParticipant is event-scoped, not company-scoped)
|
|
1058
|
+
const EventManagerCompanyEntities = [
|
|
1059
|
+
EventWithCompany,
|
|
1060
|
+
EventParticipant
|
|
1061
|
+
];
|
|
1062
|
+
function getEventManagerEntitiesByConfig(enableCompanyFeature) {
|
|
1063
|
+
return enableCompanyFeature ? EventManagerCompanyEntities : EventManagerCoreEntities;
|
|
1064
|
+
}
|
|
1065
|
+
// Base type aliases for backwards compatibility with services
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
},
|
|
1071
|
+
619(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1072
|
+
/* import */ var _nestjs_common__rspack_import_0 = __webpack_require__(157);
|
|
1073
|
+
/* import */ var _config_event_manager_constants_js__rspack_import_1 = __webpack_require__(890);
|
|
1074
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
1075
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1076
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1077
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1078
|
+
} else {
|
|
1079
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
1080
|
+
if (d = decorators[i]) {
|
|
1081
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1086
|
+
}
|
|
1087
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
1088
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
1089
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
function _ts_param(paramIndex, decorator) {
|
|
1093
|
+
return function(target, key) {
|
|
1094
|
+
decorator(target, key, paramIndex);
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
|
|
1099
|
+
const DEFAULT_COLOR = '#3B82F6';
|
|
1100
|
+
const DEFAULT_MAX_RECURRENCE_OCCURRENCES = 365;
|
|
1101
|
+
class EventManagerConfigService {
|
|
1102
|
+
options;
|
|
1103
|
+
constructor(options){
|
|
1104
|
+
this.options = options;
|
|
1105
|
+
}
|
|
1106
|
+
// IModuleConfigService Implementation
|
|
1107
|
+
isCompanyFeatureEnabled() {
|
|
1108
|
+
return this.options.bootstrapAppConfig?.enableCompanyFeature ?? false;
|
|
1109
|
+
}
|
|
1110
|
+
getDatabaseMode() {
|
|
1111
|
+
return this.options.bootstrapAppConfig?.databaseMode ?? 'single';
|
|
1112
|
+
}
|
|
1113
|
+
isMultiTenant() {
|
|
1114
|
+
return this.getDatabaseMode() === 'multi-tenant';
|
|
1115
|
+
}
|
|
1116
|
+
// Config Getters
|
|
1117
|
+
getDefaultColor() {
|
|
1118
|
+
return this.options.config?.defaultColor ?? DEFAULT_COLOR;
|
|
1119
|
+
}
|
|
1120
|
+
getMaxRecurrenceOccurrences() {
|
|
1121
|
+
return this.options.config?.maxRecurrenceOccurrences ?? DEFAULT_MAX_RECURRENCE_OCCURRENCES;
|
|
1122
|
+
}
|
|
1123
|
+
getOptions() {
|
|
1124
|
+
return this.options;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
EventManagerConfigService = _ts_decorate([
|
|
1128
|
+
(0,_nestjs_common__rspack_import_0.Injectable)(),
|
|
1129
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_0.Inject)(_config_event_manager_constants_js__rspack_import_1/* .EVENT_MANAGER_MODULE_OPTIONS */.D)),
|
|
1130
|
+
_ts_metadata("design:type", Function),
|
|
1131
|
+
_ts_metadata("design:paramtypes", [
|
|
1132
|
+
typeof EventManagerModuleOptions === "undefined" ? Object : EventManagerModuleOptions
|
|
1133
|
+
])
|
|
1134
|
+
], EventManagerConfigService);
|
|
1135
|
+
|
|
1136
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1137
|
+
$: () => (EventManagerConfigService)
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
|
|
1141
|
+
},
|
|
1142
|
+
324(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1143
|
+
|
|
1144
|
+
// EXPORTS
|
|
1145
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1146
|
+
a: () => (/* binding */ EventManagerDataSourceProvider)
|
|
1147
|
+
});
|
|
1148
|
+
|
|
1149
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/modules"
|
|
1150
|
+
var modules_ = __webpack_require__(236);
|
|
1151
|
+
// EXTERNAL MODULE: external "@nestjs/common"
|
|
1152
|
+
var common_ = __webpack_require__(157);
|
|
1153
|
+
;// CONCATENATED MODULE: external "@nestjs/core"
|
|
1154
|
+
|
|
1155
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/entities/index.ts + 4 modules
|
|
1156
|
+
var src_entities = __webpack_require__(80);
|
|
1157
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/services/event-manager-config.service.ts
|
|
1158
|
+
var event_manager_config_service = __webpack_require__(619);
|
|
1159
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/services/event-manager-datasource.provider.ts
|
|
1160
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
1161
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1162
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1163
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1164
|
+
} else {
|
|
1165
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
1166
|
+
if (d = decorators[i]) {
|
|
1167
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1172
|
+
}
|
|
1173
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
1174
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
1175
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
function _ts_param(paramIndex, decorator) {
|
|
1179
|
+
return function(target, key) {
|
|
1180
|
+
decorator(target, key, paramIndex);
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
class EventManagerDataSourceProvider extends modules_.MultiTenantDataSourceService {
|
|
1189
|
+
configService;
|
|
1190
|
+
static tenantConnections = new Map();
|
|
1191
|
+
static singleDataSource = null;
|
|
1192
|
+
static tenantsRegistry = new Map();
|
|
1193
|
+
static initialized = false;
|
|
1194
|
+
static connectionLocks = new Map();
|
|
1195
|
+
static singleConnectionLock = null;
|
|
1196
|
+
constructor(configService, request){
|
|
1197
|
+
super(EventManagerDataSourceProvider.buildParentOptions(configService.getOptions()), request), this.configService = configService;
|
|
1198
|
+
}
|
|
1199
|
+
static buildParentOptions(options) {
|
|
1200
|
+
return {
|
|
1201
|
+
bootstrapAppConfig: options.bootstrapAppConfig,
|
|
1202
|
+
defaultDatabaseConfig: options.config?.defaultDatabaseConfig,
|
|
1203
|
+
tenantDefaultDatabaseConfig: options.config?.tenantDefaultDatabaseConfig,
|
|
1204
|
+
tenants: options.config?.tenants
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
getEnableCompanyFeatureForTenant(tenant) {
|
|
1208
|
+
return tenant?.enableCompanyFeature ?? this.configService.isCompanyFeatureEnabled();
|
|
1209
|
+
}
|
|
1210
|
+
async createDataSourceFromConfig(config) {
|
|
1211
|
+
const currentTenant = this.getCurrentTenant();
|
|
1212
|
+
const enableCompanyFeature = this.getEnableCompanyFeatureForTenant(currentTenant ?? undefined);
|
|
1213
|
+
const entities = (0,src_entities/* .getEventManagerEntitiesByConfig */.E1)(enableCompanyFeature);
|
|
1214
|
+
return super.createDataSourceFromConfig(config, entities);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
EventManagerDataSourceProvider = _ts_decorate([
|
|
1218
|
+
(0,common_.Injectable)({
|
|
1219
|
+
scope: common_.Scope.REQUEST
|
|
1220
|
+
}),
|
|
1221
|
+
_ts_param(0, (0,common_.Inject)(event_manager_config_service/* .EventManagerConfigService */.$)),
|
|
1222
|
+
_ts_param(1, (0,common_.Optional)()),
|
|
1223
|
+
_ts_param(1, (0,common_.Inject)(__rspack_external__nestjs_core_d7b00a1a.REQUEST)),
|
|
1224
|
+
_ts_metadata("design:type", Function),
|
|
1225
|
+
_ts_metadata("design:paramtypes", [
|
|
1226
|
+
typeof event_manager_config_service/* .EventManagerConfigService */.$ === "undefined" ? Object : event_manager_config_service/* .EventManagerConfigService */.$,
|
|
1227
|
+
typeof Request === "undefined" ? Object : Request
|
|
1228
|
+
])
|
|
1229
|
+
], EventManagerDataSourceProvider);
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
},
|
|
1233
|
+
332(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1234
|
+
|
|
1235
|
+
// EXPORTS
|
|
1236
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1237
|
+
U: () => (/* binding */ EventService)
|
|
1238
|
+
});
|
|
1239
|
+
|
|
1240
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/classes"
|
|
1241
|
+
var classes_ = __webpack_require__(937);
|
|
1242
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/decorators"
|
|
1243
|
+
var decorators_ = __webpack_require__(265);
|
|
1244
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/enums"
|
|
1245
|
+
var enums_ = __webpack_require__(471);
|
|
1246
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/modules"
|
|
1247
|
+
var modules_ = __webpack_require__(236);
|
|
1248
|
+
;// CONCATENATED MODULE: external "@flusys/nestjs-shared/utils"
|
|
1249
|
+
|
|
1250
|
+
// EXTERNAL MODULE: external "@nestjs/common"
|
|
1251
|
+
var common_ = __webpack_require__(157);
|
|
1252
|
+
// EXTERNAL MODULE: external "typeorm"
|
|
1253
|
+
var external_typeorm_ = __webpack_require__(158);
|
|
1254
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/config/event-actions.ts
|
|
1255
|
+
var event_actions = __webpack_require__(782);
|
|
1256
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/config/message-keys.ts
|
|
1257
|
+
var message_keys = __webpack_require__(401);
|
|
1258
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/dtos/index.ts + 4 modules
|
|
1259
|
+
var dtos = __webpack_require__(178);
|
|
1260
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/entities/index.ts + 4 modules
|
|
1261
|
+
var src_entities = __webpack_require__(80);
|
|
1262
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/services/event-manager-config.service.ts
|
|
1263
|
+
var event_manager_config_service = __webpack_require__(619);
|
|
1264
|
+
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/services/event-manager-datasource.provider.ts + 1 modules
|
|
1265
|
+
var event_manager_datasource_provider = __webpack_require__(324);
|
|
1266
|
+
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/services/event.service.ts
|
|
1267
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
1268
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1269
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1270
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1271
|
+
} else {
|
|
1272
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
1273
|
+
if (d = decorators[i]) {
|
|
1274
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1279
|
+
}
|
|
1280
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
1281
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
1282
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
function _ts_param(paramIndex, decorator) {
|
|
1286
|
+
return function(target, key) {
|
|
1287
|
+
decorator(target, key, paramIndex);
|
|
1288
|
+
};
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
class EventService extends classes_.ApiService {
|
|
1303
|
+
cacheManager;
|
|
1304
|
+
utilsService;
|
|
1305
|
+
eventConfig;
|
|
1306
|
+
dataSourceProvider;
|
|
1307
|
+
participantRepository = null;
|
|
1308
|
+
pendingParticipantsList = [];
|
|
1309
|
+
constructor(cacheManager, utilsService, eventConfig, dataSourceProvider){
|
|
1310
|
+
super(event_actions/* .EVENT_MANAGER_EVENT_ENTITIES.EVENT */.sI.EVENT, cacheManager, utilsService, EventService.name, true, event_actions/* .EVENT_MANAGER_EVENT_MODULE */.vR, dataSourceProvider, eventConfig.isCompanyFeatureEnabled() ? src_entities/* .EventWithCompany */.QO : src_entities/* .Event */.Jh), this.cacheManager = cacheManager, this.utilsService = utilsService, this.eventConfig = eventConfig, this.dataSourceProvider = dataSourceProvider;
|
|
1311
|
+
}
|
|
1312
|
+
// Override methods
|
|
1313
|
+
async convertSingleDtoToEntity(dto, user) {
|
|
1314
|
+
await this.ensureDataSourceRepository();
|
|
1315
|
+
let entity = {};
|
|
1316
|
+
if ('id' in dto && dto.id && typeof dto.id === 'string') {
|
|
1317
|
+
const existing = await this.repository.findOne({
|
|
1318
|
+
where: {
|
|
1319
|
+
id: dto.id
|
|
1320
|
+
}
|
|
1321
|
+
});
|
|
1322
|
+
if (!existing) throw new common_.NotFoundException({
|
|
1323
|
+
message: 'Event not found',
|
|
1324
|
+
messageKey: message_keys/* .EVENT_MESSAGES.NOT_FOUND */.G.NOT_FOUND
|
|
1325
|
+
});
|
|
1326
|
+
entity = existing;
|
|
1327
|
+
}
|
|
1328
|
+
const isAllDay = dto.isAllDay ?? entity.isAllDay ?? false;
|
|
1329
|
+
const merged = {
|
|
1330
|
+
...entity,
|
|
1331
|
+
title: dto.title ?? entity.title,
|
|
1332
|
+
description: dto.description ?? entity.description,
|
|
1333
|
+
eventDate: dto.eventDate ?? entity.eventDate,
|
|
1334
|
+
startTime: isAllDay ? '00:00' : dto.startTime ?? entity.startTime ?? '00:00',
|
|
1335
|
+
endTime: isAllDay ? '23:59' : dto.endTime ?? entity.endTime ?? '23:59',
|
|
1336
|
+
isAllDay,
|
|
1337
|
+
recurrenceType: dto.recurrenceType ?? entity.recurrenceType ?? enums_.RecurrenceType.NONE,
|
|
1338
|
+
recurrenceEndDate: dto.recurrenceEndDate ?? entity.recurrenceEndDate ?? null,
|
|
1339
|
+
weekDays: dto.weekDays ?? entity.weekDays ?? null,
|
|
1340
|
+
color: dto.color ?? entity.color ?? this.eventConfig.getDefaultColor(),
|
|
1341
|
+
meetingLink: dto.meetingLink !== undefined ? dto.meetingLink ?? null : entity.meetingLink ?? null,
|
|
1342
|
+
isActive: dto.isActive ?? entity.isActive ?? true
|
|
1343
|
+
};
|
|
1344
|
+
if (this.eventConfig.isCompanyFeatureEnabled()) {
|
|
1345
|
+
merged.companyId = user?.companyId ?? null;
|
|
1346
|
+
}
|
|
1347
|
+
if ('participantIds' in dto) {
|
|
1348
|
+
this.pendingParticipantsList.push(dto.participantIds ?? []);
|
|
1349
|
+
}
|
|
1350
|
+
return merged;
|
|
1351
|
+
}
|
|
1352
|
+
async getFilterQuery(query, filter, _user) {
|
|
1353
|
+
for (const [key, value] of Object.entries(filter)){
|
|
1354
|
+
if (key === 'isActive' && typeof value === 'boolean') {
|
|
1355
|
+
query.andWhere(`${this.entityName}.isActive = :isActive`, {
|
|
1356
|
+
isActive: value
|
|
1357
|
+
});
|
|
1358
|
+
} else if (key === 'recurrenceType') {
|
|
1359
|
+
query.andWhere(`${this.entityName}.recurrenceType = :recurrenceType`, {
|
|
1360
|
+
recurrenceType: value
|
|
1361
|
+
});
|
|
1362
|
+
} else if (key === 'participantUserId' && typeof value === 'string') {
|
|
1363
|
+
const eventIds = await this.getParticipantEventIds(value);
|
|
1364
|
+
if (eventIds.length > 0) {
|
|
1365
|
+
query.andWhere(`${this.entityName}.id IN (:...participantEventIds)`, {
|
|
1366
|
+
participantEventIds: eventIds
|
|
1367
|
+
});
|
|
1368
|
+
} else {
|
|
1369
|
+
query.andWhere('1 = 0');
|
|
1370
|
+
}
|
|
1371
|
+
} else {
|
|
1372
|
+
query.andWhere(`${this.entityName}.${key} = :value`, {
|
|
1373
|
+
value
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
return {
|
|
1378
|
+
query,
|
|
1379
|
+
isRaw: false
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
async getExtraManipulateQuery(query, filterDto, user) {
|
|
1383
|
+
const result = await super.getExtraManipulateQuery(query, filterDto, user);
|
|
1384
|
+
this.applyEventCompanyFilter(query, user);
|
|
1385
|
+
await this.ensureParticipantRepositoryInitialized();
|
|
1386
|
+
query.leftJoinAndMapMany(`${this.entityName}.participants`, src_entities/* .EventParticipant */.ek, 'ep', 'ep.event_id = event.id AND ep.deleted_at IS NULL');
|
|
1387
|
+
return result;
|
|
1388
|
+
}
|
|
1389
|
+
async afterInsertOperation(entities, _dto, user, _qr) {
|
|
1390
|
+
for(let i = 0; i < entities.length; i++){
|
|
1391
|
+
const participantIds = this.pendingParticipantsList[i] ?? [];
|
|
1392
|
+
await this.addCreatorAndParticipants(entities[i].id, participantIds, user);
|
|
1393
|
+
}
|
|
1394
|
+
this.pendingParticipantsList = [];
|
|
1395
|
+
}
|
|
1396
|
+
async afterUpdateOperation(entities, _dto, user, _qr) {
|
|
1397
|
+
const participantRepo = await this.ensureParticipantRepositoryInitialized();
|
|
1398
|
+
for(let i = 0; i < entities.length; i++){
|
|
1399
|
+
const participantIds = this.pendingParticipantsList[i] ?? [];
|
|
1400
|
+
await participantRepo.update({
|
|
1401
|
+
eventId: entities[i].id,
|
|
1402
|
+
deletedAt: (0,external_typeorm_.IsNull)()
|
|
1403
|
+
}, {
|
|
1404
|
+
deletedAt: new Date()
|
|
1405
|
+
});
|
|
1406
|
+
await this.addCreatorAndParticipants(entities[i].id, participantIds, user);
|
|
1407
|
+
}
|
|
1408
|
+
this.pendingParticipantsList = [];
|
|
1409
|
+
}
|
|
1410
|
+
// Public API methods
|
|
1411
|
+
async getEventsForCalendarRange(queryDto, user) {
|
|
1412
|
+
await this.ensureDataSourceRepository();
|
|
1413
|
+
const query = this.repository.createQueryBuilder('event').where('event.deletedAt IS NULL').andWhere('event.isActive = :isActive', {
|
|
1414
|
+
isActive: queryDto.activeOnly !== false
|
|
1415
|
+
}).andWhere('((event.eventDate >= :startDate AND event.eventDate <= :endDate) OR (event.recurrenceType != :none AND event.eventDate <= :endDate AND (event.recurrenceEndDate IS NULL OR event.recurrenceEndDate >= :startDate)))', {
|
|
1416
|
+
startDate: queryDto.startDate,
|
|
1417
|
+
endDate: queryDto.endDate,
|
|
1418
|
+
none: enums_.RecurrenceType.NONE
|
|
1419
|
+
});
|
|
1420
|
+
this.applyEventCompanyFilter(query, user);
|
|
1421
|
+
if (queryDto.userId) {
|
|
1422
|
+
const eventIds = await this.getParticipantEventIds(queryDto.userId);
|
|
1423
|
+
if (eventIds.length > 0) {
|
|
1424
|
+
query.andWhere('event.id IN (:...eventIds)', {
|
|
1425
|
+
eventIds
|
|
1426
|
+
});
|
|
1427
|
+
} else {
|
|
1428
|
+
return [];
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
const events = await query.getMany();
|
|
1432
|
+
if (queryDto.includeParticipants && events.length > 0) {
|
|
1433
|
+
await this.loadParticipantsForEvents(events);
|
|
1434
|
+
}
|
|
1435
|
+
return this.expandRecurringEvents(events, queryDto.startDate, queryDto.endDate);
|
|
1436
|
+
}
|
|
1437
|
+
async updateParticipantStatus(dto, user) {
|
|
1438
|
+
const participantRepo = await this.ensureParticipantRepositoryInitialized();
|
|
1439
|
+
const participant = await participantRepo.findOne({
|
|
1440
|
+
where: {
|
|
1441
|
+
id: dto.id
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
if (!participant) {
|
|
1445
|
+
throw new common_.NotFoundException({
|
|
1446
|
+
message: 'Event participant not found',
|
|
1447
|
+
messageKey: message_keys/* .EVENT_PARTICIPANT_MESSAGES.NOT_FOUND */.C.NOT_FOUND
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
participant.status = dto.status;
|
|
1451
|
+
const saved = await participantRepo.save(participant);
|
|
1452
|
+
await Promise.all([
|
|
1453
|
+
this.clearCacheForAll(),
|
|
1454
|
+
this.clearCacheForId([
|
|
1455
|
+
{
|
|
1456
|
+
id: participant.eventId
|
|
1457
|
+
}
|
|
1458
|
+
])
|
|
1459
|
+
]);
|
|
1460
|
+
await this.publishDomainAction(event_actions/* .EVENT_MANAGER_EVENT_ACTIONS.PARTICIPANT_STATUS_CHANGED */.i2.PARTICIPANT_STATUS_CHANGED, {
|
|
1461
|
+
ids: [
|
|
1462
|
+
participant.eventId
|
|
1463
|
+
],
|
|
1464
|
+
metadata: {
|
|
1465
|
+
participantId: saved.id,
|
|
1466
|
+
participantUserId: saved.userId,
|
|
1467
|
+
status: saved.status
|
|
1468
|
+
},
|
|
1469
|
+
user
|
|
1470
|
+
});
|
|
1471
|
+
return saved;
|
|
1472
|
+
}
|
|
1473
|
+
// Private business logic helpers
|
|
1474
|
+
async addCreatorAndParticipants(eventId, participantIds, user) {
|
|
1475
|
+
if (!user?.id) return;
|
|
1476
|
+
const participantRepo = await this.ensureParticipantRepositoryInitialized();
|
|
1477
|
+
const allUserIds = Array.from(new Set([
|
|
1478
|
+
user.id,
|
|
1479
|
+
...participantIds
|
|
1480
|
+
]));
|
|
1481
|
+
const existing = await participantRepo.find({
|
|
1482
|
+
where: {
|
|
1483
|
+
eventId,
|
|
1484
|
+
userId: (0,external_typeorm_.In)(allUserIds)
|
|
1485
|
+
},
|
|
1486
|
+
withDeleted: true
|
|
1487
|
+
});
|
|
1488
|
+
const existingByUserId = new Map(existing.map((p)=>[
|
|
1489
|
+
p.userId,
|
|
1490
|
+
p
|
|
1491
|
+
]));
|
|
1492
|
+
const toSave = allUserIds.map((userId)=>{
|
|
1493
|
+
const existingRecord = existingByUserId.get(userId);
|
|
1494
|
+
if (existingRecord) {
|
|
1495
|
+
return {
|
|
1496
|
+
...existingRecord,
|
|
1497
|
+
deletedAt: null,
|
|
1498
|
+
isOrganizer: userId === user.id
|
|
1499
|
+
};
|
|
1500
|
+
}
|
|
1501
|
+
return {
|
|
1502
|
+
eventId,
|
|
1503
|
+
userId,
|
|
1504
|
+
isOrganizer: userId === user.id
|
|
1505
|
+
};
|
|
1506
|
+
});
|
|
1507
|
+
await participantRepo.save(toSave);
|
|
1508
|
+
}
|
|
1509
|
+
expandRecurringEvents(events, rangeStart, rangeEnd) {
|
|
1510
|
+
const result = [];
|
|
1511
|
+
const maxOccurrences = this.eventConfig.getMaxRecurrenceOccurrences();
|
|
1512
|
+
for (const event of events){
|
|
1513
|
+
if (event.recurrenceType === enums_.RecurrenceType.NONE) {
|
|
1514
|
+
result.push(this.toCalendarEvent(event));
|
|
1515
|
+
} else {
|
|
1516
|
+
result.push(...this.generateOccurrences(event, rangeStart, rangeEnd, maxOccurrences));
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
return result.sort((a, b)=>a.eventDate.localeCompare(b.eventDate));
|
|
1520
|
+
}
|
|
1521
|
+
generateOccurrences(event, rangeStart, rangeEnd, maxOccurrences) {
|
|
1522
|
+
const occurrences = [];
|
|
1523
|
+
const recurrenceEnd = event.recurrenceEndDate ?? null;
|
|
1524
|
+
const recurrenceType = event.recurrenceType;
|
|
1525
|
+
const weekDays = event.weekDays ?? [
|
|
1526
|
+
this.getDayOfWeek(event.eventDate)
|
|
1527
|
+
];
|
|
1528
|
+
let currentDate = event.eventDate;
|
|
1529
|
+
let count = 0;
|
|
1530
|
+
if (recurrenceType === enums_.RecurrenceType.WEEKLY || recurrenceType === enums_.RecurrenceType.BIWEEKLY) {
|
|
1531
|
+
let weekStart = this.getWeekStart(event.eventDate);
|
|
1532
|
+
while(count < maxOccurrences){
|
|
1533
|
+
for (const dayOfWeek of weekDays){
|
|
1534
|
+
if (count >= maxOccurrences) break;
|
|
1535
|
+
currentDate = this.addDaysToDate(weekStart, this.weekdayNameToIndex(dayOfWeek));
|
|
1536
|
+
if (currentDate < event.eventDate) continue;
|
|
1537
|
+
if (this.shouldStopRecurrence(currentDate, recurrenceEnd, rangeEnd)) {
|
|
1538
|
+
count = maxOccurrences;
|
|
1539
|
+
break;
|
|
1540
|
+
}
|
|
1541
|
+
if (currentDate >= rangeStart && currentDate <= rangeEnd) {
|
|
1542
|
+
occurrences.push(this.toCalendarEventOnDate(event, currentDate, occurrences.length > 0));
|
|
1543
|
+
}
|
|
1544
|
+
count++;
|
|
1545
|
+
}
|
|
1546
|
+
const weeksToAdd = recurrenceType === enums_.RecurrenceType.BIWEEKLY ? 2 : 1;
|
|
1547
|
+
weekStart = this.addDaysToDate(weekStart, 7 * weeksToAdd);
|
|
1548
|
+
}
|
|
1549
|
+
} else {
|
|
1550
|
+
const originalDayOfMonth = parseInt(event.eventDate.split('-')[2], 10);
|
|
1551
|
+
while(count < maxOccurrences){
|
|
1552
|
+
if (this.shouldStopRecurrence(currentDate, recurrenceEnd, rangeEnd)) break;
|
|
1553
|
+
if (currentDate >= rangeStart && currentDate <= rangeEnd) {
|
|
1554
|
+
occurrences.push(this.toCalendarEventOnDate(event, currentDate, count > 0));
|
|
1555
|
+
}
|
|
1556
|
+
currentDate = this.getNextOccurrenceDate(currentDate, recurrenceType, originalDayOfMonth);
|
|
1557
|
+
count++;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
return occurrences;
|
|
1561
|
+
}
|
|
1562
|
+
// Private utility helpers
|
|
1563
|
+
async ensureParticipantRepositoryInitialized() {
|
|
1564
|
+
if (!this.participantRepository) {
|
|
1565
|
+
this.participantRepository = await this.dataSourceProvider.getRepository(src_entities/* .EventParticipant */.ek);
|
|
1566
|
+
}
|
|
1567
|
+
return this.participantRepository;
|
|
1568
|
+
}
|
|
1569
|
+
async getParticipantEventIds(userId) {
|
|
1570
|
+
const participantRepo = await this.ensureParticipantRepositoryInitialized();
|
|
1571
|
+
const results = await participantRepo.createQueryBuilder('ep').select('ep.eventId').where('ep.userId = :userId', {
|
|
1572
|
+
userId
|
|
1573
|
+
}).andWhere('ep.deletedAt IS NULL').getRawMany();
|
|
1574
|
+
return results.map((p)=>p.ep_event_id);
|
|
1575
|
+
}
|
|
1576
|
+
async loadParticipantsForEvents(events) {
|
|
1577
|
+
const participantRepo = await this.ensureParticipantRepositoryInitialized();
|
|
1578
|
+
const eventIds = events.map((e)=>e.id);
|
|
1579
|
+
const participants = await participantRepo.find({
|
|
1580
|
+
where: {
|
|
1581
|
+
eventId: (0,external_typeorm_.In)(eventIds),
|
|
1582
|
+
deletedAt: (0,external_typeorm_.IsNull)()
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
const participantsByEvent = new Map();
|
|
1586
|
+
for (const p of participants){
|
|
1587
|
+
const list = participantsByEvent.get(p.eventId) || [];
|
|
1588
|
+
list.push(p);
|
|
1589
|
+
participantsByEvent.set(p.eventId, list);
|
|
1590
|
+
}
|
|
1591
|
+
for (const event of events){
|
|
1592
|
+
event.participants = participantsByEvent.get(event.id) || [];
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
applyEventCompanyFilter(query, user) {
|
|
1596
|
+
(0,__rspack_external__flusys_nestjs_shared_utils_9125c1f1.applyCompanyFilter)(query, {
|
|
1597
|
+
isCompanyFeatureEnabled: this.eventConfig.isCompanyFeatureEnabled(),
|
|
1598
|
+
entityAlias: 'event'
|
|
1599
|
+
}, user);
|
|
1600
|
+
}
|
|
1601
|
+
shouldStopRecurrence(currentDate, recurrenceEnd, rangeEnd) {
|
|
1602
|
+
return recurrenceEnd !== null && currentDate > recurrenceEnd || currentDate > rangeEnd;
|
|
1603
|
+
}
|
|
1604
|
+
getDayOfWeek(dateStr) {
|
|
1605
|
+
const days = [
|
|
1606
|
+
'SUN',
|
|
1607
|
+
'MON',
|
|
1608
|
+
'TUE',
|
|
1609
|
+
'WED',
|
|
1610
|
+
'THU',
|
|
1611
|
+
'FRI',
|
|
1612
|
+
'SAT'
|
|
1613
|
+
];
|
|
1614
|
+
return days[new Date(`${dateStr}T00:00:00Z`).getUTCDay()];
|
|
1615
|
+
}
|
|
1616
|
+
weekdayNameToIndex(day) {
|
|
1617
|
+
const map = {
|
|
1618
|
+
SUN: 0,
|
|
1619
|
+
MON: 1,
|
|
1620
|
+
TUE: 2,
|
|
1621
|
+
WED: 3,
|
|
1622
|
+
THU: 4,
|
|
1623
|
+
FRI: 5,
|
|
1624
|
+
SAT: 6
|
|
1625
|
+
};
|
|
1626
|
+
return map[day.toUpperCase()] ?? 0;
|
|
1627
|
+
}
|
|
1628
|
+
getWeekStart(dateStr) {
|
|
1629
|
+
const d = new Date(`${dateStr}T00:00:00Z`);
|
|
1630
|
+
d.setUTCDate(d.getUTCDate() - d.getUTCDay());
|
|
1631
|
+
return d.toISOString().slice(0, 10);
|
|
1632
|
+
}
|
|
1633
|
+
addDaysToDate(dateStr, days) {
|
|
1634
|
+
const d = new Date(`${dateStr}T00:00:00Z`);
|
|
1635
|
+
d.setUTCDate(d.getUTCDate() + days);
|
|
1636
|
+
return d.toISOString().slice(0, 10);
|
|
1637
|
+
}
|
|
1638
|
+
getNextOccurrenceDate(current, recurrenceType, originalDayOfMonth) {
|
|
1639
|
+
const d = new Date(`${current}T00:00:00Z`);
|
|
1640
|
+
switch(recurrenceType){
|
|
1641
|
+
case enums_.RecurrenceType.DAILY:
|
|
1642
|
+
d.setUTCDate(d.getUTCDate() + 1);
|
|
1643
|
+
break;
|
|
1644
|
+
case enums_.RecurrenceType.MONTHLY:
|
|
1645
|
+
{
|
|
1646
|
+
// Compute the target year/month from the *original* date before any mutation.
|
|
1647
|
+
// Mutating `d` first (e.g. via setUTCMonth) can overflow past short months
|
|
1648
|
+
// (Jan 31 -> Feb 31 normalizes to Mar 3), which would then compute
|
|
1649
|
+
// `lastDayOfMonth` for the wrong (already-overflowed) month and silently
|
|
1650
|
+
// skip target months that have fewer days than the original day-of-month.
|
|
1651
|
+
const targetDay = originalDayOfMonth ?? d.getUTCDate();
|
|
1652
|
+
const targetYear = d.getUTCFullYear();
|
|
1653
|
+
const targetMonth = d.getUTCMonth() + 1;
|
|
1654
|
+
const lastDayOfMonth = new Date(Date.UTC(targetYear, targetMonth + 1, 0)).getUTCDate();
|
|
1655
|
+
return new Date(Date.UTC(targetYear, targetMonth, Math.min(targetDay, lastDayOfMonth))).toISOString().slice(0, 10);
|
|
1656
|
+
}
|
|
1657
|
+
default:
|
|
1658
|
+
break;
|
|
1659
|
+
}
|
|
1660
|
+
return d.toISOString().slice(0, 10);
|
|
1661
|
+
}
|
|
1662
|
+
// Private transformation helpers
|
|
1663
|
+
toCalendarEvent(event) {
|
|
1664
|
+
return {
|
|
1665
|
+
id: event.id,
|
|
1666
|
+
title: event.title,
|
|
1667
|
+
description: event.description,
|
|
1668
|
+
eventDate: event.eventDate,
|
|
1669
|
+
startTime: event.startTime,
|
|
1670
|
+
endTime: event.endTime,
|
|
1671
|
+
isAllDay: event.isAllDay,
|
|
1672
|
+
recurrenceType: event.recurrenceType,
|
|
1673
|
+
recurrenceEndDate: event.recurrenceEndDate,
|
|
1674
|
+
weekDays: event.weekDays,
|
|
1675
|
+
color: event.color,
|
|
1676
|
+
meetingLink: event.meetingLink ?? null,
|
|
1677
|
+
isActive: event.isActive,
|
|
1678
|
+
createdAt: event.createdAt,
|
|
1679
|
+
updatedAt: event.updatedAt,
|
|
1680
|
+
deletedAt: event.deletedAt,
|
|
1681
|
+
createdById: event.createdById,
|
|
1682
|
+
updatedById: event.updatedById,
|
|
1683
|
+
deletedById: event.deletedById,
|
|
1684
|
+
participants: event.participants?.map((p)=>this.toParticipantInfo(p))
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
toCalendarEventOnDate(event, occurrenceDate, isRecurrenceInstance) {
|
|
1688
|
+
return {
|
|
1689
|
+
...this.toCalendarEvent(event),
|
|
1690
|
+
id: `${event.id}_${occurrenceDate}`,
|
|
1691
|
+
originalEventId: event.id,
|
|
1692
|
+
isRecurrenceInstance,
|
|
1693
|
+
eventDate: occurrenceDate
|
|
1694
|
+
};
|
|
1695
|
+
}
|
|
1696
|
+
toParticipantInfo(p) {
|
|
1697
|
+
return {
|
|
1698
|
+
id: p.id,
|
|
1699
|
+
eventId: p.eventId,
|
|
1700
|
+
userId: p.userId,
|
|
1701
|
+
status: p.status,
|
|
1702
|
+
isOrganizer: p.isOrganizer,
|
|
1703
|
+
createdAt: p.createdAt,
|
|
1704
|
+
updatedAt: p.updatedAt,
|
|
1705
|
+
deletedAt: p.deletedAt,
|
|
1706
|
+
createdById: p.createdById,
|
|
1707
|
+
updatedById: p.updatedById,
|
|
1708
|
+
deletedById: p.deletedById
|
|
1709
|
+
};
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
_ts_decorate([
|
|
1713
|
+
(0,decorators_.LogAction)({
|
|
1714
|
+
action: 'eventParticipant.updateStatus',
|
|
1715
|
+
module: 'event-manager'
|
|
1716
|
+
}),
|
|
1717
|
+
_ts_metadata("design:type", Function),
|
|
1718
|
+
_ts_metadata("design:paramtypes", [
|
|
1719
|
+
typeof dtos/* .UpdateParticipantStatusDto */.Wk === "undefined" ? Object : dtos/* .UpdateParticipantStatusDto */.Wk,
|
|
1720
|
+
Object
|
|
1721
|
+
]),
|
|
1722
|
+
_ts_metadata("design:returntype", Promise)
|
|
1723
|
+
], EventService.prototype, "updateParticipantStatus", null);
|
|
1724
|
+
EventService = _ts_decorate([
|
|
1725
|
+
(0,common_.Injectable)({
|
|
1726
|
+
scope: common_.Scope.REQUEST
|
|
1727
|
+
}),
|
|
1728
|
+
_ts_param(0, (0,common_.Inject)('CACHE_INSTANCE')),
|
|
1729
|
+
_ts_param(1, (0,common_.Inject)(modules_.UtilsService)),
|
|
1730
|
+
_ts_param(2, (0,common_.Inject)(event_manager_config_service/* .EventManagerConfigService */.$)),
|
|
1731
|
+
_ts_param(3, (0,common_.Inject)(event_manager_datasource_provider/* .EventManagerDataSourceProvider */.a)),
|
|
1732
|
+
_ts_metadata("design:type", Function),
|
|
1733
|
+
_ts_metadata("design:paramtypes", [
|
|
1734
|
+
typeof classes_.HybridCache === "undefined" ? Object : classes_.HybridCache,
|
|
1735
|
+
typeof modules_.UtilsService === "undefined" ? Object : modules_.UtilsService,
|
|
1736
|
+
typeof event_manager_config_service/* .EventManagerConfigService */.$ === "undefined" ? Object : event_manager_config_service/* .EventManagerConfigService */.$,
|
|
1737
|
+
typeof event_manager_datasource_provider/* .EventManagerDataSourceProvider */.a === "undefined" ? Object : event_manager_datasource_provider/* .EventManagerDataSourceProvider */.a
|
|
1738
|
+
])
|
|
1739
|
+
], EventService);
|
|
1740
|
+
|
|
1741
|
+
|
|
1742
|
+
},
|
|
1743
|
+
422(module) {
|
|
1744
|
+
|
|
1745
|
+
module.exports = __rspack_external__flusys_nestjs_shared_393d2cae;
|
|
1746
|
+
|
|
1747
|
+
|
|
1748
|
+
},
|
|
1749
|
+
937(module) {
|
|
1750
|
+
|
|
1751
|
+
module.exports = __rspack_external__flusys_nestjs_shared_classes_6076a329;
|
|
1752
|
+
|
|
1753
|
+
|
|
1754
|
+
},
|
|
1755
|
+
265(module) {
|
|
1756
|
+
|
|
1757
|
+
module.exports = __rspack_external__flusys_nestjs_shared_decorators_c129b601;
|
|
1758
|
+
|
|
1759
|
+
|
|
1760
|
+
},
|
|
1761
|
+
471(module) {
|
|
1762
|
+
|
|
1763
|
+
module.exports = __rspack_external__flusys_nestjs_shared_enums_327421f8;
|
|
1764
|
+
|
|
1765
|
+
|
|
1766
|
+
},
|
|
1767
|
+
236(module) {
|
|
1768
|
+
|
|
1769
|
+
module.exports = __rspack_external__flusys_nestjs_shared_modules_24702bee;
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
},
|
|
1773
|
+
157(module) {
|
|
1774
|
+
|
|
1775
|
+
module.exports = __rspack_external__nestjs_common_a04939da;
|
|
1776
|
+
|
|
1777
|
+
|
|
1778
|
+
},
|
|
1779
|
+
176(module) {
|
|
1780
|
+
|
|
1781
|
+
module.exports = __rspack_external__nestjs_swagger_7cd450b5;
|
|
1782
|
+
|
|
1783
|
+
|
|
1784
|
+
},
|
|
1785
|
+
812(module) {
|
|
1786
|
+
|
|
1787
|
+
module.exports = __rspack_external_class_transformer_c5a479fb;
|
|
1788
|
+
|
|
1789
|
+
|
|
1790
|
+
},
|
|
1791
|
+
158(module) {
|
|
1792
|
+
|
|
1793
|
+
module.exports = __rspack_external_typeorm;
|
|
1794
|
+
|
|
1795
|
+
|
|
1796
|
+
},
|
|
1797
|
+
|
|
1798
|
+
};
|