HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
[New] 아만드팀
[New] 아만드팀
/
🌟
팀프로젝트
/
/reservations

/reservations

기타 헤더
Authorization
Method
Post
Domain
Guest
Reservation
담당자
Yu Min hwan
리뷰
설명
예약 생성
완료?
완료?
반환코드
201
created

Request body

{ "checkIn":"2022-06-30", "checkOut":"2022-07-03", "totalGuest":1, "totalPrice":300000, "roomId":1 }
 

Resoponse

HTTP/1.1 201 Created Location: http://localhost:8080/reservations/1 Content-Type: application/json Content-Length: 288 { "data":{ "reservation":{ "id":1, "checkIn":"2022-07-05", "checkOut":"2022-07-08", "totalGuest":1, "totalPrice":300000, "reservationStatus":"PENDING" }, "room":{ "roomId":1, "name":"별빛밤", "roomAddress":{ "zipcode":"00000", "address":"창원", "detailAddress":"의창구" } }, "host":{ "id":1, "name":"host", "email":"host@gmail.com" } } }
 

예외

  • 숙소가 이미 예약되어 있다
  • 금액이 부족하다.
    • 넘어온 totalPrice 가격과 방 가격 비교
  • 카드가 invalid 하다 - 결제실패 (옵션)
 
 

sequenceDiagram Guest->>+Client: 예약 생성 요청 Client->>Amabnb: POST /reservations Note over Client, Amabnb: 예약 생성 요청 API Amabnb->>+Reservation: 예약 생성 요청 Reservation ->> Room : 예약 정보 검증 Room -->> Reservation : 응답 및 예외처리 Reservation-->>Amabnb: 응답 및 예외처리 Amabnb-->>Client: 응답 및 예외처리 Client-->>Guest: 응답 및 예외처리