-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreservation-service.json
More file actions
1 lines (1 loc) · 16.1 KB
/
Copy pathreservation-service.json
File metadata and controls
1 lines (1 loc) · 16.1 KB
1
{"openapi":"3.1.0","info":{"title":"Reservation Service API","description":"예약 서비스 API","version":"v1"},"servers":[{"url":"http://localhost:8000","description":"Gateway"}],"security":[{"X-User-Id":[],"X-User-Role":[]}],"tags":[{"name":"Reservation Internal","description":"서비스 내부/관리자 호출용 예약 API"}],"paths":{"/api/v1/slots":{"get":{"tags":["슬롯 관리"],"summary":"슬롯 목록 조회","operationId":"getSlots","parameters":[{"name":"storeId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"date","in":"query","required":false,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseListSlotResponse"}}}}}},"post":{"tags":["슬롯 관리"],"summary":"슬롯 생성","operationId":"createSlot","parameters":[{"name":"X-User-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSlotRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseSlotResponse"}}}}}}},"/api/v1/reservations":{"post":{"tags":["예약 관리 (사용자)"],"summary":"예약 생성","operationId":"createReservation","parameters":[{"name":"X-User-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReservationRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseReservationResponse"}}}}}}},"/api/v1/internal/reservations/stores/{storeId}/capacity/restore":{"post":{"tags":["Reservation Internal"],"summary":"슬롯 정원 Redis 값 복구","description":"Redis 장애로 유실된 slot:capacity:{slotId}를 DB 기준으로 재계산하여 복구한다. slotDate 미지정 시 오늘 이후 OPEN 슬롯 전체가 대상.","operationId":"restoreSlotCapacity","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"slotDate","in":"query","required":false,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseSlotCapacityRestoreResponse"}}}}}}},"/api/v1/stores/{storeId}/reservations/{reservationId}/visit":{"patch":{"tags":["예약 관리 (점주)"],"summary":"방문 처리","operationId":"visitReservation","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"reservationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseReservationResponse"}}}}}}},"/api/v1/stores/{storeId}/reservations/{reservationId}/no-show":{"patch":{"tags":["예약 관리 (점주)"],"summary":"노쇼 처리","operationId":"noShowReservation","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"reservationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseReservationResponse"}}}}}}},"/api/v1/stores/{storeId}/reservations/{reservationId}/cancel":{"patch":{"tags":["예약 관리 (점주)"],"summary":"점주 예약 취소","operationId":"cancelByStore","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"reservationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelReservationRequest"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseReservationResponse"}}}}}}},"/api/v1/slots/{slotId}":{"get":{"tags":["슬롯 관리"],"summary":"슬롯 단건 조회","operationId":"getSlot","parameters":[{"name":"slotId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseSlotResponse"}}}}}},"delete":{"tags":["슬롯 관리"],"summary":"슬롯 삭제","operationId":"deleteSlot","parameters":[{"name":"X-User-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"slotId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}}}},"patch":{"tags":["슬롯 관리"],"summary":"슬롯 수정","operationId":"updateSlot","parameters":[{"name":"X-User-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"slotId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSlotRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseSlotResponse"}}}}}}},"/api/v1/reservations/{reservationId}/change":{"patch":{"tags":["예약 관리 (사용자)"],"summary":"예약 변경","operationId":"changeReservation","parameters":[{"name":"X-User-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"reservationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeReservationRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseReservationResponse"}}}}}}},"/api/v1/reservations/{reservationId}/cancel":{"patch":{"tags":["예약 관리 (사용자)"],"summary":"예약 취소","operationId":"cancelReservation","parameters":[{"name":"X-User-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"reservationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelReservationRequest"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseReservationResponse"}}}}}}},"/api/v1/stores/{storeId}/statistics":{"get":{"tags":["예약 통계 (점주)"],"summary":"매장 예약 통계 조회","operationId":"getStatistics","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseReservationStatisticsResponse"}}}}}}},"/api/v1/stores/{storeId}/reservations":{"get":{"tags":["예약 관리 (점주)"],"summary":"매장 예약 목록 조회","operationId":"getStoreReservations","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PAYMENT_PENDING","CONFIRMED","VISITED","NO_SHOW","CANCELLED"]}},{"name":"date","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponsePageResponseReservationResponse"}}}}}}},"/api/v1/stores/{storeId}/reservations/{reservationId}":{"get":{"tags":["예약 관리 (점주)"],"summary":"매장 예약 단건 조회","operationId":"getStoreReservation","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"reservationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseReservationResponse"}}}}}}},"/api/v1/reservations/slots/{storeId}":{"get":{"tags":["슬롯 조회 (유저)"],"summary":"가게별 예약 가능 슬롯 조회","operationId":"getAvailableSlots","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"date","in":"query","required":false,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseListSlotResponse"}}}}}}},"/api/v1/reservations/me":{"get":{"tags":["예약 관리 (사용자)"],"summary":"내 예약 목록 조회","operationId":"getMyReservations","parameters":[{"name":"X-User-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PAYMENT_PENDING","CONFIRMED","VISITED","NO_SHOW","CANCELLED"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponsePageResponseReservationResponse"}}}}}}},"/api/v1/reservations/me/{reservationId}":{"get":{"tags":["예약 관리 (사용자)"],"summary":"내 예약 단건 조회","operationId":"getMyReservation","parameters":[{"name":"X-User-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"reservationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseReservationResponse"}}}}}}}},"components":{"schemas":{"CreateSlotRequest":{"type":"object","properties":{"storeId":{"type":"string","format":"uuid"},"storeName":{"type":"string","maxLength":100,"minLength":0},"slotDate":{"type":"string","format":"date"},"slotTime":{"type":"string"},"maxCapacity":{"type":"integer","format":"int32","minimum":1},"depositRequired":{"type":"boolean"},"depositAmount":{"type":"integer","format":"int64"},"depositAmountValid":{"type":"boolean"}},"required":["slotDate","slotTime","storeId","storeName"]},"ApiResponseSlotResponse":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/SlotResponse"}}},"SlotResponse":{"type":"object","properties":{"slotId":{"type":"string","format":"uuid"},"storeId":{"type":"string","format":"uuid"},"storeName":{"type":"string"},"slotDate":{"type":"string","format":"date"},"slotTime":{"type":"string"},"maxCapacity":{"type":"integer","format":"int32"},"remainingCapacity":{"type":"integer","format":"int32"},"depositRequired":{"type":"boolean"},"depositAmount":{"type":"integer","format":"int64"},"status":{"type":"string","enum":["OPEN","FULL","CLOSED","CANCELLED"]},"createdAt":{"type":"string","format":"date-time"}}},"CreateReservationRequest":{"type":"object","properties":{"slotId":{"type":"string","format":"uuid"},"bookerName":{"type":"string","minLength":1},"bookerPhone":{"type":"string","minLength":1},"reservationSize":{"type":"integer","format":"int32","minimum":1},"requestMessage":{"type":"string"},"paymentMethod":{"type":"string"}},"required":["bookerName","bookerPhone","slotId"]},"ApiResponseReservationResponse":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/ReservationResponse"}}},"ReservationResponse":{"type":"object","properties":{"reservationId":{"type":"string","format":"uuid"},"slotId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"storeId":{"type":"string","format":"uuid"},"storeName":{"type":"string"},"scheduledAt":{"type":"string","format":"date-time"},"bookerName":{"type":"string"},"bookerPhone":{"type":"string"},"reservationSize":{"type":"integer","format":"int32"},"requestMessage":{"type":"string"},"status":{"type":"string","enum":["PAYMENT_PENDING","CONFIRMED","VISITED","NO_SHOW","CANCELLED"]},"createdAt":{"type":"string","format":"date-time"}}},"ApiResponseSlotCapacityRestoreResponse":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/SlotCapacityRestoreResponse"}}},"SlotCapacityRestoreItem":{"type":"object","properties":{"slotId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["RESTORED","SKIPPED"]},"before":{"type":"integer","format":"int64"},"after":{"type":"integer","format":"int64"}}},"SlotCapacityRestoreResponse":{"type":"object","properties":{"storeId":{"type":"string","format":"uuid"},"slotDate":{"type":"string","format":"date"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SlotCapacityRestoreItem"}},"restoredAt":{"type":"string","format":"date-time"}}},"CancelReservationRequest":{"type":"object","properties":{"cancelReason":{"type":"string"}}},"UpdateSlotRequest":{"type":"object","properties":{"slotDate":{"type":"string","format":"date"},"slotTime":{"type":"string"},"maxCapacity":{"type":"integer","format":"int32","minimum":1},"depositRequired":{"type":"boolean"},"depositAmount":{"type":"integer","format":"int64"},"depositAmountValid":{"type":"boolean"}}},"ChangeReservationRequest":{"type":"object","properties":{"reservationSize":{"type":"integer","format":"int32","minimum":1},"newSlotId":{"type":"string","format":"uuid"}}},"ApiResponseReservationStatisticsResponse":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/ReservationStatisticsResponse"}}},"DailyStat":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer","format":"int64"},"revenue":{"type":"integer","format":"int64"}}},"Period":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}}},"ReservationStatisticsResponse":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/Period"},"totalReservations":{"type":"integer","format":"int64"},"confirmed":{"type":"integer","format":"int64"},"cancelled":{"type":"integer","format":"int64"},"noShow":{"type":"integer","format":"int64"},"cancellationRate":{"type":"number","format":"double"},"noShowRate":{"type":"number","format":"double"},"totalDepositAmount":{"type":"integer","format":"int64"},"dailyStats":{"type":"array","items":{"$ref":"#/components/schemas/DailyStat"}}}},"ApiResponsePageResponseReservationResponse":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/PageResponseReservationResponse"}}},"PageResponseReservationResponse":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/ReservationResponse"}},"page":{"type":"integer","format":"int32"},"size":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"}}},"ApiResponseListSlotResponse":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/SlotResponse"}}}},"ApiResponseVoid":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{}}}},"securitySchemes":{"X-User-Id":{"type":"apiKey","name":"X-User-Id","in":"header"},"X-User-Role":{"type":"apiKey","name":"X-User-Role","in":"header"}}}}