Files
Repuestera/back/models/orden_compra.go
T

23 lines
824 B
Go

package models
import (
"time"
models_seguridad "repuestera_back/models/seguridad"
)
type OrdenCompra struct {
ID uint64 `gorm:"primaryKey" json:"id"`
EmpresaID string `gorm:"type:varchar(3);index;not null" json:"empresaId"`
UsuarioID uint64 `gorm:"index;not null" json:"usuarioId"`
Fecha time.Time `gorm:"not null" json:"fecha"`
Proveedor string `gorm:"type:varchar(100)" json:"proveedor"`
Total float64 `gorm:"not null;default:0" json:"total"`
Detalles []OrdenCompraDetalle `gorm:"type:json" json:"detalles,omitempty"`
Usuario models_seguridad.Usuario `gorm:"foreignKey:UsuarioID" json:"usuario,omitempty"`
}
func (OrdenCompra) TableName() string {
return "orden_compra"
}