Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookRoomParams ¶
type BookRoomParams struct { NumPeople int `json:"numPeople"` FromDate time.Time `json:"fromDate"` ToDate time.Time `json:"toDate"` }
func (BookRoomParams) Validate ¶
func (p BookRoomParams) Validate() map[string]string
type Booking ¶
type Booking struct { ID string `bson:"_id,omitempty" json:"id,omitempty"` UserID string `bson:"userID" json:"userID"` RoomID string `bson:"roomID" json:"roomID"` NumPeople int `bson:"numPeople" json:"numPeople"` FromDate time.Time `bson:"fromDate" json:"fromDate"` ToDate time.Time `bson:"toDate" json:"toDate"` Canceled bool `bson:"canceled" json:"canceled"` }
type CreateRoomParams ¶
func (CreateRoomParams) ToBSON ¶
func (p CreateRoomParams) ToBSON() bson.M
type CreateUserParams ¶
type CreateUserParams struct { FirstName string `json:"firstName"` LastName string `json:"lastName"` Email string `json:"email"` Password string `json:"password"` }
func (CreateUserParams) Validate ¶
func (p CreateUserParams) Validate() map[string]string
type Hotel ¶
type Hotel struct { ID string `bson:"_id,omitempty" json:"id,omitempty"` Name string `bson:"name" json:"name"` Location string `bson:"location" json:"location"` Rooms []string `bson:"rooms" json:"rooms"` Rating int `bson:"rating" json:"rating"` }
func (*Hotel) MakeHotelWithRooms ¶
func (h *Hotel) MakeHotelWithRooms(rooms []*Room) *HotelWithRooms
type HotelQueryParams ¶
type HotelWithRooms ¶
type Room ¶
type Room struct { ID string `bson:"_id,omitempty" json:"id,omitempty"` Type string `bson:"type" json:"type"` Price float64 `bson:"price" json:"price"` HotelID string `bson:"hotelID" json:"hotelID"` }
func NewRoomFromParams ¶
func NewRoomFromParams(params *CreateRoomParams, id string) *Room
type UpdateHotelParams ¶
type UpdateHotelParams struct { Name string `json:"name"` Location string `json:"location"` Rooms []string `json:"rooms"` }
func (UpdateHotelParams) ToBSON ¶
func (p UpdateHotelParams) ToBSON() bson.M
type UpdateUserParams ¶
type UpdateUserParams struct { FirstName string `json:"firstName"` LastName string `json:"lastName"` }
func (UpdateUserParams) ToBSON ¶
func (p UpdateUserParams) ToBSON() bson.M
func (UpdateUserParams) Validate ¶
func (p UpdateUserParams) Validate() map[string]string
type User ¶
type User struct { ID string `bson:"_id,omitempty" json:"id,omitempty"` FirstName string `bson:"firstName" json:"firstName"` LastName string `bson:"lastName" json:"lastName"` Email string `bson:"email" json:"email"` EncryptedPassword string `bson:"encryptedPassword" json:"-"` Admin bool `bson:"admin" json:"-"` }
func NewUserFromParams ¶
func NewUserFromParams(params *CreateUserParams) (*User, error)
Click to show internal directories.
Click to hide internal directories.