From 40171d9719a58891509c66f1ef18b33381008d03 Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Tue, 24 Mar 2026 10:37:43 +0100 Subject: [PATCH] Update Workfeed OpenAPI spec with detailed schema definitions for employees, shifts, and departments. Add pagination support and replace generic response references with specific ones. --- openapi.yaml | 216 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 208 insertions(+), 8 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 87276c99..ce0b5680 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7724,7 +7724,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WorkfeedObjectResponse' + $ref: '#/components/schemas/WorkfeedEmployeeListResponse' /modules/workfeed/employees/{id}: get: @@ -7746,7 +7746,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WorkfeedObjectResponse' + $ref: '#/components/schemas/WorkfeedEmployeeSingleResponse' /modules/workfeed/shifts: get: @@ -7805,7 +7805,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WorkfeedObjectResponse' + $ref: '#/components/schemas/WorkfeedShiftListResponse' /modules/workfeed/shifts/{id}: get: @@ -7827,7 +7827,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WorkfeedObjectResponse' + $ref: '#/components/schemas/WorkfeedShiftSingleResponse' /modules/workfeed/departments: get: @@ -7862,7 +7862,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WorkfeedObjectResponse' + $ref: '#/components/schemas/WorkfeedDepartmentListResponse' /departments/weather: get: @@ -10439,14 +10439,214 @@ components: additionalProperties: true required: [data] - WorkfeedObjectResponse: + WorkfeedPagination: + type: object + description: Cursor-based pagination metadata returned by Workfeed list endpoints + properties: + cursor: + type: string + nullable: true + description: Cursor used for the current page + example: eyJpZCI6IjEyMyJ9 + nextCursor: + type: string + nullable: true + description: Cursor token for the next page + example: eyJpZCI6IjEyNCJ9 + previousCursor: + type: string + nullable: true + description: Cursor token for the previous page (if provided) + limit: + type: integer + nullable: true + minimum: 1 + example: 50 + total: + type: integer + nullable: true + minimum: 0 + example: 184 + additionalProperties: true + + WorkfeedAddress: + type: object + properties: + line1: { type: string, nullable: true, example: "Main Street 1" } + line2: { type: string, nullable: true, example: "2nd floor" } + postalCode: { type: string, nullable: true, example: "2100" } + city: { type: string, nullable: true, example: "Copenhagen" } + region: { type: string, nullable: true, example: "Hovedstaden" } + country: { type: string, nullable: true, example: "DK" } + additionalProperties: true + + WorkfeedDepartment: + type: object + properties: + id: { type: string, example: "dep_01J5P2B0BC9Q2X7H8Y7JQ1M2N3" } + externalId: { type: string, nullable: true, example: "truckwash_north" } + name: { type: string, example: "North Facility" } + timezone: { type: string, nullable: true, example: "Europe/Copenhagen" } + active: { type: boolean, nullable: true, example: true } + address: + $ref: '#/components/schemas/WorkfeedAddress' + createdAt: { type: string, format: date-time, nullable: true, example: "2026-03-10T08:15:00Z" } + updatedAt: { type: string, format: date-time, nullable: true, example: "2026-03-22T14:05:31Z" } + additionalProperties: true + + WorkfeedEmployee: + type: object + properties: + id: { type: string, example: "emp_01J5P2F2A0CQKBBX4P8M3Y7R5P" } + externalId: { type: string, nullable: true, example: "tw_10042" } + firstName: { type: string, nullable: true, example: "Anne" } + lastName: { type: string, nullable: true, example: "Nielsen" } + fullName: { type: string, nullable: true, example: "Anne Nielsen" } + email: { type: string, nullable: true, example: "anne.nielsen@example.com" } + phone: { type: string, nullable: true, example: "+4540123456" } + jobTitle: { type: string, nullable: true, example: "Shift Lead" } + active: { type: boolean, nullable: true, example: true } + departmentId: { type: string, nullable: true, example: "dep_01J5P2B0BC9Q2X7H8Y7JQ1M2N3" } + departmentName: { type: string, nullable: true, example: "North Facility" } + department: + $ref: '#/components/schemas/WorkfeedDepartment' + hourlyRate: { type: number, format: float, nullable: true, example: 185.5 } + currency: { type: string, nullable: true, example: "DKK" } + startDate: { type: string, format: date, nullable: true, example: "2025-09-01" } + endDate: { type: string, format: date, nullable: true } + createdAt: { type: string, format: date-time, nullable: true, example: "2026-03-10T08:15:00Z" } + updatedAt: { type: string, format: date-time, nullable: true, example: "2026-03-22T14:05:31Z" } + additionalProperties: true + + WorkfeedShift: + type: object + properties: + id: { type: string, example: "shf_01J5P3X9D35R9C6BDZ1S0R4V6Q" } + title: { type: string, nullable: true, example: "Morning Shift" } + status: { type: string, nullable: true, example: "published" } + employeeId: { type: string, nullable: true, example: "emp_01J5P2F2A0CQKBBX4P8M3Y7R5P" } + employeeName: { type: string, nullable: true, example: "Anne Nielsen" } + departmentId: { type: string, nullable: true, example: "dep_01J5P2B0BC9Q2X7H8Y7JQ1M2N3" } + departmentName: { type: string, nullable: true, example: "North Facility" } + startAt: { type: string, format: date-time, nullable: true, example: "2026-03-24T06:00:00Z" } + endAt: { type: string, format: date-time, nullable: true, example: "2026-03-24T14:00:00Z" } + breakMinutes: { type: integer, nullable: true, minimum: 0, example: 30 } + durationMinutes: { type: integer, nullable: true, minimum: 0, example: 450 } + published: { type: boolean, nullable: true, example: true } + notes: { type: string, nullable: true, example: "Covering lane A and B" } + createdAt: { type: string, format: date-time, nullable: true, example: "2026-03-20T12:00:00Z" } + updatedAt: { type: string, format: date-time, nullable: true, example: "2026-03-23T11:42:19Z" } + additionalProperties: true + + WorkfeedEmployeeListData: + type: object + description: Employee list payload from Workfeed. Supports both normalized and provider-native collection keys. + properties: + items: + type: array + items: + $ref: '#/components/schemas/WorkfeedEmployee' + results: + type: array + items: + $ref: '#/components/schemas/WorkfeedEmployee' + pagination: + $ref: '#/components/schemas/WorkfeedPagination' + cursor: + type: string + nullable: true + nextCursor: + type: string + nullable: true + additionalProperties: true + + WorkfeedShiftListData: + type: object + description: Shift list payload from Workfeed. Supports both normalized and provider-native collection keys. + properties: + items: + type: array + items: + $ref: '#/components/schemas/WorkfeedShift' + results: + type: array + items: + $ref: '#/components/schemas/WorkfeedShift' + pagination: + $ref: '#/components/schemas/WorkfeedPagination' + cursor: + type: string + nullable: true + nextCursor: + type: string + nullable: true + additionalProperties: true + + WorkfeedDepartmentListData: + type: object + description: Department list payload from Workfeed. Supports both normalized and provider-native collection keys. + properties: + items: + type: array + items: + $ref: '#/components/schemas/WorkfeedDepartment' + results: + type: array + items: + $ref: '#/components/schemas/WorkfeedDepartment' + pagination: + $ref: '#/components/schemas/WorkfeedPagination' + cursor: + type: string + nullable: true + nextCursor: + type: string + nullable: true + additionalProperties: true + + WorkfeedEmployeeListResponse: allOf: - $ref: '#/components/schemas/ModuleConfigEnvelopeBase' - type: object properties: data: - type: object - additionalProperties: true + $ref: '#/components/schemas/WorkfeedEmployeeListData' + required: [data] + + WorkfeedEmployeeSingleResponse: + allOf: + - $ref: '#/components/schemas/ModuleConfigEnvelopeBase' + - type: object + properties: + data: + $ref: '#/components/schemas/WorkfeedEmployee' + required: [data] + + WorkfeedShiftListResponse: + allOf: + - $ref: '#/components/schemas/ModuleConfigEnvelopeBase' + - type: object + properties: + data: + $ref: '#/components/schemas/WorkfeedShiftListData' + required: [data] + + WorkfeedShiftSingleResponse: + allOf: + - $ref: '#/components/schemas/ModuleConfigEnvelopeBase' + - type: object + properties: + data: + $ref: '#/components/schemas/WorkfeedShift' + required: [data] + + WorkfeedDepartmentListResponse: + allOf: + - $ref: '#/components/schemas/ModuleConfigEnvelopeBase' + - type: object + properties: + data: + $ref: '#/components/schemas/WorkfeedDepartmentListData' required: [data] DepartmentWeatherTimelineResponse: