diff --git a/pkg/models/portal_user.go b/pkg/models/portal_user.go index 01a8d6f..f84ea86 100644 --- a/pkg/models/portal_user.go +++ b/pkg/models/portal_user.go @@ -20,9 +20,10 @@ type PortalUser struct { ClienteID *uint `json:"cliente_id" gorm:"column:cliente_id;index"` // nil si es partner Cliente *Cliente `json:"cliente" gorm:"foreignKey:ClienteID"` Rol string `json:"rol" gorm:"column:rol;default:'cliente'"` // cliente|partner - Activo bool `json:"activo" gorm:"column:activo;default:true"` - Notas string `json:"notas" gorm:"column:notas;type:text"` - PortalAccesos []PortalAcceso `json:"portal_accesos" gorm:"foreignKey:PortalUserID"` + Activo bool `json:"activo" gorm:"column:activo;default:true"` + Notas string `json:"notas" gorm:"column:notas;type:text"` + TelegramChatID string `json:"telegram_chat_id" gorm:"column:telegram_chat_id"` + PortalAccesos []PortalAcceso `json:"portal_accesos" gorm:"foreignKey:PortalUserID"` } func (PortalUser) TableName() string { return "portal_users" } @@ -71,12 +72,13 @@ func CreatePortalUser(u *PortalUser) error { func UpdatePortalUser(u *PortalUser) error { return app.Http.Database.DB.Model(&PortalUser{}).Where("id = ?", u.ID).Updates(map[string]interface{}{ - "nombre": u.Nombre, - "email": u.Email, - "cliente_id": u.ClienteID, - "rol": u.Rol, - "activo": u.Activo, - "notas": u.Notas, + "nombre": u.Nombre, + "email": u.Email, + "cliente_id": u.ClienteID, + "rol": u.Rol, + "activo": u.Activo, + "notas": u.Notas, + "telegram_chat_id": u.TelegramChatID, }).Error } diff --git a/resources/views/portal_usuarios.html b/resources/views/portal_usuarios.html index 8afe904..be802f2 100644 --- a/resources/views/portal_usuarios.html +++ b/resources/views/portal_usuarios.html @@ -21,6 +21,7 @@ Rol Cliente / Accesos Estado + Telegram Acciones @@ -54,6 +55,10 @@ + + + +