@startuml Add Reservation (POST)Reservation

header Sample reservation Sequence Diagram
footer Page %page% of %lastpage%
title "Add Reservations (POST)"

actor "Client" as client
participant "<<javaScript>>\n:server" as server
participant "<<router>>\n:reservations" as routerReservations
participant "<<controllers>>\n:reservations" as controllersReservations
participant "<<model>>\n:Reservation" as modelReservation
database "<<MongoDB>>\n:reservations" as ReservationsDatabase

client->server ++:req.post('/reservations')
server->routerReservations ++:app.use('/api-informations/\nreservations', reservations)
routerReservations -> controllersReservations ++:addReservation()
controllersReservations->modelReservation ++:create(req.body)
modelReservation ->ReservationsDatabase ++: ReservationSchema
ReservationsDatabase --> modelReservation --: reservation
controllersReservations <-- modelReservation --:reservation
controllersReservations->client --:response

@enduml
