wip itemvariant
This commit is contained in:
@@ -4,14 +4,34 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
/*
|
||||
Sticker
|
||||
- name, abstr, descr, price, tag
|
||||
Poster
|
||||
- name, abstr, descr, price bw/colored, tag
|
||||
Zines
|
||||
- name, abstr, descr, price bw/colored/coloredcoveronly, tag
|
||||
Books
|
||||
- name, abstr, descr, price, tag
|
||||
*/
|
||||
|
||||
type ItemVariant struct {
|
||||
gorm.Model
|
||||
Name string `json:"name" gorm:"not null"`
|
||||
Price float64 `json:"price" gorm:"not null"`
|
||||
InStock bool `json:"inStock" gorm:"default:true"`
|
||||
ShopItemID uint
|
||||
}
|
||||
|
||||
type ShopItem struct {
|
||||
gorm.Model
|
||||
Name string `json:"name" binding:"required" gorm:"unique;not null"`
|
||||
Abstract string `json:"Abstract" binding:"required"`
|
||||
Description string `json:"description" binding:"required"`
|
||||
Price float64 `json:"price" binding:"required"`
|
||||
Category string `json:"category"`
|
||||
Variants []ItemVariant `json:"variant"`
|
||||
BasePrice float64 `json:"basePrice"`
|
||||
IsPublic bool `json:"isPublic" gorm:"default:true"`
|
||||
Tags []Tag `gorm:"many2many:item_tags;"`
|
||||
Image string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user