-
Notifications
You must be signed in to change notification settings - Fork 1
/
report.go
71 lines (60 loc) · 1.46 KB
/
report.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
Copyright 2021 Adevinta
*/
package model
import (
"time"
)
// NotifFmt represents the
// report notification format.
type NotifFmt uint8
const (
// NotifFmtHTML indicates notification has HTML format.
NotifFmtHTML = iota
// NotifFmtText indicates notification has Text format.
NotifFmtText
// LiveReportType identifies the live report type.
LiveReportType = "livereport"
// StatusGenerating indicates that report is being generated.
StatusGenerating = "GENERATING"
// StatusFinished indicates that report has been generated.
StatusFinished = "FINISHED"
// StatusFailed indicates that report generation failed.
StatusFailed = "FAILED"
)
// ReportType specifies a report type.
type ReportType string
// Report represents the interface
// which all report types must comply with.
type Report interface {
GetID() string
GetNotification() Notification
GetDeliveredTo() []string
GetStatus() string
GetCreatedAt() time.Time
GetUpdatedAt() time.Time
}
// BaseReport represents the common
// fields for all types of reports.
type BaseReport struct {
ID string
Notification Notification
DeliveredTo []string
Status string
CreatedAt time.Time
UpdatedAt time.Time
}
// FileInfo contains report file
// and its upload destination.
type FileInfo struct {
FilePath string
DestBucket string
DestPath string
}
// Notification represents
// a report notification.
type Notification struct {
Subject string
Body string
Fmt NotifFmt
}