Files
Charon/backend/internal/models/notification_template.go
GitHub Actions 8294d6ee49 Add QA test outputs, build scripts, and Dockerfile validation
- Created `qa-test-output-after-fix.txt` and `qa-test-output.txt` to log results of certificate page authentication tests.
- Added `build.sh` for deterministic backend builds in CI, utilizing `go list` for efficiency.
- Introduced `codeql_scan.sh` for CodeQL database creation and analysis for Go and JavaScript/TypeScript.
- Implemented `dockerfile_check.sh` to validate Dockerfiles for base image and package manager mismatches.
- Added `sourcery_precommit_wrapper.sh` to facilitate Sourcery CLI usage in pre-commit hooks.
2025-12-11 18:26:24 +00:00

31 lines
828 B
Go

package models
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
// NotificationTemplate represents a reusable external notification template
// that can be applied when sending webhooks or other external notifications.
type NotificationTemplate struct {
ID string `gorm:"primaryKey" json:"id"`
Name string `json:"name"`
Description string `json:"description"`
// Config holds the JSON/template body for external webhook payloads
Config string `json:"config"`
// Template is a hint: minimal|detailed|custom (optional)
Template string `json:"template" gorm:"default:minimal"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (t *NotificationTemplate) BeforeCreate(tx *gorm.DB) (err error) {
if t.ID == "" {
t.ID = uuid.New().String()
}
return
}