-
Notifications
You must be signed in to change notification settings - Fork 4
/
decl.go
34 lines (27 loc) · 941 Bytes
/
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
// Package coupon is a default implementation of discount interface declared in
// "github.com/ottemo/commerce/app/models/checkout" package
package coupon
import (
"github.com/ottemo/commerce/env"
)
// Package global constants
const (
ConstSessionKeyCurrentRedemptions = "current_redemption_codes"
ConstCollectionNameCouponDiscounts = "coupon_discounts"
ConstConfigPathDiscounts = "general.discounts"
ConstConfigPathDiscountApplyPriority = "general.discounts.discount_apply_priority"
ConstErrorModule = "coupon"
ConstErrorLevel = env.ConstErrorLevelActor
)
// Coupon is a default implementer of InterfaceDiscount
type Coupon struct{}
// usedCoupons contains used coupon codes with visitorsId's, initialize from orders and updated on checkout success
var usedCoupons map[string][]string
type discount struct {
Code string
Name string
Total float64
Amount float64
Percents float64
Qty int
}