From 7b5187e3db86214da720aa788cd4a07e71a2ff71 Mon Sep 17 00:00:00 2001 From: Soctarian Date: Mon, 4 Apr 2022 02:20:23 +0300 Subject: [PATCH 1/2] add documentation to several schedule endpoints --- .../Controllers/SchedulesController.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CharlieBackend.Api/Controllers/SchedulesController.cs b/CharlieBackend.Api/Controllers/SchedulesController.cs index deb1f0577..eb190f7b5 100644 --- a/CharlieBackend.Api/Controllers/SchedulesController.cs +++ b/CharlieBackend.Api/Controllers/SchedulesController.cs @@ -40,6 +40,17 @@ public SchedulesController(IScheduleService scheduleService) /// Creates new EventOccurence instance and related ScheduledEvents /// Information on input format could be found here: https://docs.microsoft.com/en-us/graph/outlook-schedule-recurring-events /// + /// + /// + /// Pattern + /// type: 0 - daily, 1 - weekly, 2 - absolute monthly, 3 - relative monthly, + /// days of week: 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday + /// month index: 0 - Undefined, 1 - First, 2 - Second, 3 - Third, 4 - Fourth, 5 - Last + /// Range + /// range: stardDate and finishDate in DateTime type. + /// + /// + /// /// Successful add of schedule /// Can not create schedule due to wrong request data /// Can not create schedule due to missing request data @@ -85,6 +96,15 @@ public async Task> GetDetailedEventOccu /// /// Returns the list of events depending on the filtering rules set /// + /// + /// + /// Return result by filtering data with parameters + /// + /// + /// + /// Mention courseID, mentorID, groupID, themeID, etc to filter all schedules + /// All params are optional + /// /// Successful return event list [SwaggerResponse(200, type: typeof(IList))] [Authorize(Roles = "Secretary, Admin, Mentor, Student")] @@ -102,6 +122,7 @@ public async Task>> GetEventsFiltered(Sche /// /// Event date could not changed via this method. /// Event start and Finish could only be used to change event start and finish time. + /// Choose range of events in "filter" block and change in request /// /// Successful update of schedule /// Error, update data is missing From 343be6cd0d7c775c4f954fba407778706c6483f3 Mon Sep 17 00:00:00 2001 From: Soctarian Date: Wed, 6 Apr 2022 10:12:42 +0300 Subject: [PATCH 2/2] update documentation for endpoints in SchedulesController --- .../Controllers/SchedulesController.cs | 47 +++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/CharlieBackend.Api/Controllers/SchedulesController.cs b/CharlieBackend.Api/Controllers/SchedulesController.cs index eb190f7b5..f6cf596e5 100644 --- a/CharlieBackend.Api/Controllers/SchedulesController.cs +++ b/CharlieBackend.Api/Controllers/SchedulesController.cs @@ -39,16 +39,14 @@ public SchedulesController(IScheduleService scheduleService) /// /// Creates new EventOccurence instance and related ScheduledEvents /// Information on input format could be found here: https://docs.microsoft.com/en-us/graph/outlook-schedule-recurring-events - /// - /// - /// /// Pattern - /// type: 0 - daily, 1 - weekly, 2 - absolute monthly, 3 - relative monthly, - /// days of week: 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday - /// month index: 0 - Undefined, 1 - First, 2 - Second, 3 - Third, 4 - Fourth, 5 - Last + /// type: 0 - daily, 1 - weekly, 2 - absolute monthly, 3 - relative monthly; + /// days of week: 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday; + /// month index: 0 - Undefined, 1 - First, 2 - Second, 3 - Third, 4 - Fourth, 5 - Last; + /// dates: 1-31; /// Range - /// range: stardDate and finishDate in DateTime type. - /// + /// range: stardDate and finishDate in DateTime type; + /// /// /// /// Successful add of schedule @@ -66,6 +64,17 @@ public async Task> PostSchedule([FromBody] Crea /// /// Get schedule by id /// + /// + /// Schedules + /// id: eventOccurrenceID; + /// studentGroupID: student group id to wich is schedule attached to; + /// pattern(type): 0 - daily, 1 - weekly, 2 - absolute monthly, 3 - relative monthly; + /// Events - events wich are contained in schedules. + /// id: EventID + /// studentGroupID: student group id to wich is event occurrences attached to; + /// themID, mentorID: them and mentor ids + /// + /// /// Successful return of schedule /// No such event occurence [SwaggerResponse(200, type: typeof(EventOccurrenceDTO))] @@ -81,6 +90,15 @@ public async Task> GetEventOccurenceById(long i /// /// Get detailed schedule by id /// + /// + /// Pattern + /// type: 0 - daily, 1 - weekly, 2 - absolute monthly, 3 - relative monthly; + /// days of week: 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday; + /// month index: 0 - Undefined, 1 - First, 2 - Second, 3 - Third, 4 - Fourth, 5 - Last; + /// dates: 1-31; + /// Range + /// range: stardDate and finishDate in DateTime type; + /// /// Successful return of detailed schedule /// No such event occurence [SwaggerResponse(200, type: typeof(DetailedEventOccurrenceDTO))] @@ -148,6 +166,13 @@ public async Task>> UpdateEventRange([From /// Old instance of event occurrence is replaced with the new one (id is the same). /// Scheduled events are recreated accordingly. /// Any events with lessons attached are not removed + /// Pattern + /// type: 0 - daily, 1 - weekly, 2 - absolute monthly, 3 - relative monthly; + /// days of week: 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday; + /// month index: 0 - Undefined, 1 - First, 2 - Second, 3 - Third, 4 - Fourth, 5 - Last; + /// dates: 1-31; + /// Range + /// range: stardDate and finishDate in DateTime type; /// /// Successful update of schedule /// Error, update data is missing @@ -169,6 +194,11 @@ public async Task> UpdateEventOccurrenceById(lo /// /// Gets all schedules /// + /// + /// id: eventOccurrenceID; + /// studentGroupID: student group id to wich is event occurrences attached to; + /// pattern(type): 0 - daily, 1 - weekly, 2 - absolute monthly, 3 - relative monthly; + /// /// Successfully returned a collection of event occurrences. [SwaggerResponse(200, type: typeof(IList))] [Authorize(Roles = "Secretary, Admin")] @@ -188,6 +218,7 @@ public async Task>> GetAllEventOccurrence /// If no events are left, event occurrence is deleted completely /// Start and finish dates input is optional. Leave blanc to remove all related events /// Events with lessons attached are not deleted + /// id: eventOccurrenceID; /// /// Successful delete of schedule /// Error, given schedule not found