feat: adapatadas entidades para que coinsidan con el modelo

This commit is contained in:
fede committed 2026-08-06 02:12:51 -03:00
1 parent de33352618
commit 152a40ca19
16 files changed
+105 -68

No files matched your search

+4 -13
View File
@@ -1,20 +1,11 @@
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"`
Usuario models_seguridad.Usuario `gorm:"foreignKey:UsuarioID" json:"usuario,omitempty"`
Comprobante
Cliente Cliente `gorm:"foreignKey:ClienteID" json:"cliente"`
Total float64 `gorm:"not null;default:0" json:"total"`
Detalles []FacturaDetalle `gorm:"type:json" json:"detalles,omitempty"`
}
func (Factura) TableName() string {