aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/models/bug.go')
-rw-r--r--pkg/models/bug.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/models/bug.go b/pkg/models/bug.go
index 15bdaf5..1329631 100644
--- a/pkg/models/bug.go
+++ b/pkg/models/bug.go
@@ -1,5 +1,14 @@
package models
+type BugComponent string
+
+const (
+ BugComponentVulnerabilities BugComponent = "Vulnerabilities"
+ BugComponentStabilization BugComponent = "Stabilization"
+ BugComponentKeywording BugComponent = "Keywording"
+ BugComponentGeneral BugComponent = ""
+)
+
type Bug struct {
Id string `pg:",pk"`
Product string
@@ -20,3 +29,12 @@ type VersionToBug struct {
VersionId string
BugId string
}
+
+func (b *Bug) MatchesComponent(component BugComponent) bool {
+ if component != BugComponentGeneral {
+ return b.Component == string(component)
+ }
+ return b.Component != string(BugComponentVulnerabilities) &&
+ b.Component != string(BugComponentStabilization) &&
+ b.Component != string(BugComponentKeywording)
+}