Private
Public Access
termine de crear los modelos por una segunda vez
This commit is contained in:
1 parent
152a40ca19
commit
8a1ea71805
12 files changed
+49
-17
No files matched your search
@@ -1,14 +1,12 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/datatypes"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Repuesto struct {
|
||||
ID uint64 `gorm:"primaryKey" json:"id"`
|
||||
gorm.Model
|
||||
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"`
|
||||
@@ -16,9 +14,6 @@ type Repuesto struct {
|
||||
Marca Marca `gorm:"foreignKey:marcaId"`
|
||||
Aliases datatypes.JSONSlice[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:"deleted_at,omitempty"`
|
||||
}
|
||||
|
||||
func (Repuesto) TableName() string {
|
||||
|
||||
Reference in new issue
Block a user