Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrderProduct ¶
type OrderProduct struct { ID uint `gorm:"primaryKey" json:"id"` OrderID uint `gorm:"not null" json:"order_id"` ProductID uint `gorm:"not null" json:"product_id"` Quantity uint `gorm:"not null" json:"quantity"` Price float64 `gorm:"type:decimal(10,2);not null" json:"price"` Order Order `gorm:"foreignKey:OrderID" json:"order"` Product Product `gorm:"foreignKey:ProductID" json:"product"` }
type Product ¶
type Product struct { gorm.Model Name string `gorm:"size:100;not null" json:"name"` Description string `gorm:"type:text" json:"description"` Price float64 `gorm:"type:decimal(10,2);not null" json:"price"` Discount float64 `gorm:"type:decimal(10,2)" json:"discount"` Stock uint `gorm:"not null" json:"stock"` BrandID uint `json:"brand_id"` Brand Brand `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"brand"` OrderProducts []OrderProduct `gorm:"foreignKey:ProductID" json:"order_products"` }
type User ¶
type User struct { gorm.Model Name string `gorm:"size:100;not null" json:"name"` Email string `gorm:"size:100;not null;unique" json:"email"` Password string `gorm:"size:255;not null" json:"-"` Role Role `gorm:"size:100;not null" json:"role"` GoogleID *string `gorm:"size:255;unique" json:"google_id,omitempty"` ProfilePictureURL *string `gorm:"size:255" json:"profile_picture_url"` BillingAddress *string `gorm:"type:text" json:"billing_address"` StripeCustomerID *string `gorm:"size:255" json:"stripe_customer_id"` }
func (*User) IsValidRole ¶
Click to show internal directories.
Click to hide internal directories.