Files
Repuestera/back/models/pago.go
T
2026-11-30 22:51:55 -03:00

26 lines
822 B
Go

package models
import (
"time"
"gorm.io/gorm"
)
type Pago struct {
gorm.Model
EmpresaID uint `gorm:"not null;default:1;index" json:"empresaId"`
FacturaID uint `gorm:"column:facturaId;index" json:"facturaId"`
Factura *Factura `gorm:"foreignKey:FacturaID" json:"factura,omitempty"`
FormaDePagoID uint `gorm:"column:formaDePagoID"`
FormaDePago FormaDePago `gorm:"foreignKey:FormaDePagoID"`
ReciboID *uint `json:"reciboId,omitempty"`
Recibo *Recibo `gorm:"foreignKey:ReciboID" json:"recibo,omitempty"`
Importe float64 `gorm:"type:decimal(15,2)"`
Fecha time.Time `gorm:"not null" json:"fecha"`
Observacion string `gorm:"type:varchar(255)" json:"observacion,omitempty"`
}
func (Pago) TableName() string {
return "pago"
}