Private
Public Access
23 lines
736 B
Go
23 lines
736 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Almacen struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
CreatedAt time.Time `json:"CreatedAt"`
|
|
UpdatedAt time.Time `json:"UpdatedAt"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"DeletedAt"`
|
|
EmpresaID uint `gorm:"not null;default:1;index;uniqueIndex:uq_almacen_empresa_codigo,priority:1" json:"empresaId"`
|
|
Codigo string `gorm:"type:varchar(5);not null;uniqueIndex:uq_almacen_empresa_codigo,priority:2" json:"codigo"`
|
|
Ubicacion string `gorm:"type:varchar(40)" json:"ubicacion"`
|
|
Stocks []Stock `gorm:"foreignKey:AlmacenID" json:"stocks,omitempty"`
|
|
}
|
|
|
|
func (Almacen) TableName() string {
|
|
return "almacen"
|
|
}
|