feat: selector de pasarela (Bold/dLocal/ninguna) en regla + muestra {{.EnlacePago}} en editor de plantillas

This commit is contained in:
Lizandro Guarnizo
2026-05-01 12:47:13 -05:00
parent 8c4b401379
commit 0da9331a5e
4 changed files with 103 additions and 26 deletions
+13 -11
View File
@@ -7,12 +7,13 @@ import (
type NotificacionRegla struct {
gorm.Model
Nombre string `json:"nombre" gorm:"column:nombre"`
DiasAntes int `json:"dias_antes" gorm:"column:dias_antes"`
PlantillaID uint `json:"plantilla_id" gorm:"column:plantilla_id"`
Plantilla PlantillaCorreo `json:"plantilla" gorm:"foreignKey:PlantillaID"`
Activo bool `json:"activo" gorm:"column:activo;default:true"`
AplicaA string `json:"aplica_a" gorm:"column:aplica_a;default:'todos'"` // todos | renovable | unico
Nombre string `json:"nombre" gorm:"column:nombre"`
DiasAntes int `json:"dias_antes" gorm:"column:dias_antes"`
PlantillaID uint `json:"plantilla_id" gorm:"column:plantilla_id"`
Plantilla PlantillaCorreo `json:"plantilla" gorm:"foreignKey:PlantillaID"`
Activo bool `json:"activo" gorm:"column:activo;default:true"`
AplicaA string `json:"aplica_a" gorm:"column:aplica_a;default:'todos'"` // todos | renovable | unico
PasarelaEnlace string `json:"pasarela_enlace" gorm:"column:pasarela_enlace;default:'bold'"` // bold | dlocal | ninguna
}
func (NotificacionRegla) TableName() string { return "notificacion_reglas" }
@@ -48,11 +49,12 @@ func CreateRegla(r NotificacionRegla) error {
func UpdateRegla(r NotificacionRegla) error {
return app.Http.Database.DB.Model(&r).Updates(map[string]interface{}{
"nombre": r.Nombre,
"dias_antes": r.DiasAntes,
"plantilla_id": r.PlantillaID,
"activo": r.Activo,
"aplica_a": r.AplicaA,
"nombre": r.Nombre,
"dias_antes": r.DiasAntes,
"plantilla_id": r.PlantillaID,
"activo": r.Activo,
"aplica_a": r.AplicaA,
"pasarela_enlace": r.PasarelaEnlace,
}).Error
}