Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Author struct { ID uint64 `json:"id" gorm:"primaryKey;autoIncrement;->"` Firstname string `json:"firstname" gorm:"size:255" validate:"required,min=1,max=255"` Surname string `json:"surname" gorm:"size:255" validate:"required,min=1,max=255"` }
Author represents an author entity with ID, Firstname, and Surname.
type Book ¶ added in v0.8.0
type Book struct { ID uint `json:"id" gorm:"primaryKey;autoIncrement;->"` BranchID uint `json:"branch_id"` Branch *Branch `json:"branch" gorm:"foreignKey:BranchID"` Added time.Time `json:"added"` ShortDescription string `json:"summary"` Author []*Author `json:"authors" gorm:"many2many:book_author;"` // Genre *Genre `json:"genre" gorm:"foreignKey:GenreID"` Price float32 `json:"price" gorm:"default:0.00"` Sold bool `gorm:"default:false"` SoldOn time.Time `json:"sold_on,omitempty"` Removed bool `gorm:"default:false"` RemovedOn time.Time `json:"removed_on,omitempty"` Reserved bool `gorm:"default:false"` ReservedAt time.Time `json:"reserved_at,omitempty"` ReleaseYear time.Time `json:"published_date"` Condition *Condition `json:"condition" gorm:"foreignKey:ConditionID"` ConditionID uint `json:"condition_id"` Tags []*Tag `json:"tags" gorm:"many2many:book_tag;"` // Reservation []*Reservation `json:"reservations" gorm:"foreignKey:BookID"` Recommendation bool `json:"recommendations" gorm:"foreignKey:BookID"` Inventory bool `gorm:"default:false"` // Format *Format `json:"format" gorm:"foreignKey:FormatID"` FormatID uint `json:"format_id"` Subtitle string `json:"subtitle" validate:"max=255"` Duplicate bool `gorm:"default:false"` }
Book represents a book entity.
type Branch ¶ added in v0.6.0
type Branch struct { ID uint `json:"id" gorm:"primaryKey;autoIncrement;->"` Name string `json:"name" validate:"required,max=255"` Steps float32 `json:"steps" validate:"gte=0.00" gorm:"default:0.00"` Currency string `json:"currency" validate:"required,oneof=EUR USD" gorm:"default:'EUR'"` Ordering string `json:"ordering" gorm:"type:text"` Public bool `json:"public" gorm:"default:false"` Pricelist string `json:"pricelist" gorm:"type:text"` Cart bool `json:"cart" gorm:"default:false"` Content string `json:"content" gorm:"type:text"` }
Branch represents a branch entity with various attributes.
type Condition ¶ added in v0.7.0
type Condition struct { ID uint `json:"id" gorm:"primaryKey;autoIncrement;->"` Name string `json:"name" gorm:"type:varchar(255);not null;unique" validate:"required,min=1,max=255"` BranchID uint `json:"branch_id" gorm:"index"` Branch Branch `json:"branch" gorm:"foreignKey:BranchID"` }
Condition model represents a book's condition.
type Tabler ¶ added in v0.6.0
type Tabler interface {
TableName() string
}
Tabler interface for table name.
type Tag ¶ added in v0.8.0
type Tag struct { ID uint `json:"id" gorm:"primaryKey;autoIncrement;->"` Name string `json:"name" validate:"required,max=255"` BranchID uint `json:"branch_id" gorm:"index"` Branch Branch `json:"branch" gorm:"foreignKey:BranchID"` Books []*Book `json:"books" gorm:"many2many:book_tag;"` }
Tag represents a tag model.
Click to show internal directories.
Click to hide internal directories.