Commit 8e2a6cb0 authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

Schedules api documentation

parent feec84cf
......@@ -11,9 +11,33 @@ use Source\UseCases\Schedules\ScheduleCreate\ScheduleCreateUseCase;
use Source\UseCases\Schedules\ScheduleUpdate\ScheduleUpdateUseCase;
use Source\UseCases\Schedules\SchedulesGet\APIPresenter as SchedulesGetApiPresenter;
/**
* @group Schedules Management
*
* This api deals with scheduling for doors and users.
*/
class SchedulesController extends ApiController
{
/**
* Create Schedule
*
* This endpoint adds a schedule into the system. Schedules have two types. A type of 0 means it is
* an open mode schedule and only effects doors for when they go into open mode. If type is 1, the schedule
* is a user access schedule and restricts access to doors from users in the attached group based upon the
* schedule. The schedule start times are defined by an iCal rset. See further reading here:
* https://tools.ietf.org/html/rfc5545
* Supported RSET rules are:
* RRULE, EXRULE, RDATE, EXDATE, and DTSTART
* See: https://github.com/rlanvin/php-rrule/wiki/RSet
*
*
* @authenticated
* @bodyParam duration integer required The duration in minutes that the event lasts for. Example: 120
* @bodyParam group_id integer required The group to apply the schedule for. Example: 8
* @bodyParam type integer required The type of schedule. Example: 0
* @bodyParam rset string required The RFC 5545 compliant string representing the set. Example: RRULE:FREQ=MINUTELY
* @bodyParam description string required The administrative description for the schedule. Example: Documentation
*
* @param \Source\UseCases\Schedules\ScheduleCreate\ScheduleCreateUseCase $scheduleCreate
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Validation\ValidationException
......@@ -42,6 +66,13 @@ class SchedulesController extends ApiController
}
/**
* Get Schedule
*
* Gets a schedule from the system.
*
* @authenticated
* @urlParam scheduleId required The id of the schedule to retrieve. Example: 1
*
* @param string $scheduleId
* @param \Source\UseCases\Schedules\ScheduleGet\ScheduleGetUseCase $scheduleGet
* @return \Illuminate\Http\JsonResponse
......@@ -60,6 +91,18 @@ class SchedulesController extends ApiController
}
/**
* Filter Schedules
*
* This endpoint searches/filters schedules in the system by start, end, type, or group_id. If no query is provided
* a paginated list of all schedules are returned.
*
* @authenticated
* @paginated
* @queryParam start Filters schedules active after this datetime. Example: 1900-06-04 19:23:55
* @queryParam end Filters schedules active before this datetime. Example: 2900-06-04
* @queryParam type The type to filter on. Example: 0
* @queryParam group_id The group id to filter on. Example: 7
*
* @param \Source\UseCases\Schedules\SchedulesGet\SchedulesGetUseCase $schedulesBetween
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Validation\ValidationException
......@@ -97,6 +140,19 @@ class SchedulesController extends ApiController
}
/**
* Update Schedule
*
* This endpoint updates a schedule. See the create schedule endpoint description for more information about
* the parameters.
*
* @authenticated
* @urlParam scheduleId required The schedule to update. Example: 1
* @bodyParam duration integer The duration in minutes that the event lasts for. Example: 120
* @bodyParam group_id integer The group to apply the schedule for. Example: 8
* @bodyParam type integer The type of schedule. Example: 0
* @bodyParam rset string The RFC 5545 compliant string representing the set. Example: RRULE:FREQ=MINUTELY
* @bodyParam description string The administrative description for the schedule. Example: Documentation
*
* @param string $scheduleId
* @param \Source\UseCases\Schedules\ScheduleUpdate\ScheduleUpdateUseCase $scheduleUpdate
* @return \Illuminate\Http\JsonResponse
......
......@@ -70,6 +70,8 @@ class UsersController extends ApiController
*
* This endpoint gets a specific user and returns information relating directly to the user.
*
* @authenticated
*
* @response 404 {"status":"error","code":404,"message":"Entity not found"}
*
* @param \Source\UseCases\Users\GetUser\GetUserUseCase $getUser
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment