From 32c30509af36dc74ab083c19ae1ccb8d5d21f2d5 Mon Sep 17 00:00:00 2001 From: Shubham Prajapati Date: Mon, 22 Jul 2024 16:24:24 +0530 Subject: [PATCH] updating Gorm Type --- models/brand.go | 2 +- models/phygital.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/models/brand.go b/models/brand.go index eb026d5..49afaba 100644 --- a/models/brand.go +++ b/models/brand.go @@ -20,7 +20,7 @@ type Brand struct { AdditionalInfo string `json:"additional_info"` Industry string `json:"industry"` Tags string `json:"tags"` - Fees float64 `json:"fees"` + Fees float64 `json:"fees" gorm:"type:decimal(10,2)"` PayoutAddress string `json:"payout_address"` AccessMaster string `json:"access_master"` TradeHub string `json:"trade_hub"` diff --git a/models/phygital.go b/models/phygital.go index 03becc0..a07f399 100644 --- a/models/phygital.go +++ b/models/phygital.go @@ -14,15 +14,15 @@ type Phygital struct { BrandName string `json:"brand_name"` Category datatypes.JSON `gorm:"type:jsonb" json:"category"` Description string `json:"description"` - Price float64 `json:"price"` + Price float64 `json:"price" gorm:"type:decimal(10,2)"` Quantity int `json:"quantity"` Royality int `json:"royality"` Image string `json:"image"` ProductInfo string `json:"product_info"` - ProductUrl string `json:"product_url"` + ProductUrl string `json:"product_url"` Color string `json:"color"` Size string `json:"size"` - Weight float64 `json:"weight"` + Weight float64 `json:"weight" gorm:"type:decimal(10,2)"` Material string `json:"material"` Usage string `json:"usage"` Quality string `json:"quality"` @@ -33,7 +33,7 @@ type Phygital struct { ContractAddress string `json:"contract_address"` GraphURL string `json:"graph_url"` CollectionID uuid.UUID `json:"collection_id"` - ChaintypeID uuid.UUID `gorm:"type:uuid" json:"chaintype_id"` + ChaintypeID uuid.UUID `gorm:"type:uuid" json:"chaintype_id"` CreatedAt time.Time `gorm:"type:timestamp;default:current_timestamp" json:"created_at"` UpdatedAt time.Time `gorm:"type:timestamp;default:current_timestamp" json:"updated_at"` }