-
Notifications
You must be signed in to change notification settings - Fork 43
/
notification.go
executable file
·93 lines (81 loc) · 1.72 KB
/
notification.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package notification
import (
"time"
"github.com/albertwidi/go-project-example/internal/entity/device"
)
// Client interface
type Client interface {
Send(templateName string) error
}
// SendOptions struct
type SendOptions struct {
DryRun bool
}
// UserNotification struct
type UserNotification struct {
ID string
UserID int64
ProviderType int
ProviderID int
ProviderSendID string
Purpose int
IsWebpage bool
Status int
Title string
Message string
Show bool
HasDetail bool
Read bool
CreatedAt time.Time
UpdatedAt time.Time
IsDeleted bool
IsTest bool
Detail UserNotificationDetail
}
// UserNotificationDetail struct
type UserNotificationDetail struct {
NotificationID string
Body string
WebLink string
CreatedAt time.Time
IsDeleted bool
IsTest bool
}
// Notification struct
type Notification struct {
UserID int64
Title string
Message string
DetailBody string
Image string
WebLink string
Purpose int
DeviceID device.Device
// either push, sms or email
NotifData interface{}
}
// Validate notification param
func (n Notification) Validate() error {
return nil
}
// Options of notification
type Options struct {
InboxSave bool
Fake bool
}
// PushNotification struct
type PushNotification struct {
// if device token is present, then the device token is used rather than seeking in session
// this is useful in user register flow
DeviceToken string
}
// SMSNotification struct
type SMSNotification struct {
From string
ToMSISDN string
}
// EmailNotification struct
type EmailNotification struct {
To string
Cc string
}