Time Off Requests Overview

A time off request

Attributes:

  • id (int) - A unique identifier
  • role_id (int) - the ID of the role that the user belongs to
  • user_id (int) - the ID of the user
  • role_to_user_id (int) - Maps the relationship between a user and a role - don't worry about this
  • start (Iso8601 datetime) - Determines when the time off request starts, in UTC
  • stop (Iso8601 datetime) - Determines when the time off request ends, in UTC
  • state (string) - The current state of the time off request. See below for details on each state.
  • minutes_paid (int) - The amount minutes that will be paid for this time off request.

States:

  • null - When a worker has requested time off, it starts in the null state. Time off requests in the null state require action from a manager.
  • approved_paid - Time off has been approved and a worker will be paid an amount designated by the minutes_paid field, which must be greater than 0.
  • approved_unpaid - Time off has been approved, but a worker will not be paid for it. minutes_paid must be 0.
  • sick - This is a special type of time off that is independent of minutes_paid because rules will differ between different organizations.

Notes:

  • All time off requests span for exactly one calendar day and start at midnight in the location's timezone.
  • A user can only have one time off request record for a calendar day
  • The start and end times are stored in UTC in the Staffjoy database, and all queries to search the database need datetime values to be in UTC as well.
  • minutes_paid must be greater than 0 if the state is approved_paid; it must be 0 if the state is approved_unpaid