chore: update
This commit is contained in:
@@ -8,6 +8,7 @@ type Product struct {
|
||||
Category string `json:"category" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
Stock float64 `json:"stock"` // ← ajouter le stock ici
|
||||
Unit string `json:"unit"` // kg | g | bag | l | cl | pcs | u
|
||||
Prices []ProductPrice `json:"prices"`
|
||||
Media []Media `json:"media,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
@@ -38,7 +39,8 @@ type StockInfo struct {
|
||||
func (p *Product) GetName() string { return p.Name }
|
||||
func (p *Product) GetCategory() string { return p.Category }
|
||||
func (p *Product) GetDescription() string { return p.Description }
|
||||
func (p *Product) GetStock() float64 { return p.Stock } // ← méthode pour le stock
|
||||
func (p *Product) GetStock() float64 { return p.Stock }
|
||||
func (p *Product) GetUnit() string { return p.Unit }
|
||||
func (p *Product) GetPrices() []ProductPrice { return p.Prices }
|
||||
func (p *Product) SetID(id int) { p.ID = id }
|
||||
func (p *Product) SetCreatedAt(t time.Time) { p.CreatedAt = t }
|
||||
|
||||
Reference in New Issue
Block a user