enum EquipmentStatus { value Active { label "В эксплуатации"; } value Repair { label "В ремонте"; } value Reserve { label "В резерве"; } value WriteOff { label "Списано"; } } // Оборудование entity Equipment { description "Единица оборудования — объект ремонта и технического обслуживания"; attribute id { type uuid; key primary; } attribute name { description "Название оборудования"; is required; type string; } attribute serialNumber { description "Заводской (серийный) номер"; type string; is required; } attribute dateOfInspection { description "Дата поверки"; type date; } attribute commissionedAt { description "Дата изготовления"; type date; } attribute status { description "Текущий статус"; type EquipmentStatus; default Active; is required; } } // Документ изменения статуса оборудования — с характеристиками: дата события, ссылка на оборудование, новый статус, возможно ответственный entity ChangeEquipmentStatus { description "Документ изменения статуса оборудования"; attribute equipmentId { description "Оборудование"; type Equipment; } attribute newStatus { description "Новый статус"; type EquipmentStatus; is required; //sync Equipment.status; } attribute number { description "Номер"; type string; } attribute date { description "Дата изменения статуса"; is required; type date; } attribute responsible { description "Ответственный"; type string; } }