package
Version:
v0.0.0-...-54eb6b5
Opens a new window with list of versions in this module.
Published: Mar 7, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Cart struct {
ProductID uint `json:"product_id"`
Quantity int `json:"quantity"`
}
type Customer struct {
gorm.Model
Name string `json:"name" gorm:"text;not null;default:null"`
Phone string `json:"phone" gorm:"text;not null;unique"`
Password string `json:"password" gorm:"text;not null;default:null"`
}
type Order struct {
gorm.Model
Customer Customer `gorm:"foreignKey:CustomerID"`
CustomerID uint `json:"customer_id" gorm:"integer;not null;default:null"`
Product Product `gorm:"foreignKey:ProductID"`
ProductID uint `json:"product_id" gorm:"integer;not null;default:null"`
Quantity int `json:"quantity" gorm:"integer;not null;default:null"`
Amount int `json:"amount" gorm:"float;not null;default:null"`
Time string `json:"time" gorm:"text;not null;default:null"`
Status string `json:"status" gorm:"text;not null;default:null"`
}
type Product struct {
gorm.Model
Name string `json:"name" gorm:"text;not null;default:null"`
Price int `json:"price" gorm:"float;not null;default:null"`
Stock int `json:"stock" gorm:"integer;not null;default:null"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.