-
Notifications
You must be signed in to change notification settings - Fork 0
/
coupon.go
68 lines (49 loc) · 1.15 KB
/
coupon.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
/**
* Copyright 2014 @ S1N1 Team.
* name :
* author : jarryliu
* date : 2013-12-03 21:04
* description :
* history :
*/
package promotion
import (
"go2o/src/core/domain/interface/member"
)
// 优惠券促销
type ICouponPromotion interface {
GetDomainId() int
// 获取促销内容
GetDetailsValue() ValueCoupon
// 设置促销内容
SetDetailsValue(*ValueCoupon) error
// 获取绑定
GetBinds() []ValueCouponBind
// 获取占用
GetTakes() []ValueCouponTake
// 保存
Save() (id int, err error)
// 获取优惠券描述
GetDescribe() string
// 获取优惠的金额
GetCouponFee(orderFee float32) float32
// 是否可用,传递会员及订单金额
// error返回不适用的详细信息
CanUse(member.IMember, float32) (bool, error)
// 是否允许占用
CanTake() bool
// 获取占用
GetTake(memberId int) (*ValueCouponTake, error)
//占用
Take(memberId int) error
// 应用到订单
ApplyTake(couponTakeId int) error
// 绑定
Bind(memberId int) error
//获取绑定
GetBind(memberId int) (*ValueCouponBind, error)
//绑定
Binds(memberIds []string) error
//使用优惠券
UseCoupon(couponBindId int) error
}