Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Customer ¶
type Customer struct {
gorm.Model
Name string `json:"name"`
Email string `json:"email" gorm:"unique"`
Password string `json:"password"`
}
Customer represents a simple user who browses and buys items.
type Inventory ¶
type Inventory struct {
gorm.Model
ShopID uint `json:"shop_id"` // Foreign key to Shop.
InventoryName string `json:"inventory_name"`
Items []Item `json:"items"` // One-to-many relationship.
}
Inventory represents a shop's collection of items.
type Item ¶
type Item struct {
gorm.Model
InventoryID uint `json:"inventory_id"` // Foreign key to Inventory.
Name string `json:"name"`
Quantity int `json:"quantity"`
}
Item represents a product in an inventory.
type Shop ¶
type Shop struct {
gorm.Model
Name string `json:"name"`
Email string `json:"email" gorm:"unique"`
OwnerID uint `json:"owner_id"` // Reference to the shop owner.
Owner ShopOwner `json:"owner"` // One-to-one relation.
Employees []ShopEmployee `json:"employees"` // One-to-many relation.
Inventories []Inventory `json:"inventories"` // One-to-many relation.
}
Shop represents the business entity with its inventories and staff.
Click to show internal directories.
Click to hide internal directories.