init equipment & change-status

This commit is contained in:
MaKarin
2026-04-03 21:45:13 -07:00
parent c89c23fd1d
commit cec42f08d0
87 changed files with 19086 additions and 86 deletions

View File

@@ -1,90 +1,367 @@
enum EquipmentStatus {
value Active {
label "В эксплуатации";
}
value Repair {
label "В ремонте";
}
value Reserve {
label "В резерве";
}
value WriteOff {
label "Списано";
}
}
// Оборудование
entity Equipment {
description "Единица оборудования — объект ремонта и технического обслуживания";
dto DTO.Equipment {
description "Полный response-объект для единицы оборудования";
attribute id {
type uuid;
key primary;
map Equipment.id;
}
attribute name {
type string;
description "Название оборудования";
map Equipment.name;
}
attribute serialNumber {
type string;
description "Заводской (серийный) номер";
map Equipment.serialNumber;
}
attribute dateOfInspection {
type date;
is nullable;
description "Дата поверки";
map Equipment.dateOfInspection;
}
attribute commissionedAt {
type date;
is nullable;
description "Дата изготовления";
map Equipment.commissionedAt;
}
attribute status {
type EquipmentStatus;
description "Текущий статус";
map Equipment.status;
}
}
dto DTO.EquipmentCreate {
description "Тело запроса на создание единицы оборудования";
attribute name {
type string;
description "Название оборудования";
is required;
type string;
map Equipment.name;
}
attribute serialNumber {
description "Заводской (серийный) номер";
type string;
description "Заводской (серийный) номер";
is required;
map Equipment.serialNumber;
}
attribute dateOfInspection {
type date;
is nullable;
description "Дата поверки";
type date;
map Equipment.dateOfInspection;
}
attribute commissionedAt {
description "Дата изготовления";
type date;
is nullable;
description "Дата изготовления";
map Equipment.commissionedAt;
}
attribute status {
description "Текущий статус";
type EquipmentStatus;
default Active;
description "Текущий статус";
is required;
map Equipment.status;
}
}
// Документ изменения статуса оборудования — с характеристиками: дата события, ссылка на оборудование, новый статус, возможно ответственный
entity ChangeEquipmentStatus {
description "Документ изменения статуса оборудования";
attribute equipmentId {
description "Оборудование";
type Equipment;
}
attribute newStatus {
description "Новый статус";
type EquipmentStatus;
is required;
//sync Equipment.status;
}
attribute number {
description "Номер";
dto DTO.EquipmentUpdate {
description "Тело запроса на обновление единицы оборудования";
attribute name {
type string;
description "Название оборудования";
is nullable;
map Equipment.name;
}
attribute serialNumber {
type string;
description "Заводской (серийный) номер";
is nullable;
map Equipment.serialNumber;
}
attribute dateOfInspection {
type date;
is nullable;
description "Дата поверки";
map Equipment.dateOfInspection;
}
attribute commissionedAt {
type date;
is nullable;
description "Дата изготовления";
map Equipment.commissionedAt;
}
attribute status {
type EquipmentStatus;
description "Текущий статус";
is nullable;
map Equipment.status;
}
}
dto DTO.EquipmentListRequest {
description "Запрос для постраничного получения списка оборудования с фильтрацией";
attribute page {
type DTO.PageRequest;
}
attribute filterName {
type string;
is nullable;
}
attribute filterSerialNumber {
type string;
is nullable;
}
attribute filterStatus {
type EquipmentStatus;
is nullable;
}
}
dto DTO.EquipmentListResponse {
description "Ответ с постраничным списком оборудования и метаданными";
attribute content {
type DTO.Equipment[];
}
attribute pageInfo {
type DTO.PageInfo;
}
}
dto DTO.ChangeEquipmentStatus {
description "Полный response-объект для документа изменения статуса";
attribute equipmentId {
type Equipment;
is nullable;
map ChangeEquipmentStatus.equipmentId;
}
attribute newStatus {
type EquipmentStatus;
description "Новый статус";
map ChangeEquipmentStatus.newStatus;
}
attribute number {
type string;
description "Номер";
is nullable;
map ChangeEquipmentStatus.number;
}
attribute date {
type date;
description "Дата изменения статуса";
map ChangeEquipmentStatus.date;
}
attribute responsible {
type string;
description "Ответственный";
is nullable;
map ChangeEquipmentStatus.responsible;
}
}
dto DTO.ChangeEquipmentStatusCreate {
description "Тело запроса на создание документа изменения статуса";
attribute equipmentId {
type Equipment;
is nullable;
map ChangeEquipmentStatus.equipmentId;
}
attribute newStatus {
type EquipmentStatus;
description "Новый статус";
is required;
map ChangeEquipmentStatus.newStatus;
}
attribute number {
type string;
description "Номер";
is nullable;
map ChangeEquipmentStatus.number;
}
attribute date {
type date;
description "Дата изменения статуса";
is required;
type date;
map ChangeEquipmentStatus.date;
}
attribute responsible {
description "Ответственный";
type string;
description "Ответственный";
is nullable;
map ChangeEquipmentStatus.responsible;
}
}
dto DTO.ChangeEquipmentStatusUpdate {
description "Тело запроса на обновление документа изменения статуса";
attribute equipmentId {
type Equipment;
is nullable;
map ChangeEquipmentStatus.equipmentId;
}
attribute newStatus {
type EquipmentStatus;
description "Новый статус";
is nullable;
map ChangeEquipmentStatus.newStatus;
}
attribute number {
type string;
description "Номер";
is nullable;
map ChangeEquipmentStatus.number;
}
attribute date {
type date;
description "Дата изменения статуса";
is nullable;
map ChangeEquipmentStatus.date;
}
attribute responsible {
type string;
description "Ответственный";
is nullable;
map ChangeEquipmentStatus.responsible;
}
}
dto DTO.ChangeEquipmentStatusListRequest {
description "Запрос для постраничного получения списка документов изменения статуса с фильтрацией";
attribute page {
type DTO.PageRequest;
}
attribute filterEquipmentId {
type uuid;
is nullable;
}
attribute filterNumber {
type string;
is nullable;
}
attribute filterDate {
type date;
is nullable;
}
attribute filterResponsible {
type string;
is nullable;
}
}
dto DTO.ChangeEquipmentStatusListResponse {
description "Ответ с постраничным списком документов изменения статуса и метаданными";
attribute content {
type DTO.ChangeEquipmentStatus[];
}
attribute pageInfo {
type DTO.PageInfo;
}
}
api API.Equipment {
description "API управления справочником оборудования";
endpoint listEquipment {
label "POST /equipment/page";
description "Постраничный список оборудования с фильтрацией";
attribute request {
type DTO.EquipmentListRequest;
}
attribute response {
type DTO.EquipmentListResponse;
}
}
endpoint getEquipment {
label "GET /equipment/{id}";
description "Получить единицу оборудования по идентификатору";
attribute id {
type uuid;
}
attribute response {
type DTO.Equipment;
}
}
endpoint createEquipment {
label "POST /equipment";
description "Создать новую единицу оборудования";
attribute request {
type DTO.EquipmentCreate;
}
}
endpoint updateEquipment {
label "PUT /equipment/{id}";
description "Обновить данные единицы оборудования";
attribute id {
type uuid;
}
attribute request {
type DTO.EquipmentUpdate;
}
}
endpoint deleteEquipment {
label "DELETE /equipment/{id}";
description "Удалить единицу оборудования";
attribute id {
type uuid;
}
}
}
api API.EquipmentStatusChange {
description "API управления документами изменения статуса оборудования";
endpoint listStatusChanges {
label "POST /status-changes/page";
description "Постраничный список документов изменения статуса с фильтрацией";
attribute request {
type DTO.ChangeEquipmentStatusListRequest;
}
attribute response {
type DTO.ChangeEquipmentStatusListResponse;
}
}
endpoint getStatusChange {
label "GET /status-changes/{id}";
description "Получить документ изменения статуса по идентификатору";
attribute id {
type uuid;
}
attribute response {
type DTO.ChangeEquipmentStatus;
}
}
endpoint createStatusChange {
label "POST /status-changes";
description "Создать документ изменения статуса оборудования";
attribute request {
type DTO.ChangeEquipmentStatusCreate;
}
}
endpoint updateStatusChange {
label "PUT /status-changes/{id}";
description "Обновить документ изменения статуса";
attribute id {
type uuid;
}
attribute request {
type DTO.ChangeEquipmentStatusUpdate;
}
}
endpoint deleteStatusChange {
label "DELETE /status-changes/{id}";
description "Удалить документ изменения статуса";
attribute id {
type uuid;
}
}
}