-
Notifications
You must be signed in to change notification settings - Fork 13
/
sms_tracker_entity.go
72 lines (57 loc) · 1.67 KB
/
sms_tracker_entity.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
package entity
import (
"time"
"github.com/latolukasz/beeorm"
)
const (
SMSTrackerTypeSMS = "sms"
SMSTrackerTypeCallout = "callout"
)
type smsTrackerTypeAll struct {
SMSTrackerTypeSMS string
SMSTrackerTypeCallout string
}
var SMSTrackerTypeAll = smsTrackerTypeAll{
SMSTrackerTypeSMS: SMSTrackerTypeSMS,
SMSTrackerTypeCallout: SMSTrackerTypeCallout,
}
type SmsTrackerEntity struct {
beeorm.ORM `orm:"table=sms_tracker"`
ID uint64
Status string
To string `orm:"length=15"`
Text string `orm:"length=max"`
FromPrimaryGateway string
FromSecondaryGateway string
PrimaryGatewayError string `orm:"length=max"`
SecondaryGatewayError string `orm:"length=max"`
Type string `orm:"enum=entity.SMSTrackerTypeAll;required"`
SentAt time.Time `orm:"time"`
}
func (s *SmsTrackerEntity) SetStatus(status string) {
s.Status = status
}
func (s *SmsTrackerEntity) SetTo(to string) {
s.To = to
}
func (s *SmsTrackerEntity) SetText(text string) {
s.Text = text
}
func (s *SmsTrackerEntity) SetFromPrimaryProvider(primary string) {
s.FromPrimaryGateway = primary
}
func (s *SmsTrackerEntity) SetFromSecondaryProvider(secondary string) {
s.FromSecondaryGateway = secondary
}
func (s *SmsTrackerEntity) SetPrimaryProviderError(primaryError string) {
s.PrimaryGatewayError = primaryError
}
func (s *SmsTrackerEntity) SetSecondaryProviderError(secondaryError string) {
s.SecondaryGatewayError = secondaryError
}
func (s *SmsTrackerEntity) SetType(typ string) {
s.Type = typ
}
func (s *SmsTrackerEntity) SetSentAt(sendAt time.Time) {
s.SentAt = sendAt
}