Manage general employee time logs (clock in/out) in RepairShopr
I manage employee time logs for clock-in/clock-out tracking. These logs record when employees start and end work shifts, including lunch breaks and notes. I can list timelogs (with optional user filter), retrieve the last timelog for a user, and update timelog details (like adding notes or correcting times).
Use this when:
out_at)Required API base URL:
VITE_REPAIRSHOPR_SUBDOMAINVITE_REPAIRSHOPR_API_KEYPermissions: Users with "Timelogs - Manage" can see all users' timelogs; otherwise only own.
List Timelogs (GET /timelogs) Optional:
user_id (integer) - Filter by user ID (current user if omitted)Get Last Timelog (GET /timelogs/last) Optional:
user_id (integer) - Default is current user if not providedUpdate Timelog (PUT /timelogs)
This is a bit unusual: the endpoint is /timelogs (no ID in path), so it likely updates the most recent or open timelog for the current user, or you pass id in body? The docs show a PUT with no path ID. Let's infer you can update timelog by passing its ID in body or it updates the "last" or currently open one. The example body doesn't include id. For safety, assume it updates the most recent/active timelog for the authenticated user.
Body fields:
in_at (string, ISO 8601) - Clock-in timeout_at (string, ISO 8601) - Clock-out time (null to indicate still working)lunch (boolean) - Whether lunch break was takenin_note (string) - Note at clock-inout_note (string) - Note at clock-outExample calls:
// Clock in (create new timelog) - Actually perhaps via some other endpoint?
// The provided docs don't show a POST create; maybe UI uses different endpoint.
// Update timelog (clock out) - likely need to update the open one
await skill({ name: "repairshopr-timelog" }, {
out_at: "2024-01-15T17:00:00Z",
out_note: "End of day",
lunch: true
}, { method: 'PUT' })
// Get last timelog for user 5
const last = await skill({ name: "repairshopr-timelog" }, {},
{ user_id: 5, method: 'GET', endpoint: '/last' }
)
// List timelogs
const logs = await skill({ name: "repairshopr-timelog" }, {
user_id: 5
})
Response includes:
timelogs array with objects: id, in_at, out_at, user_id, in_note, out_note, lunch, manually_updatedlunch is a boolean indicating lunch break taken; don't confuse with lunch duration.in_at to set original clock-in; can't change after posting maybe.repairshopr-ticket-timer - Separate timer system specifically for ticketsrepairshopr-user - For user information to map user_id to names