package models type Factura struct { Comprobante ClienteID uint `gorm:"column:ClienteID"` Cliente Cliente `gorm:"foreignKey:ClienteID" json:"cliente"` SeAviso bool `gorm:"" json:"seAviso"` Detalles []FacturaDetalle `gorm:"type:json" json:"detalles,omitempty"` } func (Factura) TableName() string { return "factura" }