openapi: 3.2.0 info: title: Operations Hub Dispatch.services API version: 0.1.1 description: '' servers: [] tags: - name: dispatch.services paths: /api/dispatch/v1/services: get: operationId: dispatch_api_services_list_services summary: List Services parameters: - in: query name: search schema: anyOf: - type: string - type: 'null' title: Search required: false - in: query name: code schema: anyOf: - type: string - type: 'null' title: Code required: false - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/DispatchService' title: Response type: array description: 'List all services. TODO: Services needs testing to be properly used.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/services/{service_id}: get: operationId: dispatch_api_services_get_service summary: Get Service parameters: - in: path name: service_id schema: title: Service Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/DispatchService' description: 'Retrieve a service. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/service-items: get: operationId: dispatch_api_services_list_service_items summary: List Service Items parameters: - in: query name: search schema: anyOf: - type: string - type: 'null' title: Search required: false - in: query name: service_id schema: anyOf: - type: integer - type: 'null' title: Service Id required: false - in: query name: is_optional schema: anyOf: - type: boolean - type: 'null' title: Is Optional required: false responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/ServiceItem' title: Response type: array description: 'List service items. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/service-items/{service_item_id}: get: operationId: dispatch_api_services_get_service_item summary: Get Service Item parameters: - in: path name: service_item_id schema: title: Service Item Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceItem' description: 'Retrieve a service item. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/services/{service_id}/service-items: get: operationId: dispatch_api_services_list_service_items_for_service summary: List Service Items For Service parameters: - in: path name: service_id schema: title: Service Id type: integer required: true - in: query name: search schema: anyOf: - type: string - type: 'null' title: Search required: false - in: query name: service_id schema: anyOf: - type: integer - type: 'null' title: Service Id required: false - in: query name: is_optional schema: anyOf: - type: boolean - type: 'null' title: Is Optional required: false responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/ServiceItem' title: Response type: array description: 'List service items for a service. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/services/{service_id}/service-items/{service_item_id}: get: operationId: dispatch_api_services_get_service_item_for_service summary: Get Service Item For Service parameters: - in: path name: service_id schema: title: Service Id type: integer required: true - in: path name: service_item_id schema: title: Service Item Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceItem' description: 'Retrieve a service item for a service. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/service-item-activities: get: operationId: dispatch_api_services_list_service_item_activities summary: List Service Item Activities parameters: - in: query name: service_item_id schema: anyOf: - type: integer - type: 'null' title: Service Item Id required: false - in: query name: service_code schema: anyOf: - type: string - type: 'null' title: Service Code required: false responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/ServiceItemActivity' title: Response type: array description: 'List service item activities. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/service-item-activities/{activity_id}: get: operationId: dispatch_api_services_get_service_item_activity summary: Get Service Item Activity parameters: - in: path name: activity_id schema: title: Activity Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceItemActivity' description: 'Retrieve a service item activity. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/services/{service_id}/service-items/{service_item_id}/activities: get: operationId: dispatch_api_services_list_service_item_activities_for_service summary: List Service Item Activities For Service parameters: - in: path name: service_id schema: title: Service Id type: integer required: true - in: path name: service_item_id schema: title: Service Item Id type: integer required: true - in: query name: service_item_id schema: anyOf: - type: integer - type: 'null' title: Service Item Id required: false - in: query name: service_code schema: anyOf: - type: string - type: 'null' title: Service Code required: false responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/ServiceItemActivity' title: Response type: array description: 'List service item activities for a service item. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/services/{service_id}/service-items/{service_item_id}/activities/{activity_id}: get: operationId: dispatch_api_services_get_service_item_activity_for_service summary: Get Service Item Activity For Service parameters: - in: path name: service_id schema: title: Service Id type: integer required: true - in: path name: service_item_id schema: title: Service Item Id type: integer required: true - in: path name: activity_id schema: title: Activity Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceItemActivity' description: 'Retrieve a service item activity for a service item. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/service-orders: get: operationId: dispatch_api_services_list_service_orders summary: List Service Orders parameters: - in: query name: search schema: anyOf: - type: string - type: 'null' title: Search required: false - in: query name: customer_id schema: anyOf: - type: integer - type: 'null' title: Customer Id required: false - in: query name: project_id schema: anyOf: - type: integer - type: 'null' title: Project Id required: false - in: query name: windpark_id schema: anyOf: - type: integer - type: 'null' title: Windpark Id required: false responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/ServiceOrderHeader' title: Response type: array description: 'List service orders. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: dispatch_api_services_create_service_order summary: Create Service Order parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceOrderHeader' description: 'Create a service order. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceOrderHeaderInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/service-orders/summary: get: operationId: dispatch_api_services_get_service_order_summary summary: Get Service Order Summary parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceOrderSummary' description: 'Summarize service orders. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/service-orders/{service_order_id}: get: operationId: dispatch_api_services_get_service_order summary: Get Service Order parameters: - in: path name: service_order_id schema: title: Service Order Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceOrderHeader' description: 'Retrieve a service order. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: dispatch_api_services_patch_service_order summary: Patch Service Order parameters: - in: path name: service_order_id schema: title: Service Order Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceOrderHeader' description: 'Partially update a service order. TODO: this is not yet fully implemented. Needs tests.' tags: - dispatch.services requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceOrderHeaderInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: dispatch_api_services_delete_service_order summary: Delete Service Order parameters: - in: path name: service_order_id schema: title: Service Order Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: 'Delete a service order. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/service-order-lines: get: operationId: dispatch_api_services_list_service_order_lines summary: List Service Order Lines parameters: - in: query name: search schema: anyOf: - type: string - type: 'null' title: Search required: false - in: query name: service_order_id schema: anyOf: - type: integer - type: 'null' title: Service Order Id required: false - in: query name: service_id schema: anyOf: - type: integer - type: 'null' title: Service Id required: false - in: query name: project_id schema: anyOf: - type: integer - type: 'null' title: Project Id required: false - in: query name: customer_id schema: anyOf: - type: integer - type: 'null' title: Customer Id required: false - in: query name: project_scope_item_id schema: anyOf: - type: integer - type: 'null' title: Project Scope Item Id required: false - in: query name: original_sol_id schema: anyOf: - type: integer - type: 'null' title: Original Sol Id required: false - in: query name: billable schema: anyOf: - type: boolean - type: 'null' title: Billable required: false - in: query name: paginate schema: default: true description: Enable pagination (false returns all results) title: Paginate type: boolean required: false description: Enable pagination (false returns all results) - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/ServiceOrderLine' title: Response type: array '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' description: List service order lines. tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: dispatch_api_services_create_service_order_line summary: Create Service Order Line parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceOrderLine' description: 'Create a service order line. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceOrderLineInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/service-order-lines/{line_id}: get: operationId: dispatch_api_services_get_service_order_line summary: Get Service Order Line parameters: - in: path name: line_id schema: title: Line Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceOrderLine' description: 'Retrieve a service order line. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] put: operationId: dispatch_api_services_update_service_order_line summary: Update Service Order Line parameters: - in: path name: line_id schema: title: Line Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceOrderLine' description: 'Update a service order line. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceOrderLineInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: dispatch_api_services_patch_service_order_line summary: Patch Service Order Line parameters: - in: path name: line_id schema: title: Line Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceOrderLine' description: 'Partially update a service order line. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceOrderLineInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: dispatch_api_services_delete_service_order_line summary: Delete Service Order Line parameters: - in: path name: line_id schema: title: Line Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: 'Delete a service order line. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.services security: - APIKeyAuth: [] - CookieAuth: [] components: schemas: ServiceOrderHeader: additionalProperties: false description: Dispatch service order header. properties: id: title: Id type: integer sales_order_id: anyOf: - type: integer - type: 'null' title: Sales Order Id project_id: title: Project Id type: integer project_name: anyOf: - type: string - type: 'null' title: Project Name customer_id: title: Customer Id type: integer windpark_id: anyOf: - type: integer - type: 'null' title: Windpark Id client_name: anyOf: - type: string - type: 'null' title: Client Name service_order_date: anyOf: - format: date type: string - type: 'null' title: Service Order Date service_order_number: anyOf: - type: string - type: 'null' title: Service Order Number service_order_type: anyOf: - type: string - type: 'null' title: Service Order Type project_manager_user_id: anyOf: - type: integer - type: 'null' title: Project Manager User Id status: anyOf: - type: string - type: 'null' title: Status required: - id - project_id - customer_id title: ServiceOrderHeader type: object ServiceItemActivityInstructionLink: additionalProperties: false description: Web link on a service-item-activity instruction. properties: id: title: Id type: integer url: title: Url type: string label: title: Label type: string sort_order: anyOf: - type: integer - type: 'null' title: Sort Order required: - id - url - label title: ServiceItemActivityInstructionLink type: object ServiceItem: additionalProperties: false description: Dispatch service item. properties: id: title: Id type: integer code: title: Code type: string component: anyOf: - type: integer - type: 'null' title: Component component_name: anyOf: - type: string - type: 'null' title: Component Name description: anyOf: - type: string - type: 'null' title: Description is_optional: anyOf: - type: boolean - type: 'null' title: Is Optional service: anyOf: - type: integer - type: 'null' title: Service sort_order: anyOf: - type: integer - type: 'null' title: Sort Order required: - id - code title: ServiceItem type: object ServiceItemActivityInstruction: additionalProperties: false description: One ordered procedure step on a service-item-activity. properties: id: title: Id type: integer title: title: Title type: string body: anyOf: - type: string - type: 'null' title: Body sort_order: anyOf: - type: integer - type: 'null' title: Sort Order attachments: default: [] items: $ref: '#/components/schemas/ServiceItemActivityAttachment' title: Attachments type: array links: default: [] items: $ref: '#/components/schemas/ServiceItemActivityInstructionLink' title: Links type: array required: - id - title title: ServiceItemActivityInstruction type: object ServiceOrderTypeCount: additionalProperties: false description: Count of service orders by type. properties: service_order_type: title: Service Order Type type: string count: title: Count type: integer required: - service_order_type - count title: ServiceOrderTypeCount type: object ServiceOrderLine: additionalProperties: false description: Dispatch service order line. properties: id: title: Id type: integer number: anyOf: - type: string - type: 'null' title: Number service_order: anyOf: - type: integer - type: 'null' title: Service Order service: anyOf: - type: integer - type: 'null' title: Service quantity: anyOf: - type: integer - type: 'null' title: Quantity turbine_id: anyOf: - type: integer - type: 'null' title: Turbine Id component_type_id: anyOf: - type: integer - type: 'null' title: Component Type Id turbine_component_id: anyOf: - type: integer - type: 'null' title: Turbine Component Id service_code: anyOf: - type: string - type: 'null' title: Service Code service_description: anyOf: - type: string - type: 'null' title: Service Description customer_id: anyOf: - type: integer - type: 'null' title: Customer Id project_id: anyOf: - type: integer - type: 'null' title: Project Id sales_order_line_id: anyOf: - type: integer - type: 'null' title: Sales Order Line Id project_scope_item_id: anyOf: - type: integer - type: 'null' title: Project Scope Item Id required_qualifications: anyOf: - type: object - items: {} type: array - type: 'null' title: Required Qualifications status: anyOf: - type: string - type: 'null' title: Status stage: anyOf: - type: string - type: 'null' title: Stage completed_by: anyOf: - type: integer - type: 'null' title: Completed By completed_date: anyOf: - type: string - type: 'null' title: Completed Date original_sol_id: anyOf: - type: integer - type: 'null' title: Original Sol Id billable: default: true title: Billable type: boolean required: - id title: ServiceOrderLine type: object ServiceOrderSummary: additionalProperties: false description: Service order summary response. properties: total: title: Total type: integer by_type: items: $ref: '#/components/schemas/ServiceOrderTypeCount' title: By Type type: array by_client: items: $ref: '#/components/schemas/ServiceOrderClientCount' title: By Client type: array required: - total - by_type - by_client title: ServiceOrderSummary type: object DispatchService: additionalProperties: false description: Dispatch service. properties: id: title: Id type: integer code: anyOf: - type: string - type: 'null' title: Code description: anyOf: - type: string - type: 'null' title: Description is_configured: title: Is Configured type: boolean required: - id - is_configured title: DispatchService type: object ServiceOrderLineInput: additionalProperties: false description: Payload for creating/updating service order lines. properties: number: anyOf: - type: string - type: 'null' title: Number service_order: anyOf: - type: integer - type: 'null' title: Service Order service: anyOf: - type: integer - type: 'null' title: Service quantity: anyOf: - type: integer - type: 'null' title: Quantity turbine_id: anyOf: - type: integer - type: 'null' title: Turbine Id component_type_id: anyOf: - type: integer - type: 'null' title: Component Type Id turbine_component_id: anyOf: - type: integer - type: 'null' title: Turbine Component Id service_code: anyOf: - type: string - type: 'null' title: Service Code service_description: anyOf: - type: string - type: 'null' title: Service Description customer_id: anyOf: - type: integer - type: 'null' title: Customer Id project_id: anyOf: - type: integer - type: 'null' title: Project Id sales_order_line_id: anyOf: - type: integer - type: 'null' title: Sales Order Line Id project_scope_item_id: anyOf: - type: integer - type: 'null' title: Project Scope Item Id required_qualifications: anyOf: - type: object - items: {} type: array - type: 'null' title: Required Qualifications status: anyOf: - type: string - type: 'null' title: Status stage: anyOf: - type: string - type: 'null' title: Stage original_sol_id: anyOf: - type: integer - type: 'null' title: Original Sol Id billable: anyOf: - type: boolean - type: 'null' title: Billable title: ServiceOrderLineInput type: object ServiceItemActivity: additionalProperties: false description: Dispatch service item activity. properties: id: title: Id type: integer service_item: anyOf: - type: integer - type: 'null' title: Service Item description: anyOf: - type: string - type: 'null' title: Description requires_robot_set: anyOf: - type: boolean - type: 'null' title: Requires Robot Set estimated_duration: anyOf: - type: integer - type: 'null' title: Estimated Duration sort_order: anyOf: - type: integer - type: 'null' title: Sort Order is_optional: anyOf: - type: boolean - type: 'null' title: Is Optional instructions: default: [] items: $ref: '#/components/schemas/ServiceItemActivityInstruction' title: Instructions type: array required: - id title: ServiceItemActivity type: object Error: additionalProperties: false description: Error response schema. properties: code: $ref: '#/components/schemas/ErrorCode' message: title: Message type: string required: - code - message title: Error type: object ServiceOrderClientCount: additionalProperties: false description: Count of service orders by client. properties: client_name: title: Client Name type: string count: title: Count type: integer required: - client_name - count title: ServiceOrderClientCount type: object ServiceOrderHeaderInput: additionalProperties: false description: Payload for creating/updating service order headers. properties: sales_order_id: anyOf: - type: integer - type: 'null' title: Sales Order Id project_id: anyOf: - type: integer - type: 'null' title: Project Id project_name: anyOf: - type: string - type: 'null' title: Project Name customer_id: anyOf: - type: integer - type: 'null' title: Customer Id windpark_id: anyOf: - type: integer - type: 'null' title: Windpark Id client_name: anyOf: - type: string - type: 'null' title: Client Name service_order_date: anyOf: - format: date type: string - type: 'null' title: Service Order Date service_order_number: anyOf: - type: string - type: 'null' title: Service Order Number service_order_type: anyOf: - type: string - type: 'null' title: Service Order Type project_manager_user_id: anyOf: - type: integer - type: 'null' title: Project Manager User Id status: anyOf: - type: string - type: 'null' title: Status title: ServiceOrderHeaderInput type: object ServiceItemActivityAttachment: additionalProperties: false description: 'File (image or video) attached to a service-item-activity instruction. Mirrors the GraphQL `ServiceItemActivityAttachment` type. `url` is an authenticated proxy URL through `/api/files/{id}/download` — the underlying GCS bucket stays private and the URL itself does not expire.' properties: id: title: Id type: integer caption: anyOf: - type: string - type: 'null' title: Caption sort_order: anyOf: - type: integer - type: 'null' title: Sort Order file_name: title: File Name type: string file_type: title: File Type type: string url: anyOf: - type: string - type: 'null' title: Url required: - id - file_name - file_type title: ServiceItemActivityAttachment type: object Success: additionalProperties: false description: 'Schema returned for successful operations. The `success` field is always ``true`` in this schema. Failed operations are represented by the :class:`Error` schema instead, so a ``false`` value does not occur in practice. The field is included for consistency across responses and to make the contract explicit for clients.' properties: success: default: true description: Always true for this schema. Errors are represented by a separate Error schema, so false is never returned. title: Success type: boolean title: Success type: object ErrorCode: description: Error codes for API errors. enum: - validation - server - auth - unknown - external - generic title: ErrorCode type: string securitySchemes: APIKeyAuth: type: http scheme: bearer CookieAuth: type: apiKey in: cookie name: opshub_prod_sessionid AuthBearer: type: http scheme: bearer