@flusys/nestjs-event-manager 3.0.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 +1328 -0
- package/adapters/event-manager.adapter.d.ts +12 -0
- package/adapters/index.d.ts +1 -0
- package/cjs/adapters/event-manager.adapter.js +71 -0
- package/cjs/adapters/index.js +18 -0
- package/cjs/config/event-manager.constants.js +13 -0
- package/cjs/config/index.js +18 -0
- package/cjs/controllers/event-participant.controller.js +271 -0
- package/cjs/controllers/event.controller.js +229 -0
- package/cjs/controllers/index.js +19 -0
- package/cjs/docs/event-manager-swagger.config.js +135 -0
- package/cjs/docs/index.js +24 -0
- package/cjs/dtos/calendar-query.dto.js +186 -0
- package/cjs/dtos/event-participant.dto.js +226 -0
- package/cjs/dtos/event.dto.js +291 -0
- package/cjs/dtos/index.js +20 -0
- package/cjs/entities/event-participant.entity.js +96 -0
- package/cjs/entities/event-with-company.entity.js +56 -0
- package/cjs/entities/event.entity.js +143 -0
- package/cjs/entities/index.js +55 -0
- package/cjs/index.js +27 -0
- package/cjs/interfaces/event-manager-module.interface.js +4 -0
- package/cjs/interfaces/event.interface.js +4 -0
- package/cjs/interfaces/index.js +19 -0
- package/cjs/modules/event-manager.module.js +133 -0
- package/cjs/modules/index.js +18 -0
- package/cjs/services/event-manager-config.service.js +76 -0
- package/cjs/services/event-manager-datasource.provider.js +181 -0
- package/cjs/services/event-manager-helper.service.js +253 -0
- package/cjs/services/event-participant.service.js +164 -0
- package/cjs/services/event.service.js +421 -0
- package/cjs/services/index.js +22 -0
- package/config/event-manager.constants.d.ts +1 -0
- package/config/index.d.ts +1 -0
- package/controllers/event-participant.controller.d.ts +31 -0
- package/controllers/event.controller.d.ts +24 -0
- package/controllers/index.d.ts +2 -0
- package/docs/event-manager-swagger.config.d.ts +3 -0
- package/docs/index.d.ts +2 -0
- package/dtos/calendar-query.dto.d.ts +23 -0
- package/dtos/event-participant.dto.d.ts +31 -0
- package/dtos/event.dto.d.ts +37 -0
- package/dtos/index.d.ts +3 -0
- package/entities/event-participant.entity.d.ts +8 -0
- package/entities/event-with-company.entity.d.ts +4 -0
- package/entities/event.entity.d.ts +14 -0
- package/entities/index.d.ts +11 -0
- package/fesm/adapters/event-manager.adapter.js +61 -0
- package/fesm/adapters/index.js +1 -0
- package/fesm/config/event-manager.constants.js +3 -0
- package/fesm/config/index.js +1 -0
- package/fesm/controllers/event-participant.controller.js +261 -0
- package/fesm/controllers/event.controller.js +219 -0
- package/fesm/controllers/index.js +2 -0
- package/fesm/docs/event-manager-swagger.config.js +128 -0
- package/fesm/docs/index.js +4 -0
- package/fesm/dtos/calendar-query.dto.js +168 -0
- package/fesm/dtos/event-participant.dto.js +199 -0
- package/fesm/dtos/event.dto.js +270 -0
- package/fesm/dtos/index.js +3 -0
- package/fesm/entities/event-participant.entity.js +86 -0
- package/fesm/entities/event-with-company.entity.js +46 -0
- package/fesm/entities/event.entity.js +133 -0
- package/fesm/entities/index.js +24 -0
- package/fesm/index.js +10 -0
- package/fesm/interfaces/event-manager-module.interface.js +3 -0
- package/fesm/interfaces/event.interface.js +1 -0
- package/fesm/interfaces/index.js +2 -0
- package/fesm/modules/event-manager.module.js +123 -0
- package/fesm/modules/index.js +1 -0
- package/fesm/services/event-manager-config.service.js +66 -0
- package/fesm/services/event-manager-datasource.provider.js +130 -0
- package/fesm/services/event-manager-helper.service.js +243 -0
- package/fesm/services/event-participant.service.js +154 -0
- package/fesm/services/event.service.js +411 -0
- package/fesm/services/index.js +5 -0
- package/index.d.ts +9 -0
- package/interfaces/event-manager-module.interface.d.ts +20 -0
- package/interfaces/event.interface.d.ts +28 -0
- package/interfaces/index.d.ts +2 -0
- package/modules/event-manager.module.d.ts +8 -0
- package/modules/index.d.ts +1 -0
- package/package.json +89 -0
- package/services/event-manager-config.service.d.ts +13 -0
- package/services/event-manager-datasource.provider.d.ts +23 -0
- package/services/event-manager-helper.service.d.ts +27 -0
- package/services/event-participant.service.d.ts +27 -0
- package/services/event.service.d.ts +49 -0
- package/services/index.d.ts +5 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "eventManagerSwaggerConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return eventManagerSwaggerConfig;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
/** Schema properties to exclude when company feature is disabled */ const COMPANY_SCHEMA_EXCLUSIONS = [
|
|
12
|
+
{
|
|
13
|
+
schemaName: 'EventResponseDto',
|
|
14
|
+
properties: [
|
|
15
|
+
'companyId'
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
schemaName: 'CalendarEventResponseDto',
|
|
20
|
+
properties: [
|
|
21
|
+
'companyId'
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
function buildDescription(enableCompanyFeature) {
|
|
26
|
+
const companyFeatures = enableCompanyFeature ? '\n- **Company-scoped events**' : '';
|
|
27
|
+
const companyIsolation = enableCompanyFeature ? '\n- **Company isolation**' : '';
|
|
28
|
+
const multiTenantSection = enableCompanyFeature ? `
|
|
29
|
+
## Multi-Tenant Support
|
|
30
|
+
|
|
31
|
+
Events are automatically isolated by:
|
|
32
|
+
- **Company ID**: Events belong to specific companies
|
|
33
|
+
- **User Context**: Participants are company members
|
|
34
|
+
|
|
35
|
+
All queries automatically filter by current user's company context.
|
|
36
|
+
` : '';
|
|
37
|
+
return `
|
|
38
|
+
# Event Manager API
|
|
39
|
+
|
|
40
|
+
Calendar event management with recurrence support${enableCompanyFeature ? ' and multi-tenant capabilities' : ''}.
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
### 📅 Event Management
|
|
45
|
+
- Create, read, update, delete events
|
|
46
|
+
- Rich metadata support
|
|
47
|
+
- Meeting link integration
|
|
48
|
+
- Color-coded events${companyFeatures}
|
|
49
|
+
|
|
50
|
+
### 🔄 Recurrence Support
|
|
51
|
+
- **None**: Single occurrence
|
|
52
|
+
- **Daily**: Every day
|
|
53
|
+
- **Weekly**: Specific days of the week
|
|
54
|
+
- **Biweekly**: Every two weeks
|
|
55
|
+
- **Monthly**: Same day each month
|
|
56
|
+
|
|
57
|
+
### 👥 Participant Management
|
|
58
|
+
- Add/remove participants
|
|
59
|
+
- Status tracking (pending, accepted, declined, tentative)
|
|
60
|
+
- Organizer designation
|
|
61
|
+
- Bulk participant operations
|
|
62
|
+
|
|
63
|
+
### 📆 Calendar Queries
|
|
64
|
+
- Date range queries
|
|
65
|
+
- Automatic recurrence expansion
|
|
66
|
+
- Filter by user participation
|
|
67
|
+
- Include/exclude participants in response
|
|
68
|
+
|
|
69
|
+
### 🔒 Security
|
|
70
|
+
- JWT authentication required
|
|
71
|
+
- Permission-based access control${companyIsolation}
|
|
72
|
+
|
|
73
|
+
## Recurrence Patterns
|
|
74
|
+
|
|
75
|
+
### Weekly Recurrence
|
|
76
|
+
Use \`metadata.recurrenceDays\` array to specify days:
|
|
77
|
+
- 0 = Sunday
|
|
78
|
+
- 1 = Monday
|
|
79
|
+
- 2 = Tuesday
|
|
80
|
+
- 3 = Wednesday
|
|
81
|
+
- 4 = Thursday
|
|
82
|
+
- 5 = Friday
|
|
83
|
+
- 6 = Saturday
|
|
84
|
+
|
|
85
|
+
Example: \`{ "recurrenceDays": [1, 3, 5] }\` = Monday, Wednesday, Friday
|
|
86
|
+
|
|
87
|
+
### Recurrence Expansion
|
|
88
|
+
Calendar queries automatically expand recurring events into individual instances.
|
|
89
|
+
Each instance includes:
|
|
90
|
+
- \`isRecurrenceInstance: true\`
|
|
91
|
+
- \`originalEventId\`: Reference to parent event
|
|
92
|
+
- \`recurrenceInstanceDate\`: Specific occurrence date
|
|
93
|
+
${multiTenantSection}
|
|
94
|
+
## API Endpoints
|
|
95
|
+
|
|
96
|
+
All endpoints use POST method (RPC style):
|
|
97
|
+
|
|
98
|
+
### Events
|
|
99
|
+
- \`/event-manager/event/insert\` - Create event
|
|
100
|
+
- \`/event-manager/event/get/:id\` - Get by ID
|
|
101
|
+
- \`/event-manager/event/get-all\` - List with pagination
|
|
102
|
+
- \`/event-manager/event/update\` - Update event
|
|
103
|
+
- \`/event-manager/event/delete\` - Soft delete
|
|
104
|
+
- \`/event-manager/event/calendar\` - Calendar query with expansion
|
|
105
|
+
- \`/event-manager/event/get-with-participants\` - Get with participant list
|
|
106
|
+
- \`/event-manager/event/add-participants\` - Add participants
|
|
107
|
+
|
|
108
|
+
### Participants
|
|
109
|
+
- \`/event-manager/participant/insert\` - Create participant
|
|
110
|
+
- \`/event-manager/participant/get-all\` - List participants
|
|
111
|
+
- \`/event-manager/participant/update-status\` - Update status
|
|
112
|
+
- \`/event-manager/participant/get-by-event\` - Get by event
|
|
113
|
+
- \`/event-manager/participant/get-by-user\` - Get by user
|
|
114
|
+
- \`/event-manager/participant/remove\` - Remove from event
|
|
115
|
+
|
|
116
|
+
## Getting Started
|
|
117
|
+
|
|
118
|
+
1. **Authenticate**: Obtain JWT token from /auth/login
|
|
119
|
+
2. **Create Event**: POST to /event-manager/event/insert
|
|
120
|
+
3. **Add Participants**: POST to /event-manager/event/add-participants
|
|
121
|
+
4. **Query Calendar**: POST to /event-manager/event/calendar with date range
|
|
122
|
+
`;
|
|
123
|
+
}
|
|
124
|
+
function eventManagerSwaggerConfig(bootstrapConfig) {
|
|
125
|
+
const enableCompanyFeature = bootstrapConfig?.enableCompanyFeature ?? true;
|
|
126
|
+
return {
|
|
127
|
+
title: 'Event Manager API',
|
|
128
|
+
description: buildDescription(enableCompanyFeature),
|
|
129
|
+
version: '1.0',
|
|
130
|
+
path: 'api/docs/event-manager',
|
|
131
|
+
bearerAuth: true,
|
|
132
|
+
excludeTags: [],
|
|
133
|
+
excludeSchemaProperties: enableCompanyFeature ? undefined : COMPANY_SCHEMA_EXCLUSIONS
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Re-export permissions from shared for convenience
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
get EVENT_PARTICIPANT_PERMISSIONS () {
|
|
14
|
+
return _nestjsshared.EVENT_PARTICIPANT_PERMISSIONS;
|
|
15
|
+
},
|
|
16
|
+
get EVENT_PERMISSIONS () {
|
|
17
|
+
return _nestjsshared.EVENT_PERMISSIONS;
|
|
18
|
+
},
|
|
19
|
+
get eventManagerSwaggerConfig () {
|
|
20
|
+
return _eventmanagerswaggerconfig.eventManagerSwaggerConfig;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _nestjsshared = require("@flusys/nestjs-shared");
|
|
24
|
+
const _eventmanagerswaggerconfig = require("./event-manager-swagger.config");
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get CalendarEventResponseDto () {
|
|
13
|
+
return CalendarEventResponseDto;
|
|
14
|
+
},
|
|
15
|
+
get CalendarQueryDto () {
|
|
16
|
+
return CalendarQueryDto;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _swagger = require("@nestjs/swagger");
|
|
20
|
+
const _classtransformer = require("class-transformer");
|
|
21
|
+
const _classvalidator = require("class-validator");
|
|
22
|
+
const _eventparticipantdto = require("./event-participant.dto");
|
|
23
|
+
function _define_property(obj, key, value) {
|
|
24
|
+
if (key in obj) {
|
|
25
|
+
Object.defineProperty(obj, key, {
|
|
26
|
+
value: value,
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
obj[key] = value;
|
|
33
|
+
}
|
|
34
|
+
return obj;
|
|
35
|
+
}
|
|
36
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
37
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
38
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
39
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
40
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
41
|
+
}
|
|
42
|
+
function _ts_metadata(k, v) {
|
|
43
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
44
|
+
}
|
|
45
|
+
let CalendarQueryDto = class CalendarQueryDto {
|
|
46
|
+
constructor(){
|
|
47
|
+
_define_property(this, "startDate", void 0);
|
|
48
|
+
_define_property(this, "endDate", void 0);
|
|
49
|
+
_define_property(this, "includeParticipants", void 0);
|
|
50
|
+
_define_property(this, "userId", void 0);
|
|
51
|
+
_define_property(this, "activeOnly", void 0);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
_ts_decorate([
|
|
55
|
+
(0, _swagger.ApiProperty)({
|
|
56
|
+
description: 'Start date for calendar range',
|
|
57
|
+
example: '2024-01-01T00:00:00Z'
|
|
58
|
+
}),
|
|
59
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
60
|
+
(0, _classvalidator.IsDate)(),
|
|
61
|
+
(0, _classtransformer.Type)(()=>Date),
|
|
62
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
63
|
+
], CalendarQueryDto.prototype, "startDate", void 0);
|
|
64
|
+
_ts_decorate([
|
|
65
|
+
(0, _swagger.ApiProperty)({
|
|
66
|
+
description: 'End date for calendar range',
|
|
67
|
+
example: '2024-01-31T23:59:59Z'
|
|
68
|
+
}),
|
|
69
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
70
|
+
(0, _classvalidator.IsDate)(),
|
|
71
|
+
(0, _classtransformer.Type)(()=>Date),
|
|
72
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
73
|
+
], CalendarQueryDto.prototype, "endDate", void 0);
|
|
74
|
+
_ts_decorate([
|
|
75
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
76
|
+
description: 'Include participant details',
|
|
77
|
+
default: false
|
|
78
|
+
}),
|
|
79
|
+
(0, _classvalidator.IsOptional)(),
|
|
80
|
+
(0, _classvalidator.IsBoolean)(),
|
|
81
|
+
_ts_metadata("design:type", Boolean)
|
|
82
|
+
], CalendarQueryDto.prototype, "includeParticipants", void 0);
|
|
83
|
+
_ts_decorate([
|
|
84
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
85
|
+
description: 'Filter by specific user ID'
|
|
86
|
+
}),
|
|
87
|
+
(0, _classvalidator.IsOptional)(),
|
|
88
|
+
(0, _classvalidator.IsUUID)(),
|
|
89
|
+
_ts_metadata("design:type", String)
|
|
90
|
+
], CalendarQueryDto.prototype, "userId", void 0);
|
|
91
|
+
_ts_decorate([
|
|
92
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
93
|
+
description: 'Include only active events',
|
|
94
|
+
default: true
|
|
95
|
+
}),
|
|
96
|
+
(0, _classvalidator.IsOptional)(),
|
|
97
|
+
(0, _classvalidator.IsBoolean)(),
|
|
98
|
+
_ts_metadata("design:type", Boolean)
|
|
99
|
+
], CalendarQueryDto.prototype, "activeOnly", void 0);
|
|
100
|
+
let CalendarEventResponseDto = class CalendarEventResponseDto {
|
|
101
|
+
constructor(){
|
|
102
|
+
_define_property(this, "id", void 0);
|
|
103
|
+
_define_property(this, "title", void 0);
|
|
104
|
+
_define_property(this, "description", void 0);
|
|
105
|
+
_define_property(this, "meetingLink", void 0);
|
|
106
|
+
_define_property(this, "startDateTime", void 0);
|
|
107
|
+
_define_property(this, "endDateTime", void 0);
|
|
108
|
+
_define_property(this, "isAllDay", void 0);
|
|
109
|
+
_define_property(this, "recurrenceType", void 0);
|
|
110
|
+
_define_property(this, "color", void 0);
|
|
111
|
+
_define_property(this, "isActive", void 0);
|
|
112
|
+
_define_property(this, "originalEventId", void 0);
|
|
113
|
+
_define_property(this, "isRecurrenceInstance", void 0);
|
|
114
|
+
_define_property(this, "participants", void 0);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
_ts_decorate([
|
|
118
|
+
(0, _classtransformer.Expose)(),
|
|
119
|
+
(0, _swagger.ApiProperty)(),
|
|
120
|
+
_ts_metadata("design:type", String)
|
|
121
|
+
], CalendarEventResponseDto.prototype, "id", void 0);
|
|
122
|
+
_ts_decorate([
|
|
123
|
+
(0, _classtransformer.Expose)(),
|
|
124
|
+
(0, _swagger.ApiProperty)(),
|
|
125
|
+
_ts_metadata("design:type", String)
|
|
126
|
+
], CalendarEventResponseDto.prototype, "title", void 0);
|
|
127
|
+
_ts_decorate([
|
|
128
|
+
(0, _classtransformer.Expose)(),
|
|
129
|
+
(0, _swagger.ApiPropertyOptional)(),
|
|
130
|
+
_ts_metadata("design:type", Object)
|
|
131
|
+
], CalendarEventResponseDto.prototype, "description", void 0);
|
|
132
|
+
_ts_decorate([
|
|
133
|
+
(0, _classtransformer.Expose)(),
|
|
134
|
+
(0, _swagger.ApiPropertyOptional)(),
|
|
135
|
+
_ts_metadata("design:type", Object)
|
|
136
|
+
], CalendarEventResponseDto.prototype, "meetingLink", void 0);
|
|
137
|
+
_ts_decorate([
|
|
138
|
+
(0, _classtransformer.Expose)(),
|
|
139
|
+
(0, _swagger.ApiProperty)(),
|
|
140
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
141
|
+
], CalendarEventResponseDto.prototype, "startDateTime", void 0);
|
|
142
|
+
_ts_decorate([
|
|
143
|
+
(0, _classtransformer.Expose)(),
|
|
144
|
+
(0, _swagger.ApiProperty)(),
|
|
145
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
146
|
+
], CalendarEventResponseDto.prototype, "endDateTime", void 0);
|
|
147
|
+
_ts_decorate([
|
|
148
|
+
(0, _classtransformer.Expose)(),
|
|
149
|
+
(0, _swagger.ApiProperty)(),
|
|
150
|
+
_ts_metadata("design:type", Boolean)
|
|
151
|
+
], CalendarEventResponseDto.prototype, "isAllDay", void 0);
|
|
152
|
+
_ts_decorate([
|
|
153
|
+
(0, _classtransformer.Expose)(),
|
|
154
|
+
(0, _swagger.ApiProperty)(),
|
|
155
|
+
_ts_metadata("design:type", String)
|
|
156
|
+
], CalendarEventResponseDto.prototype, "recurrenceType", void 0);
|
|
157
|
+
_ts_decorate([
|
|
158
|
+
(0, _classtransformer.Expose)(),
|
|
159
|
+
(0, _swagger.ApiProperty)(),
|
|
160
|
+
_ts_metadata("design:type", String)
|
|
161
|
+
], CalendarEventResponseDto.prototype, "color", void 0);
|
|
162
|
+
_ts_decorate([
|
|
163
|
+
(0, _classtransformer.Expose)(),
|
|
164
|
+
(0, _swagger.ApiProperty)(),
|
|
165
|
+
_ts_metadata("design:type", Boolean)
|
|
166
|
+
], CalendarEventResponseDto.prototype, "isActive", void 0);
|
|
167
|
+
_ts_decorate([
|
|
168
|
+
(0, _classtransformer.Expose)(),
|
|
169
|
+
(0, _swagger.ApiPropertyOptional)(),
|
|
170
|
+
_ts_metadata("design:type", String)
|
|
171
|
+
], CalendarEventResponseDto.prototype, "originalEventId", void 0);
|
|
172
|
+
_ts_decorate([
|
|
173
|
+
(0, _classtransformer.Expose)(),
|
|
174
|
+
(0, _swagger.ApiPropertyOptional)(),
|
|
175
|
+
_ts_metadata("design:type", Boolean)
|
|
176
|
+
], CalendarEventResponseDto.prototype, "isRecurrenceInstance", void 0);
|
|
177
|
+
_ts_decorate([
|
|
178
|
+
(0, _classtransformer.Expose)(),
|
|
179
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
180
|
+
type: ()=>[
|
|
181
|
+
_eventparticipantdto.EventParticipantResponseDto
|
|
182
|
+
]
|
|
183
|
+
}),
|
|
184
|
+
(0, _classtransformer.Type)(()=>_eventparticipantdto.EventParticipantResponseDto),
|
|
185
|
+
_ts_metadata("design:type", Array)
|
|
186
|
+
], CalendarEventResponseDto.prototype, "participants", void 0);
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get BulkAddParticipantsDto () {
|
|
13
|
+
return BulkAddParticipantsDto;
|
|
14
|
+
},
|
|
15
|
+
get CreateEventParticipantDto () {
|
|
16
|
+
return CreateEventParticipantDto;
|
|
17
|
+
},
|
|
18
|
+
get EventParticipantResponseDto () {
|
|
19
|
+
return EventParticipantResponseDto;
|
|
20
|
+
},
|
|
21
|
+
get UpdateEventParticipantDto () {
|
|
22
|
+
return UpdateEventParticipantDto;
|
|
23
|
+
},
|
|
24
|
+
get UpdateParticipantStatusDto () {
|
|
25
|
+
return UpdateParticipantStatusDto;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _enums = require("@flusys/nestjs-shared/enums");
|
|
29
|
+
const _swagger = require("@nestjs/swagger");
|
|
30
|
+
const _classtransformer = require("class-transformer");
|
|
31
|
+
const _classvalidator = require("class-validator");
|
|
32
|
+
function _define_property(obj, key, value) {
|
|
33
|
+
if (key in obj) {
|
|
34
|
+
Object.defineProperty(obj, key, {
|
|
35
|
+
value: value,
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true
|
|
39
|
+
});
|
|
40
|
+
} else {
|
|
41
|
+
obj[key] = value;
|
|
42
|
+
}
|
|
43
|
+
return obj;
|
|
44
|
+
}
|
|
45
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
46
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
47
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
48
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
49
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
50
|
+
}
|
|
51
|
+
function _ts_metadata(k, v) {
|
|
52
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
53
|
+
}
|
|
54
|
+
let CreateEventParticipantDto = class CreateEventParticipantDto {
|
|
55
|
+
constructor(){
|
|
56
|
+
_define_property(this, "eventId", void 0);
|
|
57
|
+
_define_property(this, "userId", void 0);
|
|
58
|
+
_define_property(this, "status", void 0);
|
|
59
|
+
_define_property(this, "isOrganizer", void 0);
|
|
60
|
+
_define_property(this, "metadata", void 0);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
_ts_decorate([
|
|
64
|
+
(0, _swagger.ApiProperty)({
|
|
65
|
+
description: 'Event ID',
|
|
66
|
+
example: 'f2e9c8d0-7a2a-11eb-9439-0242ac130002'
|
|
67
|
+
}),
|
|
68
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
69
|
+
(0, _classvalidator.IsUUID)(),
|
|
70
|
+
_ts_metadata("design:type", String)
|
|
71
|
+
], CreateEventParticipantDto.prototype, "eventId", void 0);
|
|
72
|
+
_ts_decorate([
|
|
73
|
+
(0, _swagger.ApiProperty)({
|
|
74
|
+
description: 'User ID',
|
|
75
|
+
example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
|
|
76
|
+
}),
|
|
77
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
78
|
+
(0, _classvalidator.IsUUID)(),
|
|
79
|
+
_ts_metadata("design:type", String)
|
|
80
|
+
], CreateEventParticipantDto.prototype, "userId", void 0);
|
|
81
|
+
_ts_decorate([
|
|
82
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
83
|
+
description: 'Participation status',
|
|
84
|
+
enum: _enums.ParticipantStatus,
|
|
85
|
+
default: _enums.ParticipantStatus.PENDING
|
|
86
|
+
}),
|
|
87
|
+
(0, _classvalidator.IsOptional)(),
|
|
88
|
+
(0, _classvalidator.IsEnum)(_enums.ParticipantStatus),
|
|
89
|
+
_ts_metadata("design:type", typeof _enums.ParticipantStatus === "undefined" ? Object : _enums.ParticipantStatus)
|
|
90
|
+
], CreateEventParticipantDto.prototype, "status", void 0);
|
|
91
|
+
_ts_decorate([
|
|
92
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
93
|
+
description: 'Is the organizer of the event',
|
|
94
|
+
default: false
|
|
95
|
+
}),
|
|
96
|
+
(0, _classvalidator.IsOptional)(),
|
|
97
|
+
(0, _classvalidator.IsBoolean)(),
|
|
98
|
+
_ts_metadata("design:type", Boolean)
|
|
99
|
+
], CreateEventParticipantDto.prototype, "isOrganizer", void 0);
|
|
100
|
+
_ts_decorate([
|
|
101
|
+
(0, _swagger.ApiPropertyOptional)({
|
|
102
|
+
description: 'Additional metadata'
|
|
103
|
+
}),
|
|
104
|
+
(0, _classvalidator.IsOptional)(),
|
|
105
|
+
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
|
106
|
+
], CreateEventParticipantDto.prototype, "metadata", void 0);
|
|
107
|
+
let UpdateEventParticipantDto = class UpdateEventParticipantDto extends (0, _swagger.PartialType)(CreateEventParticipantDto) {
|
|
108
|
+
constructor(...args){
|
|
109
|
+
super(...args), _define_property(this, "id", void 0);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
_ts_decorate([
|
|
113
|
+
(0, _swagger.ApiProperty)({
|
|
114
|
+
description: 'Event Participant ID',
|
|
115
|
+
example: 'f2e9c8d0-7a2a-11eb-9439-0242ac130002'
|
|
116
|
+
}),
|
|
117
|
+
(0, _classvalidator.IsUUID)(),
|
|
118
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
119
|
+
_ts_metadata("design:type", String)
|
|
120
|
+
], UpdateEventParticipantDto.prototype, "id", void 0);
|
|
121
|
+
let EventParticipantResponseDto = class EventParticipantResponseDto {
|
|
122
|
+
constructor(){
|
|
123
|
+
_define_property(this, "id", void 0);
|
|
124
|
+
_define_property(this, "eventId", void 0);
|
|
125
|
+
_define_property(this, "userId", void 0);
|
|
126
|
+
_define_property(this, "status", void 0);
|
|
127
|
+
_define_property(this, "isOrganizer", void 0);
|
|
128
|
+
_define_property(this, "metadata", void 0);
|
|
129
|
+
_define_property(this, "createdAt", void 0);
|
|
130
|
+
_define_property(this, "updatedAt", void 0);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
_ts_decorate([
|
|
134
|
+
(0, _classtransformer.Expose)(),
|
|
135
|
+
(0, _swagger.ApiProperty)(),
|
|
136
|
+
_ts_metadata("design:type", String)
|
|
137
|
+
], EventParticipantResponseDto.prototype, "id", void 0);
|
|
138
|
+
_ts_decorate([
|
|
139
|
+
(0, _classtransformer.Expose)(),
|
|
140
|
+
(0, _swagger.ApiProperty)(),
|
|
141
|
+
_ts_metadata("design:type", String)
|
|
142
|
+
], EventParticipantResponseDto.prototype, "eventId", void 0);
|
|
143
|
+
_ts_decorate([
|
|
144
|
+
(0, _classtransformer.Expose)(),
|
|
145
|
+
(0, _swagger.ApiProperty)(),
|
|
146
|
+
_ts_metadata("design:type", String)
|
|
147
|
+
], EventParticipantResponseDto.prototype, "userId", void 0);
|
|
148
|
+
_ts_decorate([
|
|
149
|
+
(0, _classtransformer.Expose)(),
|
|
150
|
+
(0, _swagger.ApiProperty)({
|
|
151
|
+
enum: _enums.ParticipantStatus
|
|
152
|
+
}),
|
|
153
|
+
_ts_metadata("design:type", String)
|
|
154
|
+
], EventParticipantResponseDto.prototype, "status", void 0);
|
|
155
|
+
_ts_decorate([
|
|
156
|
+
(0, _classtransformer.Expose)(),
|
|
157
|
+
(0, _swagger.ApiProperty)(),
|
|
158
|
+
_ts_metadata("design:type", Boolean)
|
|
159
|
+
], EventParticipantResponseDto.prototype, "isOrganizer", void 0);
|
|
160
|
+
_ts_decorate([
|
|
161
|
+
(0, _classtransformer.Expose)(),
|
|
162
|
+
(0, _swagger.ApiPropertyOptional)(),
|
|
163
|
+
_ts_metadata("design:type", Object)
|
|
164
|
+
], EventParticipantResponseDto.prototype, "metadata", void 0);
|
|
165
|
+
_ts_decorate([
|
|
166
|
+
(0, _classtransformer.Expose)(),
|
|
167
|
+
(0, _swagger.ApiProperty)(),
|
|
168
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
169
|
+
], EventParticipantResponseDto.prototype, "createdAt", void 0);
|
|
170
|
+
_ts_decorate([
|
|
171
|
+
(0, _classtransformer.Expose)(),
|
|
172
|
+
(0, _swagger.ApiProperty)(),
|
|
173
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
174
|
+
], EventParticipantResponseDto.prototype, "updatedAt", void 0);
|
|
175
|
+
let UpdateParticipantStatusDto = class UpdateParticipantStatusDto {
|
|
176
|
+
constructor(){
|
|
177
|
+
_define_property(this, "id", void 0);
|
|
178
|
+
_define_property(this, "status", void 0);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
_ts_decorate([
|
|
182
|
+
(0, _swagger.ApiProperty)({
|
|
183
|
+
description: 'Event Participant ID',
|
|
184
|
+
example: 'f2e9c8d0-7a2a-11eb-9439-0242ac130002'
|
|
185
|
+
}),
|
|
186
|
+
(0, _classvalidator.IsUUID)(),
|
|
187
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
188
|
+
_ts_metadata("design:type", String)
|
|
189
|
+
], UpdateParticipantStatusDto.prototype, "id", void 0);
|
|
190
|
+
_ts_decorate([
|
|
191
|
+
(0, _swagger.ApiProperty)({
|
|
192
|
+
description: 'New participation status',
|
|
193
|
+
enum: _enums.ParticipantStatus
|
|
194
|
+
}),
|
|
195
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
196
|
+
(0, _classvalidator.IsEnum)(_enums.ParticipantStatus),
|
|
197
|
+
_ts_metadata("design:type", typeof _enums.ParticipantStatus === "undefined" ? Object : _enums.ParticipantStatus)
|
|
198
|
+
], UpdateParticipantStatusDto.prototype, "status", void 0);
|
|
199
|
+
let BulkAddParticipantsDto = class BulkAddParticipantsDto {
|
|
200
|
+
constructor(){
|
|
201
|
+
_define_property(this, "eventId", void 0);
|
|
202
|
+
_define_property(this, "userIds", void 0);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
_ts_decorate([
|
|
206
|
+
(0, _swagger.ApiProperty)({
|
|
207
|
+
description: 'Event ID',
|
|
208
|
+
example: 'f2e9c8d0-7a2a-11eb-9439-0242ac130002'
|
|
209
|
+
}),
|
|
210
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
211
|
+
(0, _classvalidator.IsUUID)(),
|
|
212
|
+
_ts_metadata("design:type", String)
|
|
213
|
+
], BulkAddParticipantsDto.prototype, "eventId", void 0);
|
|
214
|
+
_ts_decorate([
|
|
215
|
+
(0, _swagger.ApiProperty)({
|
|
216
|
+
description: 'User IDs to add as participants',
|
|
217
|
+
type: [
|
|
218
|
+
String
|
|
219
|
+
]
|
|
220
|
+
}),
|
|
221
|
+
(0, _classvalidator.IsNotEmpty)(),
|
|
222
|
+
(0, _classvalidator.IsUUID)('4', {
|
|
223
|
+
each: true
|
|
224
|
+
}),
|
|
225
|
+
_ts_metadata("design:type", Array)
|
|
226
|
+
], BulkAddParticipantsDto.prototype, "userIds", void 0);
|