feat: add equipment area grouping, criticality, and batch inspection
All checks were successful
Deploy to Production / deploy (push) Successful in 1m7s

- Add area and criticality fields to Machine model with DB migration
- Add batch inspection endpoint (POST /inspections/batch) for area-wide inspection creation
- Rewrite MachineList with area grouping, criticality badges, and batch inspect button
- Update machine create/edit forms with area and criticality fields
- Update seed data with area/criticality values for all tenants
This commit is contained in:
Johngreen
2026-02-10 22:38:55 +09:00
parent 4c42f7aff8
commit febdbdc4f0
9 changed files with 455 additions and 43 deletions

View File

@@ -65,6 +65,8 @@ class Machine(Base):
manufacturer = Column(String(100), nullable=True)
installation_date = Column(TIMESTAMP(timezone=True), nullable=True)
location = Column(String(200), nullable=True)
area = Column(String(50), nullable=True) # 구역 그룹핑: Bay 3, A라인 등
criticality = Column(String(20), default="major") # critical | major | minor
rated_capacity = Column(String(100), nullable=True)
power_rating = Column(String(100), nullable=True)
description = Column(Text, nullable=True)
@@ -76,7 +78,11 @@ class Machine(Base):
"EquipmentPart", back_populates="machine", cascade="all, delete-orphan"
)
__table_args__ = (Index("ix_machines_tenant_id", "tenant_id"),)
__table_args__ = (
Index("ix_machines_tenant_id", "tenant_id"),
Index("ix_machines_tenant_area", "tenant_id", "area"),
Index("ix_machines_tenant_criticality", "tenant_id", "criticality"),
)
class EquipmentPart(Base):