VolunteerShift

A VolunteerShift represents a Volunteer's application to work a specific Shift. VolunteerShifts are accessed via /api/volunteershift.

Properties

See "Object Properties" in Introduction for basic shared properties.

Complete details in VolunteerShiftProperties.

Related Objects

See "Related Objects" in Introduction for how to use them.

badge

If the related Convention is set up to require volunteers to have a badge, this is the Badge this VolunteerShift belongs to. Otherwise this is optional.

convention

The Convention this VolunteerShift belongs to.

shift

The Shift this VolunteerShift belongs to. Combinations of volunteer_id and shift_id are unique in VolunteerShifts and cannot be duplicated. (A Volunteer can apply for a Shift only once.)

volunteer

The Volunteer this VolunteerShift belongs to.

Relationships

VolunteerShifts are not parents to any other object and so have no relationships.

Includes

See "Includes" in Introduction for how to use them.

shift_day

This will include the related Shift's ConventionDay in format:

 {
   "id": "xxx",
   "name": "Sunday",
   ...
 }

shift_room

This will include the Room, if any, associated to the related Shift's ShiftType, in format:

 {
   "id": "xxx",
   "name": "Fun Room",
   ...
 }

If the related ShiftType has no associated Room, shift_room will not be included (as opposed to being included, but empty { }).

supporting_badge_count

This will include the count of the volunteer's badges that can support this volunteershift. For Conventions that require volunteers to have a badge.

Services

The services used to fetch and manipulate VolunteerShifts.

Search VolunteerShifts

Searching across all conventions is not enabled. To search within a single convention's VolunteerShifts, see "Relationships" in Convention.

Create VolunteerShift

 POST /api/volunteershift
Required Params
session_id
convention_id
volunteer_id
shift_id

Returns the same as a normal read.

Read VolunteerShift

 GET /api/volunteershift/xxx

Returns:

 {
   "id" : "xxx",
   "status" : "unscheduled",
   "volunteer_id" : "xxx",
   "shift_id" : "xxx",
   ...
 }

Update VolunteerShift

There is no REST endpoint for general VolunteerShift update. See below for specific services to update a VolunteerShift status.

Delete VolunteerShift

 DELETE /api/volunteershift/xxx

You cannot delete a VolunteerShift with status "scheduled".

Returns:

 {
   "success" : 1
 }

Set status to "scheduled"

 PUT /api/volunteershift/xxx/status-schedule

Sets the volunteershift's status to "scheduled".

Makes an entry in the Shift's shift_log that you have put the volunteer on the schedule.

Set status to "declined"

 PUT /api/volunteershift/xxx/status-decline

Sets the volunteershift's status to "declined".

If the previous status was "scheduled", makes an entry in the related Shift's shift_log that you have removed the volunteer from the schedule.

Set status to "unscheduled"

 PUT /api/volunteershift/xxx/status-unschedule

Sets the volunteershift's status to "unscheduled".

If the previous status was "scheduled", makes an entry in the related Shift's shift_log that you have removed the volunteer from the schedule.

Get Supporting Badges

 GET /api/volunteershift/xxx/supporting-badges

Gets the volunteer's badges that support this volunteershift. This is useful when the Convention has been set to require volunteers to have a badge.

Returns:

 [
   {
     "id" : "xxx",
     "badge_number" : "xxx",
     "firstname" : "Joe",
     "lastname" : "User",
     ...
   },
   ...
 ]

Change Volunteershift Badge

 PUT /api/volunteershift/xxx/change-badge

Changes the badge used to support the volunteershift. This is for Conventions that have been set to require volunteers to have a badge.

Required Params
badge_id

The id of the badge to associate with this volunteershift.

Returns the same as a normal read.