Files
Repuestera/back/models/cliente.go
T

18 lines
635 B
Go

package models
import (
"database/sql"
"gorm.io/gorm"
)
type Cliente struct {
gorm.Model
EmpresaID uint `gorm:"not null;default:1;index;uniqueIndex:uq_cliente_empresa_cuit,priority:1" json:"empresaId"`
Nombre string `gorm:"type:varchar(40)" json:"nombre"`
Cuit string `gorm:"type:varchar(11);not null;uniqueIndex:uq_cliente_empresa_cuit,priority:2" json:"cuit"`
Email sql.NullString `gorm:"type:varchar(80)" json:"email"`
Facturas []Factura `gorm:"foreignKey:ClienteID" json:"facturas,omitempty"`
Recibos []Recibo `gorm:"foreignKey:ClienteID" json:"recibos,omitempty"`
}