Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation to several schedule endpoints #836

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions CharlieBackend.Api/Controllers/SchedulesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@ public SchedulesController(IScheduleService scheduleService)
/// <remarks>
/// 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;
/// dates: 1-31;
/// Range
/// range: stardDate and finishDate in DateTime type;
/// </remarks>
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty space

///
/// <response code="200">Successful add of schedule</response>
/// <response code="HTTP: 400, API: 0">Can not create schedule due to wrong request data</response>
/// <response code="HTTP: 404, API: 3">Can not create schedule due to missing request data</response>
Expand All @@ -55,6 +64,17 @@ public async Task<ActionResult<EventOccurrenceDTO>> PostSchedule([FromBody] Crea
/// <summary>
/// Get schedule by id
/// </summary>
/// <remarks>
/// 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
/// </remarks>
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty space

/// <response code="200">Successful return of schedule</response>
/// <response code="HTTP: 404, API: 3">No such event occurence</response>
[SwaggerResponse(200, type: typeof(EventOccurrenceDTO))]
Expand All @@ -70,6 +90,15 @@ public async Task<ActionResult<EventOccurrenceDTO>> GetEventOccurenceById(long i
/// <summary>
/// Get detailed schedule by id
/// </summary>
/// <remarks>
/// 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;
/// </remarks>
/// <response code="200">Successful return of detailed schedule</response>
/// <response code="HTTP: 404, API: 3">No such event occurence</response>
[SwaggerResponse(200, type: typeof(DetailedEventOccurrenceDTO))]
Expand All @@ -85,6 +114,15 @@ public async Task<ActionResult<DetailedEventOccurrenceDTO>> GetDetailedEventOccu
/// <summary>
/// Returns the list of events depending on the filtering rules set
/// </summary>
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty space

/// <remarks>
/// Return result by filtering data with parameters
/// </remarks>
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty space

/// <param name="request">
/// Mention courseID, mentorID, groupID, themeID, etc to filter all schedules
/// All params are optional
/// </param>
/// <response code="200">Successful return event list</response>
[SwaggerResponse(200, type: typeof(IList<ScheduledEventDTO>))]
[Authorize(Roles = "Secretary, Admin, Mentor, Student")]
Expand All @@ -102,6 +140,7 @@ public async Task<ActionResult<IList<ScheduledEventDTO>>> GetEventsFiltered(Sche
/// <remarks>
/// 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
/// </remarks>
/// <response code="200">Successful update of schedule</response>
/// <response code="HTTP: 404, API: 3">Error, update data is missing</response>
Expand All @@ -127,6 +166,13 @@ public async Task<ActionResult<IList<ScheduledEventDTO>>> 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;
/// </remarks>
/// <response code="200">Successful update of schedule</response>
/// <response code="HTTP: 404, API: 3">Error, update data is missing</response>
Expand All @@ -148,6 +194,11 @@ public async Task<ActionResult<EventOccurrenceDTO>> UpdateEventOccurrenceById(lo
/// <summary>
/// Gets all schedules
/// </summary>
/// <remarks>
/// 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;
/// </remarks>
/// <response code="200">Successfully returned a collection of event occurrences.</response>
[SwaggerResponse(200, type: typeof(IList<EventOccurrenceDTO>))]
[Authorize(Roles = "Secretary, Admin")]
Expand All @@ -167,6 +218,7 @@ public async Task<ActionResult<IList<EventOccurrenceDTO>>> 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;
/// </remarks>
/// <response code = "200" > Successful delete of schedule</response>
/// <response code="HTTP: 404, API: 3">Error, given schedule not found</response>
Expand Down