Split archive journal to 2 sub-modules by status. Add possibility to upload file for equipment. Change date fields for equipment.

This commit is contained in:
Первов Артем
2026-05-11 09:41:03 +03:00
parent 67f7d617be
commit 05ae32c030
33 changed files with 2753 additions and 1699 deletions

View File

@@ -20,86 +20,58 @@
}
},
"schemas": {
"Equipment": {
"FileAttachment": {
"type": "object",
"properties": {
"id": {
"objectKey": {
"type": "string",
"format": "uuid"
"description": "Ключ объекта в бакете"
},
"inventoryNumber": {
"originalFileName": {
"type": "string",
"description": нвентарный номер"
"description": сходное имя файла"
},
"serialNumber": {
"contentType": {
"type": "string",
"description": "Заводской (серийный) номер"
"description": "MIME-тип"
},
"name": {
"sizeBytes": {
"type": "integer",
"format": "int32",
"description": "Размер в байтах"
},
"downloadUrl": {
"type": "string",
"description": "Наименование единицы оборудования"
},
"equipmentTypeCode": {
"type": "string",
"description": "Код вида оборудования"
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/EquipmentStatus"
}
],
"description": "Текущий статус"
},
"location": {
"type": "string",
"description": "Место эксплуатации / скважина / куст"
},
"commissionedAt": {
"type": "string",
"format": "date-time",
"description": "Дата ввода в эксплуатацию"
},
"totalEngineHours": {
"type": "string",
"format": "decimal",
"description": "Общая наработка, моточасов"
},
"engineHoursSinceLastRepair": {
"type": "string",
"format": "decimal",
"description": "Наработка с последнего ремонта, моточасов"
},
"lastRepairAt": {
"type": "string",
"format": "date-time",
"description": "Дата последнего ремонта"
},
"notes": {
"type": "string",
"description": "Примечания"
"description": "Ссылка на скачивание (публичная или presigned)"
}
},
"description": "Оборудование — полный объект ответа"
"description": "Метаданные файла в объектном хранилище (MinIO/S3); бинарные данные в БД не хранятся"
},
"Equipment": {
"type": "string",
"x-dsl-enum": "Equipment",
"description": "Enum: Equipment (values defined in domain/*.api.dsl)"
},
"EquipmentCreate": {
"type": "object",
"properties": {
"inventoryNumber": {
"name": {
"type": "string",
"description": "Инвентарный номер"
"description": "Название оборудования"
},
"serialNumber": {
"type": "string",
"description": "Заводской (серийный) номер"
},
"name": {
"dateOfInspection": {
"type": "string",
"description": "Наименование единицы оборудования"
"format": "date-time",
"description": "Дата поверки"
},
"equipmentTypeCode": {
"commissionedAt": {
"type": "string",
"description": "Код вида оборудования"
"format": "date-time",
"description": "Дата изготовления"
},
"status": {
"allOf": [
@@ -108,61 +80,35 @@
}
],
"description": "Текущий статус"
},
"location": {
"type": "string",
"description": "Место эксплуатации / скважина / куст"
},
"commissionedAt": {
"type": "string",
"format": "date-time",
"description": "Дата ввода в эксплуатацию"
},
"totalEngineHours": {
"type": "string",
"format": "decimal",
"description": "Общая наработка, моточасов"
},
"engineHoursSinceLastRepair": {
"type": "string",
"format": "decimal",
"description": "Наработка с последнего ремонта, моточасов"
},
"lastRepairAt": {
"type": "string",
"format": "date-time",
"description": "Дата последнего ремонта"
},
"notes": {
"type": "string",
"description": "Примечания"
}
},
"description": "Оборудование — тело запроса на создание",
"description": "Тело запроса на создание единицы оборудования",
"required": [
"inventoryNumber",
"name",
"equipmentTypeCode"
"serialNumber",
"status"
]
},
"EquipmentUpdate": {
"type": "object",
"properties": {
"inventoryNumber": {
"name": {
"type": "string",
"description": "Инвентарный номер"
"description": "Название оборудования"
},
"serialNumber": {
"type": "string",
"description": "Заводской (серийный) номер"
},
"name": {
"dateOfInspection": {
"type": "string",
"description": "Наименование единицы оборудования"
"format": "date-time",
"description": "Дата поверки"
},
"equipmentTypeCode": {
"commissionedAt": {
"type": "string",
"description": "Код вида оборудования"
"format": "date-time",
"description": "Дата изготовления"
},
"status": {
"allOf": [
@@ -171,52 +117,27 @@
}
],
"description": "Текущий статус"
},
"location": {
"type": "string",
"description": "Место эксплуатации / скважина / куст"
},
"commissionedAt": {
"type": "string",
"format": "date-time",
"description": "Дата ввода в эксплуатацию"
},
"totalEngineHours": {
"type": "string",
"format": "decimal",
"description": "Общая наработка, моточасов"
},
"engineHoursSinceLastRepair": {
"type": "string",
"format": "decimal",
"description": "Наработка с последнего ремонта, моточасов"
},
"lastRepairAt": {
"type": "string",
"format": "date-time",
"description": "Дата последнего ремонта"
},
"notes": {
"type": "string",
"description": "Примечания"
}
},
"description": "Оборудование — тело запроса на обновление (частичное)"
"description": "Тело запроса на обновление единицы оборудования"
},
"EquipmentListRequest": {
"type": "object",
"properties": {
"filters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DTO.Filter"
}
},
"page": {
"$ref": "#/components/schemas/DTO.PageRequest"
},
"filterName": {
"type": "string"
},
"filterSerialNumber": {
"type": "string"
},
"filterStatus": {
"$ref": "#/components/schemas/EquipmentStatus"
}
},
"description": "Оборудование — запрос постраничного списка с фильтрацией"
"description": "Запрос для постраничного получения списка оборудования с фильтрацией"
},
"EquipmentListResponse": {
"type": "object",
@@ -227,263 +148,149 @@
"$ref": "#/components/schemas/Equipment"
}
},
"page": {
"pageInfo": {
"$ref": "#/components/schemas/DTO.PageInfo"
}
},
"description": "Оборудование — постраничный результат"
"description": "Ответ с постраничным списком оборудования и метаданными"
},
"RepairOrder": {
"ChangeEquipmentStatus": {
"type": "object",
"properties": {
"id": {
"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"
},
"number": {
"filterNumber": {
"type": "string"
},
"filterDate": {
"type": "string",
"description": "Номер заявки"
"format": "date-time"
},
"equipmentId": {
"type": "string",
"format": "uuid",
"description": "Идентификатор оборудования"
},
"repairKind": {
"allOf": [
{
"$ref": "#/components/schemas/RepairKind"
}
],
"description": "Вид ремонта"
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/RepairOrderStatus"
}
],
"description": "Статус заявки"
},
"plannedAt": {
"type": "string",
"format": "date-time",
"description": "Плановая дата начала"
},
"startedAt": {
"type": "string",
"format": "date-time",
"description": "Фактическая дата начала"
},
"completedAt": {
"type": "string",
"format": "date-time",
"description": "Фактическая дата завершения"
},
"contractor": {
"type": "string",
"description": "Подрядная организация (если внешний ремонт)"
},
"engineHoursAtRepair": {
"type": "string",
"format": "decimal",
"description": "Наработка на момент ремонта, моточасов"
},
"description": {
"type": "string",
"description": "Описание работ / дефекта"
},
"notes": {
"type": "string",
"description": "Примечания"
},
"confirmed": {
"type": "boolean",
"description": "Согласовано/Не согласовано"
"filterResponsible": {
"type": "string"
}
},
"description": "Заявка на ремонт — полный объект ответа"
"description": "Запрос для постраничного получения списка документов изменения статуса с фильтрацией"
},
"RepairOrderCreate": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "Номер заявки"
},
"equipmentId": {
"type": "string",
"format": "uuid",
"description": "Идентификатор оборудования"
},
"repairKind": {
"allOf": [
{
"$ref": "#/components/schemas/RepairKind"
}
],
"description": "Вид ремонта"
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/RepairOrderStatus"
}
],
"description": "Статус заявки"
},
"plannedAt": {
"type": "string",
"format": "date-time",
"description": "Плановая дата начала"
},
"startedAt": {
"type": "string",
"format": "date-time",
"description": "Фактическая дата начала"
},
"completedAt": {
"type": "string",
"format": "date-time",
"description": "Фактическая дата завершения"
},
"contractor": {
"type": "string",
"description": "Подрядная организация (если внешний ремонт)"
},
"engineHoursAtRepair": {
"type": "string",
"format": "decimal",
"description": "Наработка на момент ремонта, моточасов"
},
"description": {
"type": "string",
"description": "Описание работ / дефекта"
},
"notes": {
"type": "string",
"description": "Примечания"
},
"confirmed": {
"type": "boolean",
"description": "Согласовано/Не согласовано"
}
},
"description": "Заявка на ремонт — тело запроса на создание",
"required": [
"number",
"equipmentId",
"repairKind",
"plannedAt"
]
},
"RepairOrderUpdate": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "Номер заявки"
},
"equipmentId": {
"type": "string",
"format": "uuid",
"description": "Идентификатор оборудования"
},
"repairKind": {
"allOf": [
{
"$ref": "#/components/schemas/RepairKind"
}
],
"description": "Вид ремонта"
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/RepairOrderStatus"
}
],
"description": "Статус заявки"
},
"plannedAt": {
"type": "string",
"format": "date-time",
"description": "Плановая дата начала"
},
"startedAt": {
"type": "string",
"format": "date-time",
"description": "Фактическая дата начала"
},
"completedAt": {
"type": "string",
"format": "date-time",
"description": "Фактическая дата завершения"
},
"contractor": {
"type": "string",
"description": "Подрядная организация (если внешний ремонт)"
},
"engineHoursAtRepair": {
"type": "string",
"format": "decimal",
"description": "Наработка на момент ремонта, моточасов"
},
"description": {
"type": "string",
"description": "Описание работ / дефекта"
},
"notes": {
"type": "string",
"description": "Примечания"
},
"confirmed": {
"type": "boolean",
"description": "Согласовано/Не согласовано"
}
},
"description": "Заявка на ремонт — тело запроса на обновление (частичное)"
},
"RepairOrderListRequest": {
"type": "object",
"properties": {
"filters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DTO.Filter"
}
},
"page": {
"$ref": "#/components/schemas/DTO.PageRequest"
}
},
"description": "Заявка на ремонт — запрос постраничного списка с фильтрацией"
},
"RepairOrderListResponse": {
"ChangeEquipmentStatusListResponse": {
"type": "object",
"properties": {
"content": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RepairOrder"
"$ref": "#/components/schemas/ChangeEquipmentStatus"
}
},
"page": {
"pageInfo": {
"$ref": "#/components/schemas/DTO.PageInfo"
}
},
"description": "Заявка на ремонт постраничный результат"
"description": "Ответ с постраничным списком документов изменения статуса и метаданными"
},
"EquipmentStatus": {
"type": "string",
"x-dsl-enum": "EquipmentStatus",
"description": "Enum: EquipmentStatus (values defined in domain/*.api.dsl)"
},
"DTO.Filter": {
"type": "string",
"x-dsl-enum": "DTO.Filter",
"description": "Enum: DTO.Filter (values defined in domain/*.api.dsl)"
},
"DTO.PageRequest": {
"type": "string",
"x-dsl-enum": "DTO.PageRequest",
@@ -493,16 +300,6 @@
"type": "string",
"x-dsl-enum": "DTO.PageInfo",
"description": "Enum: DTO.PageInfo (values defined in domain/*.api.dsl)"
},
"RepairKind": {
"type": "string",
"x-dsl-enum": "RepairKind",
"description": "Enum: RepairKind (values defined in domain/*.api.dsl)"
},
"RepairOrderStatus": {
"type": "string",
"x-dsl-enum": "RepairOrderStatus",
"description": "Enum: RepairOrderStatus (values defined in domain/*.api.dsl)"
}
}
},
@@ -516,7 +313,7 @@
}
],
"tags": [
"оборудованием"
"справочником оборудования"
],
"requestBody": {
"required": true,
@@ -550,14 +347,14 @@
},
"/equipment/{id}": {
"get": {
"summary": "Получить оборудование по идентификатору",
"summary": "Получить единицу оборудования по идентификатору",
"security": [
{
"bearerAuth": []
}
],
"tags": [
"оборудованием"
"справочником оборудования"
],
"parameters": [
{
@@ -590,14 +387,14 @@
}
},
"put": {
"summary": "Обновить единицу оборудования",
"summary": "Обновить данные единицы оборудования",
"security": [
{
"bearerAuth": []
}
],
"tags": [
"оборудованием"
"справочником оборудования"
],
"parameters": [
{
@@ -647,7 +444,7 @@
}
],
"tags": [
"оборудованием"
"справочником оборудования"
],
"parameters": [
{
@@ -678,14 +475,14 @@
},
"/equipment": {
"post": {
"summary": "Создать единицу оборудования",
"summary": "Создать новую единицу оборудования",
"security": [
{
"bearerAuth": []
}
],
"tags": [
"оборудованием"
"справочником оборудования"
],
"requestBody": {
"required": true,
@@ -717,34 +514,35 @@
}
}
},
"/repair-orders/page": {
"/equipment/{id}/attachments": {
"post": {
"summary": "Постраничный список заявок на ремонт с фильтрацией",
"summary": "Загрузить файл-вложение (multipart/form-data, поле file)",
"security": [
{
"bearerAuth": []
}
],
"tags": [
"заявками на ремонт"
"справочником оборудования"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepairOrderListRequest"
}
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
},
],
"responses": {
"200": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepairOrderListResponse"
"type": "object"
}
}
}
@@ -758,16 +556,155 @@
}
}
},
"/repair-orders/{id}": {
"get": {
"summary": "Получить заявку на ремонт по идентификатору",
"/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": [
{
@@ -786,7 +723,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepairOrder"
"$ref": "#/components/schemas/ChangeEquipmentStatus"
}
}
}
@@ -800,14 +737,14 @@
}
},
"put": {
"summary": "Обновить заявку на ремонт",
"summary": "Обновить документ изменения статуса",
"security": [
{
"bearerAuth": []
}
],
"tags": [
"заявками на ремонт"
"документами изменения статуса оборудования"
],
"parameters": [
{
@@ -825,7 +762,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepairOrderUpdate"
"$ref": "#/components/schemas/ChangeEquipmentStatusUpdate"
}
}
}
@@ -850,14 +787,14 @@
}
},
"delete": {
"summary": "Удалить заявку на ремонт",
"summary": "Удалить документ изменения статуса",
"security": [
{
"bearerAuth": []
}
],
"tags": [
"заявками на ремонт"
"документами изменения статуса оборудования"
],
"parameters": [
{
@@ -886,23 +823,23 @@
}
}
},
"/repair-orders": {
"/status-changes": {
"post": {
"summary": "Создать заявку на ремонт",
"summary": "Создать документ изменения статуса оборудования",
"security": [
{
"bearerAuth": []
}
],
"tags": [
"заявками на ремонт"
"документами изменения статуса оборудования"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepairOrderCreate"
"$ref": "#/components/schemas/ChangeEquipmentStatusCreate"
}
}
}