기능 추가 — 재조치 요청 (조치 기록 유지 재출동)
정비사 조치 완료 후 동일 문제 재발 시 관리자가 기존 기록을 보존한 채
재조치를 요청할 수 있는 기능 추가.
- DB: repairs.re_dispatch_requested/at, reports.re_dispatch_count 컬럼 추가
- 재조치 요청 엔드포인트 (POST /repairs/{id}/re-dispatch): 기존 repair에 플래그,
연결 신고를 pending으로 복원, re_dispatch_count 증가
- pending 상태 신고는 새 조치 생성으로 분기 (in_progress만 기존 수정 모드)
- report-detail: 조치승인·취소 사이에 "🔁 재조치 요청" 버튼, 이전 조치 이력 카드
- 정비사 대시보드: 재조치 건에 🔁 뱃지 및 강조 버튼색 표시
- 엑셀 export: 재조치횟수 컬럼 추가
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -63,6 +63,7 @@ class Report(Base):
|
||||
closure_note = Column(Text)
|
||||
closed_at = Column(TIMESTAMP)
|
||||
closed_by = Column(Integer, ForeignKey("users.id"), nullable=True)
|
||||
re_dispatch_count = Column(Integer, default=0)
|
||||
charger = relationship("Charger", back_populates="reports")
|
||||
photos = relationship("ReportPhoto", back_populates="report", cascade="all, delete-orphan")
|
||||
repair_links = relationship("RepairReport", back_populates="report")
|
||||
@@ -90,6 +91,8 @@ class Repair(Base):
|
||||
mechanic_lng = Column(Float)
|
||||
approved_at = Column(TIMESTAMP)
|
||||
approved_by = Column(Integer, ForeignKey("users.id"))
|
||||
re_dispatch_requested = Column(Boolean, default=False)
|
||||
re_dispatch_requested_at = Column(TIMESTAMP)
|
||||
mechanic = relationship("User", foreign_keys=[mechanic_id])
|
||||
approver = relationship("User", foreign_keys=[approved_by])
|
||||
report_links = relationship("RepairReport", back_populates="repair", cascade="all, delete-orphan")
|
||||
|
||||
Reference in New Issue
Block a user