Documentation
¶
Index ¶
- type APIError
- type Category
- type CategoryBase
- type CategoryCreate
- type CreditCard
- type CreditCardBase
- type CreditCardCreate
- type Customer
- type CustomerBase
- type CustomerCreate
- type Login
- type LoginBase
- type LoginCreate
- type Order
- type OrderBase
- type OrderCreate
- type OrderProduct
- type OrderProductBase
- type OrderProductCreate
- type Payment
- type PaymentBase
- type PaymentCreate
- type Product
- type ProductBase
- type ProductCreate
- type Shipper
- type ShipperBase
- type ShipperCreate
- type Subcategory
- type SubcategoryBase
- type SubcategoryCreate
- type Supplier
- type SupplierBase
- type SupplierCreate
- type Tabler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct {
gorm.Model
ID string `gorm:"primaryKey; not null; unique_index"`
CategoryBase
Subcategories []Subcategory
Products []Product
}
type CategoryBase ¶
type CategoryCreate ¶
type CategoryCreate struct {
CategoryBase
}
type CreditCard ¶
type CreditCard struct {
gorm.Model
ID string `gorm:"primaryKey; not null; unique_index"`
CreditCardBase
Payments []Payment
}
func (CreditCard) TableName ¶
func (CreditCard) TableName() string
TableName overrides the table name used by CredirCard to `credit_card`
type CreditCardBase ¶
type CreditCardCreate ¶
type CreditCardCreate struct {
CreditCardBase
}
type Customer ¶
type Customer struct {
gorm.Model
ID string `gorm:"primaryKey; not null; unique_index"`
CustomerBase
CreditCards []CreditCard
Logins []Login
Orders []Order
}
type CustomerBase ¶
type CustomerBase struct {
Name string `gorm:"not null"`
Email string `gorm:"not null; unique_index"`
DNI string `gorm:"not null; unique_index"`
Address string `gorm:"not null"`
City string `gorm:"not null"`
Birthday time.Time `gorm:"not null"`
PostalCode string `gorm:"not null"`
Country string `gorm:"not null"`
Phone string `gorm:"not null"`
UserName string `gorm:"not null"`
Password string `gorm:"not null; unique_index"`
}
type CustomerCreate ¶
type CustomerCreate struct {
CustomerBase
}
type LoginCreate ¶
type LoginCreate struct {
LoginBase
}
type Order ¶
type OrderBase ¶
type OrderBase struct {
OrderDate time.Time `gorm:"not null"`
RequiredDate time.Time `gorm:"not null"`
ShippedDate time.Time `gorm:"not null"`
ShipName string `gorm:"not null"`
ShipAddress string `gorm:"not null"`
ShipCity string `gorm:"not null"`
ShipPostalCode string `gorm:"not null"`
ShipCountry string `gorm:"not null"`
CustomerID string `gorm:"not null; unique_index"`
ShipperID string `gorm:"not null; unique_index"`
}
type OrderCreate ¶
type OrderCreate struct {
OrderBase
}
type OrderProduct ¶
type OrderProduct struct {
gorm.Model
OrderProductBase
}
func (OrderProduct) TableName ¶
func (OrderProduct) TableName() string
TableName overrides the table name used by OrderProduct to `order_product`
type OrderProductBase ¶
type OrderProductCreate ¶
type OrderProductCreate struct {
OrderProductBase
}
type Payment ¶
type Payment struct {
gorm.Model
ID string `gorm:"primaryKey; not null; unique_index"`
PaymentBase
}
type PaymentBase ¶
type PaymentCreate ¶
type PaymentCreate struct {
PaymentBase
}
type Product ¶
type Product struct {
gorm.Model
ID string `gorm:"primaryKey; not null; unique_index"`
ProductBase
Orders []Order `gorm:"many2many:order_product;"`
}
type ProductBase ¶
type ProductBase struct {
ProductName string `gorm:"not null"`
QuantityPerUnit string `gorm:"not null"`
UnitsInStock uint `gorm:"not null"`
UnitsOnOrder uint `gorm:"not null"`
ReorderLevel uint `gorm:"not null"`
Discontinued bool `gorm:"default:false"`
Quantity uint `gorm:"not null"`
SupplierID string `gorm:"not null; unique_index"`
CategoryID string `gorm:"not null; unique_index"`
}
type ProductCreate ¶
type ProductCreate struct {
ProductBase
}
type Shipper ¶
type Shipper struct {
gorm.Model
ID string `gorm:"primaryKey; not null; unique_index"`
ShipperBase
Orders []Order
}
type ShipperBase ¶
type ShipperCreate ¶
type ShipperCreate struct {
ShipperBase
}
type Subcategory ¶
type Subcategory struct {
gorm.Model
ID string `gorm:"primaryKey; not null; unique_index"`
SubcategoryBase
}
func (Subcategory) TableName ¶
func (Subcategory) TableName() string
TableName overrides the table name used by Subcategory to `subcategory`
type SubcategoryBase ¶
type SubcategoryCreate ¶
type SubcategoryCreate struct {
SubcategoryBase
}
type Supplier ¶
type Supplier struct {
gorm.Model
ID string `gorm:"primaryKey; not null; unique_index"`
SupplierBase
Products []Product
}
type SupplierBase ¶
type SupplierCreate ¶
type SupplierCreate struct {
SupplierBase
}
Click to show internal directories.
Click to hide internal directories.