types

package
v0.0.0-...-ef3362d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinFirstNameLength = 2
	MinLastNameLength  = 2
	MinPasswordLength  = 7
)

Variables

This section is empty.

Functions

func IsValidPassword

func IsValidPassword(encpw, pw string) bool

Types

type Booking

type Booking struct {
	ID         primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	UserID     primitive.ObjectID `json:"userID,omitempty" bson:"userID,omitempty"`
	RoomID     primitive.ObjectID `json:"roomID,omitempty" bson:"roomID,omitempty"`
	FromDate   time.Time          `json:"fromDate,omitempty" bson:"fromDate,omitempty"`
	TillDate   time.Time          `json:"tillDate,omitempty" bson:"tillDate,omitempty"`
	NumPersons int                `json:"numPersons,omitempty" bson:"numPersons,omitempty"`
	Cancelled  bool               `json:"cancelled" bson:"cancelled"`
}

type CreateUserParams

type CreateUserParams struct {
	FirstName string `json:"firstName" bson:"firstName" `
	LastName  string `json:"lastName" bson:"lastName"`
	Email     string `json:"email" bson:"email"`
	Password  string `json:"password" bson:"password"`
}

func (CreateUserParams) ValidateUsers

func (params CreateUserParams) ValidateUsers() map[string]string

type Hotel

type Hotel struct {
	ID       primitive.ObjectID   `json:"id,omitempty" bson:"_id,omitempty"`
	Name     string               `josn:"name" bson:"name"`
	Location string               `json:"location" bson:"location"`
	Rooms    []primitive.ObjectID `json:"rooms" bson:"rooms"`
	Rating   int                  `json:"rating" bson:"rating"`
}

type Room

type Room struct {
	ID      primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	Size    string             `json:"size" bson:"size"` // size ,normal , kingszie
	Price   float64            `json:"price" bson:"price"`
	Seaside bool               `json:"seaside bson:"seaside"`
	HotelID primitive.ObjectID `json:"hotelID" bson:"hotelID"`
}

type RoomType

type RoomType int

type UpdateUserParams

type UpdateUserParams struct {
	FirstName string `json:"firstName" bson:"firstName" `
	LastName  string `json:"lastName" bson:"lastName"`
}

type User

type User struct {
	ID                primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	FirstName         string             `json:"firstName" bson:"firstName"`
	LastName          string             `json:"lastName" bson:"lastName"`
	Email             string             `json:"email" bson:"email"`
	EncryptedPassword string             `json:"-" bson:"EncryptedPassword"`
	IsAdmin           bool               `json:"isAdmin" bson:"isAdmin"`
}

func NewUserFromParams

func NewUserFromParams(params CreateUserParams) (*User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL