1
0
mirror of https://github.com/strongdm/comply synced 2024-11-16 21:04:54 +00:00
comply/internal/model/procedure.go

34 lines
714 B
Go

package model
import (
"fmt"
"time"
)
var defaultLabels = []string{"comply", "comply-procedure"}
type Procedure struct {
Name string `yaml:"name"`
ID string `yaml:"id"`
Cron string `yaml:"cron"`
CustomLabels []string `yaml:"labels"`
Revisions []Revision `yaml:"majorRevisions"`
Satisfies Satisfaction `yaml:"satisfies"`
FullPath string
OutputFilename string
ModifiedAt time.Time
Body string
}
func (p *Procedure) Labels() []string {
return append(defaultLabels, p.CustomLabels...)
}
func (p *Procedure) NewTicket() *Ticket {
return &Ticket{
Name: p.Name,
Body: fmt.Sprintf("%s\n\n\n---\nProcedure-ID: %s", p.Body, p.ID),
}
}