Skip to content

BE handoff — 시설·숙박·커머스 운영 상태 계약

원장 소유권

  • 시설관리: facility_asset, facility_work_order, facility_inspection, facility_repair
  • 숙박 운영: reservation, stay, room_operational_status, housekeeping_task
  • 상품·주문: commerce_product, commerce_order; 결제 원장과 창고 수불은 별도 서비스 소유
  • Company 자산: company_asset, asset_assignment; 시설 자산 테이블과 통합하지 않는다.

상태 전이 원칙

모든 변경 API는 office_id, actor_id, idempotency_key, expected_version을 받고 감사로그를 남긴다. 예약 체크인, 작업 완료, 결제 취소, 재고 차감은 중복 요청으로 두 번 처리되면 안 된다.

외부 서비스 응답은 내부 저장과 구분한다.

json
{
  "localStatus": "saved",
  "externalStatus": "not_connected|pending|succeeded|failed",
  "auditId": "audit_...",
  "retryable": false
}

필수 후속 구현

  1. 시설 상태 이상 → 작업 → 점검/수리 → 시설 자산 이력의 참조키
  2. 예약 → 체크인 → 룸 상태 → 하우스키핑 → 판매 가능 전이 규칙
  3. 주문 → PG 결과 → 출고 요청 → 창고 수불 결과의 이벤트 계약
  4. 로딩·부분실패·재시도를 위한 조회 상태와 오류 코드

Prototype 로컬 상태를 운영 저장 성공으로 승격하지 않는다.