From 9ee7aa11d05a22edf4a0c1d2dc6db43f12d4b38c Mon Sep 17 00:00:00 2001 From: fede Date: Tue, 16 Jun 2026 19:54:33 -0300 Subject: [PATCH] =?UTF-8?q?a=C3=B1adimos=20un=20par=20de=20campos=20que=20?= =?UTF-8?q?faltaban=20en=20las=20entidades=20de=20producto=20y=20marca?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/models/marca.go | 15 ++++++++++++--- back/models/producto.go | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/back/models/marca.go b/back/models/marca.go index 7c1c715..f64a310 100644 --- a/back/models/marca.go +++ b/back/models/marca.go @@ -1,9 +1,18 @@ package models +import ( + "time" + + "gorm.io/gorm" +) + type Marca struct { - ID string `gorm:"primaryKey;type:varchar(3)" json:"id"` - Razon string `gorm:"uniqueIndex;not null;type:varchar(70)" json:"razon"` - Productos []Producto `gorm:"foreignKey:MarcaID"` + ID string `gorm:"primaryKey;type:varchar(3)" json:"id"` + Razon string `gorm:"uniqueIndex;not null;type:varchar(70)" json:"razon"` + Productos []Producto `gorm:"foreignKey:MarcaID"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` } func (Marca) TableName() string { diff --git a/back/models/producto.go b/back/models/producto.go index b6bc055..863cba4 100644 --- a/back/models/producto.go +++ b/back/models/producto.go @@ -7,6 +7,9 @@ import ( type Producto struct { ID uint64 `gorm:"primaryKey" json:"id"` + Nombre string `gorm:"type:varchar(50);not null" json:"nombre"` + Precio float64 `gorm:"not null;type:decimal(10,2)" json:"precio"` + StockMinimo int64 `gorm:"not null;type:bigint" json:"stockMinimo"` Descripcion string `gorm:"uniqueIndex;not null;type:varchar(70)" json:"razon"` MarcaID string `gorm:"type:varchar(3);index" json:"marcaId"` Aliases []string `gorm:"type:json" json:"aliases,omitempty"`