Antylogic
DemoApp login

399 operational guides

Docs sections
DocsAttendance
Device

View Attendance Shifts

Load a selected staff member's attendance shift records from the Attendance screen so Antylogic can determine whether that person has an open shift before Entry or Exit actions. In the GB demo, this is shown for Olivia Hart at Harbor Soho.

In this article

This guide documents the shift lookup behind the Attendance screen. It is an operational state check for the selected staff member, not a separate visible shift-history table.

The implemented listing reads `calendar_events` where `kind` is `staff_shift` and returns `StaffShift[]`. Attendance corrections use a different screen and should stay documented as a separate flow.

Before you start

  • Harbor Demo Group and the Harbor Soho location are active in the app context.
  • For manager use, the selected staff member belongs to Harbor Soho. The GB demo example uses Olivia Hart.
  • The operator can access the Attendance screen. In `LocationAttendancePage`, the manager lookup is enabled by `staff-shifts:notify`; the backend also accepts `staff-shifts:view`.
  • For self-service use, the selected `staffId` must belong to the authenticated user's own staff association.

Instructions

  1. 1.

    Open Attendance

    Open Attendance for Harbor Soho. Before a staff member is selected, this is the starting surface for choosing whose attendance state to check.

  2. 2.

    Select Staff

    Select Olivia Hart, or open `attendance?staff=${STAFF_ID}` directly. The staff member must belong to the active location; an empty staff id, another location's staff member, or a staff member without a location is treated as not found.

  3. 3.

    Load Shift State

    After staff selection, the app loads shifts automatically. Manager lookup uses `GET /api/app/{orgId}/{locationId}/staff/{staffId}/shifts`; self-service lookup uses `GET /api/app/me/staff/{staffId}/shifts`.

  4. 4.

    Confirm Current State

    Use the resulting Attendance state to confirm whether the selected person already has an open shift. The app orders loaded shifts newest first and treats the first shift without `exit_at` as the open shift.

Validations and limits

  • `buildBackendPath` requires both `ctx.orgId` and `ctx.locationId` for the manager route.
  • `useStaffShifts` only runs when `orgId`, `locationId`, `staffId`, and the enabled flag are present; `useMyStaffShifts` requires `staffId`.
  • `ListStaffShifts` trims `staffID` and returns not found for an empty id, a missing staff record, a wrong location, or a staff record without `LocationID`.
  • Only `calendar_events` with `kind` set to `staff_shift` and a valid `StartsAt` value become `StaffShift` records.
  • The backend returns `StaffShift[]` sorted by `entry_at` ascending; the Attendance screen sorts newest first before deriving `openShift`.
  • If no matching shift events exist, the valid result is an empty list and no open shift is detected.
  • This listing does not support date filters, pagination, status filters, open-shift filters, or range parameters.
  • This action is read-only; it does not create, update, delete, clock in, clock out, or resolve corrections.

Expected result

The Attendance screen has the selected staff member's shift state loaded and can decide whether Entry or Exit should be available without presenting this action as a standalone shift-history table.

Related articles