33 lines
939 B
Go
33 lines
939 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
// type Order struct {
|
|
// Order_id uint `gorm:"primaryKey"`
|
|
// User_id uint
|
|
// UserRef User `gorm:"foreignKey:User_id"`
|
|
// Procuct_id uint
|
|
// ProductRef Product `gorm:"foreignKey:Product_id"`
|
|
// Price uint64
|
|
// Quantity_ordered uint
|
|
// Order_date time.Time
|
|
// Created_at time.Time
|
|
// Updated_at time.Time
|
|
// Removed_at time.Time
|
|
// Is_removed bool `gorm:"default:false"`
|
|
// }
|
|
|
|
type Order struct {
|
|
Order_id uint `gorm:"primaryKey"`
|
|
User_id uint
|
|
User User `gorm:"references:User_id"`
|
|
TransportationFee uint64
|
|
Tax uint64
|
|
ProductsTotalPrice uint64
|
|
TotalPrice uint64
|
|
Created_at time.Time
|
|
Updated_at time.Time `gorm:"default:null"`
|
|
Removed_at time.Time `gorm:"default:null"`
|
|
Is_removed bool `gorm:"default:false"`
|
|
}
|