@flusys/nestjs-event-manager 4.1.0 → 5.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/README.md +126 -337
- package/adapters/event-manager.adapter.d.ts +0 -2
- package/cjs/adapters/event-manager.adapter.js +1 -7
- package/cjs/config/message-keys.js +1 -31
- package/cjs/controllers/event.controller.js +10 -60
- package/cjs/controllers/index.js +0 -1
- package/cjs/docs/event-manager-swagger.config.js +19 -29
- package/cjs/docs/index.js +0 -3
- package/cjs/dtos/calendar-query.dto.js +46 -20
- package/cjs/dtos/event-participant.dto.js +0 -45
- package/cjs/dtos/event.dto.js +97 -45
- package/cjs/entities/event-participant.entity.js +1 -8
- package/cjs/entities/event.entity.js +38 -26
- package/cjs/modules/event-manager.module.js +2 -4
- package/cjs/services/event-manager-helper.service.js +15 -83
- package/cjs/services/event.service.js +143 -122
- package/cjs/services/index.js +0 -1
- package/config/message-keys.d.ts +0 -56
- package/controllers/event.controller.d.ts +2 -5
- package/controllers/index.d.ts +0 -1
- package/docs/index.d.ts +1 -1
- package/dtos/calendar-query.dto.d.ts +8 -5
- package/dtos/event-participant.dto.d.ts +0 -6
- package/dtos/event.dto.d.ts +14 -10
- package/entities/event-participant.entity.d.ts +0 -1
- package/entities/event.entity.d.ts +6 -5
- package/fesm/adapters/event-manager.adapter.js +1 -7
- package/fesm/config/message-keys.js +1 -29
- package/fesm/controllers/event.controller.js +11 -61
- package/fesm/controllers/index.js +0 -1
- package/fesm/docs/event-manager-swagger.config.js +19 -29
- package/fesm/docs/index.js +1 -1
- package/fesm/dtos/calendar-query.dto.js +47 -21
- package/fesm/dtos/event-participant.dto.js +0 -42
- package/fesm/dtos/event.dto.js +98 -46
- package/fesm/entities/event-participant.entity.js +1 -8
- package/fesm/entities/event.entity.js +38 -26
- package/fesm/modules/event-manager.module.js +4 -6
- package/fesm/services/event-manager-helper.service.js +17 -85
- package/fesm/services/event.service.js +144 -123
- package/fesm/services/index.js +0 -1
- package/interfaces/event.interface.d.ts +6 -6
- package/package.json +3 -3
- package/services/event-manager-helper.service.d.ts +1 -3
- package/services/event.service.d.ts +8 -8
- package/services/index.d.ts +0 -1
- package/cjs/controllers/event-participant.controller.js +0 -287
- package/cjs/services/event-participant.service.js +0 -198
- package/controllers/event-participant.controller.d.ts +0 -35
- package/fesm/controllers/event-participant.controller.js +0 -277
- package/fesm/services/event-participant.service.js +0 -188
- package/services/event-participant.service.d.ts +0 -27
package/cjs/dtos/event.dto.js
CHANGED
|
@@ -22,6 +22,7 @@ _export(exports, {
|
|
|
22
22
|
const _enums = require("@flusys/nestjs-shared/enums");
|
|
23
23
|
const _swagger = require("@nestjs/swagger");
|
|
24
24
|
const _classtransformer = require("class-transformer");
|
|
25
|
+
const _eventparticipantdto = require("./event-participant.dto");
|
|
25
26
|
const _classvalidator = require("class-validator");
|
|
26
27
|
function _define_property(obj, key, value) {
|
|
27
28
|
if (key in obj) {
|
|
@@ -49,15 +50,16 @@ let CreateEventDto = class CreateEventDto {
|
|
|
49
50
|
constructor(){
|
|
50
51
|
_define_property(this, "title", void 0);
|
|
51
52
|
_define_property(this, "description", void 0);
|
|
52
|
-
_define_property(this, "
|
|
53
|
-
_define_property(this, "
|
|
54
|
-
_define_property(this, "
|
|
53
|
+
_define_property(this, "eventDate", void 0);
|
|
54
|
+
_define_property(this, "startTime", void 0);
|
|
55
|
+
_define_property(this, "endTime", void 0);
|
|
55
56
|
_define_property(this, "isAllDay", void 0);
|
|
56
57
|
_define_property(this, "recurrenceType", void 0);
|
|
57
58
|
_define_property(this, "recurrenceEndDate", void 0);
|
|
59
|
+
_define_property(this, "weekDays", void 0);
|
|
58
60
|
_define_property(this, "color", void 0);
|
|
59
61
|
_define_property(this, "isActive", void 0);
|
|
60
|
-
_define_property(this, "
|
|
62
|
+
_define_property(this, "meetingLink", void 0);
|
|
61
63
|
_define_property(this, "participantIds", void 0);
|
|
62
64
|
}
|
|
63
65
|
};
|
|
@@ -81,35 +83,41 @@ _ts_decorate([
|
|
|
81
83
|
_ts_metadata("design:type", String)
|
|
82
84
|
], CreateEventDto.prototype, "description", void 0);
|
|
83
85
|
_ts_decorate([
|
|
84
|
-
(0, _swagger.
|
|
85
|
-
description: '
|
|
86
|
-
|
|
86
|
+
(0, _swagger.ApiProperty)({
|
|
87
|
+
description: 'Event date (YYYY-MM-DD)',
|
|
88
|
+
example: '2024-01-15'
|
|
87
89
|
}),
|
|
88
|
-
(0, _classvalidator.
|
|
90
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
89
91
|
(0, _classvalidator.IsString)(),
|
|
90
|
-
(0, _classvalidator.
|
|
92
|
+
(0, _classvalidator.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
93
|
+
message: 'eventDate must be in YYYY-MM-DD format'
|
|
94
|
+
}),
|
|
91
95
|
_ts_metadata("design:type", String)
|
|
92
|
-
], CreateEventDto.prototype, "
|
|
96
|
+
], CreateEventDto.prototype, "eventDate", void 0);
|
|
93
97
|
_ts_decorate([
|
|
94
98
|
(0, _swagger.ApiProperty)({
|
|
95
|
-
description: 'Start
|
|
96
|
-
example: '
|
|
99
|
+
description: 'Start time (HH:mm)',
|
|
100
|
+
example: '09:00'
|
|
97
101
|
}),
|
|
98
102
|
(0, _classvalidator.IsNotEmpty)(),
|
|
99
|
-
(0, _classvalidator.
|
|
100
|
-
(0,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
(0, _classvalidator.IsString)(),
|
|
104
|
+
(0, _classvalidator.Matches)(/^\d{2}:\d{2}$/, {
|
|
105
|
+
message: 'startTime must be in HH:mm format'
|
|
106
|
+
}),
|
|
107
|
+
_ts_metadata("design:type", String)
|
|
108
|
+
], CreateEventDto.prototype, "startTime", void 0);
|
|
103
109
|
_ts_decorate([
|
|
104
110
|
(0, _swagger.ApiProperty)({
|
|
105
|
-
description: 'End
|
|
106
|
-
example: '
|
|
111
|
+
description: 'End time (HH:mm)',
|
|
112
|
+
example: '10:00'
|
|
107
113
|
}),
|
|
108
114
|
(0, _classvalidator.IsNotEmpty)(),
|
|
109
|
-
(0, _classvalidator.
|
|
110
|
-
(0,
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
(0, _classvalidator.IsString)(),
|
|
116
|
+
(0, _classvalidator.Matches)(/^\d{2}:\d{2}$/, {
|
|
117
|
+
message: 'endTime must be in HH:mm format'
|
|
118
|
+
}),
|
|
119
|
+
_ts_metadata("design:type", String)
|
|
120
|
+
], CreateEventDto.prototype, "endTime", void 0);
|
|
113
121
|
_ts_decorate([
|
|
114
122
|
(0, _swagger.ApiPropertyOptional)({
|
|
115
123
|
description: 'All day event flag',
|
|
@@ -131,13 +139,30 @@ _ts_decorate([
|
|
|
131
139
|
], CreateEventDto.prototype, "recurrenceType", void 0);
|
|
132
140
|
_ts_decorate([
|
|
133
141
|
(0, _swagger.ApiPropertyOptional)({
|
|
134
|
-
description: 'Recurrence end date'
|
|
142
|
+
description: 'Recurrence end date (YYYY-MM-DD)',
|
|
143
|
+
example: '2024-12-31'
|
|
135
144
|
}),
|
|
136
145
|
(0, _classvalidator.IsOptional)(),
|
|
137
|
-
(0, _classvalidator.
|
|
138
|
-
(0,
|
|
139
|
-
|
|
146
|
+
(0, _classvalidator.IsString)(),
|
|
147
|
+
(0, _classvalidator.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
148
|
+
message: 'recurrenceEndDate must be in YYYY-MM-DD format'
|
|
149
|
+
}),
|
|
150
|
+
_ts_metadata("design:type", Object)
|
|
140
151
|
], CreateEventDto.prototype, "recurrenceEndDate", void 0);
|
|
152
|
+
_ts_decorate([
|
|
153
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
154
|
+
description: 'Selected weekdays for WEEKLY recurrence (e.g. ["MON","WED"])',
|
|
155
|
+
type: [
|
|
156
|
+
String
|
|
157
|
+
]
|
|
158
|
+
}),
|
|
159
|
+
(0, _classvalidator.IsOptional)(),
|
|
160
|
+
(0, _classvalidator.IsArray)(),
|
|
161
|
+
(0, _classvalidator.IsString)({
|
|
162
|
+
each: true
|
|
163
|
+
}),
|
|
164
|
+
_ts_metadata("design:type", Object)
|
|
165
|
+
], CreateEventDto.prototype, "weekDays", void 0);
|
|
141
166
|
_ts_decorate([
|
|
142
167
|
(0, _swagger.ApiPropertyOptional)({
|
|
143
168
|
description: 'Event color (hex)',
|
|
@@ -160,11 +185,17 @@ _ts_decorate([
|
|
|
160
185
|
], CreateEventDto.prototype, "isActive", void 0);
|
|
161
186
|
_ts_decorate([
|
|
162
187
|
(0, _swagger.ApiPropertyOptional)({
|
|
163
|
-
description: '
|
|
188
|
+
description: 'Meeting link URL (e.g. video call)',
|
|
189
|
+
example: 'https://meet.google.com/abc-def-ghi'
|
|
164
190
|
}),
|
|
165
191
|
(0, _classvalidator.IsOptional)(),
|
|
166
|
-
|
|
167
|
-
|
|
192
|
+
(0, _classvalidator.IsString)(),
|
|
193
|
+
(0, _classvalidator.IsUrl)({}, {
|
|
194
|
+
message: 'meetingLink must be a valid URL'
|
|
195
|
+
}),
|
|
196
|
+
(0, _classvalidator.MaxLength)(500),
|
|
197
|
+
_ts_metadata("design:type", Object)
|
|
198
|
+
], CreateEventDto.prototype, "meetingLink", void 0);
|
|
168
199
|
_ts_decorate([
|
|
169
200
|
(0, _swagger.ApiPropertyOptional)({
|
|
170
201
|
description: 'Participant user IDs',
|
|
@@ -198,18 +229,20 @@ let EventResponseDto = class EventResponseDto {
|
|
|
198
229
|
_define_property(this, "id", void 0);
|
|
199
230
|
_define_property(this, "title", void 0);
|
|
200
231
|
_define_property(this, "description", void 0);
|
|
201
|
-
_define_property(this, "
|
|
202
|
-
_define_property(this, "
|
|
203
|
-
_define_property(this, "
|
|
232
|
+
_define_property(this, "eventDate", void 0);
|
|
233
|
+
_define_property(this, "startTime", void 0);
|
|
234
|
+
_define_property(this, "endTime", void 0);
|
|
204
235
|
_define_property(this, "isAllDay", void 0);
|
|
205
236
|
_define_property(this, "recurrenceType", void 0);
|
|
206
237
|
_define_property(this, "recurrenceEndDate", void 0);
|
|
238
|
+
_define_property(this, "weekDays", void 0);
|
|
207
239
|
_define_property(this, "color", void 0);
|
|
240
|
+
_define_property(this, "meetingLink", void 0);
|
|
208
241
|
_define_property(this, "isActive", void 0);
|
|
209
|
-
_define_property(this, "metadata", void 0);
|
|
210
242
|
_define_property(this, "companyId", void 0);
|
|
211
243
|
_define_property(this, "createdAt", void 0);
|
|
212
244
|
_define_property(this, "updatedAt", void 0);
|
|
245
|
+
_define_property(this, "participants", void 0);
|
|
213
246
|
}
|
|
214
247
|
};
|
|
215
248
|
_ts_decorate([
|
|
@@ -229,19 +262,19 @@ _ts_decorate([
|
|
|
229
262
|
], EventResponseDto.prototype, "description", void 0);
|
|
230
263
|
_ts_decorate([
|
|
231
264
|
(0, _classtransformer.Expose)(),
|
|
232
|
-
(0, _swagger.
|
|
233
|
-
_ts_metadata("design:type",
|
|
234
|
-
], EventResponseDto.prototype, "
|
|
265
|
+
(0, _swagger.ApiProperty)(),
|
|
266
|
+
_ts_metadata("design:type", String)
|
|
267
|
+
], EventResponseDto.prototype, "eventDate", void 0);
|
|
235
268
|
_ts_decorate([
|
|
236
269
|
(0, _classtransformer.Expose)(),
|
|
237
270
|
(0, _swagger.ApiProperty)(),
|
|
238
|
-
_ts_metadata("design:type",
|
|
239
|
-
], EventResponseDto.prototype, "
|
|
271
|
+
_ts_metadata("design:type", String)
|
|
272
|
+
], EventResponseDto.prototype, "startTime", void 0);
|
|
240
273
|
_ts_decorate([
|
|
241
274
|
(0, _classtransformer.Expose)(),
|
|
242
275
|
(0, _swagger.ApiProperty)(),
|
|
243
|
-
_ts_metadata("design:type",
|
|
244
|
-
], EventResponseDto.prototype, "
|
|
276
|
+
_ts_metadata("design:type", String)
|
|
277
|
+
], EventResponseDto.prototype, "endTime", void 0);
|
|
245
278
|
_ts_decorate([
|
|
246
279
|
(0, _classtransformer.Expose)(),
|
|
247
280
|
(0, _swagger.ApiProperty)(),
|
|
@@ -259,21 +292,30 @@ _ts_decorate([
|
|
|
259
292
|
(0, _swagger.ApiPropertyOptional)(),
|
|
260
293
|
_ts_metadata("design:type", Object)
|
|
261
294
|
], EventResponseDto.prototype, "recurrenceEndDate", void 0);
|
|
295
|
+
_ts_decorate([
|
|
296
|
+
(0, _classtransformer.Expose)(),
|
|
297
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
298
|
+
type: [
|
|
299
|
+
String
|
|
300
|
+
]
|
|
301
|
+
}),
|
|
302
|
+
_ts_metadata("design:type", Object)
|
|
303
|
+
], EventResponseDto.prototype, "weekDays", void 0);
|
|
262
304
|
_ts_decorate([
|
|
263
305
|
(0, _classtransformer.Expose)(),
|
|
264
306
|
(0, _swagger.ApiProperty)(),
|
|
265
307
|
_ts_metadata("design:type", String)
|
|
266
308
|
], EventResponseDto.prototype, "color", void 0);
|
|
309
|
+
_ts_decorate([
|
|
310
|
+
(0, _classtransformer.Expose)(),
|
|
311
|
+
(0, _swagger.ApiPropertyOptional)(),
|
|
312
|
+
_ts_metadata("design:type", Object)
|
|
313
|
+
], EventResponseDto.prototype, "meetingLink", void 0);
|
|
267
314
|
_ts_decorate([
|
|
268
315
|
(0, _classtransformer.Expose)(),
|
|
269
316
|
(0, _swagger.ApiProperty)(),
|
|
270
317
|
_ts_metadata("design:type", Boolean)
|
|
271
318
|
], EventResponseDto.prototype, "isActive", void 0);
|
|
272
|
-
_ts_decorate([
|
|
273
|
-
(0, _classtransformer.Expose)(),
|
|
274
|
-
(0, _swagger.ApiPropertyOptional)(),
|
|
275
|
-
_ts_metadata("design:type", Object)
|
|
276
|
-
], EventResponseDto.prototype, "metadata", void 0);
|
|
277
319
|
_ts_decorate([
|
|
278
320
|
(0, _classtransformer.Expose)(),
|
|
279
321
|
(0, _swagger.ApiPropertyOptional)(),
|
|
@@ -289,3 +331,13 @@ _ts_decorate([
|
|
|
289
331
|
(0, _swagger.ApiProperty)(),
|
|
290
332
|
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
291
333
|
], EventResponseDto.prototype, "updatedAt", void 0);
|
|
334
|
+
_ts_decorate([
|
|
335
|
+
(0, _classtransformer.Expose)(),
|
|
336
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
337
|
+
type: ()=>[
|
|
338
|
+
_eventparticipantdto.EventParticipantResponseDto
|
|
339
|
+
]
|
|
340
|
+
}),
|
|
341
|
+
(0, _classtransformer.Type)(()=>_eventparticipantdto.EventParticipantResponseDto),
|
|
342
|
+
_ts_metadata("design:type", Array)
|
|
343
|
+
], EventResponseDto.prototype, "participants", void 0);
|
|
@@ -35,7 +35,7 @@ function _ts_metadata(k, v) {
|
|
|
35
35
|
}
|
|
36
36
|
let EventParticipant = class EventParticipant extends _entities.Identity {
|
|
37
37
|
constructor(...args){
|
|
38
|
-
super(...args), _define_property(this, "eventId", void 0), _define_property(this, "userId", void 0), _define_property(this, "status", void 0), _define_property(this, "isOrganizer", void 0)
|
|
38
|
+
super(...args), _define_property(this, "eventId", void 0), _define_property(this, "userId", void 0), _define_property(this, "status", void 0), _define_property(this, "isOrganizer", void 0);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
_ts_decorate([
|
|
@@ -73,13 +73,6 @@ _ts_decorate([
|
|
|
73
73
|
}),
|
|
74
74
|
_ts_metadata("design:type", Boolean)
|
|
75
75
|
], EventParticipant.prototype, "isOrganizer", void 0);
|
|
76
|
-
_ts_decorate([
|
|
77
|
-
(0, _typeorm.Column)({
|
|
78
|
-
type: 'simple-json',
|
|
79
|
-
nullable: true
|
|
80
|
-
}),
|
|
81
|
-
_ts_metadata("design:type", Object)
|
|
82
|
-
], EventParticipant.prototype, "metadata", void 0);
|
|
83
76
|
EventParticipant = _ts_decorate([
|
|
84
77
|
(0, _typeorm.Entity)({
|
|
85
78
|
name: 'event_participant'
|
|
@@ -35,7 +35,7 @@ function _ts_metadata(k, v) {
|
|
|
35
35
|
}
|
|
36
36
|
let Event = class Event extends _entities.Identity {
|
|
37
37
|
constructor(...args){
|
|
38
|
-
super(...args), _define_property(this, "title", void 0), _define_property(this, "description", void 0), _define_property(this, "
|
|
38
|
+
super(...args), _define_property(this, "title", void 0), _define_property(this, "description", void 0), _define_property(this, "eventDate", void 0), _define_property(this, "startTime", void 0), _define_property(this, "endTime", void 0), _define_property(this, "isAllDay", void 0), _define_property(this, "recurrenceType", void 0), _define_property(this, "recurrenceEndDate", void 0), _define_property(this, "weekDays", void 0), _define_property(this, "color", void 0), _define_property(this, "meetingLink", void 0), _define_property(this, "isActive", void 0);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
_ts_decorate([
|
|
@@ -55,28 +55,32 @@ _ts_decorate([
|
|
|
55
55
|
], Event.prototype, "description", void 0);
|
|
56
56
|
_ts_decorate([
|
|
57
57
|
(0, _typeorm.Column)({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
nullable:
|
|
58
|
+
name: 'event_date',
|
|
59
|
+
type: 'date',
|
|
60
|
+
nullable: false
|
|
61
61
|
}),
|
|
62
|
-
_ts_metadata("design:type",
|
|
63
|
-
], Event.prototype, "
|
|
62
|
+
_ts_metadata("design:type", String)
|
|
63
|
+
], Event.prototype, "eventDate", void 0);
|
|
64
64
|
_ts_decorate([
|
|
65
65
|
(0, _typeorm.Column)({
|
|
66
|
-
name: '
|
|
67
|
-
type: '
|
|
68
|
-
|
|
66
|
+
name: 'start_time',
|
|
67
|
+
type: 'varchar',
|
|
68
|
+
length: 5,
|
|
69
|
+
nullable: false,
|
|
70
|
+
default: '00:00'
|
|
69
71
|
}),
|
|
70
|
-
_ts_metadata("design:type",
|
|
71
|
-
], Event.prototype, "
|
|
72
|
+
_ts_metadata("design:type", String)
|
|
73
|
+
], Event.prototype, "startTime", void 0);
|
|
72
74
|
_ts_decorate([
|
|
73
75
|
(0, _typeorm.Column)({
|
|
74
|
-
name: '
|
|
75
|
-
type: '
|
|
76
|
-
|
|
76
|
+
name: 'end_time',
|
|
77
|
+
type: 'varchar',
|
|
78
|
+
length: 5,
|
|
79
|
+
nullable: false,
|
|
80
|
+
default: '23:59'
|
|
77
81
|
}),
|
|
78
|
-
_ts_metadata("design:type",
|
|
79
|
-
], Event.prototype, "
|
|
82
|
+
_ts_metadata("design:type", String)
|
|
83
|
+
], Event.prototype, "endTime", void 0);
|
|
80
84
|
_ts_decorate([
|
|
81
85
|
(0, _typeorm.Column)({
|
|
82
86
|
name: 'is_all_day',
|
|
@@ -99,11 +103,18 @@ _ts_decorate([
|
|
|
99
103
|
_ts_decorate([
|
|
100
104
|
(0, _typeorm.Column)({
|
|
101
105
|
name: 'recurrence_end_date',
|
|
102
|
-
type: '
|
|
106
|
+
type: 'date',
|
|
103
107
|
nullable: true
|
|
104
108
|
}),
|
|
105
109
|
_ts_metadata("design:type", Object)
|
|
106
110
|
], Event.prototype, "recurrenceEndDate", void 0);
|
|
111
|
+
_ts_decorate([
|
|
112
|
+
(0, _typeorm.Column)({
|
|
113
|
+
type: 'json',
|
|
114
|
+
nullable: true
|
|
115
|
+
}),
|
|
116
|
+
_ts_metadata("design:type", Object)
|
|
117
|
+
], Event.prototype, "weekDays", void 0);
|
|
107
118
|
_ts_decorate([
|
|
108
119
|
(0, _typeorm.Column)({
|
|
109
120
|
type: 'varchar',
|
|
@@ -113,6 +124,15 @@ _ts_decorate([
|
|
|
113
124
|
}),
|
|
114
125
|
_ts_metadata("design:type", String)
|
|
115
126
|
], Event.prototype, "color", void 0);
|
|
127
|
+
_ts_decorate([
|
|
128
|
+
(0, _typeorm.Column)({
|
|
129
|
+
name: 'meeting_link',
|
|
130
|
+
type: 'varchar',
|
|
131
|
+
length: 500,
|
|
132
|
+
nullable: true
|
|
133
|
+
}),
|
|
134
|
+
_ts_metadata("design:type", Object)
|
|
135
|
+
], Event.prototype, "meetingLink", void 0);
|
|
116
136
|
_ts_decorate([
|
|
117
137
|
(0, _typeorm.Column)({
|
|
118
138
|
name: 'is_active',
|
|
@@ -122,20 +142,12 @@ _ts_decorate([
|
|
|
122
142
|
}),
|
|
123
143
|
_ts_metadata("design:type", Boolean)
|
|
124
144
|
], Event.prototype, "isActive", void 0);
|
|
125
|
-
_ts_decorate([
|
|
126
|
-
(0, _typeorm.Column)({
|
|
127
|
-
type: 'simple-json',
|
|
128
|
-
nullable: true
|
|
129
|
-
}),
|
|
130
|
-
_ts_metadata("design:type", Object)
|
|
131
|
-
], Event.prototype, "metadata", void 0);
|
|
132
145
|
Event = _ts_decorate([
|
|
133
146
|
(0, _typeorm.Entity)({
|
|
134
147
|
name: 'event'
|
|
135
148
|
}),
|
|
136
149
|
(0, _typeorm.Index)([
|
|
137
|
-
'
|
|
138
|
-
'endDateTime'
|
|
150
|
+
'eventDate'
|
|
139
151
|
]),
|
|
140
152
|
(0, _typeorm.Index)([
|
|
141
153
|
'isActive'
|
|
@@ -22,15 +22,13 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
22
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
23
|
}
|
|
24
24
|
const CONTROLLERS = [
|
|
25
|
-
_controllers.EventController
|
|
26
|
-
_controllers.EventParticipantController
|
|
25
|
+
_controllers.EventController
|
|
27
26
|
];
|
|
28
27
|
const EXPORTED_SERVICES = [
|
|
29
28
|
_services.EventManagerConfigService,
|
|
30
29
|
_services.EventManagerDataSourceProvider,
|
|
31
30
|
_services.EventManagerHelperService,
|
|
32
|
-
_services.EventService
|
|
33
|
-
_services.EventParticipantService
|
|
31
|
+
_services.EventService
|
|
34
32
|
];
|
|
35
33
|
const ADAPTER_PROVIDER = {
|
|
36
34
|
provide: _interfaces.EVENT_MANAGER_ADAPTER,
|
|
@@ -63,18 +63,20 @@ let EventManagerHelperService = class EventManagerHelperService {
|
|
|
63
63
|
}
|
|
64
64
|
async createEvent(options) {
|
|
65
65
|
const repo = await this.getEventRepository();
|
|
66
|
+
const isAllDay = options.isAllDay ?? false;
|
|
66
67
|
const entity = {
|
|
67
68
|
title: options.title,
|
|
68
69
|
description: options.description ?? null,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
isAllDay
|
|
70
|
+
eventDate: options.eventDate,
|
|
71
|
+
startTime: isAllDay ? '00:00' : options.startTime,
|
|
72
|
+
endTime: isAllDay ? '23:59' : options.endTime,
|
|
73
|
+
isAllDay,
|
|
73
74
|
recurrenceType: options.recurrenceType ?? _nestjsshared.RecurrenceType.NONE,
|
|
74
75
|
recurrenceEndDate: options.recurrenceEndDate ?? null,
|
|
76
|
+
weekDays: options.weekDays ?? null,
|
|
75
77
|
color: options.color ?? this.configService.getDefaultColor(),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
meetingLink: options.meetingLink ?? null,
|
|
79
|
+
isActive: true
|
|
78
80
|
};
|
|
79
81
|
if (this.configService.isCompanyFeatureEnabled() && options.companyId) {
|
|
80
82
|
entity.companyId = options.companyId;
|
|
@@ -84,52 +86,6 @@ let EventManagerHelperService = class EventManagerHelperService {
|
|
|
84
86
|
await this.clearCache();
|
|
85
87
|
return this.toEventResult(saved);
|
|
86
88
|
}
|
|
87
|
-
async addParticipants(eventId, userIds, _companyId) {
|
|
88
|
-
const eventRepo = await this.getEventRepository();
|
|
89
|
-
const participantRepo = await this.getParticipantRepository();
|
|
90
|
-
const event = await eventRepo.findOne({
|
|
91
|
-
where: {
|
|
92
|
-
id: eventId,
|
|
93
|
-
deletedAt: (0, _typeorm.IsNull)()
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
if (!event) {
|
|
97
|
-
throw new _common.NotFoundException({
|
|
98
|
-
message: 'Event not found',
|
|
99
|
-
messageKey: _config.EVENT_MESSAGES.NOT_FOUND
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
const existingParticipants = await participantRepo.find({
|
|
103
|
-
where: {
|
|
104
|
-
eventId,
|
|
105
|
-
userId: (0, _typeorm.In)(userIds),
|
|
106
|
-
deletedAt: (0, _typeorm.IsNull)()
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
const existingUserIds = new Set(existingParticipants.map((p)=>p.userId));
|
|
110
|
-
const newParticipants = userIds.filter((userId)=>!existingUserIds.has(userId)).map((userId)=>({
|
|
111
|
-
eventId,
|
|
112
|
-
userId,
|
|
113
|
-
status: _nestjsshared.ParticipantStatus.PENDING,
|
|
114
|
-
isOrganizer: false
|
|
115
|
-
}));
|
|
116
|
-
if (newParticipants.length > 0) {
|
|
117
|
-
await participantRepo.save(newParticipants);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
async removeParticipant(eventId, userId) {
|
|
121
|
-
const participantRepo = await this.getParticipantRepository();
|
|
122
|
-
const participant = await participantRepo.findOne({
|
|
123
|
-
where: {
|
|
124
|
-
eventId,
|
|
125
|
-
userId,
|
|
126
|
-
deletedAt: (0, _typeorm.IsNull)()
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
if (participant) {
|
|
130
|
-
await participantRepo.softRemove(participant);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
89
|
async updateParticipantStatus(participantId, status) {
|
|
134
90
|
const participantRepo = await this.getParticipantRepository();
|
|
135
91
|
const participant = await participantRepo.findOne({
|
|
@@ -161,9 +117,9 @@ let EventManagerHelperService = class EventManagerHelperService {
|
|
|
161
117
|
eventIds
|
|
162
118
|
}).andWhere('event.deletedAt IS NULL').andWhere('event.isActive = :isActive', {
|
|
163
119
|
isActive: true
|
|
164
|
-
}).andWhere('event.
|
|
120
|
+
}).andWhere('event.eventDate <= :endDate', {
|
|
165
121
|
endDate
|
|
166
|
-
}).andWhere('event.
|
|
122
|
+
}).andWhere('event.eventDate >= :startDate', {
|
|
167
123
|
startDate
|
|
168
124
|
});
|
|
169
125
|
if (this.configService.isCompanyFeatureEnabled() && companyId) {
|
|
@@ -207,15 +163,16 @@ let EventManagerHelperService = class EventManagerHelperService {
|
|
|
207
163
|
id: event.id,
|
|
208
164
|
title: event.title,
|
|
209
165
|
description: event.description,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
166
|
+
eventDate: event.eventDate,
|
|
167
|
+
startTime: event.startTime,
|
|
168
|
+
endTime: event.endTime,
|
|
213
169
|
isAllDay: event.isAllDay,
|
|
214
170
|
recurrenceType: event.recurrenceType,
|
|
215
171
|
recurrenceEndDate: event.recurrenceEndDate,
|
|
172
|
+
weekDays: event.weekDays,
|
|
216
173
|
color: event.color,
|
|
174
|
+
meetingLink: event.meetingLink ?? null,
|
|
217
175
|
isActive: event.isActive,
|
|
218
|
-
metadata: event.metadata,
|
|
219
176
|
companyId: eventExt.companyId ?? null,
|
|
220
177
|
createdAt: event.createdAt,
|
|
221
178
|
updatedAt: event.updatedAt
|
|
@@ -250,31 +207,6 @@ _ts_decorate([
|
|
|
250
207
|
]),
|
|
251
208
|
_ts_metadata("design:returntype", Promise)
|
|
252
209
|
], EventManagerHelperService.prototype, "createEvent", null);
|
|
253
|
-
_ts_decorate([
|
|
254
|
-
(0, _decorators.LogAction)({
|
|
255
|
-
action: 'eventParticipant.addMany',
|
|
256
|
-
module: 'event-manager'
|
|
257
|
-
}),
|
|
258
|
-
_ts_metadata("design:type", Function),
|
|
259
|
-
_ts_metadata("design:paramtypes", [
|
|
260
|
-
String,
|
|
261
|
-
Array,
|
|
262
|
-
String
|
|
263
|
-
]),
|
|
264
|
-
_ts_metadata("design:returntype", Promise)
|
|
265
|
-
], EventManagerHelperService.prototype, "addParticipants", null);
|
|
266
|
-
_ts_decorate([
|
|
267
|
-
(0, _decorators.LogAction)({
|
|
268
|
-
action: 'eventParticipant.remove',
|
|
269
|
-
module: 'event-manager'
|
|
270
|
-
}),
|
|
271
|
-
_ts_metadata("design:type", Function),
|
|
272
|
-
_ts_metadata("design:paramtypes", [
|
|
273
|
-
String,
|
|
274
|
-
String
|
|
275
|
-
]),
|
|
276
|
-
_ts_metadata("design:returntype", Promise)
|
|
277
|
-
], EventManagerHelperService.prototype, "removeParticipant", null);
|
|
278
210
|
_ts_decorate([
|
|
279
211
|
(0, _decorators.LogAction)({
|
|
280
212
|
action: 'eventParticipant.updateStatus',
|