This commit is contained in:
fede committed 2026-06-19 23:04:13 -03:00
1 parent 6c0e44cb45
commit 90e76d4963
11 files changed
+112 -38

No files matched your search

+8 -8
View File
@@ -9,16 +9,16 @@ import (
type Repuesto 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"`
Nombre string `gorm:"type:varchar(50);not null" json:"nombre" binding:"required"`
Precio float64 `gorm:"not null;type:decimal(10,2)" json:"precio" binding:"required"`
StockMinimo int64 `gorm:"not null;type:bigint" json:"stockMinimo" binding:"required"`
Descripcion string `gorm:"uniqueIndex;not null;type:varchar(70)" json:"razon" binding:"required"`
MarcaID string `gorm:"type:varchar(3);index" json:"marcaId" binding:"required"`
Aliases []string `gorm:"type:json" json:"aliases,omitempty"`
Stocks []Stock `gorm:"foreignKey:RepuestoID" json:"stocks,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
func (Repuesto) TableName() string {