@flusys/nestjs-event-manager 9.1.2 → 9.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/adapters/event-manager.adapter.d.ts +4 -3
- package/config/event-actions.d.ts +3 -0
- package/controllers/event.controller.d.ts +1 -0
- package/fesm/617.js +151 -103
- package/fesm/833.js +27 -17
- package/fesm/adapters/index.js +76 -43
- package/fesm/config/index.js +12 -6
- package/fesm/controllers/index.js +1 -1
- package/fesm/dtos/index.js +22 -2
- package/fesm/index.js +6 -3
- package/fesm/services/index.js +9 -7
- package/package.json +3 -3
- package/services/event-manager-helper.service.d.ts +0 -1
- package/services/event.service.d.ts +10 -6
package/README.md
CHANGED
|
@@ -155,6 +155,19 @@ The service resolves the correct entity variant automatically per request.
|
|
|
155
155
|
|
|
156
156
|
---
|
|
157
157
|
|
|
158
|
+
## 3. Caching
|
|
159
|
+
|
|
160
|
+
`EventService` caches `get-all` / `get/:id` through the shared version-stamp cache (see `@flusys/nestjs-shared` README, section 7). Its reads depend on two stamps:
|
|
161
|
+
|
|
162
|
+
| Stamp | Bumped by (always after the write commits) |
|
|
163
|
+
| ------------------- | --------------------------------------------------------------------------------------------- |
|
|
164
|
+
| `event` | event insert / update / delete (`ApiService`), `EventManagerHelperService.createEvent` |
|
|
165
|
+
| `event_participant` | the same event writes (participants are rewritten in their transaction), `update-participant-status`, adapter `updateParticipantStatus` |
|
|
166
|
+
|
|
167
|
+
`get-all` embeds participant rows, so a participant-only write bumps `event_participant` and every cached event list is re-read. `event_participant` is a cache stamp only (`EVENT_MANAGER_CACHE_ENTITIES`); it is not a published domain-event entity. The `calendar` endpoint, recurrence expansion and the adapter's `getEventsForUser` / `getEventById` are never cached.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
158
171
|
## 4. Cross-Module Adapter (EVENT_MANAGER_ADAPTER)
|
|
159
172
|
|
|
160
173
|
Other modules can create events without importing this package directly. The `IEventManagerAdapter` interface and `EVENT_MANAGER_ADAPTER` token are defined in `@flusys/nestjs-shared`.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { ModuleRef } from '@nestjs/core';
|
|
1
2
|
import { type IEventManagerAdapter, type CreateEventOptions, type EventResult, ParticipantStatus } from '@flusys/nestjs-shared';
|
|
2
|
-
import { EventManagerHelperService } from '../services/event-manager-helper.service.js';
|
|
3
3
|
export declare class EventManagerAdapter implements IEventManagerAdapter {
|
|
4
|
-
private readonly
|
|
5
|
-
constructor(
|
|
4
|
+
private readonly moduleRef;
|
|
5
|
+
constructor(moduleRef: ModuleRef);
|
|
6
6
|
createEvent(options: CreateEventOptions): Promise<EventResult>;
|
|
7
7
|
updateParticipantStatus(participantId: string, status: ParticipantStatus): Promise<void>;
|
|
8
8
|
getEventsForUser(userId: string, startDate: Date, endDate: Date, companyId?: string): Promise<EventResult[]>;
|
|
9
9
|
getEventById(eventId: string): Promise<EventResult | null>;
|
|
10
|
+
private helper;
|
|
10
11
|
}
|
|
@@ -6,6 +6,7 @@ declare const EventController_base: abstract new (service: EventService) => {
|
|
|
6
6
|
readonly enabledEndpoints: import("@flusys/nestjs-shared").ApiEndpoint[] | "all";
|
|
7
7
|
service: EventService;
|
|
8
8
|
isEnabled(endpoint: import("@flusys/nestjs-shared").ApiEndpoint): boolean;
|
|
9
|
+
assertEnabled(endpoint: import("@flusys/nestjs-shared").ApiEndpoint): void;
|
|
9
10
|
insert(addDto: CreateEventDto, user: ILoggedUserInfo | null): Promise<SingleResponseDto<EventResponseDto>>;
|
|
10
11
|
insertMany(addDto: CreateEventDto[], user: ILoggedUserInfo | null): Promise<import("@flusys/nestjs-shared").BulkResponseDto<EventResponseDto>>;
|
|
11
12
|
getById(id: string, body: import("@flusys/nestjs-shared").GetByIdBodyDto, user: ILoggedUserInfo | null): Promise<SingleResponseDto<EventResponseDto>>;
|
package/fesm/617.js
CHANGED
|
@@ -5,16 +5,16 @@ import * as __rspack_external__flusys_nestjs_shared_enums_327421f8 from "@flusys
|
|
|
5
5
|
import * as __rspack_external__flusys_nestjs_shared_modules_24702bee from "@flusys/nestjs-shared/modules";
|
|
6
6
|
import * as __rspack_external__flusys_nestjs_shared_utils_9125c1f1 from "@flusys/nestjs-shared/utils";
|
|
7
7
|
import * as __rspack_external__nestjs_common_a04939da from "@nestjs/common";
|
|
8
|
+
import * as __rspack_external__nestjs_core_d7b00a1a from "@nestjs/core";
|
|
8
9
|
import * as __rspack_external__nestjs_swagger_7cd450b5 from "@nestjs/swagger";
|
|
9
10
|
import * as __rspack_external_class_transformer_c5a479fb from "class-transformer";
|
|
10
11
|
import * as __rspack_external_typeorm from "typeorm";
|
|
11
|
-
import * as __rspack_external__nestjs_core_d7b00a1a from "@nestjs/core";
|
|
12
12
|
import * as __rspack_external__flusys_nestjs_shared_entities_420e6d19 from "@flusys/nestjs-shared/entities";
|
|
13
13
|
import * as __rspack_external_class_validator_7b99ef4d from "class-validator";
|
|
14
14
|
export const __rspack_esm_id = 617;
|
|
15
15
|
export const __rspack_esm_ids = [617];
|
|
16
16
|
export const __webpack_modules__ = {
|
|
17
|
-
|
|
17
|
+
401(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
18
18
|
/**
|
|
19
19
|
* Domain event actions published by the event manager module, alongside the CRUD
|
|
20
20
|
* lifecycle actions every ApiService emits.
|
|
@@ -25,11 +25,15 @@ export const __webpack_modules__ = {
|
|
|
25
25
|
EVENT: 'event'
|
|
26
26
|
};
|
|
27
27
|
const EVENT_MANAGER_EVENT_MODULE = 'event-manager';
|
|
28
|
+
/** Cache stamps for entities that are never published on their own (participants ride inside event reads) */ const EVENT_MANAGER_CACHE_ENTITIES = {
|
|
29
|
+
PARTICIPANT: 'event_participant'
|
|
30
|
+
};
|
|
28
31
|
|
|
29
32
|
__webpack_require__.d(__webpack_exports__, {
|
|
30
33
|
}, {
|
|
31
34
|
i2: EVENT_MANAGER_EVENT_ACTIONS,
|
|
32
35
|
sI: EVENT_MANAGER_EVENT_ENTITIES,
|
|
36
|
+
sl: EVENT_MANAGER_CACHE_ENTITIES,
|
|
33
37
|
vR: EVENT_MANAGER_EVENT_MODULE
|
|
34
38
|
});
|
|
35
39
|
|
|
@@ -47,7 +51,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
47
51
|
|
|
48
52
|
|
|
49
53
|
},
|
|
50
|
-
|
|
54
|
+
782(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
51
55
|
// ==================== EVENT MANAGER MODULE MESSAGE KEYS ====================
|
|
52
56
|
const EVENT_MESSAGES = {
|
|
53
57
|
GET_ALL_SUCCESS: 'event.get.all.success',
|
|
@@ -304,6 +308,11 @@ event_dto_ts_decorate([
|
|
|
304
308
|
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
305
309
|
message: 'eventDate must be in YYYY-MM-DD format'
|
|
306
310
|
}),
|
|
311
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsISO8601)({
|
|
312
|
+
strict: true
|
|
313
|
+
}, {
|
|
314
|
+
message: 'eventDate must be a valid calendar date'
|
|
315
|
+
}),
|
|
307
316
|
event_dto_ts_metadata("design:type", String)
|
|
308
317
|
], CreateEventDto.prototype, "eventDate", void 0);
|
|
309
318
|
event_dto_ts_decorate([
|
|
@@ -313,7 +322,7 @@ event_dto_ts_decorate([
|
|
|
313
322
|
}),
|
|
314
323
|
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
315
324
|
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
316
|
-
(0,__rspack_external_class_validator_7b99ef4d.Matches)(
|
|
325
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^([01]\d|2[0-3]):[0-5]\d$/, {
|
|
317
326
|
message: 'startTime must be in HH:mm format'
|
|
318
327
|
}),
|
|
319
328
|
event_dto_ts_metadata("design:type", String)
|
|
@@ -325,7 +334,7 @@ event_dto_ts_decorate([
|
|
|
325
334
|
}),
|
|
326
335
|
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
327
336
|
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
328
|
-
(0,__rspack_external_class_validator_7b99ef4d.Matches)(
|
|
337
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^([01]\d|2[0-3]):[0-5]\d$/, {
|
|
329
338
|
message: 'endTime must be in HH:mm format'
|
|
330
339
|
}),
|
|
331
340
|
event_dto_ts_metadata("design:type", String)
|
|
@@ -359,6 +368,11 @@ event_dto_ts_decorate([
|
|
|
359
368
|
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
360
369
|
message: 'recurrenceEndDate must be in YYYY-MM-DD format'
|
|
361
370
|
}),
|
|
371
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsISO8601)({
|
|
372
|
+
strict: true
|
|
373
|
+
}, {
|
|
374
|
+
message: 'recurrenceEndDate must be a valid calendar date'
|
|
375
|
+
}),
|
|
362
376
|
event_dto_ts_metadata("design:type", Object)
|
|
363
377
|
], CreateEventDto.prototype, "recurrenceEndDate", void 0);
|
|
364
378
|
event_dto_ts_decorate([
|
|
@@ -590,6 +604,11 @@ calendar_query_dto_ts_decorate([
|
|
|
590
604
|
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
591
605
|
message: 'startDate must be in YYYY-MM-DD format'
|
|
592
606
|
}),
|
|
607
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsISO8601)({
|
|
608
|
+
strict: true
|
|
609
|
+
}, {
|
|
610
|
+
message: 'startDate must be a valid calendar date'
|
|
611
|
+
}),
|
|
593
612
|
calendar_query_dto_ts_metadata("design:type", String)
|
|
594
613
|
], CalendarQueryDto.prototype, "startDate", void 0);
|
|
595
614
|
calendar_query_dto_ts_decorate([
|
|
@@ -602,6 +621,11 @@ calendar_query_dto_ts_decorate([
|
|
|
602
621
|
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
603
622
|
message: 'endDate must be in YYYY-MM-DD format'
|
|
604
623
|
}),
|
|
624
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsISO8601)({
|
|
625
|
+
strict: true
|
|
626
|
+
}, {
|
|
627
|
+
message: 'endDate must be a valid calendar date'
|
|
628
|
+
}),
|
|
605
629
|
calendar_query_dto_ts_metadata("design:type", String)
|
|
606
630
|
], CalendarQueryDto.prototype, "endDate", void 0);
|
|
607
631
|
calendar_query_dto_ts_decorate([
|
|
@@ -1139,24 +1163,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1139
1163
|
|
|
1140
1164
|
|
|
1141
1165
|
},
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
__webpack_require__
|
|
1146
|
-
|
|
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
|
|
1166
|
+
978(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1167
|
+
/* import */ var _flusys_nestjs_shared_modules__rspack_import_0 = __webpack_require__(236);
|
|
1168
|
+
/* import */ var _nestjs_common__rspack_import_1 = __webpack_require__(157);
|
|
1169
|
+
/* import */ var _nestjs_core__rspack_import_2 = __webpack_require__(75);
|
|
1170
|
+
/* import */ var _entities_index_js__rspack_import_3 = __webpack_require__(80);
|
|
1171
|
+
/* import */ var _event_manager_config_service_js__rspack_import_4 = __webpack_require__(619);
|
|
1160
1172
|
function _ts_decorate(decorators, target, key, desc) {
|
|
1161
1173
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1162
1174
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -1185,7 +1197,7 @@ function _ts_param(paramIndex, decorator) {
|
|
|
1185
1197
|
|
|
1186
1198
|
|
|
1187
1199
|
|
|
1188
|
-
class EventManagerDataSourceProvider extends
|
|
1200
|
+
class EventManagerDataSourceProvider extends _flusys_nestjs_shared_modules__rspack_import_0.MultiTenantDataSourceService {
|
|
1189
1201
|
configService;
|
|
1190
1202
|
static tenantConnections = new Map();
|
|
1191
1203
|
static singleDataSource = null;
|
|
@@ -1210,24 +1222,28 @@ class EventManagerDataSourceProvider extends modules_.MultiTenantDataSourceServi
|
|
|
1210
1222
|
async createDataSourceFromConfig(config) {
|
|
1211
1223
|
const currentTenant = this.getCurrentTenant();
|
|
1212
1224
|
const enableCompanyFeature = this.getEnableCompanyFeatureForTenant(currentTenant ?? undefined);
|
|
1213
|
-
const entities = (0,
|
|
1225
|
+
const entities = (0,_entities_index_js__rspack_import_3/* .getEventManagerEntitiesByConfig */.E1)(enableCompanyFeature);
|
|
1214
1226
|
return super.createDataSourceFromConfig(config, entities);
|
|
1215
1227
|
}
|
|
1216
1228
|
}
|
|
1217
1229
|
EventManagerDataSourceProvider = _ts_decorate([
|
|
1218
|
-
(0,
|
|
1219
|
-
scope:
|
|
1230
|
+
(0,_nestjs_common__rspack_import_1.Injectable)({
|
|
1231
|
+
scope: _nestjs_common__rspack_import_1.Scope.REQUEST
|
|
1220
1232
|
}),
|
|
1221
|
-
_ts_param(0, (0,
|
|
1222
|
-
_ts_param(1, (0,
|
|
1223
|
-
_ts_param(1, (0,
|
|
1233
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_1.Inject)(_event_manager_config_service_js__rspack_import_4/* .EventManagerConfigService */.$)),
|
|
1234
|
+
_ts_param(1, (0,_nestjs_common__rspack_import_1.Optional)()),
|
|
1235
|
+
_ts_param(1, (0,_nestjs_common__rspack_import_1.Inject)(_nestjs_core__rspack_import_2.REQUEST)),
|
|
1224
1236
|
_ts_metadata("design:type", Function),
|
|
1225
1237
|
_ts_metadata("design:paramtypes", [
|
|
1226
|
-
typeof
|
|
1238
|
+
typeof _event_manager_config_service_js__rspack_import_4/* .EventManagerConfigService */.$ === "undefined" ? Object : _event_manager_config_service_js__rspack_import_4/* .EventManagerConfigService */.$,
|
|
1227
1239
|
typeof Request === "undefined" ? Object : Request
|
|
1228
1240
|
])
|
|
1229
1241
|
], EventManagerDataSourceProvider);
|
|
1230
1242
|
|
|
1243
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1244
|
+
a: () => (EventManagerDataSourceProvider)
|
|
1245
|
+
});
|
|
1246
|
+
|
|
1231
1247
|
|
|
1232
1248
|
},
|
|
1233
1249
|
600(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1238,12 +1254,12 @@ EventManagerDataSourceProvider = _ts_decorate([
|
|
|
1238
1254
|
/* import */ var _flusys_nestjs_shared_utils__rspack_import_4 = __webpack_require__(216);
|
|
1239
1255
|
/* import */ var _nestjs_common__rspack_import_5 = __webpack_require__(157);
|
|
1240
1256
|
/* import */ var typeorm__rspack_import_6 = __webpack_require__(158);
|
|
1241
|
-
/* import */ var _config_index_js__rspack_import_11 = __webpack_require__(
|
|
1242
|
-
/* import */ var _config_index_js__rspack_import_12 = __webpack_require__(
|
|
1257
|
+
/* import */ var _config_index_js__rspack_import_11 = __webpack_require__(401);
|
|
1258
|
+
/* import */ var _config_index_js__rspack_import_12 = __webpack_require__(782);
|
|
1243
1259
|
/* import */ var _dtos_index_js__rspack_import_7 = __webpack_require__(178);
|
|
1244
1260
|
/* import */ var _entities_index_js__rspack_import_8 = __webpack_require__(80);
|
|
1245
1261
|
/* import */ var _event_manager_config_service_js__rspack_import_9 = __webpack_require__(619);
|
|
1246
|
-
/* import */ var _event_manager_datasource_provider_js__rspack_import_10 = __webpack_require__(
|
|
1262
|
+
/* import */ var _event_manager_datasource_provider_js__rspack_import_10 = __webpack_require__(978);
|
|
1247
1263
|
function _ts_decorate(decorators, target, key, desc) {
|
|
1248
1264
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1249
1265
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -1279,27 +1295,52 @@ function _ts_param(paramIndex, decorator) {
|
|
|
1279
1295
|
|
|
1280
1296
|
|
|
1281
1297
|
|
|
1298
|
+
const WEEKDAY_INDEX = {
|
|
1299
|
+
SUN: 0,
|
|
1300
|
+
MON: 1,
|
|
1301
|
+
TUE: 2,
|
|
1302
|
+
WED: 3,
|
|
1303
|
+
THU: 4,
|
|
1304
|
+
FRI: 5,
|
|
1305
|
+
SAT: 6
|
|
1306
|
+
};
|
|
1282
1307
|
class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiService {
|
|
1283
1308
|
cacheManager;
|
|
1284
1309
|
utilsService;
|
|
1285
1310
|
eventConfig;
|
|
1286
1311
|
dataSourceProvider;
|
|
1287
1312
|
participantRepository = null;
|
|
1288
|
-
|
|
1313
|
+
pendingParticipants = new Map();
|
|
1289
1314
|
constructor(cacheManager, utilsService, eventConfig, dataSourceProvider){
|
|
1290
1315
|
super(_config_index_js__rspack_import_11/* .EVENT_MANAGER_EVENT_ENTITIES.EVENT */.sI.EVENT, cacheManager, utilsService, EventService.name, true, _config_index_js__rspack_import_11/* .EVENT_MANAGER_EVENT_MODULE */.vR, dataSourceProvider, eventConfig.isCompanyFeatureEnabled() ? _entities_index_js__rspack_import_8/* .EventWithCompany */.QO : _entities_index_js__rspack_import_8/* .Event */.Jh), this.cacheManager = cacheManager, this.utilsService = utilsService, this.eventConfig = eventConfig, this.dataSourceProvider = dataSourceProvider;
|
|
1291
1316
|
}
|
|
1292
1317
|
// Override methods
|
|
1318
|
+
cacheDependencies() {
|
|
1319
|
+
return [
|
|
1320
|
+
this.entityName,
|
|
1321
|
+
_config_index_js__rspack_import_11/* .EVENT_MANAGER_CACHE_ENTITIES.PARTICIPANT */.sl.PARTICIPANT
|
|
1322
|
+
];
|
|
1323
|
+
}
|
|
1324
|
+
// The after-insert/update hooks rewrite participant rows in the same transaction
|
|
1325
|
+
async invalidateCache() {
|
|
1326
|
+
await Promise.all([
|
|
1327
|
+
super.invalidateCache(),
|
|
1328
|
+
this.invalidateParticipantCache()
|
|
1329
|
+
]);
|
|
1330
|
+
}
|
|
1293
1331
|
async convertSingleDtoToEntity(dto, user) {
|
|
1294
1332
|
await this.ensureDataSourceRepository();
|
|
1295
1333
|
let entity = {};
|
|
1296
|
-
|
|
1334
|
+
const companyFeature = this.eventConfig.isCompanyFeatureEnabled();
|
|
1335
|
+
const isUpdate = 'id' in dto && !!dto.id && typeof dto.id === 'string';
|
|
1336
|
+
if (isUpdate) {
|
|
1297
1337
|
const existing = await this.repository.findOne({
|
|
1298
1338
|
where: {
|
|
1299
1339
|
id: dto.id
|
|
1300
1340
|
}
|
|
1301
1341
|
});
|
|
1302
|
-
|
|
1342
|
+
const otherCompany = companyFeature && (!user?.companyId || existing?.companyId !== user.companyId);
|
|
1343
|
+
if (!existing || otherCompany) throw new _nestjs_common__rspack_import_5.NotFoundException({
|
|
1303
1344
|
message: 'Event not found',
|
|
1304
1345
|
messageKey: _config_index_js__rspack_import_12/* .EVENT_MESSAGES.NOT_FOUND */.G.NOT_FOUND
|
|
1305
1346
|
});
|
|
@@ -1309,24 +1350,22 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1309
1350
|
const merged = {
|
|
1310
1351
|
...entity,
|
|
1311
1352
|
title: dto.title ?? entity.title,
|
|
1312
|
-
description: dto.description
|
|
1353
|
+
description: this.updatedOrKept(dto.description, entity.description),
|
|
1313
1354
|
eventDate: dto.eventDate ?? entity.eventDate,
|
|
1314
1355
|
startTime: isAllDay ? '00:00' : dto.startTime ?? entity.startTime ?? '00:00',
|
|
1315
1356
|
endTime: isAllDay ? '23:59' : dto.endTime ?? entity.endTime ?? '23:59',
|
|
1316
1357
|
isAllDay,
|
|
1317
1358
|
recurrenceType: dto.recurrenceType ?? entity.recurrenceType ?? _flusys_nestjs_shared_enums__rspack_import_2.RecurrenceType.NONE,
|
|
1318
|
-
recurrenceEndDate: dto.recurrenceEndDate
|
|
1319
|
-
weekDays: dto.weekDays
|
|
1359
|
+
recurrenceEndDate: this.updatedOrKept(dto.recurrenceEndDate, entity.recurrenceEndDate),
|
|
1360
|
+
weekDays: this.updatedOrKept(dto.weekDays, entity.weekDays),
|
|
1320
1361
|
color: dto.color ?? entity.color ?? this.eventConfig.getDefaultColor(),
|
|
1321
|
-
meetingLink:
|
|
1362
|
+
meetingLink: this.updatedOrKept(dto.meetingLink, entity.meetingLink),
|
|
1322
1363
|
isActive: dto.isActive ?? entity.isActive ?? true
|
|
1323
1364
|
};
|
|
1324
|
-
if (
|
|
1365
|
+
if (companyFeature && !isUpdate) {
|
|
1325
1366
|
merged.companyId = user?.companyId ?? null;
|
|
1326
1367
|
}
|
|
1327
|
-
|
|
1328
|
-
this.pendingParticipantsList.push(dto.participantIds ?? []);
|
|
1329
|
-
}
|
|
1368
|
+
this.pendingParticipants.set(merged, dto.participantIds);
|
|
1330
1369
|
return merged;
|
|
1331
1370
|
}
|
|
1332
1371
|
async getFilterQuery(query, filter, _user) {
|
|
@@ -1364,26 +1403,34 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1364
1403
|
query.leftJoinAndMapMany(`${this.entityName}.participants`, _entities_index_js__rspack_import_8/* .EventParticipant */.ek, 'ep', 'ep.event_id = event.id AND ep.deleted_at IS NULL');
|
|
1365
1404
|
return result;
|
|
1366
1405
|
}
|
|
1367
|
-
async afterInsertOperation(entities, _dto, user,
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1406
|
+
async afterInsertOperation(entities, _dto, user, qr) {
|
|
1407
|
+
const participantRepo = qr.manager.getRepository(_entities_index_js__rspack_import_8/* .EventParticipant */.ek);
|
|
1408
|
+
for (const entity of entities){
|
|
1409
|
+
const participantIds = this.pendingParticipants.get(entity) ?? [];
|
|
1410
|
+
await this.addOrganizerAndParticipants(participantRepo, entity.id, participantIds, user?.id);
|
|
1371
1411
|
}
|
|
1372
|
-
this.
|
|
1412
|
+
this.pendingParticipants.clear();
|
|
1373
1413
|
}
|
|
1374
|
-
async afterUpdateOperation(entities, _dto, user,
|
|
1375
|
-
const participantRepo =
|
|
1376
|
-
for(
|
|
1377
|
-
const participantIds = this.
|
|
1414
|
+
async afterUpdateOperation(entities, _dto, user, qr) {
|
|
1415
|
+
const participantRepo = qr.manager.getRepository(_entities_index_js__rspack_import_8/* .EventParticipant */.ek);
|
|
1416
|
+
for (const entity of entities){
|
|
1417
|
+
const participantIds = this.pendingParticipants.get(entity);
|
|
1418
|
+
if (participantIds === undefined) continue;
|
|
1419
|
+
const organizer = await participantRepo.findOne({
|
|
1420
|
+
where: {
|
|
1421
|
+
eventId: entity.id,
|
|
1422
|
+
isOrganizer: true
|
|
1423
|
+
}
|
|
1424
|
+
});
|
|
1378
1425
|
await participantRepo.update({
|
|
1379
|
-
eventId:
|
|
1426
|
+
eventId: entity.id,
|
|
1380
1427
|
deletedAt: (0,typeorm__rspack_import_6.IsNull)()
|
|
1381
1428
|
}, {
|
|
1382
1429
|
deletedAt: new Date()
|
|
1383
1430
|
});
|
|
1384
|
-
await this.
|
|
1431
|
+
await this.addOrganizerAndParticipants(participantRepo, entity.id, participantIds, organizer?.userId ?? user?.id);
|
|
1385
1432
|
}
|
|
1386
|
-
this.
|
|
1433
|
+
this.pendingParticipants.clear();
|
|
1387
1434
|
}
|
|
1388
1435
|
// Public API methods
|
|
1389
1436
|
async getEventsForCalendarRange(queryDto, user) {
|
|
@@ -1419,7 +1466,7 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1419
1466
|
id: dto.id
|
|
1420
1467
|
}
|
|
1421
1468
|
});
|
|
1422
|
-
if (!participant) {
|
|
1469
|
+
if (!participant || !await this.isEventInUserCompany(participant.eventId, user)) {
|
|
1423
1470
|
throw new _nestjs_common__rspack_import_5.NotFoundException({
|
|
1424
1471
|
message: 'Event participant not found',
|
|
1425
1472
|
messageKey: _config_index_js__rspack_import_12/* .EVENT_PARTICIPANT_MESSAGES.NOT_FOUND */.C.NOT_FOUND
|
|
@@ -1427,14 +1474,7 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1427
1474
|
}
|
|
1428
1475
|
participant.status = dto.status;
|
|
1429
1476
|
const saved = await participantRepo.save(participant);
|
|
1430
|
-
await
|
|
1431
|
-
this.clearCacheForAll(),
|
|
1432
|
-
this.clearCacheForId([
|
|
1433
|
-
{
|
|
1434
|
-
id: participant.eventId
|
|
1435
|
-
}
|
|
1436
|
-
])
|
|
1437
|
-
]);
|
|
1477
|
+
await this.invalidateParticipantCache();
|
|
1438
1478
|
await this.publishDomainAction(_config_index_js__rspack_import_11/* .EVENT_MANAGER_EVENT_ACTIONS.PARTICIPANT_STATUS_CHANGED */.i2.PARTICIPANT_STATUS_CHANGED, {
|
|
1439
1479
|
ids: [
|
|
1440
1480
|
participant.eventId
|
|
@@ -1449,11 +1489,10 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1449
1489
|
return saved;
|
|
1450
1490
|
}
|
|
1451
1491
|
// Private business logic helpers
|
|
1452
|
-
async
|
|
1453
|
-
if (!
|
|
1454
|
-
const participantRepo = await this.ensureParticipantRepositoryInitialized();
|
|
1492
|
+
async addOrganizerAndParticipants(participantRepo, eventId, participantIds, organizerId) {
|
|
1493
|
+
if (!organizerId) return;
|
|
1455
1494
|
const allUserIds = Array.from(new Set([
|
|
1456
|
-
|
|
1495
|
+
organizerId,
|
|
1457
1496
|
...participantIds
|
|
1458
1497
|
]));
|
|
1459
1498
|
const existing = await participantRepo.find({
|
|
@@ -1473,13 +1512,13 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1473
1512
|
return {
|
|
1474
1513
|
...existingRecord,
|
|
1475
1514
|
deletedAt: null,
|
|
1476
|
-
isOrganizer: userId ===
|
|
1515
|
+
isOrganizer: userId === organizerId
|
|
1477
1516
|
};
|
|
1478
1517
|
}
|
|
1479
1518
|
return {
|
|
1480
1519
|
eventId,
|
|
1481
1520
|
userId,
|
|
1482
|
-
isOrganizer: userId ===
|
|
1521
|
+
isOrganizer: userId === organizerId
|
|
1483
1522
|
};
|
|
1484
1523
|
});
|
|
1485
1524
|
await participantRepo.save(toSave);
|
|
@@ -1500,24 +1539,22 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1500
1539
|
const occurrences = [];
|
|
1501
1540
|
const recurrenceEnd = event.recurrenceEndDate ?? null;
|
|
1502
1541
|
const recurrenceType = event.recurrenceType;
|
|
1503
|
-
const weekDays = event.weekDays ?? [
|
|
1504
|
-
this.getDayOfWeek(event.eventDate)
|
|
1505
|
-
];
|
|
1506
1542
|
let currentDate = event.eventDate;
|
|
1507
1543
|
let count = 0;
|
|
1508
1544
|
if (recurrenceType === _flusys_nestjs_shared_enums__rspack_import_2.RecurrenceType.WEEKLY || recurrenceType === _flusys_nestjs_shared_enums__rspack_import_2.RecurrenceType.BIWEEKLY) {
|
|
1545
|
+
const dayIndexes = this.normalizeWeekDays(event.weekDays, event.eventDate);
|
|
1509
1546
|
let weekStart = this.getWeekStart(event.eventDate);
|
|
1510
1547
|
while(count < maxOccurrences){
|
|
1511
|
-
for (const
|
|
1548
|
+
for (const dayIndex of dayIndexes){
|
|
1512
1549
|
if (count >= maxOccurrences) break;
|
|
1513
|
-
currentDate = this.addDaysToDate(weekStart,
|
|
1550
|
+
currentDate = this.addDaysToDate(weekStart, dayIndex);
|
|
1514
1551
|
if (currentDate < event.eventDate) continue;
|
|
1515
1552
|
if (this.shouldStopRecurrence(currentDate, recurrenceEnd, rangeEnd)) {
|
|
1516
1553
|
count = maxOccurrences;
|
|
1517
1554
|
break;
|
|
1518
1555
|
}
|
|
1519
1556
|
if (currentDate >= rangeStart && currentDate <= rangeEnd) {
|
|
1520
|
-
occurrences.push(this.toCalendarEventOnDate(event, currentDate,
|
|
1557
|
+
occurrences.push(this.toCalendarEventOnDate(event, currentDate, currentDate !== event.eventDate));
|
|
1521
1558
|
}
|
|
1522
1559
|
count++;
|
|
1523
1560
|
}
|
|
@@ -1529,15 +1566,20 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1529
1566
|
while(count < maxOccurrences){
|
|
1530
1567
|
if (this.shouldStopRecurrence(currentDate, recurrenceEnd, rangeEnd)) break;
|
|
1531
1568
|
if (currentDate >= rangeStart && currentDate <= rangeEnd) {
|
|
1532
|
-
occurrences.push(this.toCalendarEventOnDate(event, currentDate,
|
|
1569
|
+
occurrences.push(this.toCalendarEventOnDate(event, currentDate, currentDate !== event.eventDate));
|
|
1533
1570
|
}
|
|
1534
|
-
|
|
1571
|
+
const nextDate = this.getNextOccurrenceDate(currentDate, recurrenceType, originalDayOfMonth);
|
|
1572
|
+
if (nextDate <= currentDate) break;
|
|
1573
|
+
currentDate = nextDate;
|
|
1535
1574
|
count++;
|
|
1536
1575
|
}
|
|
1537
1576
|
}
|
|
1538
1577
|
return occurrences;
|
|
1539
1578
|
}
|
|
1540
1579
|
// Private utility helpers
|
|
1580
|
+
async invalidateParticipantCache() {
|
|
1581
|
+
await this.utilsService.clearCache(_config_index_js__rspack_import_11/* .EVENT_MANAGER_CACHE_ENTITIES.PARTICIPANT */.sl.PARTICIPANT, this.cacheManager, this.cacheTenant());
|
|
1582
|
+
}
|
|
1541
1583
|
async ensureParticipantRepositoryInitialized() {
|
|
1542
1584
|
if (!this.participantRepository) {
|
|
1543
1585
|
this.participantRepository = await this.dataSourceProvider.getRepository(_entities_index_js__rspack_import_8/* .EventParticipant */.ek);
|
|
@@ -1570,6 +1612,21 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1570
1612
|
event.participants = participantsByEvent.get(event.id) || [];
|
|
1571
1613
|
}
|
|
1572
1614
|
}
|
|
1615
|
+
async isEventInUserCompany(eventId, user) {
|
|
1616
|
+
if (!this.eventConfig.isCompanyFeatureEnabled()) return true;
|
|
1617
|
+
if (!user?.companyId) return false;
|
|
1618
|
+
await this.ensureDataSourceRepository();
|
|
1619
|
+
const event = await this.repository.findOne({
|
|
1620
|
+
where: {
|
|
1621
|
+
id: eventId,
|
|
1622
|
+
companyId: user.companyId
|
|
1623
|
+
}
|
|
1624
|
+
});
|
|
1625
|
+
return !!event;
|
|
1626
|
+
}
|
|
1627
|
+
updatedOrKept(dtoValue, current) {
|
|
1628
|
+
return dtoValue !== undefined ? dtoValue ?? null : current ?? null;
|
|
1629
|
+
}
|
|
1573
1630
|
applyEventCompanyFilter(query, user) {
|
|
1574
1631
|
(0,_flusys_nestjs_shared_utils__rspack_import_4.applyCompanyFilter)(query, {
|
|
1575
1632
|
isCompanyFeatureEnabled: this.eventConfig.isCompanyFeatureEnabled(),
|
|
@@ -1579,29 +1636,14 @@ class EventService extends _flusys_nestjs_shared_classes__rspack_import_0.ApiSer
|
|
|
1579
1636
|
shouldStopRecurrence(currentDate, recurrenceEnd, rangeEnd) {
|
|
1580
1637
|
return recurrenceEnd !== null && currentDate > recurrenceEnd || currentDate > rangeEnd;
|
|
1581
1638
|
}
|
|
1582
|
-
|
|
1583
|
-
const
|
|
1584
|
-
|
|
1585
|
-
'
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
'SAT'
|
|
1591
|
-
];
|
|
1592
|
-
return days[new Date(`${dateStr}T00:00:00Z`).getUTCDay()];
|
|
1593
|
-
}
|
|
1594
|
-
weekdayNameToIndex(day) {
|
|
1595
|
-
const map = {
|
|
1596
|
-
SUN: 0,
|
|
1597
|
-
MON: 1,
|
|
1598
|
-
TUE: 2,
|
|
1599
|
-
WED: 3,
|
|
1600
|
-
THU: 4,
|
|
1601
|
-
FRI: 5,
|
|
1602
|
-
SAT: 6
|
|
1603
|
-
};
|
|
1604
|
-
return map[day.toUpperCase()] ?? 0;
|
|
1639
|
+
normalizeWeekDays(weekDays, eventDate) {
|
|
1640
|
+
const indexes = new Set();
|
|
1641
|
+
for (const day of weekDays ?? []){
|
|
1642
|
+
const index = typeof day === 'string' ? WEEKDAY_INDEX[day.toUpperCase()] : undefined;
|
|
1643
|
+
if (index !== undefined) indexes.add(index);
|
|
1644
|
+
}
|
|
1645
|
+
if (indexes.size === 0) indexes.add(new Date(`${eventDate}T00:00:00Z`).getUTCDay());
|
|
1646
|
+
return Array.from(indexes).sort((a, b)=>a - b);
|
|
1605
1647
|
}
|
|
1606
1648
|
getWeekStart(dateStr) {
|
|
1607
1649
|
const d = new Date(`${dateStr}T00:00:00Z`);
|
|
@@ -1763,6 +1805,12 @@ module.exports = __rspack_external__flusys_nestjs_shared_utils_9125c1f1;
|
|
|
1763
1805
|
module.exports = __rspack_external__nestjs_common_a04939da;
|
|
1764
1806
|
|
|
1765
1807
|
|
|
1808
|
+
},
|
|
1809
|
+
75(module) {
|
|
1810
|
+
|
|
1811
|
+
module.exports = __rspack_external__nestjs_core_d7b00a1a;
|
|
1812
|
+
|
|
1813
|
+
|
|
1766
1814
|
},
|
|
1767
1815
|
176(module) {
|
|
1768
1816
|
|
package/fesm/833.js
CHANGED
|
@@ -13,6 +13,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
13
13
|
|
|
14
14
|
// EXTERNAL MODULE: external "@nestjs/common"
|
|
15
15
|
var common_ = __webpack_require__(157);
|
|
16
|
+
// EXTERNAL MODULE: external "@nestjs/core"
|
|
17
|
+
var core_ = __webpack_require__(75);
|
|
16
18
|
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/services/event-manager-helper.service.ts
|
|
17
19
|
var event_manager_helper_service = __webpack_require__(605);
|
|
18
20
|
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/adapters/event-manager.adapter.ts
|
|
@@ -41,30 +43,36 @@ function _ts_param(paramIndex, decorator) {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
|
|
46
|
+
|
|
44
47
|
class EventManagerAdapter {
|
|
45
|
-
|
|
46
|
-
constructor(
|
|
47
|
-
this.
|
|
48
|
+
moduleRef;
|
|
49
|
+
constructor(moduleRef){
|
|
50
|
+
this.moduleRef = moduleRef;
|
|
48
51
|
}
|
|
49
52
|
async createEvent(options) {
|
|
50
|
-
return this.
|
|
53
|
+
return (await this.helper()).createEvent(options);
|
|
51
54
|
}
|
|
52
55
|
async updateParticipantStatus(participantId, status) {
|
|
53
|
-
await this.
|
|
56
|
+
await (await this.helper()).updateParticipantStatus(participantId, status);
|
|
54
57
|
}
|
|
55
58
|
async getEventsForUser(userId, startDate, endDate, companyId) {
|
|
56
|
-
return this.
|
|
59
|
+
return (await this.helper()).getEventsForUser(userId, startDate.toISOString().split('T')[0], endDate.toISOString().split('T')[0], companyId);
|
|
57
60
|
}
|
|
58
61
|
async getEventById(eventId) {
|
|
59
|
-
return this.
|
|
62
|
+
return (await this.helper()).getEventById(eventId);
|
|
63
|
+
}
|
|
64
|
+
helper() {
|
|
65
|
+
return this.moduleRef.resolve(event_manager_helper_service/* .EventManagerHelperService */.x, core_.ContextIdFactory.create(), {
|
|
66
|
+
strict: false
|
|
67
|
+
});
|
|
60
68
|
}
|
|
61
69
|
}
|
|
62
70
|
EventManagerAdapter = _ts_decorate([
|
|
63
71
|
(0,common_.Injectable)(),
|
|
64
|
-
_ts_param(0, (0,common_.Inject)(
|
|
72
|
+
_ts_param(0, (0,common_.Inject)(core_.ModuleRef)),
|
|
65
73
|
_ts_metadata("design:type", Function),
|
|
66
74
|
_ts_metadata("design:paramtypes", [
|
|
67
|
-
typeof
|
|
75
|
+
typeof core_.ModuleRef === "undefined" ? Object : core_.ModuleRef
|
|
68
76
|
])
|
|
69
77
|
], EventManagerAdapter);
|
|
70
78
|
|
|
@@ -95,7 +103,7 @@ var swagger_ = __webpack_require__(176);
|
|
|
95
103
|
// EXTERNAL MODULE: external "class-transformer"
|
|
96
104
|
var external_class_transformer_ = __webpack_require__(812);
|
|
97
105
|
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/config/message-keys.ts
|
|
98
|
-
var message_keys = __webpack_require__(
|
|
106
|
+
var message_keys = __webpack_require__(782);
|
|
99
107
|
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/docs/index.ts + 1 modules
|
|
100
108
|
var docs = __webpack_require__(283);
|
|
101
109
|
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/dtos/index.ts + 4 modules
|
|
@@ -582,6 +590,7 @@ EventManagerModule = _ts_decorate([
|
|
|
582
590
|
},
|
|
583
591
|
605(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
584
592
|
/* import */ var _config_index_js__rspack_import_10 = __webpack_require__(401);
|
|
593
|
+
/* import */ var _config_index_js__rspack_import_11 = __webpack_require__(782);
|
|
585
594
|
/* import */ var _nestjs_common__rspack_import_0 = __webpack_require__(157);
|
|
586
595
|
/* import */ var typeorm__rspack_import_1 = __webpack_require__(158);
|
|
587
596
|
/* import */ var _flusys_nestjs_shared_classes__rspack_import_2 = __webpack_require__(937);
|
|
@@ -590,7 +599,7 @@ EventManagerModule = _ts_decorate([
|
|
|
590
599
|
/* import */ var _flusys_nestjs_shared_utils__rspack_import_5 = __webpack_require__(216);
|
|
591
600
|
/* import */ var _flusys_nestjs_shared__rspack_import_6 = __webpack_require__(422);
|
|
592
601
|
/* import */ var _event_manager_config_service_js__rspack_import_7 = __webpack_require__(619);
|
|
593
|
-
/* import */ var _event_manager_datasource_provider_js__rspack_import_8 = __webpack_require__(
|
|
602
|
+
/* import */ var _event_manager_datasource_provider_js__rspack_import_8 = __webpack_require__(978);
|
|
594
603
|
/* import */ var _entities_index_js__rspack_import_9 = __webpack_require__(80);
|
|
595
604
|
function _ts_decorate(decorators, target, key, desc) {
|
|
596
605
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -631,7 +640,6 @@ class EventManagerHelperService {
|
|
|
631
640
|
utilsService;
|
|
632
641
|
configService;
|
|
633
642
|
dataSourceProvider;
|
|
634
|
-
eventEntityName = 'event';
|
|
635
643
|
dataSource = null;
|
|
636
644
|
constructor(cacheManager, utilsService, configService, dataSourceProvider){
|
|
637
645
|
this.cacheManager = cacheManager;
|
|
@@ -676,7 +684,7 @@ class EventManagerHelperService {
|
|
|
676
684
|
}
|
|
677
685
|
const saved = await repo.save(entity);
|
|
678
686
|
await this.addEventParticipants(saved.id, options.participantIds ?? [], options.organizerId);
|
|
679
|
-
await this.clearCache();
|
|
687
|
+
await this.clearCache(_config_index_js__rspack_import_10/* .EVENT_MANAGER_EVENT_ENTITIES.EVENT */.sI.EVENT, _config_index_js__rspack_import_10/* .EVENT_MANAGER_CACHE_ENTITIES.PARTICIPANT */.sl.PARTICIPANT);
|
|
680
688
|
return this.toEventResult(saved);
|
|
681
689
|
}
|
|
682
690
|
async updateParticipantStatus(participantId, status) {
|
|
@@ -690,11 +698,12 @@ class EventManagerHelperService {
|
|
|
690
698
|
if (!participant) {
|
|
691
699
|
throw new _nestjs_common__rspack_import_0.NotFoundException({
|
|
692
700
|
message: 'Event participant not found',
|
|
693
|
-
messageKey:
|
|
701
|
+
messageKey: _config_index_js__rspack_import_11/* .EVENT_PARTICIPANT_MESSAGES.NOT_FOUND */.C.NOT_FOUND
|
|
694
702
|
});
|
|
695
703
|
}
|
|
696
704
|
participant.status = status;
|
|
697
705
|
await participantRepo.save(participant);
|
|
706
|
+
await this.clearCache(_config_index_js__rspack_import_10/* .EVENT_MANAGER_CACHE_ENTITIES.PARTICIPANT */.sl.PARTICIPANT);
|
|
698
707
|
}
|
|
699
708
|
async getEventsForUser(userId, startDate, endDate, companyId) {
|
|
700
709
|
const eventRepo = await this.getEventRepository();
|
|
@@ -771,8 +780,9 @@ class EventManagerHelperService {
|
|
|
771
780
|
updatedAt: event.updatedAt
|
|
772
781
|
};
|
|
773
782
|
}
|
|
774
|
-
async clearCache() {
|
|
775
|
-
|
|
783
|
+
async clearCache(...entityNames) {
|
|
784
|
+
const tenantId = (0,_flusys_nestjs_shared_utils__rspack_import_5.cacheTenantId)(this.dataSourceProvider);
|
|
785
|
+
await Promise.all(entityNames.map((name)=>this.utilsService.clearCache(name, this.cacheManager, tenantId)));
|
|
776
786
|
}
|
|
777
787
|
}
|
|
778
788
|
_ts_decorate([
|
|
@@ -821,7 +831,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
821
831
|
},
|
|
822
832
|
965(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
823
833
|
/* import */ var _event_manager_config_service_js__rspack_import_0 = __webpack_require__(619);
|
|
824
|
-
/* import */ var _event_manager_datasource_provider_js__rspack_import_1 = __webpack_require__(
|
|
834
|
+
/* import */ var _event_manager_datasource_provider_js__rspack_import_1 = __webpack_require__(978);
|
|
825
835
|
/* import */ var _event_manager_helper_service_js__rspack_import_2 = __webpack_require__(605);
|
|
826
836
|
/* import */ var _event_service_js__rspack_import_3 = __webpack_require__(600);
|
|
827
837
|
|
package/fesm/adapters/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import * as __rspack_external__flusys_nestjs_shared_enums_327421f8 from "@flusys
|
|
|
5
5
|
import * as __rspack_external__flusys_nestjs_shared_modules_24702bee from "@flusys/nestjs-shared/modules";
|
|
6
6
|
import * as __rspack_external__flusys_nestjs_shared_utils_9125c1f1 from "@flusys/nestjs-shared/utils";
|
|
7
7
|
import * as __rspack_external__nestjs_common_a04939da from "@nestjs/common";
|
|
8
|
-
import * as __rspack_external_typeorm from "typeorm";
|
|
9
8
|
import * as __rspack_external__nestjs_core_d7b00a1a from "@nestjs/core";
|
|
9
|
+
import * as __rspack_external_typeorm from "typeorm";
|
|
10
10
|
import * as __rspack_external__flusys_nestjs_shared_entities_420e6d19 from "@flusys/nestjs-shared/entities";
|
|
11
11
|
export const __rspack_esm_id = 795;
|
|
12
12
|
export const __rspack_esm_ids = [795];
|
|
@@ -20,6 +20,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
20
20
|
|
|
21
21
|
// EXTERNAL MODULE: external "@nestjs/common"
|
|
22
22
|
var common_ = __webpack_require__(157);
|
|
23
|
+
// EXTERNAL MODULE: external "@nestjs/core"
|
|
24
|
+
var core_ = __webpack_require__(75);
|
|
23
25
|
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/services/event-manager-helper.service.ts
|
|
24
26
|
var event_manager_helper_service = __webpack_require__(605);
|
|
25
27
|
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/adapters/event-manager.adapter.ts
|
|
@@ -48,30 +50,36 @@ function _ts_param(paramIndex, decorator) {
|
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
|
|
53
|
+
|
|
51
54
|
class EventManagerAdapter {
|
|
52
|
-
|
|
53
|
-
constructor(
|
|
54
|
-
this.
|
|
55
|
+
moduleRef;
|
|
56
|
+
constructor(moduleRef){
|
|
57
|
+
this.moduleRef = moduleRef;
|
|
55
58
|
}
|
|
56
59
|
async createEvent(options) {
|
|
57
|
-
return this.
|
|
60
|
+
return (await this.helper()).createEvent(options);
|
|
58
61
|
}
|
|
59
62
|
async updateParticipantStatus(participantId, status) {
|
|
60
|
-
await this.
|
|
63
|
+
await (await this.helper()).updateParticipantStatus(participantId, status);
|
|
61
64
|
}
|
|
62
65
|
async getEventsForUser(userId, startDate, endDate, companyId) {
|
|
63
|
-
return this.
|
|
66
|
+
return (await this.helper()).getEventsForUser(userId, startDate.toISOString().split('T')[0], endDate.toISOString().split('T')[0], companyId);
|
|
64
67
|
}
|
|
65
68
|
async getEventById(eventId) {
|
|
66
|
-
return this.
|
|
69
|
+
return (await this.helper()).getEventById(eventId);
|
|
70
|
+
}
|
|
71
|
+
helper() {
|
|
72
|
+
return this.moduleRef.resolve(event_manager_helper_service/* .EventManagerHelperService */.x, core_.ContextIdFactory.create(), {
|
|
73
|
+
strict: false
|
|
74
|
+
});
|
|
67
75
|
}
|
|
68
76
|
}
|
|
69
77
|
EventManagerAdapter = _ts_decorate([
|
|
70
78
|
(0,common_.Injectable)(),
|
|
71
|
-
_ts_param(0, (0,common_.Inject)(
|
|
79
|
+
_ts_param(0, (0,common_.Inject)(core_.ModuleRef)),
|
|
72
80
|
_ts_metadata("design:type", Function),
|
|
73
81
|
_ts_metadata("design:paramtypes", [
|
|
74
|
-
typeof
|
|
82
|
+
typeof core_.ModuleRef === "undefined" ? Object : core_.ModuleRef
|
|
75
83
|
])
|
|
76
84
|
], EventManagerAdapter);
|
|
77
85
|
|
|
@@ -79,6 +87,31 @@ EventManagerAdapter = _ts_decorate([
|
|
|
79
87
|
|
|
80
88
|
|
|
81
89
|
|
|
90
|
+
},
|
|
91
|
+
401(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
92
|
+
/**
|
|
93
|
+
* Domain event actions published by the event manager module, alongside the CRUD
|
|
94
|
+
* lifecycle actions every ApiService emits.
|
|
95
|
+
*/ const EVENT_MANAGER_EVENT_ACTIONS = {
|
|
96
|
+
PARTICIPANT_STATUS_CHANGED: 'participant-status-changed'
|
|
97
|
+
};
|
|
98
|
+
/** Every entity the event manager module publishes under */ const EVENT_MANAGER_EVENT_ENTITIES = {
|
|
99
|
+
EVENT: 'event'
|
|
100
|
+
};
|
|
101
|
+
const EVENT_MANAGER_EVENT_MODULE = 'event-manager';
|
|
102
|
+
/** Cache stamps for entities that are never published on their own (participants ride inside event reads) */ const EVENT_MANAGER_CACHE_ENTITIES = {
|
|
103
|
+
PARTICIPANT: 'event_participant'
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
107
|
+
}, {
|
|
108
|
+
i2: EVENT_MANAGER_EVENT_ACTIONS,
|
|
109
|
+
sI: EVENT_MANAGER_EVENT_ENTITIES,
|
|
110
|
+
sl: EVENT_MANAGER_CACHE_ENTITIES,
|
|
111
|
+
vR: EVENT_MANAGER_EVENT_MODULE
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
|
|
82
115
|
},
|
|
83
116
|
890(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
84
117
|
/**
|
|
@@ -92,7 +125,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
92
125
|
|
|
93
126
|
|
|
94
127
|
},
|
|
95
|
-
|
|
128
|
+
782(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
96
129
|
// ==================== EVENT MANAGER MODULE MESSAGE KEYS ====================
|
|
97
130
|
const EVENT_MESSAGES = {
|
|
98
131
|
GET_ALL_SUCCESS: 'event.get.all.success',
|
|
@@ -505,24 +538,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
505
538
|
|
|
506
539
|
|
|
507
540
|
},
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
__webpack_require__
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
// EXTERNAL MODULE: external "@flusys/nestjs-shared/modules"
|
|
516
|
-
var modules_ = __webpack_require__(236);
|
|
517
|
-
// EXTERNAL MODULE: external "@nestjs/common"
|
|
518
|
-
var common_ = __webpack_require__(157);
|
|
519
|
-
;// CONCATENATED MODULE: external "@nestjs/core"
|
|
520
|
-
|
|
521
|
-
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/entities/index.ts + 4 modules
|
|
522
|
-
var src_entities = __webpack_require__(80);
|
|
523
|
-
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/services/event-manager-config.service.ts
|
|
524
|
-
var event_manager_config_service = __webpack_require__(619);
|
|
525
|
-
;// CONCATENATED MODULE: ./projects/nestjs-event-manager/src/services/event-manager-datasource.provider.ts
|
|
541
|
+
978(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
542
|
+
/* import */ var _flusys_nestjs_shared_modules__rspack_import_0 = __webpack_require__(236);
|
|
543
|
+
/* import */ var _nestjs_common__rspack_import_1 = __webpack_require__(157);
|
|
544
|
+
/* import */ var _nestjs_core__rspack_import_2 = __webpack_require__(75);
|
|
545
|
+
/* import */ var _entities_index_js__rspack_import_3 = __webpack_require__(80);
|
|
546
|
+
/* import */ var _event_manager_config_service_js__rspack_import_4 = __webpack_require__(619);
|
|
526
547
|
function _ts_decorate(decorators, target, key, desc) {
|
|
527
548
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
528
549
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -551,7 +572,7 @@ function _ts_param(paramIndex, decorator) {
|
|
|
551
572
|
|
|
552
573
|
|
|
553
574
|
|
|
554
|
-
class EventManagerDataSourceProvider extends
|
|
575
|
+
class EventManagerDataSourceProvider extends _flusys_nestjs_shared_modules__rspack_import_0.MultiTenantDataSourceService {
|
|
555
576
|
configService;
|
|
556
577
|
static tenantConnections = new Map();
|
|
557
578
|
static singleDataSource = null;
|
|
@@ -576,28 +597,33 @@ class EventManagerDataSourceProvider extends modules_.MultiTenantDataSourceServi
|
|
|
576
597
|
async createDataSourceFromConfig(config) {
|
|
577
598
|
const currentTenant = this.getCurrentTenant();
|
|
578
599
|
const enableCompanyFeature = this.getEnableCompanyFeatureForTenant(currentTenant ?? undefined);
|
|
579
|
-
const entities = (0,
|
|
600
|
+
const entities = (0,_entities_index_js__rspack_import_3/* .getEventManagerEntitiesByConfig */.E1)(enableCompanyFeature);
|
|
580
601
|
return super.createDataSourceFromConfig(config, entities);
|
|
581
602
|
}
|
|
582
603
|
}
|
|
583
604
|
EventManagerDataSourceProvider = _ts_decorate([
|
|
584
|
-
(0,
|
|
585
|
-
scope:
|
|
605
|
+
(0,_nestjs_common__rspack_import_1.Injectable)({
|
|
606
|
+
scope: _nestjs_common__rspack_import_1.Scope.REQUEST
|
|
586
607
|
}),
|
|
587
|
-
_ts_param(0, (0,
|
|
588
|
-
_ts_param(1, (0,
|
|
589
|
-
_ts_param(1, (0,
|
|
608
|
+
_ts_param(0, (0,_nestjs_common__rspack_import_1.Inject)(_event_manager_config_service_js__rspack_import_4/* .EventManagerConfigService */.$)),
|
|
609
|
+
_ts_param(1, (0,_nestjs_common__rspack_import_1.Optional)()),
|
|
610
|
+
_ts_param(1, (0,_nestjs_common__rspack_import_1.Inject)(_nestjs_core__rspack_import_2.REQUEST)),
|
|
590
611
|
_ts_metadata("design:type", Function),
|
|
591
612
|
_ts_metadata("design:paramtypes", [
|
|
592
|
-
typeof
|
|
613
|
+
typeof _event_manager_config_service_js__rspack_import_4/* .EventManagerConfigService */.$ === "undefined" ? Object : _event_manager_config_service_js__rspack_import_4/* .EventManagerConfigService */.$,
|
|
593
614
|
typeof Request === "undefined" ? Object : Request
|
|
594
615
|
])
|
|
595
616
|
], EventManagerDataSourceProvider);
|
|
596
617
|
|
|
618
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
619
|
+
a: () => (EventManagerDataSourceProvider)
|
|
620
|
+
});
|
|
621
|
+
|
|
597
622
|
|
|
598
623
|
},
|
|
599
624
|
605(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
600
625
|
/* import */ var _config_index_js__rspack_import_10 = __webpack_require__(401);
|
|
626
|
+
/* import */ var _config_index_js__rspack_import_11 = __webpack_require__(782);
|
|
601
627
|
/* import */ var _nestjs_common__rspack_import_0 = __webpack_require__(157);
|
|
602
628
|
/* import */ var typeorm__rspack_import_1 = __webpack_require__(158);
|
|
603
629
|
/* import */ var _flusys_nestjs_shared_classes__rspack_import_2 = __webpack_require__(937);
|
|
@@ -606,7 +632,7 @@ EventManagerDataSourceProvider = _ts_decorate([
|
|
|
606
632
|
/* import */ var _flusys_nestjs_shared_utils__rspack_import_5 = __webpack_require__(216);
|
|
607
633
|
/* import */ var _flusys_nestjs_shared__rspack_import_6 = __webpack_require__(422);
|
|
608
634
|
/* import */ var _event_manager_config_service_js__rspack_import_7 = __webpack_require__(619);
|
|
609
|
-
/* import */ var _event_manager_datasource_provider_js__rspack_import_8 = __webpack_require__(
|
|
635
|
+
/* import */ var _event_manager_datasource_provider_js__rspack_import_8 = __webpack_require__(978);
|
|
610
636
|
/* import */ var _entities_index_js__rspack_import_9 = __webpack_require__(80);
|
|
611
637
|
function _ts_decorate(decorators, target, key, desc) {
|
|
612
638
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -647,7 +673,6 @@ class EventManagerHelperService {
|
|
|
647
673
|
utilsService;
|
|
648
674
|
configService;
|
|
649
675
|
dataSourceProvider;
|
|
650
|
-
eventEntityName = 'event';
|
|
651
676
|
dataSource = null;
|
|
652
677
|
constructor(cacheManager, utilsService, configService, dataSourceProvider){
|
|
653
678
|
this.cacheManager = cacheManager;
|
|
@@ -692,7 +717,7 @@ class EventManagerHelperService {
|
|
|
692
717
|
}
|
|
693
718
|
const saved = await repo.save(entity);
|
|
694
719
|
await this.addEventParticipants(saved.id, options.participantIds ?? [], options.organizerId);
|
|
695
|
-
await this.clearCache();
|
|
720
|
+
await this.clearCache(_config_index_js__rspack_import_10/* .EVENT_MANAGER_EVENT_ENTITIES.EVENT */.sI.EVENT, _config_index_js__rspack_import_10/* .EVENT_MANAGER_CACHE_ENTITIES.PARTICIPANT */.sl.PARTICIPANT);
|
|
696
721
|
return this.toEventResult(saved);
|
|
697
722
|
}
|
|
698
723
|
async updateParticipantStatus(participantId, status) {
|
|
@@ -706,11 +731,12 @@ class EventManagerHelperService {
|
|
|
706
731
|
if (!participant) {
|
|
707
732
|
throw new _nestjs_common__rspack_import_0.NotFoundException({
|
|
708
733
|
message: 'Event participant not found',
|
|
709
|
-
messageKey:
|
|
734
|
+
messageKey: _config_index_js__rspack_import_11/* .EVENT_PARTICIPANT_MESSAGES.NOT_FOUND */.C.NOT_FOUND
|
|
710
735
|
});
|
|
711
736
|
}
|
|
712
737
|
participant.status = status;
|
|
713
738
|
await participantRepo.save(participant);
|
|
739
|
+
await this.clearCache(_config_index_js__rspack_import_10/* .EVENT_MANAGER_CACHE_ENTITIES.PARTICIPANT */.sl.PARTICIPANT);
|
|
714
740
|
}
|
|
715
741
|
async getEventsForUser(userId, startDate, endDate, companyId) {
|
|
716
742
|
const eventRepo = await this.getEventRepository();
|
|
@@ -787,8 +813,9 @@ class EventManagerHelperService {
|
|
|
787
813
|
updatedAt: event.updatedAt
|
|
788
814
|
};
|
|
789
815
|
}
|
|
790
|
-
async clearCache() {
|
|
791
|
-
|
|
816
|
+
async clearCache(...entityNames) {
|
|
817
|
+
const tenantId = (0,_flusys_nestjs_shared_utils__rspack_import_5.cacheTenantId)(this.dataSourceProvider);
|
|
818
|
+
await Promise.all(entityNames.map((name)=>this.utilsService.clearCache(name, this.cacheManager, tenantId)));
|
|
792
819
|
}
|
|
793
820
|
}
|
|
794
821
|
_ts_decorate([
|
|
@@ -876,6 +903,12 @@ module.exports = __rspack_external__flusys_nestjs_shared_utils_9125c1f1;
|
|
|
876
903
|
module.exports = __rspack_external__nestjs_common_a04939da;
|
|
877
904
|
|
|
878
905
|
|
|
906
|
+
},
|
|
907
|
+
75(module) {
|
|
908
|
+
|
|
909
|
+
module.exports = __rspack_external__nestjs_core_d7b00a1a;
|
|
910
|
+
|
|
911
|
+
|
|
879
912
|
},
|
|
880
913
|
158(module) {
|
|
881
914
|
|
package/fesm/config/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const __rspack_esm_id = 565;
|
|
2
2
|
export const __rspack_esm_ids = [565];
|
|
3
3
|
export const __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
401(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
/**
|
|
6
6
|
* Domain event actions published by the event manager module, alongside the CRUD
|
|
7
7
|
* lifecycle actions every ApiService emits.
|
|
@@ -12,11 +12,15 @@ export const __webpack_modules__ = {
|
|
|
12
12
|
EVENT: 'event'
|
|
13
13
|
};
|
|
14
14
|
const EVENT_MANAGER_EVENT_MODULE = 'event-manager';
|
|
15
|
+
/** Cache stamps for entities that are never published on their own (participants ride inside event reads) */ const EVENT_MANAGER_CACHE_ENTITIES = {
|
|
16
|
+
PARTICIPANT: 'event_participant'
|
|
17
|
+
};
|
|
15
18
|
|
|
16
19
|
__webpack_require__.d(__webpack_exports__, {
|
|
17
20
|
}, {
|
|
18
21
|
i2: EVENT_MANAGER_EVENT_ACTIONS,
|
|
19
22
|
sI: EVENT_MANAGER_EVENT_ENTITIES,
|
|
23
|
+
sl: EVENT_MANAGER_CACHE_ENTITIES,
|
|
20
24
|
vR: EVENT_MANAGER_EVENT_MODULE
|
|
21
25
|
});
|
|
22
26
|
|
|
@@ -35,9 +39,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
35
39
|
|
|
36
40
|
},
|
|
37
41
|
895(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
38
|
-
/* import */ var _event_actions_js__rspack_import_0 = __webpack_require__(
|
|
42
|
+
/* import */ var _event_actions_js__rspack_import_0 = __webpack_require__(401);
|
|
39
43
|
/* import */ var _event_manager_constants_js__rspack_import_1 = __webpack_require__(890);
|
|
40
|
-
/* import */ var _message_keys_js__rspack_import_2 = __webpack_require__(
|
|
44
|
+
/* import */ var _message_keys_js__rspack_import_2 = __webpack_require__(782);
|
|
41
45
|
|
|
42
46
|
|
|
43
47
|
|
|
@@ -48,12 +52,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
48
52
|
G_: () => (/* reexport safe */ _message_keys_js__rspack_import_2.G),
|
|
49
53
|
i2: () => (/* reexport safe */ _event_actions_js__rspack_import_0.i2),
|
|
50
54
|
sI: () => (/* reexport safe */ _event_actions_js__rspack_import_0.sI),
|
|
55
|
+
sl: () => (/* reexport safe */ _event_actions_js__rspack_import_0.sl),
|
|
51
56
|
vR: () => (/* reexport safe */ _event_actions_js__rspack_import_0.vR)
|
|
52
57
|
});
|
|
53
58
|
|
|
54
59
|
|
|
55
60
|
},
|
|
56
|
-
|
|
61
|
+
782(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
57
62
|
// ==================== EVENT MANAGER MODULE MESSAGE KEYS ====================
|
|
58
63
|
const EVENT_MESSAGES = {
|
|
59
64
|
GET_ALL_SUCCESS: 'event.get.all.success',
|
|
@@ -78,10 +83,11 @@ import { __webpack_require__ } from '../runtime.js';
|
|
|
78
83
|
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
79
84
|
import * as __rspack_chunk_1 from './index.js';
|
|
80
85
|
__webpack_require__.C(__rspack_chunk_1);
|
|
81
|
-
var __webpack_exports__ = __webpack_exec__(895);var
|
|
86
|
+
var __webpack_exports__ = __webpack_exec__(895);var __webpack_exports__EVENT_MANAGER_CACHE_ENTITIES = __webpack_exports__.sl;
|
|
87
|
+
var __webpack_exports__EVENT_MANAGER_EVENT_ACTIONS = __webpack_exports__.i2;
|
|
82
88
|
var __webpack_exports__EVENT_MANAGER_EVENT_ENTITIES = __webpack_exports__.sI;
|
|
83
89
|
var __webpack_exports__EVENT_MANAGER_EVENT_MODULE = __webpack_exports__.vR;
|
|
84
90
|
var __webpack_exports__EVENT_MANAGER_MODULE_OPTIONS = __webpack_exports__.DJ;
|
|
85
91
|
var __webpack_exports__EVENT_MESSAGES = __webpack_exports__.G_;
|
|
86
92
|
var __webpack_exports__EVENT_PARTICIPANT_MESSAGES = __webpack_exports__.Ch;
|
|
87
|
-
export { __webpack_exports__EVENT_MANAGER_EVENT_ACTIONS as EVENT_MANAGER_EVENT_ACTIONS, __webpack_exports__EVENT_MANAGER_EVENT_ENTITIES as EVENT_MANAGER_EVENT_ENTITIES, __webpack_exports__EVENT_MANAGER_EVENT_MODULE as EVENT_MANAGER_EVENT_MODULE, __webpack_exports__EVENT_MANAGER_MODULE_OPTIONS as EVENT_MANAGER_MODULE_OPTIONS, __webpack_exports__EVENT_MESSAGES as EVENT_MESSAGES, __webpack_exports__EVENT_PARTICIPANT_MESSAGES as EVENT_PARTICIPANT_MESSAGES };
|
|
93
|
+
export { __webpack_exports__EVENT_MANAGER_CACHE_ENTITIES as EVENT_MANAGER_CACHE_ENTITIES, __webpack_exports__EVENT_MANAGER_EVENT_ACTIONS as EVENT_MANAGER_EVENT_ACTIONS, __webpack_exports__EVENT_MANAGER_EVENT_ENTITIES as EVENT_MANAGER_EVENT_ENTITIES, __webpack_exports__EVENT_MANAGER_EVENT_MODULE as EVENT_MANAGER_EVENT_MODULE, __webpack_exports__EVENT_MANAGER_MODULE_OPTIONS as EVENT_MANAGER_MODULE_OPTIONS, __webpack_exports__EVENT_MESSAGES as EVENT_MESSAGES, __webpack_exports__EVENT_PARTICIPANT_MESSAGES as EVENT_PARTICIPANT_MESSAGES };
|
|
@@ -25,7 +25,7 @@ var swagger_ = __webpack_require__(176);
|
|
|
25
25
|
// EXTERNAL MODULE: external "class-transformer"
|
|
26
26
|
var external_class_transformer_ = __webpack_require__(812);
|
|
27
27
|
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/config/message-keys.ts
|
|
28
|
-
var message_keys = __webpack_require__(
|
|
28
|
+
var message_keys = __webpack_require__(782);
|
|
29
29
|
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/docs/index.ts + 1 modules
|
|
30
30
|
var docs = __webpack_require__(283);
|
|
31
31
|
// EXTERNAL MODULE: ./projects/nestjs-event-manager/src/dtos/index.ts + 4 modules
|
package/fesm/dtos/index.js
CHANGED
|
@@ -243,6 +243,11 @@ event_dto_ts_decorate([
|
|
|
243
243
|
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
244
244
|
message: 'eventDate must be in YYYY-MM-DD format'
|
|
245
245
|
}),
|
|
246
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsISO8601)({
|
|
247
|
+
strict: true
|
|
248
|
+
}, {
|
|
249
|
+
message: 'eventDate must be a valid calendar date'
|
|
250
|
+
}),
|
|
246
251
|
event_dto_ts_metadata("design:type", String)
|
|
247
252
|
], CreateEventDto.prototype, "eventDate", void 0);
|
|
248
253
|
event_dto_ts_decorate([
|
|
@@ -252,7 +257,7 @@ event_dto_ts_decorate([
|
|
|
252
257
|
}),
|
|
253
258
|
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
254
259
|
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
255
|
-
(0,__rspack_external_class_validator_7b99ef4d.Matches)(
|
|
260
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^([01]\d|2[0-3]):[0-5]\d$/, {
|
|
256
261
|
message: 'startTime must be in HH:mm format'
|
|
257
262
|
}),
|
|
258
263
|
event_dto_ts_metadata("design:type", String)
|
|
@@ -264,7 +269,7 @@ event_dto_ts_decorate([
|
|
|
264
269
|
}),
|
|
265
270
|
(0,__rspack_external_class_validator_7b99ef4d.IsNotEmpty)(),
|
|
266
271
|
(0,__rspack_external_class_validator_7b99ef4d.IsString)(),
|
|
267
|
-
(0,__rspack_external_class_validator_7b99ef4d.Matches)(
|
|
272
|
+
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^([01]\d|2[0-3]):[0-5]\d$/, {
|
|
268
273
|
message: 'endTime must be in HH:mm format'
|
|
269
274
|
}),
|
|
270
275
|
event_dto_ts_metadata("design:type", String)
|
|
@@ -298,6 +303,11 @@ event_dto_ts_decorate([
|
|
|
298
303
|
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
299
304
|
message: 'recurrenceEndDate must be in YYYY-MM-DD format'
|
|
300
305
|
}),
|
|
306
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsISO8601)({
|
|
307
|
+
strict: true
|
|
308
|
+
}, {
|
|
309
|
+
message: 'recurrenceEndDate must be a valid calendar date'
|
|
310
|
+
}),
|
|
301
311
|
event_dto_ts_metadata("design:type", Object)
|
|
302
312
|
], CreateEventDto.prototype, "recurrenceEndDate", void 0);
|
|
303
313
|
event_dto_ts_decorate([
|
|
@@ -529,6 +539,11 @@ calendar_query_dto_ts_decorate([
|
|
|
529
539
|
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
530
540
|
message: 'startDate must be in YYYY-MM-DD format'
|
|
531
541
|
}),
|
|
542
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsISO8601)({
|
|
543
|
+
strict: true
|
|
544
|
+
}, {
|
|
545
|
+
message: 'startDate must be a valid calendar date'
|
|
546
|
+
}),
|
|
532
547
|
calendar_query_dto_ts_metadata("design:type", String)
|
|
533
548
|
], CalendarQueryDto.prototype, "startDate", void 0);
|
|
534
549
|
calendar_query_dto_ts_decorate([
|
|
@@ -541,6 +556,11 @@ calendar_query_dto_ts_decorate([
|
|
|
541
556
|
(0,__rspack_external_class_validator_7b99ef4d.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
542
557
|
message: 'endDate must be in YYYY-MM-DD format'
|
|
543
558
|
}),
|
|
559
|
+
(0,__rspack_external_class_validator_7b99ef4d.IsISO8601)({
|
|
560
|
+
strict: true
|
|
561
|
+
}, {
|
|
562
|
+
message: 'endDate must be a valid calendar date'
|
|
563
|
+
}),
|
|
544
564
|
calendar_query_dto_ts_metadata("design:type", String)
|
|
545
565
|
], CalendarQueryDto.prototype, "endDate", void 0);
|
|
546
566
|
calendar_query_dto_ts_decorate([
|
package/fesm/index.js
CHANGED
|
@@ -2,9 +2,9 @@ export const __rspack_esm_id = 410;
|
|
|
2
2
|
export const __rspack_esm_ids = [410];
|
|
3
3
|
export const __webpack_modules__ = {
|
|
4
4
|
895(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5
|
-
/* import */ var _event_actions_js__rspack_import_0 = __webpack_require__(
|
|
5
|
+
/* import */ var _event_actions_js__rspack_import_0 = __webpack_require__(401);
|
|
6
6
|
/* import */ var _event_manager_constants_js__rspack_import_1 = __webpack_require__(890);
|
|
7
|
-
/* import */ var _message_keys_js__rspack_import_2 = __webpack_require__(
|
|
7
|
+
/* import */ var _message_keys_js__rspack_import_2 = __webpack_require__(782);
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -15,6 +15,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15
15
|
G_: () => (/* reexport safe */ _message_keys_js__rspack_import_2.G),
|
|
16
16
|
i2: () => (/* reexport safe */ _event_actions_js__rspack_import_0.i2),
|
|
17
17
|
sI: () => (/* reexport safe */ _event_actions_js__rspack_import_0.sI),
|
|
18
|
+
sl: () => (/* reexport safe */ _event_actions_js__rspack_import_0.sl),
|
|
18
19
|
vR: () => (/* reexport safe */ _event_actions_js__rspack_import_0.vR)
|
|
19
20
|
});
|
|
20
21
|
|
|
@@ -70,6 +71,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
70
71
|
mF: () => (/* reexport safe */ _dtos_index_js__rspack_import_7.mF),
|
|
71
72
|
nx: () => (/* reexport safe */ _dtos_index_js__rspack_import_7.nx),
|
|
72
73
|
sI: () => (/* reexport safe */ _config_index_js__rspack_import_5.sI),
|
|
74
|
+
sl: () => (/* reexport safe */ _config_index_js__rspack_import_5.sl),
|
|
73
75
|
vR: () => (/* reexport safe */ _config_index_js__rspack_import_5.vR),
|
|
74
76
|
wJ: () => (/* reexport safe */ _dtos_index_js__rspack_import_7.wJ),
|
|
75
77
|
x_: () => (/* reexport safe */ _services_index_js__rspack_import_2.x_)
|
|
@@ -91,6 +93,7 @@ var __webpack_exports__ = __webpack_exec__(952);var __webpack_exports__CalendarE
|
|
|
91
93
|
var __webpack_exports__CalendarQueryDto = __webpack_exports__.it;
|
|
92
94
|
var __webpack_exports__CreateEventDto = __webpack_exports__.wJ;
|
|
93
95
|
var __webpack_exports__CreateEventParticipantDto = __webpack_exports__.nx;
|
|
96
|
+
var __webpack_exports__EVENT_MANAGER_CACHE_ENTITIES = __webpack_exports__.sl;
|
|
94
97
|
var __webpack_exports__EVENT_MANAGER_EVENT_ACTIONS = __webpack_exports__.i2;
|
|
95
98
|
var __webpack_exports__EVENT_MANAGER_EVENT_ENTITIES = __webpack_exports__.sI;
|
|
96
99
|
var __webpack_exports__EVENT_MANAGER_EVENT_MODULE = __webpack_exports__.vR;
|
|
@@ -119,4 +122,4 @@ var __webpack_exports__UpdateEventParticipantDto = __webpack_exports__.mF;
|
|
|
119
122
|
var __webpack_exports__UpdateParticipantStatusDto = __webpack_exports__.Wk;
|
|
120
123
|
var __webpack_exports__eventManagerSwaggerConfig = __webpack_exports__.SS;
|
|
121
124
|
var __webpack_exports__getEventManagerEntitiesByConfig = __webpack_exports__.E1;
|
|
122
|
-
export { __webpack_exports__CalendarEventResponseDto as CalendarEventResponseDto, __webpack_exports__CalendarQueryDto as CalendarQueryDto, __webpack_exports__CreateEventDto as CreateEventDto, __webpack_exports__CreateEventParticipantDto as CreateEventParticipantDto, __webpack_exports__EVENT_MANAGER_EVENT_ACTIONS as EVENT_MANAGER_EVENT_ACTIONS, __webpack_exports__EVENT_MANAGER_EVENT_ENTITIES as EVENT_MANAGER_EVENT_ENTITIES, __webpack_exports__EVENT_MANAGER_EVENT_MODULE as EVENT_MANAGER_EVENT_MODULE, __webpack_exports__EVENT_MANAGER_MODULE_OPTIONS as EVENT_MANAGER_MODULE_OPTIONS, __webpack_exports__EVENT_MESSAGES as EVENT_MESSAGES, __webpack_exports__EVENT_PARTICIPANT_MESSAGES as EVENT_PARTICIPANT_MESSAGES, __webpack_exports__EVENT_PERMISSIONS as EVENT_PERMISSIONS, __webpack_exports__Event as Event, __webpack_exports__EventBase as EventBase, __webpack_exports__EventController as EventController, __webpack_exports__EventManagerAdapter as EventManagerAdapter, __webpack_exports__EventManagerCompanyEntities as EventManagerCompanyEntities, __webpack_exports__EventManagerConfigService as EventManagerConfigService, __webpack_exports__EventManagerCoreEntities as EventManagerCoreEntities, __webpack_exports__EventManagerDataSourceProvider as EventManagerDataSourceProvider, __webpack_exports__EventManagerHelperService as EventManagerHelperService, __webpack_exports__EventManagerModule as EventManagerModule, __webpack_exports__EventParticipant as EventParticipant, __webpack_exports__EventParticipantBase as EventParticipantBase, __webpack_exports__EventParticipantResponseDto as EventParticipantResponseDto, __webpack_exports__EventResponseDto as EventResponseDto, __webpack_exports__EventService as EventService, __webpack_exports__EventWithCompany as EventWithCompany, __webpack_exports__UpdateEventDto as UpdateEventDto, __webpack_exports__UpdateEventParticipantDto as UpdateEventParticipantDto, __webpack_exports__UpdateParticipantStatusDto as UpdateParticipantStatusDto, __webpack_exports__eventManagerSwaggerConfig as eventManagerSwaggerConfig, __webpack_exports__getEventManagerEntitiesByConfig as getEventManagerEntitiesByConfig };
|
|
125
|
+
export { __webpack_exports__CalendarEventResponseDto as CalendarEventResponseDto, __webpack_exports__CalendarQueryDto as CalendarQueryDto, __webpack_exports__CreateEventDto as CreateEventDto, __webpack_exports__CreateEventParticipantDto as CreateEventParticipantDto, __webpack_exports__EVENT_MANAGER_CACHE_ENTITIES as EVENT_MANAGER_CACHE_ENTITIES, __webpack_exports__EVENT_MANAGER_EVENT_ACTIONS as EVENT_MANAGER_EVENT_ACTIONS, __webpack_exports__EVENT_MANAGER_EVENT_ENTITIES as EVENT_MANAGER_EVENT_ENTITIES, __webpack_exports__EVENT_MANAGER_EVENT_MODULE as EVENT_MANAGER_EVENT_MODULE, __webpack_exports__EVENT_MANAGER_MODULE_OPTIONS as EVENT_MANAGER_MODULE_OPTIONS, __webpack_exports__EVENT_MESSAGES as EVENT_MESSAGES, __webpack_exports__EVENT_PARTICIPANT_MESSAGES as EVENT_PARTICIPANT_MESSAGES, __webpack_exports__EVENT_PERMISSIONS as EVENT_PERMISSIONS, __webpack_exports__Event as Event, __webpack_exports__EventBase as EventBase, __webpack_exports__EventController as EventController, __webpack_exports__EventManagerAdapter as EventManagerAdapter, __webpack_exports__EventManagerCompanyEntities as EventManagerCompanyEntities, __webpack_exports__EventManagerConfigService as EventManagerConfigService, __webpack_exports__EventManagerCoreEntities as EventManagerCoreEntities, __webpack_exports__EventManagerDataSourceProvider as EventManagerDataSourceProvider, __webpack_exports__EventManagerHelperService as EventManagerHelperService, __webpack_exports__EventManagerModule as EventManagerModule, __webpack_exports__EventParticipant as EventParticipant, __webpack_exports__EventParticipantBase as EventParticipantBase, __webpack_exports__EventParticipantResponseDto as EventParticipantResponseDto, __webpack_exports__EventResponseDto as EventResponseDto, __webpack_exports__EventService as EventService, __webpack_exports__EventWithCompany as EventWithCompany, __webpack_exports__UpdateEventDto as UpdateEventDto, __webpack_exports__UpdateEventParticipantDto as UpdateEventParticipantDto, __webpack_exports__UpdateParticipantStatusDto as UpdateParticipantStatusDto, __webpack_exports__eventManagerSwaggerConfig as eventManagerSwaggerConfig, __webpack_exports__getEventManagerEntitiesByConfig as getEventManagerEntitiesByConfig };
|
package/fesm/services/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export const __rspack_esm_ids = [995];
|
|
|
3
3
|
export const __webpack_modules__ = {
|
|
4
4
|
605(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
/* import */ var _config_index_js__rspack_import_10 = __webpack_require__(401);
|
|
6
|
+
/* import */ var _config_index_js__rspack_import_11 = __webpack_require__(782);
|
|
6
7
|
/* import */ var _nestjs_common__rspack_import_0 = __webpack_require__(157);
|
|
7
8
|
/* import */ var typeorm__rspack_import_1 = __webpack_require__(158);
|
|
8
9
|
/* import */ var _flusys_nestjs_shared_classes__rspack_import_2 = __webpack_require__(937);
|
|
@@ -11,7 +12,7 @@ export const __webpack_modules__ = {
|
|
|
11
12
|
/* import */ var _flusys_nestjs_shared_utils__rspack_import_5 = __webpack_require__(216);
|
|
12
13
|
/* import */ var _flusys_nestjs_shared__rspack_import_6 = __webpack_require__(422);
|
|
13
14
|
/* import */ var _event_manager_config_service_js__rspack_import_7 = __webpack_require__(619);
|
|
14
|
-
/* import */ var _event_manager_datasource_provider_js__rspack_import_8 = __webpack_require__(
|
|
15
|
+
/* import */ var _event_manager_datasource_provider_js__rspack_import_8 = __webpack_require__(978);
|
|
15
16
|
/* import */ var _entities_index_js__rspack_import_9 = __webpack_require__(80);
|
|
16
17
|
function _ts_decorate(decorators, target, key, desc) {
|
|
17
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -52,7 +53,6 @@ class EventManagerHelperService {
|
|
|
52
53
|
utilsService;
|
|
53
54
|
configService;
|
|
54
55
|
dataSourceProvider;
|
|
55
|
-
eventEntityName = 'event';
|
|
56
56
|
dataSource = null;
|
|
57
57
|
constructor(cacheManager, utilsService, configService, dataSourceProvider){
|
|
58
58
|
this.cacheManager = cacheManager;
|
|
@@ -97,7 +97,7 @@ class EventManagerHelperService {
|
|
|
97
97
|
}
|
|
98
98
|
const saved = await repo.save(entity);
|
|
99
99
|
await this.addEventParticipants(saved.id, options.participantIds ?? [], options.organizerId);
|
|
100
|
-
await this.clearCache();
|
|
100
|
+
await this.clearCache(_config_index_js__rspack_import_10/* .EVENT_MANAGER_EVENT_ENTITIES.EVENT */.sI.EVENT, _config_index_js__rspack_import_10/* .EVENT_MANAGER_CACHE_ENTITIES.PARTICIPANT */.sl.PARTICIPANT);
|
|
101
101
|
return this.toEventResult(saved);
|
|
102
102
|
}
|
|
103
103
|
async updateParticipantStatus(participantId, status) {
|
|
@@ -111,11 +111,12 @@ class EventManagerHelperService {
|
|
|
111
111
|
if (!participant) {
|
|
112
112
|
throw new _nestjs_common__rspack_import_0.NotFoundException({
|
|
113
113
|
message: 'Event participant not found',
|
|
114
|
-
messageKey:
|
|
114
|
+
messageKey: _config_index_js__rspack_import_11/* .EVENT_PARTICIPANT_MESSAGES.NOT_FOUND */.C.NOT_FOUND
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
participant.status = status;
|
|
118
118
|
await participantRepo.save(participant);
|
|
119
|
+
await this.clearCache(_config_index_js__rspack_import_10/* .EVENT_MANAGER_CACHE_ENTITIES.PARTICIPANT */.sl.PARTICIPANT);
|
|
119
120
|
}
|
|
120
121
|
async getEventsForUser(userId, startDate, endDate, companyId) {
|
|
121
122
|
const eventRepo = await this.getEventRepository();
|
|
@@ -192,8 +193,9 @@ class EventManagerHelperService {
|
|
|
192
193
|
updatedAt: event.updatedAt
|
|
193
194
|
};
|
|
194
195
|
}
|
|
195
|
-
async clearCache() {
|
|
196
|
-
|
|
196
|
+
async clearCache(...entityNames) {
|
|
197
|
+
const tenantId = (0,_flusys_nestjs_shared_utils__rspack_import_5.cacheTenantId)(this.dataSourceProvider);
|
|
198
|
+
await Promise.all(entityNames.map((name)=>this.utilsService.clearCache(name, this.cacheManager, tenantId)));
|
|
197
199
|
}
|
|
198
200
|
}
|
|
199
201
|
_ts_decorate([
|
|
@@ -242,7 +244,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
242
244
|
},
|
|
243
245
|
965(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
244
246
|
/* import */ var _event_manager_config_service_js__rspack_import_0 = __webpack_require__(619);
|
|
245
|
-
/* import */ var _event_manager_datasource_provider_js__rspack_import_1 = __webpack_require__(
|
|
247
|
+
/* import */ var _event_manager_datasource_provider_js__rspack_import_1 = __webpack_require__(978);
|
|
246
248
|
/* import */ var _event_manager_helper_service_js__rspack_import_2 = __webpack_require__(605);
|
|
247
249
|
/* import */ var _event_service_js__rspack_import_3 = __webpack_require__(600);
|
|
248
250
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/nestjs-event-manager",
|
|
3
|
-
"version": "9.1
|
|
3
|
+
"version": "9.2.1",
|
|
4
4
|
"description": "Event manager module with calendar support and recurrence",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./fesm/index.js",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"express": "^5.0.0"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@flusys/nestjs-core": "9.1
|
|
78
|
-
"@flusys/nestjs-shared": "9.1
|
|
77
|
+
"@flusys/nestjs-core": "9.2.1",
|
|
78
|
+
"@flusys/nestjs-shared": "9.2.1"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -8,7 +8,6 @@ export declare class EventManagerHelperService {
|
|
|
8
8
|
private readonly utilsService;
|
|
9
9
|
private readonly configService;
|
|
10
10
|
private readonly dataSourceProvider;
|
|
11
|
-
private readonly eventEntityName;
|
|
12
11
|
private dataSource;
|
|
13
12
|
constructor(cacheManager: HybridCache, utilsService: UtilsService, configService: EventManagerConfigService, dataSourceProvider: EventManagerDataSourceProvider);
|
|
14
13
|
private getDataSource;
|
|
@@ -13,8 +13,10 @@ export declare class EventService extends ApiService<CreateEventDto, UpdateEvent
|
|
|
13
13
|
private readonly eventConfig;
|
|
14
14
|
private readonly dataSourceProvider;
|
|
15
15
|
private participantRepository;
|
|
16
|
-
private
|
|
16
|
+
private readonly pendingParticipants;
|
|
17
17
|
constructor(cacheManager: HybridCache, utilsService: UtilsService, eventConfig: EventManagerConfigService, dataSourceProvider: EventManagerDataSourceProvider);
|
|
18
|
+
protected cacheDependencies(): string[];
|
|
19
|
+
invalidateCache(): Promise<void>;
|
|
18
20
|
convertSingleDtoToEntity(dto: CreateEventDto | UpdateEventDto, user: ILoggedUserInfo | null): Promise<EventBase>;
|
|
19
21
|
protected getFilterQuery(query: SelectQueryBuilder<EventBase>, filter: Record<string, unknown>, _user: ILoggedUserInfo | null): Promise<{
|
|
20
22
|
query: SelectQueryBuilder<EventBase>;
|
|
@@ -24,20 +26,22 @@ export declare class EventService extends ApiService<CreateEventDto, UpdateEvent
|
|
|
24
26
|
query: SelectQueryBuilder<EventBase>;
|
|
25
27
|
isRaw: boolean;
|
|
26
28
|
}>;
|
|
27
|
-
protected afterInsertOperation(entities: EventBase[], _dto: CreateEventDto | Array<CreateEventDto>, user: ILoggedUserInfo | null,
|
|
28
|
-
protected afterUpdateOperation(entities: EventBase[], _dto: UpdateEventDto | Array<UpdateEventDto>, user: ILoggedUserInfo | null,
|
|
29
|
+
protected afterInsertOperation(entities: EventBase[], _dto: CreateEventDto | Array<CreateEventDto>, user: ILoggedUserInfo | null, qr: QueryRunner): Promise<void>;
|
|
30
|
+
protected afterUpdateOperation(entities: EventBase[], _dto: UpdateEventDto | Array<UpdateEventDto>, user: ILoggedUserInfo | null, qr: QueryRunner): Promise<void>;
|
|
29
31
|
getEventsForCalendarRange(queryDto: CalendarQueryDto, user: ILoggedUserInfo | null): Promise<ICalendarEvent[]>;
|
|
30
32
|
updateParticipantStatus(dto: UpdateParticipantStatusDto, user: ILoggedUserInfo | null): Promise<EventParticipant>;
|
|
31
|
-
private
|
|
33
|
+
private addOrganizerAndParticipants;
|
|
32
34
|
private expandRecurringEvents;
|
|
33
35
|
private generateOccurrences;
|
|
36
|
+
private invalidateParticipantCache;
|
|
34
37
|
private ensureParticipantRepositoryInitialized;
|
|
35
38
|
private getParticipantEventIds;
|
|
36
39
|
private loadParticipantsForEvents;
|
|
40
|
+
private isEventInUserCompany;
|
|
41
|
+
private updatedOrKept;
|
|
37
42
|
private applyEventCompanyFilter;
|
|
38
43
|
private shouldStopRecurrence;
|
|
39
|
-
private
|
|
40
|
-
private weekdayNameToIndex;
|
|
44
|
+
private normalizeWeekDays;
|
|
41
45
|
private getWeekStart;
|
|
42
46
|
private addDaysToDate;
|
|
43
47
|
private getNextOccurrenceDate;
|