feat: setup editable product struct
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package model
|
||||
|
||||
import "git.ma-al.com/goc_daniel/b2b/app/model/dbmodel"
|
||||
|
||||
type ProductInList struct {
|
||||
ProductID uint `gorm:"column:product_id" json:"product_id" form:"product_id"`
|
||||
Name string `gorm:"column:name" json:"name" form:"name"`
|
||||
@@ -38,3 +40,28 @@ type B2bFavorite struct {
|
||||
func (*B2bFavorite) TableName() string {
|
||||
return "b2b_favorites"
|
||||
}
|
||||
|
||||
// contains everything that is editable in product (and possibly more)
|
||||
type ProductEditing struct {
|
||||
Product dbmodel.PsProduct `json:"product,omitempty"`
|
||||
ProductShop dbmodel.PsProductShop `json:"product_shop,omitempty"`
|
||||
ProductLang []dbmodel.PsProductLang `json:"product_lang,omitempty"`
|
||||
CategoryProduct []dbmodel.PsCategoryProduct `json:"category_product"`
|
||||
ProductTag []dbmodel.PsTag `json:"tag"`
|
||||
Feature []ProductFeature `json:"features"`
|
||||
Attachments []dbmodel.PsProductAttachment `json:"product_attachment"`
|
||||
Carrier []dbmodel.PsProductCarrier `json:"product_carrier"`
|
||||
Accessory []dbmodel.PsAccessory `json:"accessory"`
|
||||
SpecificPrice []dbmodel.PsSpecificPrice `json:"specific_price"`
|
||||
SpecificPricePriority []dbmodel.PsSpecificPricePriority `json:"specific_price_priority"`
|
||||
}
|
||||
|
||||
type ProductFeature struct {
|
||||
FeatureValue dbmodel.PsFeatureValue `json:"featue_value"`
|
||||
FeatureValueLang []dbmodel.PsFeatureValueLang `json:"featue_value_lang"`
|
||||
}
|
||||
|
||||
type ProductCustomizationField struct {
|
||||
CustomizationField dbmodel.PsCustomizationField `json:"customization_field"`
|
||||
CustomizationFieldLang dbmodel.PsCustomizationFieldLang `json:"customization_field_lang"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user