diff --git a/dtos/MeetingDetailResponse.js b/dtos/MeetingDetailResponse.js new file mode 100644 index 0000000000000000000000000000000000000000..6670fe49a85573d4654b2e13c5b31a28572fbac0 --- /dev/null +++ b/dtos/MeetingDetailResponse.js @@ -0,0 +1,20 @@ +class MeetingDetailResponse { + constructor(meeting) { + this.id = meeting.id; + this.title = meeting.title; + this.description = meeting.description; + this.startTime = meeting.start_time; + this.endTime = meeting.end_time; + this.location = meeting.location; + this.deadline = meeting.deadline; + this.type = meeting.type; + this.creatorName = meeting.creator ? meeting.creator.name : 'Unknown'; + this.participants = meeting.participants.map(participant => ({ + userId: participant.user_id, + name: participant.participantUser ? participant.participantUser.name : 'Unknown', + email: participant.participantUser ? participant.participantUser.email : 'Unknown' + })); + } +} + +module.exports = MeetingDetailResponse; \ No newline at end of file diff --git a/dtos/MeetingResponse.js b/dtos/MeetingResponse.js new file mode 100644 index 0000000000000000000000000000000000000000..8ee8b833c23b8ff6fb70d200f4384965230f57b5 --- /dev/null +++ b/dtos/MeetingResponse.js @@ -0,0 +1,19 @@ +// dtos/MeetingResponse.js + +class MeetingResponse { + constructor(meeting, isParticipant, isScheduleConflict, creatorName) { + this.id = meeting.id; + this.title = meeting.title; + this.description = meeting.description; + this.startTime = meeting.start_time; + this.endTime = meeting.end_time; + this.location = meeting.location; + this.deadline = meeting.deadline; + this.type = meeting.type; + this.creatorName = creatorName; + this.isParticipant = isParticipant; + this.isScheduleConflict = isScheduleConflict; + } +} + +module.exports = MeetingResponse; \ No newline at end of file