Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Media ¶
type Reservation ¶
type Reservation struct {
gorm.Model
User User
UserID uint `json:"user_id,omitempty"`
Room Room
RoomID uint `json:"room_id,omitempty"`
StartDate time.Time `json:"start_date" json:"start_date"`
EndDate time.Time `json:"end_date" json:"end_date"`
Price float32 `json:"price" json:"price,omitempty"`
Total float32 `json:"total" json:"total,omitempty"`
}
func (*Reservation) Delete ¶
func (u *Reservation) Delete(id uint) error
func (*Reservation) Get ¶
func (u *Reservation) Get(*Reservation) []Reservation
func (*Reservation) Save ¶
func (u *Reservation) Save() (*Reservation, error)
func (*Reservation) Update ¶
func (u *Reservation) Update() (*Reservation, error)
type Review ¶
type Room ¶
type Room struct {
gorm.Model
RoomName string `json:"room_name,omitempty"`
HomeType string `json:"home_type,omitempty"`
RoomType string `json:"room_type,omitempty"`
TotalOccupancy uint8 `gorm:"default:1" json:"total_occupancy,omitempty"`
TotalBedrooms uint8 `gorm:"default:1" json:"total_bedrooms,omitempty"`
Summary string `gorm:"size:255" json:"summary,omitempty"`
Address string `gorm:"size:255" json:"address,omitempty"`
HasTV *bool `gorm:"default:false" json:"has_tv,omitempty"`
HasKitchen *bool `gorm:"default:false" json:"has_kitchen,omitempty"`
HasAirCon *bool `gorm:"default:false" json:"has_air_con,omitempty"`
HasHeating *bool `gorm:"default:false" json:"has_heating,omitempty"`
HasInternet *bool `gorm:"default:false" json:"has_internet,omitempty"`
Price float32 `json:"price,omitempty"`
PublishedAt time.Time `json:"published_at,omitempty"`
Latitude float32 `gorm:"default:0" json:"latitude,omitempty"`
Longitude float32 `gorm:"default:0" json:"longitude,omitempty"`
UserID uint
User User
Reservation []Reservation
}
type User ¶
type User struct {
gorm.Model
Password string `gorm:"size:255;not null;omitempty" json:"-"`
Email string `gorm:"size:255;not null;unique;"`
EmailVerifiedAt time.Time
Reservations *[]Reservation
Rooms *[]Room
Details *UserDetails
}
func FindUserByEmail ¶
func FindUserById ¶
func FindUserByUsername ¶
func (*User) ValidatePassword ¶
type UserDetails ¶
type UserDetails struct {
gorm.Model
UserID uint `gorm:"omitempty;unique;not null" json:"user_id"`
FirstName string `gorm:"size:255;not null;omitempty" json:"first_name"`
LastName string `gorm:"size:255;not null;omitempty" json:"last_name"`
PhoneNumber string `gorm:"size:255;not null;omitempty" json:"phone_number"`
Description string `gorm:"type:text;size:500;not null;omitempty" json:"description"`
ProfileImage string `gorm:"size:255;omitempty" json:"profile_image"`
RememberToken string `gorm:"size:255;omitempty" json:"-"`
}
func (*UserDetails) Delete ¶
func (u *UserDetails) Delete(id uint) error
func (*UserDetails) Get ¶
func (u *UserDetails) Get(*UserDetails) []UserDetails
func (*UserDetails) Save ¶
func (u *UserDetails) Save() (*UserDetails, error)
func (*UserDetails) Update ¶
func (u *UserDetails) Update() (*UserDetails, error)
Click to show internal directories.
Click to hide internal directories.