openapi: '3.0.3'
info:
title: Backbone API
version: '1.0.0'
description: |
Auto-generated by backbone-cli.
This API provides 11 standard CRUD endpoints for each model.
servers:
- url: /
description: Development server
tags:
- name: MaintenanceRequests
description: MaintenanceRequest management endpoints
- name: MaintenanceSchedules
description: MaintenanceSchedule management endpoints
- name: MaintenanceStages
description: MaintenanceStage management endpoints
- name: MaintenanceVisits
description: MaintenanceVisit management endpoints
- name: MaintenanceVisitParts
description: MaintenanceVisitPart management endpoints
paths:
/api/v1/maintenance/maintenance_requests:
get:
tags:
- MaintenanceRequests
summary: List MaintenanceRequests
description: Get a paginated list of MaintenanceRequests with optional filtering and sorting
operationId: listMaintenanceRequests
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
- $ref: '#/components/parameters/SortByParam'
- $ref: '#/components/parameters/SortOrderParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequestList'
'401':
$ref: '#/components/responses/Unauthorized'
post:
tags:
- MaintenanceRequests
summary: Create MaintenanceRequest
description: Create a new MaintenanceRequest
operationId: createMaintenanceRequest
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMaintenanceRequestRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequest'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
/api/v1/maintenance/maintenance_requests/{id}:
parameters:
- $ref: '#/components/parameters/IdParam'
get:
tags:
- MaintenanceRequests
summary: Get MaintenanceRequest by ID
operationId: getMaintenanceRequest
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequest'
'404':
$ref: '#/components/responses/NotFound'
put:
tags:
- MaintenanceRequests
summary: Update MaintenanceRequest (full)
operationId: updateMaintenanceRequest
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceRequestRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequest'
'404':
$ref: '#/components/responses/NotFound'
patch:
tags:
- MaintenanceRequests
summary: Update MaintenanceRequest (partial)
operationId: patchMaintenanceRequest
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatchMaintenanceRequestRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequest'
'404':
$ref: '#/components/responses/NotFound'
delete:
tags:
- MaintenanceRequests
summary: Delete MaintenanceRequest (soft)
operationId: deleteMaintenanceRequest
responses:
'204':
description: Deleted
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_requests/bulk:
post:
tags:
- MaintenanceRequests
summary: Bulk create MaintenanceRequests
operationId: bulkCreateMaintenanceRequests
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CreateMaintenanceRequestRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/MaintenanceRequest'
put:
tags:
- MaintenanceRequests
summary: Bulk update MaintenanceRequests (full, atomic)
operationId: bulkUpdateMaintenanceRequests
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
allOf:
- type: object
required: [id]
properties:
id:
type: string
- $ref: '#/components/schemas/UpdateMaintenanceRequestRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequestBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
patch:
tags:
- MaintenanceRequests
summary: Bulk partial-update MaintenanceRequests (atomic)
operationId: bulkPatchMaintenanceRequests
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- type: object
required: [ids, patch]
properties:
ids:
type: array
items: { type: string }
patch:
type: object
additionalProperties: true
- type: object
required: [items]
properties:
items:
type: array
items:
type: object
required: [id, patch]
properties:
id: { type: string }
patch: { type: object, additionalProperties: true }
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequestBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_requests/upsert:
post:
tags:
- MaintenanceRequests
summary: Upsert MaintenanceRequest
operationId: upsertMaintenanceRequest
parameters:
- name: key_field
in: query
schema:
type: string
- name: key_value
in: query
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceRequestRequest'
responses:
'200':
description: Upserted
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequest'
/api/v1/maintenance/maintenance_requests/trash:
get:
tags:
- MaintenanceRequests
summary: List deleted MaintenanceRequests
operationId: listDeletedMaintenanceRequests
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequestList'
/api/v1/maintenance/maintenance_requests/{id}/restore:
parameters:
- $ref: '#/components/parameters/IdParam'
post:
tags:
- MaintenanceRequests
summary: Restore deleted MaintenanceRequest
operationId: restoreMaintenanceRequest
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequest'
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_requests/empty:
delete:
tags:
- MaintenanceRequests
summary: Empty trash for MaintenanceRequests
operationId: emptyTrashMaintenanceRequests
responses:
'200':
description: Trash emptied
content:
application/json:
schema:
type: object
properties:
deleted_count:
type: integer
/api/v1/maintenance/maintenance_requests/delete/bulk:
post:
tags:
- MaintenanceRequests
summary: Bulk soft-delete MaintenanceRequests by ids (atomic)
operationId: bulkDeleteMaintenanceRequests
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Soft-deleted
content:
application/json:
schema:
type: object
properties:
soft_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_requests/restore/bulk:
post:
tags:
- MaintenanceRequests
summary: Bulk restore MaintenanceRequests by ids (atomic)
operationId: bulkRestoreMaintenanceRequests
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceRequestBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_requests/restore/all:
post:
tags:
- MaintenanceRequests
summary: Restore all soft-deleted MaintenanceRequests
operationId: restoreAllMaintenanceRequests
responses:
'200':
description: Restored
content:
application/json:
schema:
type: object
properties:
restored: { type: integer }
/api/v1/maintenance/maintenance_requests/trash/bulk:
delete:
tags:
- MaintenanceRequests
summary: Bulk permanently-delete MaintenanceRequests from trash by ids (atomic)
operationId: bulkPermanentDeleteMaintenanceRequests
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Permanently deleted
content:
application/json:
schema:
type: object
properties:
permanently_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_schedules:
get:
tags:
- MaintenanceSchedules
summary: List MaintenanceSchedules
description: Get a paginated list of MaintenanceSchedules with optional filtering and sorting
operationId: listMaintenanceSchedules
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
- $ref: '#/components/parameters/SortByParam'
- $ref: '#/components/parameters/SortOrderParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceScheduleList'
'401':
$ref: '#/components/responses/Unauthorized'
post:
tags:
- MaintenanceSchedules
summary: Create MaintenanceSchedule
description: Create a new MaintenanceSchedule
operationId: createMaintenanceSchedule
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMaintenanceScheduleRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceSchedule'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
/api/v1/maintenance/maintenance_schedules/{id}:
parameters:
- $ref: '#/components/parameters/IdParam'
get:
tags:
- MaintenanceSchedules
summary: Get MaintenanceSchedule by ID
operationId: getMaintenanceSchedule
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceSchedule'
'404':
$ref: '#/components/responses/NotFound'
put:
tags:
- MaintenanceSchedules
summary: Update MaintenanceSchedule (full)
operationId: updateMaintenanceSchedule
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceScheduleRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceSchedule'
'404':
$ref: '#/components/responses/NotFound'
patch:
tags:
- MaintenanceSchedules
summary: Update MaintenanceSchedule (partial)
operationId: patchMaintenanceSchedule
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatchMaintenanceScheduleRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceSchedule'
'404':
$ref: '#/components/responses/NotFound'
delete:
tags:
- MaintenanceSchedules
summary: Delete MaintenanceSchedule (soft)
operationId: deleteMaintenanceSchedule
responses:
'204':
description: Deleted
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_schedules/bulk:
post:
tags:
- MaintenanceSchedules
summary: Bulk create MaintenanceSchedules
operationId: bulkCreateMaintenanceSchedules
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CreateMaintenanceScheduleRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/MaintenanceSchedule'
put:
tags:
- MaintenanceSchedules
summary: Bulk update MaintenanceSchedules (full, atomic)
operationId: bulkUpdateMaintenanceSchedules
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
allOf:
- type: object
required: [id]
properties:
id:
type: string
- $ref: '#/components/schemas/UpdateMaintenanceScheduleRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceScheduleBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
patch:
tags:
- MaintenanceSchedules
summary: Bulk partial-update MaintenanceSchedules (atomic)
operationId: bulkPatchMaintenanceSchedules
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- type: object
required: [ids, patch]
properties:
ids:
type: array
items: { type: string }
patch:
type: object
additionalProperties: true
- type: object
required: [items]
properties:
items:
type: array
items:
type: object
required: [id, patch]
properties:
id: { type: string }
patch: { type: object, additionalProperties: true }
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceScheduleBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_schedules/upsert:
post:
tags:
- MaintenanceSchedules
summary: Upsert MaintenanceSchedule
operationId: upsertMaintenanceSchedule
parameters:
- name: key_field
in: query
schema:
type: string
- name: key_value
in: query
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceScheduleRequest'
responses:
'200':
description: Upserted
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceSchedule'
/api/v1/maintenance/maintenance_schedules/trash:
get:
tags:
- MaintenanceSchedules
summary: List deleted MaintenanceSchedules
operationId: listDeletedMaintenanceSchedules
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceScheduleList'
/api/v1/maintenance/maintenance_schedules/{id}/restore:
parameters:
- $ref: '#/components/parameters/IdParam'
post:
tags:
- MaintenanceSchedules
summary: Restore deleted MaintenanceSchedule
operationId: restoreMaintenanceSchedule
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceSchedule'
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_schedules/empty:
delete:
tags:
- MaintenanceSchedules
summary: Empty trash for MaintenanceSchedules
operationId: emptyTrashMaintenanceSchedules
responses:
'200':
description: Trash emptied
content:
application/json:
schema:
type: object
properties:
deleted_count:
type: integer
/api/v1/maintenance/maintenance_schedules/delete/bulk:
post:
tags:
- MaintenanceSchedules
summary: Bulk soft-delete MaintenanceSchedules by ids (atomic)
operationId: bulkDeleteMaintenanceSchedules
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Soft-deleted
content:
application/json:
schema:
type: object
properties:
soft_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_schedules/restore/bulk:
post:
tags:
- MaintenanceSchedules
summary: Bulk restore MaintenanceSchedules by ids (atomic)
operationId: bulkRestoreMaintenanceSchedules
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceScheduleBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_schedules/restore/all:
post:
tags:
- MaintenanceSchedules
summary: Restore all soft-deleted MaintenanceSchedules
operationId: restoreAllMaintenanceSchedules
responses:
'200':
description: Restored
content:
application/json:
schema:
type: object
properties:
restored: { type: integer }
/api/v1/maintenance/maintenance_schedules/trash/bulk:
delete:
tags:
- MaintenanceSchedules
summary: Bulk permanently-delete MaintenanceSchedules from trash by ids (atomic)
operationId: bulkPermanentDeleteMaintenanceSchedules
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Permanently deleted
content:
application/json:
schema:
type: object
properties:
permanently_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_stages:
get:
tags:
- MaintenanceStages
summary: List MaintenanceStages
description: Get a paginated list of MaintenanceStages with optional filtering and sorting
operationId: listMaintenanceStages
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
- $ref: '#/components/parameters/SortByParam'
- $ref: '#/components/parameters/SortOrderParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStageList'
'401':
$ref: '#/components/responses/Unauthorized'
post:
tags:
- MaintenanceStages
summary: Create MaintenanceStage
description: Create a new MaintenanceStage
operationId: createMaintenanceStage
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMaintenanceStageRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStage'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
/api/v1/maintenance/maintenance_stages/{id}:
parameters:
- $ref: '#/components/parameters/IdParam'
get:
tags:
- MaintenanceStages
summary: Get MaintenanceStage by ID
operationId: getMaintenanceStage
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStage'
'404':
$ref: '#/components/responses/NotFound'
put:
tags:
- MaintenanceStages
summary: Update MaintenanceStage (full)
operationId: updateMaintenanceStage
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceStageRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStage'
'404':
$ref: '#/components/responses/NotFound'
patch:
tags:
- MaintenanceStages
summary: Update MaintenanceStage (partial)
operationId: patchMaintenanceStage
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatchMaintenanceStageRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStage'
'404':
$ref: '#/components/responses/NotFound'
delete:
tags:
- MaintenanceStages
summary: Delete MaintenanceStage (soft)
operationId: deleteMaintenanceStage
responses:
'204':
description: Deleted
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_stages/bulk:
post:
tags:
- MaintenanceStages
summary: Bulk create MaintenanceStages
operationId: bulkCreateMaintenanceStages
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CreateMaintenanceStageRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/MaintenanceStage'
put:
tags:
- MaintenanceStages
summary: Bulk update MaintenanceStages (full, atomic)
operationId: bulkUpdateMaintenanceStages
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
allOf:
- type: object
required: [id]
properties:
id:
type: string
- $ref: '#/components/schemas/UpdateMaintenanceStageRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStageBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
patch:
tags:
- MaintenanceStages
summary: Bulk partial-update MaintenanceStages (atomic)
operationId: bulkPatchMaintenanceStages
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- type: object
required: [ids, patch]
properties:
ids:
type: array
items: { type: string }
patch:
type: object
additionalProperties: true
- type: object
required: [items]
properties:
items:
type: array
items:
type: object
required: [id, patch]
properties:
id: { type: string }
patch: { type: object, additionalProperties: true }
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStageBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_stages/upsert:
post:
tags:
- MaintenanceStages
summary: Upsert MaintenanceStage
operationId: upsertMaintenanceStage
parameters:
- name: key_field
in: query
schema:
type: string
- name: key_value
in: query
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceStageRequest'
responses:
'200':
description: Upserted
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStage'
/api/v1/maintenance/maintenance_stages/trash:
get:
tags:
- MaintenanceStages
summary: List deleted MaintenanceStages
operationId: listDeletedMaintenanceStages
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStageList'
/api/v1/maintenance/maintenance_stages/{id}/restore:
parameters:
- $ref: '#/components/parameters/IdParam'
post:
tags:
- MaintenanceStages
summary: Restore deleted MaintenanceStage
operationId: restoreMaintenanceStage
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStage'
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_stages/empty:
delete:
tags:
- MaintenanceStages
summary: Empty trash for MaintenanceStages
operationId: emptyTrashMaintenanceStages
responses:
'200':
description: Trash emptied
content:
application/json:
schema:
type: object
properties:
deleted_count:
type: integer
/api/v1/maintenance/maintenance_stages/delete/bulk:
post:
tags:
- MaintenanceStages
summary: Bulk soft-delete MaintenanceStages by ids (atomic)
operationId: bulkDeleteMaintenanceStages
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Soft-deleted
content:
application/json:
schema:
type: object
properties:
soft_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_stages/restore/bulk:
post:
tags:
- MaintenanceStages
summary: Bulk restore MaintenanceStages by ids (atomic)
operationId: bulkRestoreMaintenanceStages
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceStageBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_stages/restore/all:
post:
tags:
- MaintenanceStages
summary: Restore all soft-deleted MaintenanceStages
operationId: restoreAllMaintenanceStages
responses:
'200':
description: Restored
content:
application/json:
schema:
type: object
properties:
restored: { type: integer }
/api/v1/maintenance/maintenance_stages/trash/bulk:
delete:
tags:
- MaintenanceStages
summary: Bulk permanently-delete MaintenanceStages from trash by ids (atomic)
operationId: bulkPermanentDeleteMaintenanceStages
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Permanently deleted
content:
application/json:
schema:
type: object
properties:
permanently_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_visits:
get:
tags:
- MaintenanceVisits
summary: List MaintenanceVisits
description: Get a paginated list of MaintenanceVisits with optional filtering and sorting
operationId: listMaintenanceVisits
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
- $ref: '#/components/parameters/SortByParam'
- $ref: '#/components/parameters/SortOrderParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitList'
'401':
$ref: '#/components/responses/Unauthorized'
post:
tags:
- MaintenanceVisits
summary: Create MaintenanceVisit
description: Create a new MaintenanceVisit
operationId: createMaintenanceVisit
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMaintenanceVisitRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisit'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
/api/v1/maintenance/maintenance_visits/{id}:
parameters:
- $ref: '#/components/parameters/IdParam'
get:
tags:
- MaintenanceVisits
summary: Get MaintenanceVisit by ID
operationId: getMaintenanceVisit
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisit'
'404':
$ref: '#/components/responses/NotFound'
put:
tags:
- MaintenanceVisits
summary: Update MaintenanceVisit (full)
operationId: updateMaintenanceVisit
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceVisitRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisit'
'404':
$ref: '#/components/responses/NotFound'
patch:
tags:
- MaintenanceVisits
summary: Update MaintenanceVisit (partial)
operationId: patchMaintenanceVisit
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatchMaintenanceVisitRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisit'
'404':
$ref: '#/components/responses/NotFound'
delete:
tags:
- MaintenanceVisits
summary: Delete MaintenanceVisit (soft)
operationId: deleteMaintenanceVisit
responses:
'204':
description: Deleted
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_visits/bulk:
post:
tags:
- MaintenanceVisits
summary: Bulk create MaintenanceVisits
operationId: bulkCreateMaintenanceVisits
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CreateMaintenanceVisitRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/MaintenanceVisit'
put:
tags:
- MaintenanceVisits
summary: Bulk update MaintenanceVisits (full, atomic)
operationId: bulkUpdateMaintenanceVisits
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
allOf:
- type: object
required: [id]
properties:
id:
type: string
- $ref: '#/components/schemas/UpdateMaintenanceVisitRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
patch:
tags:
- MaintenanceVisits
summary: Bulk partial-update MaintenanceVisits (atomic)
operationId: bulkPatchMaintenanceVisits
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- type: object
required: [ids, patch]
properties:
ids:
type: array
items: { type: string }
patch:
type: object
additionalProperties: true
- type: object
required: [items]
properties:
items:
type: array
items:
type: object
required: [id, patch]
properties:
id: { type: string }
patch: { type: object, additionalProperties: true }
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_visits/upsert:
post:
tags:
- MaintenanceVisits
summary: Upsert MaintenanceVisit
operationId: upsertMaintenanceVisit
parameters:
- name: key_field
in: query
schema:
type: string
- name: key_value
in: query
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceVisitRequest'
responses:
'200':
description: Upserted
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisit'
/api/v1/maintenance/maintenance_visits/trash:
get:
tags:
- MaintenanceVisits
summary: List deleted MaintenanceVisits
operationId: listDeletedMaintenanceVisits
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitList'
/api/v1/maintenance/maintenance_visits/{id}/restore:
parameters:
- $ref: '#/components/parameters/IdParam'
post:
tags:
- MaintenanceVisits
summary: Restore deleted MaintenanceVisit
operationId: restoreMaintenanceVisit
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisit'
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_visits/empty:
delete:
tags:
- MaintenanceVisits
summary: Empty trash for MaintenanceVisits
operationId: emptyTrashMaintenanceVisits
responses:
'200':
description: Trash emptied
content:
application/json:
schema:
type: object
properties:
deleted_count:
type: integer
/api/v1/maintenance/maintenance_visits/delete/bulk:
post:
tags:
- MaintenanceVisits
summary: Bulk soft-delete MaintenanceVisits by ids (atomic)
operationId: bulkDeleteMaintenanceVisits
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Soft-deleted
content:
application/json:
schema:
type: object
properties:
soft_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_visits/restore/bulk:
post:
tags:
- MaintenanceVisits
summary: Bulk restore MaintenanceVisits by ids (atomic)
operationId: bulkRestoreMaintenanceVisits
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_visits/restore/all:
post:
tags:
- MaintenanceVisits
summary: Restore all soft-deleted MaintenanceVisits
operationId: restoreAllMaintenanceVisits
responses:
'200':
description: Restored
content:
application/json:
schema:
type: object
properties:
restored: { type: integer }
/api/v1/maintenance/maintenance_visits/trash/bulk:
delete:
tags:
- MaintenanceVisits
summary: Bulk permanently-delete MaintenanceVisits from trash by ids (atomic)
operationId: bulkPermanentDeleteMaintenanceVisits
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Permanently deleted
content:
application/json:
schema:
type: object
properties:
permanently_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_visit_parts:
get:
tags:
- MaintenanceVisitParts
summary: List MaintenanceVisitParts
description: Get a paginated list of MaintenanceVisitParts with optional filtering and sorting
operationId: listMaintenanceVisitParts
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
- $ref: '#/components/parameters/SortByParam'
- $ref: '#/components/parameters/SortOrderParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPartList'
'401':
$ref: '#/components/responses/Unauthorized'
post:
tags:
- MaintenanceVisitParts
summary: Create MaintenanceVisitPart
description: Create a new MaintenanceVisitPart
operationId: createMaintenanceVisitPart
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMaintenanceVisitPartRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPart'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
/api/v1/maintenance/maintenance_visit_parts/{id}:
parameters:
- $ref: '#/components/parameters/IdParam'
get:
tags:
- MaintenanceVisitParts
summary: Get MaintenanceVisitPart by ID
operationId: getMaintenanceVisitPart
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPart'
'404':
$ref: '#/components/responses/NotFound'
put:
tags:
- MaintenanceVisitParts
summary: Update MaintenanceVisitPart (full)
operationId: updateMaintenanceVisitPart
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceVisitPartRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPart'
'404':
$ref: '#/components/responses/NotFound'
patch:
tags:
- MaintenanceVisitParts
summary: Update MaintenanceVisitPart (partial)
operationId: patchMaintenanceVisitPart
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatchMaintenanceVisitPartRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPart'
'404':
$ref: '#/components/responses/NotFound'
delete:
tags:
- MaintenanceVisitParts
summary: Delete MaintenanceVisitPart (soft)
operationId: deleteMaintenanceVisitPart
responses:
'204':
description: Deleted
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_visit_parts/bulk:
post:
tags:
- MaintenanceVisitParts
summary: Bulk create MaintenanceVisitParts
operationId: bulkCreateMaintenanceVisitParts
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CreateMaintenanceVisitPartRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/MaintenanceVisitPart'
put:
tags:
- MaintenanceVisitParts
summary: Bulk update MaintenanceVisitParts (full, atomic)
operationId: bulkUpdateMaintenanceVisitParts
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
allOf:
- type: object
required: [id]
properties:
id:
type: string
- $ref: '#/components/schemas/UpdateMaintenanceVisitPartRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPartBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
patch:
tags:
- MaintenanceVisitParts
summary: Bulk partial-update MaintenanceVisitParts (atomic)
operationId: bulkPatchMaintenanceVisitParts
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- type: object
required: [ids, patch]
properties:
ids:
type: array
items: { type: string }
patch:
type: object
additionalProperties: true
- type: object
required: [items]
properties:
items:
type: array
items:
type: object
required: [id, patch]
properties:
id: { type: string }
patch: { type: object, additionalProperties: true }
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPartBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_visit_parts/upsert:
post:
tags:
- MaintenanceVisitParts
summary: Upsert MaintenanceVisitPart
operationId: upsertMaintenanceVisitPart
parameters:
- name: key_field
in: query
schema:
type: string
- name: key_value
in: query
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMaintenanceVisitPartRequest'
responses:
'200':
description: Upserted
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPart'
/api/v1/maintenance/maintenance_visit_parts/trash:
get:
tags:
- MaintenanceVisitParts
summary: List deleted MaintenanceVisitParts
operationId: listDeletedMaintenanceVisitParts
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPartList'
/api/v1/maintenance/maintenance_visit_parts/{id}/restore:
parameters:
- $ref: '#/components/parameters/IdParam'
post:
tags:
- MaintenanceVisitParts
summary: Restore deleted MaintenanceVisitPart
operationId: restoreMaintenanceVisitPart
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPart'
'404':
$ref: '#/components/responses/NotFound'
/api/v1/maintenance/maintenance_visit_parts/empty:
delete:
tags:
- MaintenanceVisitParts
summary: Empty trash for MaintenanceVisitParts
operationId: emptyTrashMaintenanceVisitParts
responses:
'200':
description: Trash emptied
content:
application/json:
schema:
type: object
properties:
deleted_count:
type: integer
/api/v1/maintenance/maintenance_visit_parts/delete/bulk:
post:
tags:
- MaintenanceVisitParts
summary: Bulk soft-delete MaintenanceVisitParts by ids (atomic)
operationId: bulkDeleteMaintenanceVisitParts
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Soft-deleted
content:
application/json:
schema:
type: object
properties:
soft_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_visit_parts/restore/bulk:
post:
tags:
- MaintenanceVisitParts
summary: Bulk restore MaintenanceVisitParts by ids (atomic)
operationId: bulkRestoreMaintenanceVisitParts
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Restored
content:
application/json:
schema:
$ref: '#/components/schemas/MaintenanceVisitPartBulkResult'
'400':
$ref: '#/components/responses/BadRequest'
/api/v1/maintenance/maintenance_visit_parts/restore/all:
post:
tags:
- MaintenanceVisitParts
summary: Restore all soft-deleted MaintenanceVisitParts
operationId: restoreAllMaintenanceVisitParts
responses:
'200':
description: Restored
content:
application/json:
schema:
type: object
properties:
restored: { type: integer }
/api/v1/maintenance/maintenance_visit_parts/trash/bulk:
delete:
tags:
- MaintenanceVisitParts
summary: Bulk permanently-delete MaintenanceVisitParts from trash by ids (atomic)
operationId: bulkPermanentDeleteMaintenanceVisitParts
requestBody:
$ref: '#/components/requestBodies/BatchIds'
responses:
'200':
description: Permanently deleted
content:
application/json:
schema:
type: object
properties:
permanently_deleted: { type: integer }
'400':
$ref: '#/components/responses/BadRequest'
components:
schemas:
MaintenanceRequest:
type: object
required:
- id
- name
- request_date
- duration
- stage_id
- kanban_state
- priority
- maintenance_type
- recurring
- repeat_interval
- repeat_unit
- repeat_type
- metadata
properties:
id:
type: string
format: uuid
name:
type: string
description:
nullable: true
type: string
request_date:
type: string
format: date
schedule_date:
nullable: true
type: string
format: date-time
schedule_end:
nullable: true
type: string
format: date-time
close_date:
nullable: true
type: string
format: date
duration:
type: string
owner_user_id:
nullable: true
type: string
format: uuid
user_id:
nullable: true
type: string
format: uuid
asset_id:
nullable: true
type: string
format: uuid
stage_id:
type: string
format: uuid
kanban_state:
type: string
priority:
type: string
maintenance_type:
type: string
recurring:
type: boolean
repeat_interval:
type: integer
format: int32
repeat_unit:
type: string
repeat_type:
type: string
repeat_until:
nullable: true
type: string
format: date
successor_request_id:
nullable: true
type: string
format: uuid
successor_of_request_id:
nullable: true
type: string
format: uuid
metadata:
type: object
MaintenanceRequestBulkResult:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceRequest'
total: { type: integer }
failed: { type: integer }
errors:
type: array
items: { type: string }
CreateMaintenanceRequestRequest:
type: object
required:
- name
- request_date
- duration
- stage_id
- kanban_state
- priority
- maintenance_type
- recurring
- repeat_interval
- repeat_unit
- repeat_type
- metadata
properties:
name:
type: string
description:
nullable: true
type: string
request_date:
type: string
format: date
schedule_date:
nullable: true
type: string
format: date-time
schedule_end:
nullable: true
type: string
format: date-time
close_date:
nullable: true
type: string
format: date
duration:
type: string
owner_user_id:
nullable: true
type: string
format: uuid
user_id:
nullable: true
type: string
format: uuid
asset_id:
nullable: true
type: string
format: uuid
stage_id:
type: string
format: uuid
kanban_state:
type: string
priority:
type: string
maintenance_type:
type: string
recurring:
type: boolean
repeat_interval:
type: integer
format: int32
repeat_unit:
type: string
repeat_type:
type: string
repeat_until:
nullable: true
type: string
format: date
successor_request_id:
nullable: true
type: string
format: uuid
successor_of_request_id:
nullable: true
type: string
format: uuid
metadata:
type: object
UpdateMaintenanceRequestRequest:
type: object
required:
- name
- request_date
- duration
- stage_id
- kanban_state
- priority
- maintenance_type
- recurring
- repeat_interval
- repeat_unit
- repeat_type
- metadata
properties:
name:
type: string
description:
nullable: true
type: string
request_date:
type: string
format: date
schedule_date:
nullable: true
type: string
format: date-time
schedule_end:
nullable: true
type: string
format: date-time
close_date:
nullable: true
type: string
format: date
duration:
type: string
owner_user_id:
nullable: true
type: string
format: uuid
user_id:
nullable: true
type: string
format: uuid
asset_id:
nullable: true
type: string
format: uuid
stage_id:
type: string
format: uuid
kanban_state:
type: string
priority:
type: string
maintenance_type:
type: string
recurring:
type: boolean
repeat_interval:
type: integer
format: int32
repeat_unit:
type: string
repeat_type:
type: string
repeat_until:
nullable: true
type: string
format: date
successor_request_id:
nullable: true
type: string
format: uuid
successor_of_request_id:
nullable: true
type: string
format: uuid
metadata:
type: object
PatchMaintenanceRequestRequest:
type: object
properties:
name:
type: string
description:
nullable: true
type: string
request_date:
type: string
format: date
schedule_date:
nullable: true
type: string
format: date-time
schedule_end:
nullable: true
type: string
format: date-time
close_date:
nullable: true
type: string
format: date
duration:
type: string
owner_user_id:
nullable: true
type: string
format: uuid
user_id:
nullable: true
type: string
format: uuid
asset_id:
nullable: true
type: string
format: uuid
stage_id:
type: string
format: uuid
kanban_state:
type: string
priority:
type: string
maintenance_type:
type: string
recurring:
type: boolean
repeat_interval:
type: integer
format: int32
repeat_unit:
type: string
repeat_type:
type: string
repeat_until:
nullable: true
type: string
format: date
successor_request_id:
nullable: true
type: string
format: uuid
successor_of_request_id:
nullable: true
type: string
format: uuid
metadata:
type: object
MaintenanceRequestList:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceRequest'
meta:
$ref: '#/components/schemas/PaginationMeta'
MaintenanceSchedule:
type: object
required:
- id
- asset_id
- name
- interval_days
- next_due_date
- status
- metadata
properties:
id:
type: string
format: uuid
asset_id:
type: string
format: uuid
name:
type: string
interval_days:
type: integer
format: int32
next_due_date:
type: string
format: date
status:
type: string
metadata:
type: object
MaintenanceScheduleBulkResult:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceSchedule'
total: { type: integer }
failed: { type: integer }
errors:
type: array
items: { type: string }
CreateMaintenanceScheduleRequest:
type: object
required:
- asset_id
- name
- interval_days
- next_due_date
- status
- metadata
properties:
asset_id:
type: string
format: uuid
name:
type: string
interval_days:
type: integer
format: int32
next_due_date:
type: string
format: date
status:
type: string
metadata:
type: object
UpdateMaintenanceScheduleRequest:
type: object
required:
- asset_id
- name
- interval_days
- next_due_date
- status
- metadata
properties:
asset_id:
type: string
format: uuid
name:
type: string
interval_days:
type: integer
format: int32
next_due_date:
type: string
format: date
status:
type: string
metadata:
type: object
PatchMaintenanceScheduleRequest:
type: object
properties:
asset_id:
type: string
format: uuid
name:
type: string
interval_days:
type: integer
format: int32
next_due_date:
type: string
format: date
status:
type: string
metadata:
type: object
MaintenanceScheduleList:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceSchedule'
meta:
$ref: '#/components/schemas/PaginationMeta'
MaintenanceStage:
type: object
required:
- id
- name
- sequence
- fold
- done
- metadata
properties:
id:
type: string
format: uuid
name:
type: string
sequence:
type: integer
format: int32
fold:
type: boolean
done:
type: boolean
metadata:
type: object
MaintenanceStageBulkResult:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceStage'
total: { type: integer }
failed: { type: integer }
errors:
type: array
items: { type: string }
CreateMaintenanceStageRequest:
type: object
required:
- name
- sequence
- fold
- done
- metadata
properties:
name:
type: string
sequence:
type: integer
format: int32
fold:
type: boolean
done:
type: boolean
metadata:
type: object
UpdateMaintenanceStageRequest:
type: object
required:
- name
- sequence
- fold
- done
- metadata
properties:
name:
type: string
sequence:
type: integer
format: int32
fold:
type: boolean
done:
type: boolean
metadata:
type: object
PatchMaintenanceStageRequest:
type: object
properties:
name:
type: string
sequence:
type: integer
format: int32
fold:
type: boolean
done:
type: boolean
metadata:
type: object
MaintenanceStageList:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceStage'
meta:
$ref: '#/components/schemas/PaginationMeta'
MaintenanceVisit:
type: object
required:
- id
- asset_id
- maintenance_type
- status
- scheduled_date
- labor_cost
- parts_cost
- total_cost
- metadata
properties:
id:
type: string
format: uuid
asset_id:
type: string
format: uuid
schedule_id:
nullable: true
type: string
format: uuid
maintenance_type:
type: string
status:
type: string
warehouse_id:
nullable: true
type: string
format: uuid
warranty_claim_id:
nullable: true
type: string
format: uuid
scheduled_date:
type: string
format: date
performed_date:
nullable: true
type: string
format: date
labor_cost:
type: string
parts_cost:
type: string
total_cost:
type: string
maintenance_expense_account_id:
nullable: true
type: string
format: uuid
parts_inventory_account_id:
nullable: true
type: string
format: uuid
labor_payable_account_id:
nullable: true
type: string
format: uuid
journal_id:
nullable: true
type: string
format: uuid
accounting_post_id:
nullable: true
type: string
format: uuid
notes:
nullable: true
type: string
metadata:
type: object
MaintenanceVisitBulkResult:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceVisit'
total: { type: integer }
failed: { type: integer }
errors:
type: array
items: { type: string }
CreateMaintenanceVisitRequest:
type: object
required:
- asset_id
- maintenance_type
- status
- scheduled_date
- labor_cost
- parts_cost
- total_cost
- metadata
properties:
asset_id:
type: string
format: uuid
schedule_id:
nullable: true
type: string
format: uuid
maintenance_type:
type: string
status:
type: string
warehouse_id:
nullable: true
type: string
format: uuid
warranty_claim_id:
nullable: true
type: string
format: uuid
scheduled_date:
type: string
format: date
performed_date:
nullable: true
type: string
format: date
labor_cost:
type: string
parts_cost:
type: string
total_cost:
type: string
maintenance_expense_account_id:
nullable: true
type: string
format: uuid
parts_inventory_account_id:
nullable: true
type: string
format: uuid
labor_payable_account_id:
nullable: true
type: string
format: uuid
journal_id:
nullable: true
type: string
format: uuid
accounting_post_id:
nullable: true
type: string
format: uuid
notes:
nullable: true
type: string
metadata:
type: object
UpdateMaintenanceVisitRequest:
type: object
required:
- asset_id
- maintenance_type
- status
- scheduled_date
- labor_cost
- parts_cost
- total_cost
- metadata
properties:
asset_id:
type: string
format: uuid
schedule_id:
nullable: true
type: string
format: uuid
maintenance_type:
type: string
status:
type: string
warehouse_id:
nullable: true
type: string
format: uuid
warranty_claim_id:
nullable: true
type: string
format: uuid
scheduled_date:
type: string
format: date
performed_date:
nullable: true
type: string
format: date
labor_cost:
type: string
parts_cost:
type: string
total_cost:
type: string
maintenance_expense_account_id:
nullable: true
type: string
format: uuid
parts_inventory_account_id:
nullable: true
type: string
format: uuid
labor_payable_account_id:
nullable: true
type: string
format: uuid
journal_id:
nullable: true
type: string
format: uuid
accounting_post_id:
nullable: true
type: string
format: uuid
notes:
nullable: true
type: string
metadata:
type: object
PatchMaintenanceVisitRequest:
type: object
properties:
asset_id:
type: string
format: uuid
schedule_id:
nullable: true
type: string
format: uuid
maintenance_type:
type: string
status:
type: string
warehouse_id:
nullable: true
type: string
format: uuid
warranty_claim_id:
nullable: true
type: string
format: uuid
scheduled_date:
type: string
format: date
performed_date:
nullable: true
type: string
format: date
labor_cost:
type: string
parts_cost:
type: string
total_cost:
type: string
maintenance_expense_account_id:
nullable: true
type: string
format: uuid
parts_inventory_account_id:
nullable: true
type: string
format: uuid
labor_payable_account_id:
nullable: true
type: string
format: uuid
journal_id:
nullable: true
type: string
format: uuid
accounting_post_id:
nullable: true
type: string
format: uuid
notes:
nullable: true
type: string
metadata:
type: object
MaintenanceVisitList:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceVisit'
meta:
$ref: '#/components/schemas/PaginationMeta'
MaintenanceVisitPart:
type: object
required:
- id
- visit_id
- item_id
- quantity
- unit_cost
- amount
- metadata
properties:
id:
type: string
format: uuid
visit_id:
type: string
format: uuid
item_id:
type: string
format: uuid
quantity:
type: string
unit_cost:
type: string
amount:
type: string
metadata:
type: object
MaintenanceVisitPartBulkResult:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceVisitPart'
total: { type: integer }
failed: { type: integer }
errors:
type: array
items: { type: string }
CreateMaintenanceVisitPartRequest:
type: object
required:
- visit_id
- item_id
- quantity
- unit_cost
- amount
- metadata
properties:
visit_id:
type: string
format: uuid
item_id:
type: string
format: uuid
quantity:
type: string
unit_cost:
type: string
amount:
type: string
metadata:
type: object
UpdateMaintenanceVisitPartRequest:
type: object
required:
- visit_id
- item_id
- quantity
- unit_cost
- amount
- metadata
properties:
visit_id:
type: string
format: uuid
item_id:
type: string
format: uuid
quantity:
type: string
unit_cost:
type: string
amount:
type: string
metadata:
type: object
PatchMaintenanceVisitPartRequest:
type: object
properties:
visit_id:
type: string
format: uuid
item_id:
type: string
format: uuid
quantity:
type: string
unit_cost:
type: string
amount:
type: string
metadata:
type: object
MaintenanceVisitPartList:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MaintenanceVisitPart'
meta:
$ref: '#/components/schemas/PaginationMeta'
PaginationMeta:
type: object
properties:
total:
type: integer
example: 100
page:
type: integer
example: 1
per_page:
type: integer
example: 20
total_pages:
type: integer
example: 5
Error:
type: object
required:
- code
- message
properties:
code:
type: string
example: VALIDATION_ERROR
message:
type: string
example: Invalid input data
details:
type: object
additionalProperties: true
parameters:
IdParam:
name: id
in: path
required: true
schema:
type: string
format: uuid
PageParam:
name: page
in: query
schema:
type: integer
minimum: 1
default: 1
PerPageParam:
name: per_page
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 20
SortByParam:
name: sort_by
in: query
schema:
type: string
SortOrderParam:
name: sort_order
in: query
schema:
type: string
enum: [asc, desc]
default: asc
responses:
BadRequest:
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
NotFound:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
requestBodies:
BatchIds:
required: true
content:
application/json:
schema:
type: object
required: [ids]
properties:
ids:
type: array
items: { type: string }
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- bearerAuth: []