package models type Factura struct { 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 { return "factura" }