entity

package
v0.0.0-...-41aeae6 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyVenue

type ApplyVenue struct {
	ID          uint      `json:"id" gorm:"primaryKey"`
	UserID      uuid.UUID `json:"user_id"`
	VenueDayID  uint      `json:"venue_day_id"`
	VenueDay    VenueDay  `json:"venue_day" gorm:"foreignKey:VenueDayID"`
	StatusApply string    `json:"status_apply" sql:"type:ENUM('WAITING', 'APPROVED', 'REJECTED')" gorm:"default:'WAITING'"`
}

type Day

type Day struct {
	ID   uint   `json:"id" gorm:"autoIncreament;primaryKey"`
	Name string `json:"day"`
}

type EndTime

type EndTime struct {
	StudioID    uint `json:"studio_id" gorm:"primaryKey"`
	TimeID      uint `json:"time_id" gorm:"primaryKey"`
	Time        Time `json:"time" gorm:"foreignKey:TimeID"`
	IsAvailable bool `json:"isAvailable" gorm:"default:true"`
}

type Instrument

type Instrument struct {
	ID            uint      `json:"id" gorm:"autoIncreament;primaryKey"`
	Name          string    `json:"name"`
	Owner         string    `json:"owner"`
	ShortDesc     string    `json:"short_desc"`
	Description   string    `json:"description"`
	RentPrice     float64   `json:"rent_price"`
	District      string    `json:"district"`
	City          string    `json:"city"`
	Province      string    `json:"province"`
	Street        string    `json:"street"`
	Spesification string    `json:"spesification"`
	OwnerNumber   string    `json:"owner_number"`
	Weight        int       `json:"weight"`
	IsBooked      bool      `json:"is_booked"`
	Photo         string    `json:"photo"`
	Rating        float64   `json:"rating"`
	CreateAt      time.Time `json:"-" gorm:"autoCreateTime"`
	UpdateAt      time.Time `json:"-" gorm:"autoUpdateTime"`
}

type RentInstrument

type RentInstrument struct {
	ID             uint       `json:"id" gorm:"autoIncreament;primaryKey"`
	UserID         uuid.UUID  `json:"user_id" gorm:"type:char(36)"`
	InstrumentID   uint       `json:"-"`
	Instrument     Instrument `json:"-" gorm:"foreignKey:InstrumentID"`
	StartDate      string     `json:"start_date"`
	LengthLoan     uint       `json:"length_loan" binding:"required"`
	Courier        string     `json:"courier" binding:"required"`
	RentCost       float64    `json:"rent_cost" binding:"required"`
	ShippingCost   float64    `json:"shipping_cost" binding:"required"`
	ServiceCost    float64    `json:"service_cost" binding:"required"`
	TotalCost      float64    `json:"total_cost"`
	EstimationTime string     `json:"estimation_time" binding:"required"`
	Status         string     `json:"status" gorm:"default:'PENDING'"`
	Note           string     `json:"note"`
}

type RentStudio

type RentStudio struct {
	ID          uint      `json:"id" gorm:"autoIncreament;primaryKey"`
	StudioID    uint      `json:"studio_id"`
	UserID      uuid.UUID `json:"user_id"`
	StartTime   string    `json:"start_time" binding:"required"`
	EndTime     string    `json:"end_time" binding:"required"`
	ServiceCost float64   `json:"service_cost" binding:"required"`
	TotalHour   uint      `json:"total_hour"`
	TotalCost   float64   `json:"total_cost"`
	Status      string    `json:"status" sql:"type:ENUM('PENDING', 'BOOKED', 'REJECTED')" gorm:"default:'PENDING'"`
}

type ResponseLogin

type ResponseLogin struct {
	User  *User  `json:"user"`
	Token string `json:"token"`
}

type ShippingCost

type ShippingCost struct {
	ProvinceDestination string `json:"province_destination"`
	CityDestination     string `json:"city_destination"`
}

type StartTime

type StartTime struct {
	StudioID    uint `json:"studio_id" gorm:"primaryKey"`
	TimeID      uint `json:"time_id" gorm:"primaryKey"`
	Time        Time `json:"time" gorm:"foreignKey:TimeID"`
	IsAvailable bool `json:"isAvailable" gorm:"default:true"`
}

type Studio

type Studio struct {
	ID           uint        `json:"id" gorm:"autoIncreament;primaryKey"`
	Name         string      `json:"name"`
	Address      string      `json:"address"`
	Description  string      `json:"description"`
	PricePerHour float64     `json:"price_per_hour"`
	OpenHour     string      `json:"open_hour"`
	IsAvailable  bool        `json:"is_available" gorm:"default:true"`
	Phone        string      `json:"phone"`
	Photo        string      `json:"photo"`
	Rating       float64     `json:"rating"`
	StartTime    []StartTime `json:"start_time" gorm:"foreignKey:StudioID"`
	EndTime      []EndTime   `json:"end_time" gorm:"foreignKey:StudioID"`
	CreateAt     time.Time   `json:"-" gorm:"autoCreateTime"`
	UpdateAt     time.Time   `json:"-" gorm:"autoUpdateTime"`
}

type Time

type Time struct {
	ID   uint   `json:"id" gorm:"autoIncreament;primaryKey"`
	Time string `json:"time"`
}

type User

type User struct {
	ID       uuid.UUID `json:"id" gorm:"type:char(36);primaryKey"`
	Name     string    `json:"name"`
	Username string    `json:"username" gorm:"unique"`
	Email    string    `json:"email" gorm:"unique"`
	Password string    `db:"password" json:"-"`
	Phone    string    `json:"phone" gorm:"type:varchar(13)"`
	Photo    string    `json:"photo"`
	City     string    `json:"city"`
	Province string    `json:"province"`
	Street   string    `json:"street"`
	Status   bool      `json:"status" gorm:"default:false"`
	CreateAt time.Time `json:"-" gorm:"autoCreateTime"`
	UpdateAt time.Time `json:"-" gorm:"autoUpdateTime"`
}

type UserLogin

type UserLogin struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type UserRegister

type UserRegister struct {
	Name     string `json:"name" binding:"required"`
	Email    string `json:"email" binding:"required"`
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
	Phone    string `json:"phone" binding:"required"`
}

type UserUpdate

type UserUpdate struct {
	Name     string `json:"name"`
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
	Phone    string `json:"phone"`
	City     string `json:"city"`
	Province string `json:"province"`
	Street   string `json:"street"`
}

type Venue

type Venue struct {
	ID          uint       `json:"id" gorm:"autoIncreament;primaryKey"`
	Name        string     `json:"name"`
	Address     string     `json:"username"`
	Description string     `json:"description"`
	Photo       string     `json:"photo"`
	Phone       string     `json:"phone"`
	VenueDays   []VenueDay `json:"venue_days" gorm:"foreignKey:VenueID"`
	CreateAt    time.Time  `json:"-" gorm:"autoCreateTime"`
	UpdateAt    time.Time  `json:"-" gorm:"autoUpdateTime"`
}

type VenueDay

type VenueDay struct {
	ID        uint    `json:"id" gorm:"primaryKey"`
	VenueID   uint    `json:"-"`
	DayID     uint    `json:"-"`
	Day       Day     `json:"day" gorm:"foreignKey:DayID"`
	Salary    float64 `json:"salary"`
	StartTime string  `json:"start_time"`
	EndTime   string  `json:"end_time"`
	Status    string  `json:"status" sql:"type:ENUM('BOOKED', 'AVAILABLE')" gorm:"default:'AVAILABLE'"`
}

Jump to

Keyboard shortcuts

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