model

package
v0.0.0-...-e3c7bf4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	ActorId    int          `gorm:"primaryKey" json:"actor_id"`
	FirstName  string       `json:"firt_name,omitempty"`
	LastName   string       `json:"last_name,omitempty"`
	FilmsActor []*FilmActor `json:"-"`
	Films      []*Film      `gorm:"-" json:"films,omitempty"`

	LastUpdate time.Time `json:"-"`
}

func (Actor) TableName

func (Actor) TableName() string

type Address

type Address struct {
	AddressId  int     `grom:"primaryKey" json:"address_id,omitempty"`
	Address    string  `json:"address,omitempty"`
	Address2   string  `json:"address2,omitempty"`
	District   string  `json:"district,omitempty"`
	CityId     int     `json:"-"`
	City       *Cities `gorm:"foreignKey:CityId;references:CityId" json:"city,omitempty"`
	PostalCode string  `json:"postal_code,omitempty"`
	Phone      string  `json:"phone,omitempty"`

	LastUpdate time.Time `json:"-"`
}

func (Address) TableName

func (Address) TableName() string

type Category

type Category struct {
	CategoryId int    `gorm:"primaryKey"`
	Name       string `gorm:"type:varchar(25)"`
	LastUpdate time.Time
}

func (Category) TableName

func (Category) TableName() string

type Cities

type Cities struct {
	CityId    int        `gorm:"primaryKey" json:"city_id"`
	City      string     `json:"city,omitempty"`
	CountryId int        `json:"-"`
	Country   *Countries `gorm:"foreignKey:CountryId;references:CountryId" json:"country,omitempty"`

	LastUpdate time.Time `json:"-"`
}

func (Cities) TableName

func (Cities) TableName() string

type Countries

type Countries struct {
	CountryId int      `gorm:"primaryKey" json:"country_id"`
	Country   string   `json:"country,omitempty"`
	CityId    int      `json:"-"`
	City      []Cities `gorm:"foreignKey:CityId;references:CityId" json:"city,omitempty"`

	LastUpdate time.Time `json:"-"`
}

func (Countries) TableName

func (Countries) TableName() string

type Customer

type Customer struct {
	CustomerId int `gorm:"primaryKey"`

	LastUpdate time.Time
}

func (Customer) TableName

func (Customer) TableName() string

type Film

type Film struct {
	FilmId             int             `gorm:"primaryKey" json:"id"`
	Title              string          `json:"title"`
	Description        string          `json:"description,omitempty"`
	ReleaseYear        Year            `json:"release_year,omitempty"`
	LanguageId         int             `json:"-"`
	Language           *Languages      `gorm:"foreignKey:LanguageId;references:LanguageId" json:"laguage,omitempty"`
	OriginalLanguageId int             `json:"-"`
	OriginalLanguage   *Languages      `gorm:"foreignKey:OriginalLanguageId;references:LanguageId" json:"original_laguage,omitempty"`
	RentalDuration     int             `json:"rental_duration"`
	RentalRate         decimal.Decimal `json:"rental_rate"`
	Length             int             `json:"length,omitempty"`
	ReplacementCost    decimal.Decimal `json:"replacement_cost"`
	Rating             FilmRating      `json:"rating,omitempty"`
	SpecialFeatures    SpecialFeatures `json:"special_features,omitempty"`
	Actors             []*Actor        `gorm:"many2many:film_actor;joinForeignKey:film_id;" json:"actors,omitempty"`

	LastUpdate time.Time `json:"-"`
}

func (Film) TableName

func (Film) TableName() string

type FilmActor

type FilmActor struct {
	ActorId int
	Actor   []*Actor `gorm:"foreignKey:ActorId;references:ActorId"`
	FilmId  int
	Film    []*Film `gorm:"foreignKey:FilmId;references:FilmId"`

	LastUpdate time.Time
}

func (FilmActor) TableName

func (FilmActor) TableName() string

type FilmCategory

type FilmCategory struct {
	FilmId     int    `gorm:"primaryKey"`
	CategoryId string `gorm:"primaryKey"`
	LastUpdate time.Time
}

func (FilmCategory) TableName

func (FilmCategory) TableName() string

type FilmRating

type FilmRating string
const (
	RatingG    FilmRating = "G"
	RatingPG   FilmRating = "PG"
	RatingPG13 FilmRating = "PG-13"
	RatingNC17 FilmRating = "NC-17"
)

type FilmText

type FilmText struct {
	FilmId int `gorm:"primaryKey"`

	Title       string
	Description string
}

func (FilmText) TableName

func (FilmText) TableName() string

type Inventory

type Inventory struct {
	InventoryId int `gorm:"primaryKey"`

	Film  *Film
	Store *Store

	LastUpdate time.Time
}

func (Inventory) TableName

func (Inventory) TableName() string

type JSON

type JSON json.RawMessage

type Languages

type Languages struct {
	LanguageId int    `gorm:"primaryKey" json:"-"`
	Name       string `json:"name,omitempty"`

	LastUpdate time.Time `json:"-"`
}

func (Languages) TableName

func (Languages) TableName() string

type Location

type Location struct {
	X int `json:"x"`
	Y int `json:"y"`
}

func (Location) GormDataType

func (Location) GormDataType() string

func (Location) GormValue

func (l Location) GormValue(ctx context.Context, db *gorm.DB) clause.Expr

func (*Location) Scan

func (l *Location) Scan(value interface{}) error

type Payment

type Payment struct {
	PaymentId int `gorm:"primaryKey"`

	Customer *Customer
	Staff    *Staff
	Rental   *Rental

	Amount      int
	PaymentDate time.Time

	LastUpdate time.Time
}

func (Payment) TableName

func (Payment) TableName() string

type Rental

type Rental struct {
	RentalId int `gorm:"primaryKey"`

	RentalDate time.Time
	ReturnDate time.Time

	Customer *Customer
	Staff    *Staff

	LastUpdate time.Time
}

func (Rental) TableName

func (Rental) TableName() string

type SpecialFeatures

type SpecialFeatures string
const (
	FeatureTrailer        SpecialFeatures = "Trailers"
	FeatureCommentary     SpecialFeatures = "Commentaries"
	FeatureDeletedScene   SpecialFeatures = "Deleted Scenes"
	FeatureBehindtheScene SpecialFeatures = "Behind the Scenes"
)

type Staff

type Staff struct {
	StaffId   int      `gorm:"primaryKey" json:"staff_id"`
	FirstName string   `json:"first_name,omitempty"`
	LastName  string   `json:"last_name,omitempty"`
	AddressId int      `json:"address_id,omitempty"`
	Address   *Address `gorm:"foreignKey:AddressId;references:AddressId" json:"address,omitempty"`
	StoreId   int      `json:"-"`
	Store     *Store   `gorm:"foreignKey:StoreId;references:StoreId"`
	Email     string   `json:"email,omitempty"`
	Active    int      `json:"active,omitempty"`
	Username  string   `json:"username,omitempty"`
	Password  string   `json:"-"`
	Picture   []byte   `json:"-"`

	LastUpdate time.Time `json:"-"`
}

func (Staff) TableName

func (Staff) TableName() string

type Store

type Store struct {
	StoreId        int      `gorm:"primaryKey" json:"store_id"`
	ManagerStaffId int      `json:"-"`
	ManagerStaff   *Staff   `gorm:"foreignKey:ManagerStaffId;references:StaffId" json:"manger_staff,omitempty"`
	AddressId      int      `json:"-"`
	Address        *Address `gorm:"foreignKey:AddressId;references:AddressId" json:"address,omitempty"`

	LastUpdate time.Time `json:"-"`
}

func (Store) TableName

func (Store) TableName() string

type Year

type Year struct {
	// contains filtered or unexported fields
}

func (Year) GormDataType

func (Year) GormDataType() string

func (*Year) Scan

func (y *Year) Scan(value any) error

func (Year) Value

func (y Year) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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