869 lines
23 KiB
JSON
869 lines
23 KiB
JSON
{
|
||
"openapi": "3.0.3",
|
||
"info": {
|
||
"title": "KIS-TOiR API",
|
||
"description": "Equipment maintenance management system. Generated from domain/toir.api.dsl via tools/api-summary-to-openapi.mjs.",
|
||
"version": "1.0.0"
|
||
},
|
||
"servers": [
|
||
{
|
||
"url": "/api",
|
||
"description": "Default server"
|
||
}
|
||
],
|
||
"components": {
|
||
"securitySchemes": {
|
||
"bearerAuth": {
|
||
"type": "http",
|
||
"scheme": "bearer",
|
||
"bearerFormat": "JWT"
|
||
}
|
||
},
|
||
"schemas": {
|
||
"FileAttachment": {
|
||
"type": "object",
|
||
"properties": {
|
||
"objectKey": {
|
||
"type": "string",
|
||
"description": "Ключ объекта в бакете"
|
||
},
|
||
"originalFileName": {
|
||
"type": "string",
|
||
"description": "Исходное имя файла"
|
||
},
|
||
"contentType": {
|
||
"type": "string",
|
||
"description": "MIME-тип"
|
||
},
|
||
"sizeBytes": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"description": "Размер в байтах"
|
||
},
|
||
"downloadUrl": {
|
||
"type": "string",
|
||
"description": "Ссылка на скачивание (публичная или presigned)"
|
||
}
|
||
},
|
||
"description": "Метаданные файла в объектном хранилище (MinIO/S3); бинарные данные в БД не хранятся"
|
||
},
|
||
"Equipment": {
|
||
"type": "string",
|
||
"x-dsl-enum": "Equipment",
|
||
"description": "Enum: Equipment (values defined in domain/*.api.dsl)"
|
||
},
|
||
"EquipmentCreate": {
|
||
"type": "object",
|
||
"properties": {
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Название оборудования"
|
||
},
|
||
"serialNumber": {
|
||
"type": "string",
|
||
"description": "Заводской (серийный) номер"
|
||
},
|
||
"dateOfInspection": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "Дата поверки"
|
||
},
|
||
"commissionedAt": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "Дата изготовления"
|
||
},
|
||
"status": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/components/schemas/EquipmentStatus"
|
||
}
|
||
],
|
||
"description": "Текущий статус"
|
||
}
|
||
},
|
||
"description": "Тело запроса на создание единицы оборудования",
|
||
"required": [
|
||
"name",
|
||
"serialNumber",
|
||
"status"
|
||
]
|
||
},
|
||
"EquipmentUpdate": {
|
||
"type": "object",
|
||
"properties": {
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Название оборудования"
|
||
},
|
||
"serialNumber": {
|
||
"type": "string",
|
||
"description": "Заводской (серийный) номер"
|
||
},
|
||
"dateOfInspection": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "Дата поверки"
|
||
},
|
||
"commissionedAt": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "Дата изготовления"
|
||
},
|
||
"status": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/components/schemas/EquipmentStatus"
|
||
}
|
||
],
|
||
"description": "Текущий статус"
|
||
}
|
||
},
|
||
"description": "Тело запроса на обновление единицы оборудования"
|
||
},
|
||
"EquipmentListRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"page": {
|
||
"$ref": "#/components/schemas/DTO.PageRequest"
|
||
},
|
||
"filterName": {
|
||
"type": "string"
|
||
},
|
||
"filterSerialNumber": {
|
||
"type": "string"
|
||
},
|
||
"filterStatus": {
|
||
"$ref": "#/components/schemas/EquipmentStatus"
|
||
}
|
||
},
|
||
"description": "Запрос для постраничного получения списка оборудования с фильтрацией"
|
||
},
|
||
"EquipmentListResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"content": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/Equipment"
|
||
}
|
||
},
|
||
"pageInfo": {
|
||
"$ref": "#/components/schemas/DTO.PageInfo"
|
||
}
|
||
},
|
||
"description": "Ответ с постраничным списком оборудования и метаданными"
|
||
},
|
||
"ChangeEquipmentStatus": {
|
||
"type": "object",
|
||
"properties": {
|
||
"equipmentId": {
|
||
"$ref": "#/components/schemas/Equipment"
|
||
},
|
||
"newStatus": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/components/schemas/EquipmentStatus"
|
||
}
|
||
],
|
||
"description": "Новый статус"
|
||
},
|
||
"number": {
|
||
"type": "string",
|
||
"description": "Номер"
|
||
},
|
||
"date": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "Дата изменения статуса"
|
||
},
|
||
"responsible": {
|
||
"type": "string",
|
||
"description": "Ответственный"
|
||
}
|
||
},
|
||
"description": "Полный response-объект для документа изменения статуса"
|
||
},
|
||
"ChangeEquipmentStatusCreate": {
|
||
"type": "object",
|
||
"properties": {
|
||
"equipmentId": {
|
||
"$ref": "#/components/schemas/Equipment"
|
||
},
|
||
"newStatus": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/components/schemas/EquipmentStatus"
|
||
}
|
||
],
|
||
"description": "Новый статус"
|
||
},
|
||
"number": {
|
||
"type": "string",
|
||
"description": "Номер"
|
||
},
|
||
"date": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "Дата изменения статуса"
|
||
},
|
||
"responsible": {
|
||
"type": "string",
|
||
"description": "Ответственный"
|
||
}
|
||
},
|
||
"description": "Тело запроса на создание документа изменения статуса",
|
||
"required": [
|
||
"newStatus",
|
||
"date"
|
||
]
|
||
},
|
||
"ChangeEquipmentStatusUpdate": {
|
||
"type": "object",
|
||
"properties": {
|
||
"equipmentId": {
|
||
"$ref": "#/components/schemas/Equipment"
|
||
},
|
||
"newStatus": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/components/schemas/EquipmentStatus"
|
||
}
|
||
],
|
||
"description": "Новый статус"
|
||
},
|
||
"number": {
|
||
"type": "string",
|
||
"description": "Номер"
|
||
},
|
||
"date": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "Дата изменения статуса"
|
||
},
|
||
"responsible": {
|
||
"type": "string",
|
||
"description": "Ответственный"
|
||
}
|
||
},
|
||
"description": "Тело запроса на обновление документа изменения статуса"
|
||
},
|
||
"ChangeEquipmentStatusListRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"page": {
|
||
"$ref": "#/components/schemas/DTO.PageRequest"
|
||
},
|
||
"filterEquipmentId": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
},
|
||
"filterNumber": {
|
||
"type": "string"
|
||
},
|
||
"filterDate": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
},
|
||
"filterResponsible": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"description": "Запрос для постраничного получения списка документов изменения статуса с фильтрацией"
|
||
},
|
||
"ChangeEquipmentStatusListResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"content": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/ChangeEquipmentStatus"
|
||
}
|
||
},
|
||
"pageInfo": {
|
||
"$ref": "#/components/schemas/DTO.PageInfo"
|
||
}
|
||
},
|
||
"description": "Ответ с постраничным списком документов изменения статуса и метаданными"
|
||
},
|
||
"EquipmentStatus": {
|
||
"type": "string",
|
||
"x-dsl-enum": "EquipmentStatus",
|
||
"description": "Enum: EquipmentStatus (values defined in domain/*.api.dsl)"
|
||
},
|
||
"DTO.PageRequest": {
|
||
"type": "string",
|
||
"x-dsl-enum": "DTO.PageRequest",
|
||
"description": "Enum: DTO.PageRequest (values defined in domain/*.api.dsl)"
|
||
},
|
||
"DTO.PageInfo": {
|
||
"type": "string",
|
||
"x-dsl-enum": "DTO.PageInfo",
|
||
"description": "Enum: DTO.PageInfo (values defined in domain/*.api.dsl)"
|
||
}
|
||
}
|
||
},
|
||
"paths": {
|
||
"/equipment/page": {
|
||
"post": {
|
||
"summary": "Постраничный список оборудования с фильтрацией",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"справочником оборудования"
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/EquipmentListRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/EquipmentListResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/equipment/{id}": {
|
||
"get": {
|
||
"summary": "Получить единицу оборудования по идентификатору",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"справочником оборудования"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Equipment"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"summary": "Обновить данные единицы оборудования",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"справочником оборудования"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/EquipmentUpdate"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"summary": "Удалить единицу оборудования",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"справочником оборудования"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"204": {
|
||
"description": "No content"
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
},
|
||
"404": {
|
||
"description": "Not found"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/equipment": {
|
||
"post": {
|
||
"summary": "Создать новую единицу оборудования",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"справочником оборудования"
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/EquipmentCreate"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"201": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/equipment/{id}/attachments": {
|
||
"post": {
|
||
"summary": "Загрузить файл-вложение (multipart/form-data, поле file)",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"справочником оборудования"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/equipment/{id}/attachments/{attachmentId}": {
|
||
"delete": {
|
||
"summary": "Удалить файл-вложение из хранилища и из записи",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"справочником оборудования"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
},
|
||
{
|
||
"name": "attachmentId",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"204": {
|
||
"description": "No content"
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
},
|
||
"404": {
|
||
"description": "Not found"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/equipment/{id}/attachments/{attachmentId}/download": {
|
||
"get": {
|
||
"summary": "Скачать файл-вложение (Content-Disposition: attachment, поток из MinIO)",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"справочником оборудования"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
},
|
||
{
|
||
"name": "attachmentId",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/status-changes/page": {
|
||
"post": {
|
||
"summary": "Постраничный список документов изменения статуса с фильтрацией",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"документами изменения статуса оборудования"
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ChangeEquipmentStatusListRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ChangeEquipmentStatusListResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/status-changes/{id}": {
|
||
"get": {
|
||
"summary": "Получить документ изменения статуса по идентификатору",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"документами изменения статуса оборудования"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ChangeEquipmentStatus"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"summary": "Обновить документ изменения статуса",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"документами изменения статуса оборудования"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ChangeEquipmentStatusUpdate"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"summary": "Удалить документ изменения статуса",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"документами изменения статуса оборудования"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "uuid"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"204": {
|
||
"description": "No content"
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
},
|
||
"404": {
|
||
"description": "Not found"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/status-changes": {
|
||
"post": {
|
||
"summary": "Создать документ изменения статуса оборудования",
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"tags": [
|
||
"документами изменения статуса оборудования"
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ChangeEquipmentStatusCreate"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"201": {
|
||
"description": "Success",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized"
|
||
},
|
||
"403": {
|
||
"description": "Forbidden"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|