feat: add page profile with orders
This commit is contained in:
@@ -12,7 +12,7 @@ type Order struct {
|
||||
TotalPrice float64 `json:"total_price" gorm:"not null"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
Items []OrderItem
|
||||
Items []OrderItem `json:"items"`
|
||||
}
|
||||
|
||||
type OrderItem struct {
|
||||
|
||||
@@ -4,7 +4,7 @@ import "gorm.io/gorm"
|
||||
|
||||
type User struct {
|
||||
gorm.Model `json:"-"`
|
||||
Username string `gorm:"unique;not null" binding:"required"`
|
||||
Username string `json:"username" gorm:"unique;not null" binding:"required"`
|
||||
Password string `gorm:"not null" json:"-" binding:"required,min=8"`
|
||||
Role string `gorm:"default:'customer'" json:"role"`
|
||||
FirstName string `json:"first_name" binding:"required"`
|
||||
|
||||
Reference in New Issue
Block a user