Private
Public Access
16 lines
490 B
Go
16 lines
490 B
Go
package models
|
|
|
|
type Stock struct {
|
|
ID uint64 `gorm:"primaryKey" json:"id"`
|
|
RepuestoID uint64 `gorm:"index;not null" json:"repuestoId"`
|
|
CajonID string `gorm:"type:varchar(30);index;not null" json:"cajonId"`
|
|
Cantidad uint `gorm:"not null;default:0" json:"cantidad"`
|
|
|
|
Repuesto Repuesto `gorm:"foreignKey:RepuestoID" json:"repuesto,omitempty"`
|
|
Cajon Cajon `gorm:"foreignKey:CajonID" json:"cajon,omitempty"`
|
|
}
|
|
|
|
func (Stock) TableName() string {
|
|
return "stock"
|
|
}
|