mirror of
https://github.com/marcusDenslow/terminalShop.git
synced 2026-10-25 18:08:45 +01:00
the checkout flow was a bit wonky because it would display the same info twice which looked weird and confusing. this is now changed to only show once and update one of the pages independantly. Now added the possibility to modify card and address list in the account page and not in the checkout flow
37 lines
1000 B
Go
37 lines
1000 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// Coffee represents a coffee product
|
|
type Coffee struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Name string `gorm:"size:255;not null" json:"name"`
|
|
RoastType string `gorm:"size:100" json:"roast_type"`
|
|
Ounces int `json:"ounces"`
|
|
BeanType string `gorm:"size:100" json:"bean_type"`
|
|
Price int `gorm:"not null" json:"price"`
|
|
Color string `gorm:"size:7" json:"color"` // Hex color for background
|
|
Description string `gorm:"type:text" json:"description"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|
|
|
|
// TableName specifies the table name for the Coffee model
|
|
func (Coffee) TableName() string {
|
|
return "coffees"
|
|
}
|
|
|
|
// AccountMenuItems
|
|
var AccountMenuItems = []string{
|
|
"order history",
|
|
"addresses",
|
|
"cards",
|
|
"faq",
|
|
"about",
|
|
}
|