@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
package/docs/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EventParticipantResponseDto } from './event-participant.dto';
|
|
2
|
+
export declare class CalendarQueryDto {
|
|
3
|
+
startDate: Date;
|
|
4
|
+
endDate: Date;
|
|
5
|
+
includeParticipants?: boolean;
|
|
6
|
+
userId?: string;
|
|
7
|
+
activeOnly?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class CalendarEventResponseDto {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string | null;
|
|
13
|
+
meetingLink?: string | null;
|
|
14
|
+
startDateTime: Date;
|
|
15
|
+
endDateTime: Date;
|
|
16
|
+
isAllDay: boolean;
|
|
17
|
+
recurrenceType: string;
|
|
18
|
+
color: string;
|
|
19
|
+
isActive: boolean;
|
|
20
|
+
originalEventId?: string;
|
|
21
|
+
isRecurrenceInstance?: boolean;
|
|
22
|
+
participants?: EventParticipantResponseDto[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ParticipantStatus } from '@flusys/nestjs-shared/enums';
|
|
2
|
+
export declare class CreateEventParticipantDto {
|
|
3
|
+
eventId: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
status?: ParticipantStatus;
|
|
6
|
+
isOrganizer?: boolean;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
declare const UpdateEventParticipantDto_base: import("@nestjs/common").Type<Partial<CreateEventParticipantDto>>;
|
|
10
|
+
export declare class UpdateEventParticipantDto extends UpdateEventParticipantDto_base {
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class EventParticipantResponseDto {
|
|
14
|
+
id: string;
|
|
15
|
+
eventId: string;
|
|
16
|
+
userId: string;
|
|
17
|
+
status: string;
|
|
18
|
+
isOrganizer: boolean;
|
|
19
|
+
metadata?: Record<string, unknown> | null;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
}
|
|
23
|
+
export declare class UpdateParticipantStatusDto {
|
|
24
|
+
id: string;
|
|
25
|
+
status: ParticipantStatus;
|
|
26
|
+
}
|
|
27
|
+
export declare class BulkAddParticipantsDto {
|
|
28
|
+
eventId: string;
|
|
29
|
+
userIds: string[];
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RecurrenceType } from '@flusys/nestjs-shared/enums';
|
|
2
|
+
export declare class CreateEventDto {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
meetingLink?: string;
|
|
6
|
+
startDateTime: Date;
|
|
7
|
+
endDateTime: Date;
|
|
8
|
+
isAllDay?: boolean;
|
|
9
|
+
recurrenceType?: RecurrenceType;
|
|
10
|
+
recurrenceEndDate?: Date;
|
|
11
|
+
color?: string;
|
|
12
|
+
isActive?: boolean;
|
|
13
|
+
metadata?: Record<string, unknown>;
|
|
14
|
+
participantIds?: string[];
|
|
15
|
+
}
|
|
16
|
+
declare const UpdateEventDto_base: import("@nestjs/common").Type<Partial<CreateEventDto>>;
|
|
17
|
+
export declare class UpdateEventDto extends UpdateEventDto_base {
|
|
18
|
+
id: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class EventResponseDto {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description?: string | null;
|
|
24
|
+
meetingLink?: string | null;
|
|
25
|
+
startDateTime: Date;
|
|
26
|
+
endDateTime: Date;
|
|
27
|
+
isAllDay: boolean;
|
|
28
|
+
recurrenceType: string;
|
|
29
|
+
recurrenceEndDate?: Date | null;
|
|
30
|
+
color: string;
|
|
31
|
+
isActive: boolean;
|
|
32
|
+
metadata?: Record<string, unknown> | null;
|
|
33
|
+
companyId?: string | null;
|
|
34
|
+
createdAt: Date;
|
|
35
|
+
updatedAt: Date;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
package/dtos/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Identity } from '@flusys/nestjs-shared/entities';
|
|
2
|
+
export declare class Event extends Identity {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string | null;
|
|
5
|
+
meetingLink: string | null;
|
|
6
|
+
startDateTime: Date;
|
|
7
|
+
endDateTime: Date;
|
|
8
|
+
isAllDay: boolean;
|
|
9
|
+
recurrenceType: string;
|
|
10
|
+
recurrenceEndDate: Date | null;
|
|
11
|
+
color: string;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
metadata: Record<string, unknown> | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './event.entity';
|
|
2
|
+
export * from './event-participant.entity';
|
|
3
|
+
export * from './event-with-company.entity';
|
|
4
|
+
import { Event } from './event.entity';
|
|
5
|
+
import { EventParticipant } from './event-participant.entity';
|
|
6
|
+
import { EventWithCompany } from './event-with-company.entity';
|
|
7
|
+
export declare const EventManagerCoreEntities: (typeof Event | typeof EventParticipant)[];
|
|
8
|
+
export declare const EventManagerCompanyEntities: (typeof EventParticipant | typeof EventWithCompany)[];
|
|
9
|
+
export declare function getEventManagerEntitiesByConfig(enableCompanyFeature: boolean): any[];
|
|
10
|
+
export { Event as EventBase } from './event.entity';
|
|
11
|
+
export { EventParticipant as EventParticipantBase } from './event-participant.entity';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
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;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
}
|
|
20
|
+
function _ts_metadata(k, v) {
|
|
21
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
22
|
+
}
|
|
23
|
+
function _ts_param(paramIndex, decorator) {
|
|
24
|
+
return function(target, key) {
|
|
25
|
+
decorator(target, key, paramIndex);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
import { Injectable, Inject } from '@nestjs/common';
|
|
29
|
+
import { EventManagerHelperService } from '../services/event-manager-helper.service';
|
|
30
|
+
export class EventManagerAdapter {
|
|
31
|
+
async createEvent(options) {
|
|
32
|
+
return this.eventManagerHelper.createEvent(options);
|
|
33
|
+
}
|
|
34
|
+
async addParticipants(eventId, userIds, companyId) {
|
|
35
|
+
await this.eventManagerHelper.addParticipants(eventId, userIds, companyId);
|
|
36
|
+
}
|
|
37
|
+
async removeParticipant(eventId, userId) {
|
|
38
|
+
await this.eventManagerHelper.removeParticipant(eventId, userId);
|
|
39
|
+
}
|
|
40
|
+
async updateParticipantStatus(participantId, status) {
|
|
41
|
+
await this.eventManagerHelper.updateParticipantStatus(participantId, status);
|
|
42
|
+
}
|
|
43
|
+
async getEventsForUser(userId, startDate, endDate, companyId) {
|
|
44
|
+
return this.eventManagerHelper.getEventsForUser(userId, startDate, endDate, companyId);
|
|
45
|
+
}
|
|
46
|
+
async getEventById(eventId) {
|
|
47
|
+
return this.eventManagerHelper.getEventById(eventId);
|
|
48
|
+
}
|
|
49
|
+
constructor(eventManagerHelper){
|
|
50
|
+
_define_property(this, "eventManagerHelper", void 0);
|
|
51
|
+
this.eventManagerHelper = eventManagerHelper;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
EventManagerAdapter = _ts_decorate([
|
|
55
|
+
Injectable(),
|
|
56
|
+
_ts_param(0, Inject(EventManagerHelperService)),
|
|
57
|
+
_ts_metadata("design:type", Function),
|
|
58
|
+
_ts_metadata("design:paramtypes", [
|
|
59
|
+
typeof EventManagerHelperService === "undefined" ? Object : EventManagerHelperService
|
|
60
|
+
])
|
|
61
|
+
], EventManagerAdapter);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './event-manager.adapter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './event-manager.constants';
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
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;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
}
|
|
20
|
+
function _ts_metadata(k, v) {
|
|
21
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
22
|
+
}
|
|
23
|
+
function _ts_param(paramIndex, decorator) {
|
|
24
|
+
return function(target, key) {
|
|
25
|
+
decorator(target, key, paramIndex);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
import { Body, Controller, HttpCode, HttpStatus, Inject, Post, UseGuards } from '@nestjs/common';
|
|
29
|
+
import { ApiBearerAuth, ApiBody, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
|
30
|
+
import { createApiController } from '@flusys/nestjs-shared/classes';
|
|
31
|
+
import { CurrentUser, RequirePermission } from '@flusys/nestjs-shared/decorators';
|
|
32
|
+
import { ListResponseDto, MessageResponseDto, SingleResponseDto } from '@flusys/nestjs-shared/dtos';
|
|
33
|
+
import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
|
|
34
|
+
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
35
|
+
import { CreateEventParticipantDto, EventParticipantResponseDto, UpdateParticipantStatusDto, UpdateEventParticipantDto } from '../dtos';
|
|
36
|
+
import { EVENT_PARTICIPANT_PERMISSIONS } from '../docs';
|
|
37
|
+
import { EventParticipantService } from '../services/event-participant.service';
|
|
38
|
+
export class EventParticipantController extends createApiController(CreateEventParticipantDto, UpdateEventParticipantDto, EventParticipantResponseDto, {
|
|
39
|
+
security: {
|
|
40
|
+
insert: {
|
|
41
|
+
level: 'permission',
|
|
42
|
+
permissions: [
|
|
43
|
+
EVENT_PARTICIPANT_PERMISSIONS.CREATE
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
insertMany: {
|
|
47
|
+
level: 'permission',
|
|
48
|
+
permissions: [
|
|
49
|
+
EVENT_PARTICIPANT_PERMISSIONS.CREATE
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
getById: {
|
|
53
|
+
level: 'permission',
|
|
54
|
+
permissions: [
|
|
55
|
+
EVENT_PARTICIPANT_PERMISSIONS.READ
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
getAll: {
|
|
59
|
+
level: 'permission',
|
|
60
|
+
permissions: [
|
|
61
|
+
EVENT_PARTICIPANT_PERMISSIONS.READ
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
update: {
|
|
65
|
+
level: 'permission',
|
|
66
|
+
permissions: [
|
|
67
|
+
EVENT_PARTICIPANT_PERMISSIONS.UPDATE
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
updateMany: {
|
|
71
|
+
level: 'permission',
|
|
72
|
+
permissions: [
|
|
73
|
+
EVENT_PARTICIPANT_PERMISSIONS.UPDATE
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
delete: {
|
|
77
|
+
level: 'permission',
|
|
78
|
+
permissions: [
|
|
79
|
+
EVENT_PARTICIPANT_PERMISSIONS.DELETE
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}) {
|
|
84
|
+
async updateStatus(dto, user) {
|
|
85
|
+
const participant = await this.participantService.updateStatus(dto, user);
|
|
86
|
+
return {
|
|
87
|
+
success: true,
|
|
88
|
+
message: 'Participant status updated successfully',
|
|
89
|
+
data: participant
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
async getByEvent(body, user) {
|
|
93
|
+
const participants = await this.participantService.getParticipantsByEvent(body.eventId, user);
|
|
94
|
+
return this.buildListResponse(participants, 'Participants retrieved successfully');
|
|
95
|
+
}
|
|
96
|
+
async getByUser(body, user) {
|
|
97
|
+
const participants = await this.participantService.getParticipantsByUser(body.userId, user);
|
|
98
|
+
return this.buildListResponse(participants, 'Participations retrieved successfully');
|
|
99
|
+
}
|
|
100
|
+
async removeParticipant(body, user) {
|
|
101
|
+
await this.participantService.removeParticipant(body.eventId, body.userId, user);
|
|
102
|
+
return {
|
|
103
|
+
success: true,
|
|
104
|
+
message: 'Participant removed successfully'
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
buildListResponse(data, message) {
|
|
108
|
+
return {
|
|
109
|
+
success: true,
|
|
110
|
+
message,
|
|
111
|
+
data: data,
|
|
112
|
+
meta: {
|
|
113
|
+
total: data.length,
|
|
114
|
+
page: 0,
|
|
115
|
+
pageSize: data.length,
|
|
116
|
+
count: data.length
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
constructor(participantService){
|
|
121
|
+
super(participantService), _define_property(this, "participantService", void 0), this.participantService = participantService;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
_ts_decorate([
|
|
125
|
+
Post('update-status'),
|
|
126
|
+
UseGuards(JwtAuthGuard),
|
|
127
|
+
ApiBearerAuth(),
|
|
128
|
+
HttpCode(HttpStatus.OK),
|
|
129
|
+
RequirePermission(EVENT_PARTICIPANT_PERMISSIONS.UPDATE),
|
|
130
|
+
ApiOperation({
|
|
131
|
+
summary: 'Update participant status (accept/decline/tentative)'
|
|
132
|
+
}),
|
|
133
|
+
ApiBody({
|
|
134
|
+
type: UpdateParticipantStatusDto
|
|
135
|
+
}),
|
|
136
|
+
ApiResponse({
|
|
137
|
+
status: 200,
|
|
138
|
+
description: 'Status updated successfully',
|
|
139
|
+
type: SingleResponseDto
|
|
140
|
+
}),
|
|
141
|
+
_ts_param(0, Body()),
|
|
142
|
+
_ts_param(1, CurrentUser()),
|
|
143
|
+
_ts_metadata("design:type", Function),
|
|
144
|
+
_ts_metadata("design:paramtypes", [
|
|
145
|
+
typeof UpdateParticipantStatusDto === "undefined" ? Object : UpdateParticipantStatusDto,
|
|
146
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
147
|
+
]),
|
|
148
|
+
_ts_metadata("design:returntype", Promise)
|
|
149
|
+
], EventParticipantController.prototype, "updateStatus", null);
|
|
150
|
+
_ts_decorate([
|
|
151
|
+
Post('get-by-event'),
|
|
152
|
+
UseGuards(JwtAuthGuard),
|
|
153
|
+
ApiBearerAuth(),
|
|
154
|
+
HttpCode(HttpStatus.OK),
|
|
155
|
+
RequirePermission(EVENT_PARTICIPANT_PERMISSIONS.READ),
|
|
156
|
+
ApiOperation({
|
|
157
|
+
summary: 'Get all participants for an event'
|
|
158
|
+
}),
|
|
159
|
+
ApiBody({
|
|
160
|
+
schema: {
|
|
161
|
+
properties: {
|
|
162
|
+
eventId: {
|
|
163
|
+
type: 'string',
|
|
164
|
+
format: 'uuid'
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}),
|
|
169
|
+
ApiResponse({
|
|
170
|
+
status: 200,
|
|
171
|
+
description: 'Participants retrieved successfully',
|
|
172
|
+
type: ListResponseDto
|
|
173
|
+
}),
|
|
174
|
+
_ts_param(0, Body()),
|
|
175
|
+
_ts_param(1, CurrentUser()),
|
|
176
|
+
_ts_metadata("design:type", Function),
|
|
177
|
+
_ts_metadata("design:paramtypes", [
|
|
178
|
+
Object,
|
|
179
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
180
|
+
]),
|
|
181
|
+
_ts_metadata("design:returntype", Promise)
|
|
182
|
+
], EventParticipantController.prototype, "getByEvent", null);
|
|
183
|
+
_ts_decorate([
|
|
184
|
+
Post('get-by-user'),
|
|
185
|
+
UseGuards(JwtAuthGuard),
|
|
186
|
+
ApiBearerAuth(),
|
|
187
|
+
HttpCode(HttpStatus.OK),
|
|
188
|
+
RequirePermission(EVENT_PARTICIPANT_PERMISSIONS.READ),
|
|
189
|
+
ApiOperation({
|
|
190
|
+
summary: 'Get all event participations for a user'
|
|
191
|
+
}),
|
|
192
|
+
ApiBody({
|
|
193
|
+
schema: {
|
|
194
|
+
properties: {
|
|
195
|
+
userId: {
|
|
196
|
+
type: 'string',
|
|
197
|
+
format: 'uuid'
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}),
|
|
202
|
+
ApiResponse({
|
|
203
|
+
status: 200,
|
|
204
|
+
description: 'Participations retrieved successfully',
|
|
205
|
+
type: ListResponseDto
|
|
206
|
+
}),
|
|
207
|
+
_ts_param(0, Body()),
|
|
208
|
+
_ts_param(1, CurrentUser()),
|
|
209
|
+
_ts_metadata("design:type", Function),
|
|
210
|
+
_ts_metadata("design:paramtypes", [
|
|
211
|
+
Object,
|
|
212
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
213
|
+
]),
|
|
214
|
+
_ts_metadata("design:returntype", Promise)
|
|
215
|
+
], EventParticipantController.prototype, "getByUser", null);
|
|
216
|
+
_ts_decorate([
|
|
217
|
+
Post('remove'),
|
|
218
|
+
UseGuards(JwtAuthGuard),
|
|
219
|
+
ApiBearerAuth(),
|
|
220
|
+
HttpCode(HttpStatus.OK),
|
|
221
|
+
RequirePermission(EVENT_PARTICIPANT_PERMISSIONS.DELETE),
|
|
222
|
+
ApiOperation({
|
|
223
|
+
summary: 'Remove a participant from an event'
|
|
224
|
+
}),
|
|
225
|
+
ApiBody({
|
|
226
|
+
schema: {
|
|
227
|
+
properties: {
|
|
228
|
+
eventId: {
|
|
229
|
+
type: 'string',
|
|
230
|
+
format: 'uuid'
|
|
231
|
+
},
|
|
232
|
+
userId: {
|
|
233
|
+
type: 'string',
|
|
234
|
+
format: 'uuid'
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}),
|
|
239
|
+
ApiResponse({
|
|
240
|
+
status: 200,
|
|
241
|
+
description: 'Participant removed successfully',
|
|
242
|
+
type: MessageResponseDto
|
|
243
|
+
}),
|
|
244
|
+
_ts_param(0, Body()),
|
|
245
|
+
_ts_param(1, CurrentUser()),
|
|
246
|
+
_ts_metadata("design:type", Function),
|
|
247
|
+
_ts_metadata("design:paramtypes", [
|
|
248
|
+
Object,
|
|
249
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
250
|
+
]),
|
|
251
|
+
_ts_metadata("design:returntype", Promise)
|
|
252
|
+
], EventParticipantController.prototype, "removeParticipant", null);
|
|
253
|
+
EventParticipantController = _ts_decorate([
|
|
254
|
+
ApiTags('Event Participants'),
|
|
255
|
+
Controller('event-manager/participant'),
|
|
256
|
+
_ts_param(0, Inject(EventParticipantService)),
|
|
257
|
+
_ts_metadata("design:type", Function),
|
|
258
|
+
_ts_metadata("design:paramtypes", [
|
|
259
|
+
typeof EventParticipantService === "undefined" ? Object : EventParticipantService
|
|
260
|
+
])
|
|
261
|
+
], EventParticipantController);
|