func (repo *Repository) ReservationSummary(w http.ResponseWriter, r *http.Request) {
	reservation, ok := repo.App.Session.Get(r.Context(), "reservation").(models.Reservation) // type assertion
	if !ok {
		repo.App.Session.Put(r.Context(), "error", "can't get reservation from session")
		http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
		return
	}

	stringMap := make(map[string]string)
	stringMap["start_date"] = reservation.StartDate.Format("2006-01-02")
	stringMap["end_date"] = reservation.EndDate.Format("2006-01-02")

	repo.App.Session.Remove(r.Context(), "reservation")
	data := make(map[string]interface{})
	data["reservation"] = reservation
	render.Template(w, r, "reservation-summary.page.html", &models.TemplateData{
		Data:      data,
		StringMap: stringMap,
	})
}
// ReservationSummary displays the reservation summary page
ReservationSummary displays the reservation summary page
// ReservationSummary displays the reservation summary page
func (repo *Repository) ReservationSummary(w http.ResponseWriter, r *http.Request) {
	reservation, ok := repo.App.Session.Get(r.Context(), "reservation").(models.Reservation) 
	if !ok {
		repo.App.Session.Put(r.Context(), "error", "can't get reservation from session")
		http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
		return
	}
	stringMap := make(map[string]string)
	stringMap["start_date"] = reservation.StartDate.Format("2006-01-02")
	stringMap["end_date"] = reservation.EndDate.Format("2006-01-02")
	repo.App.Session.Remove(r.Context(), "reservation")
	data := make(map[string]interface{})
	data["reservation"] = reservation
	render.Template(w, r, "reservation-summary.page.html", &models.TemplateData{
		Data:      data,
		StringMap: stringMap,
	})
}
func ( repo * Repository ) ReservationSummary ( w http . ResponseWriter , r * http . Request ) { reservation , ok := repo . App . Session . Get ( r . Context ( ) , " " ) . ( models . Reservation ) if ! ok { repo . App . Session . Put ( r . Context ( ) , " " , " " ) http . Redirect ( w , r , " " , http . StatusTemporaryRedirect ) return } stringMap := make ( map [ string ] string ) stringMap [ " " ] = reservation . StartDate . Format ( " " ) stringMap [ " " ] = reservation . EndDate . Format ( " " ) repo . App . Session . Remove ( r . Context ( ) , " " ) data := make ( map [ string ] interface { } ) data [ " " ] = reservation render . Template ( w , r , " " , & models . TemplateData { Data : data , StringMap : stringMap , } ) }
ReservationSummary displays the reservation summary page
ReservationSummary displays the reservation summary page
// type assertion