-
Notifications
You must be signed in to change notification settings - Fork 4
/
decl.go
70 lines (50 loc) · 1.58 KB
/
decl.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
// Package subscription implements base subscription functionality
package subscription
import (
"time"
"github.com/ottemo/commerce/app/models/checkout"
"github.com/ottemo/commerce/app/models/subscription"
"github.com/ottemo/commerce/db"
"github.com/ottemo/commerce/env"
)
// Package global constants
const (
ConstErrorModule = "subscription"
ConstErrorLevel = env.ConstErrorLevelActor
ConstCollectionNameSubscription = "subscription"
ConstTimeDay = time.Hour * 24
ConstSchedulerTaskName = "subscriptionProcess"
)
var (
subscriptionProducts = make([]string, 0) // stores id's of products that should be subscriptional
subscriptionEnabled = false
)
// DefaultSubscription struct to hold subscription information and represent
// default implementer of InterfaceSubscription
type DefaultSubscription struct {
id string
VisitorID string
OrderID string
items []subscription.StructSubscriptionItem
CustomerEmail string
CustomerName string
Status string
State string
ActionDate time.Time
Period int
ShippingAddress map[string]interface{}
BillingAddress map[string]interface{}
ShippingMethodCode string
ShippingRate checkout.StructShippingRate
// should be stored credit card info with payment method in it
PaymentInstrument map[string]interface{}
LastSubmit time.Time
CreatedAt time.Time
UpdatedAt time.Time
Info map[string]interface{}
}
// DefaultSubscriptionCollection is a default implementer of InterfaceSubscriptionCollection
type DefaultSubscriptionCollection struct {
listCollection db.InterfaceDBCollection
listExtraAtributes []string
}