Files
Repuestera/back/models/factura.go
2026-05-14 17:21:28 -03:00

24 lines
901 B
Go

package models
import (
"time"
models_seguridad "repuestera_back/models/seguridad"
)
type Factura 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"`
Cliente string `gorm:"type:varchar(100)" json:"cliente"`
Total float64 `gorm:"not null;default:0" json:"total"`
Detalles []FacturaDetalle `gorm:"type:json" json:"detalles,omitempty"`
Empresa models_seguridad.Empresa `gorm:"foreignKey:EmpresaID" json:"empresa,omitempty"`
Usuario models_seguridad.Usuario `gorm:"foreignKey:UsuarioID" json:"usuario,omitempty"`
}
func (Factura) TableName() string {
return "factura"
}