promotion

package
v0.0.0-...-0eb9a37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPromotion

func NewPromotion(partnerId int, promRep promotion.IPromotionRep,
	memberRep member.IMemberRep) promotion.IPromotion

Types

type Coupon

type Coupon struct {
	// contains filtered or unexported fields
}

优惠券,一张优惠券有数量,对应唯一的促销码。 优惠内容包含:送金额,送积分,订单折扣。仅在消费时有效。 使用需要达到最低金额和最低等级。 优惠券包含了开始时间和结束时间,超出时间则过期。 优惠券可以设置启用和停用 是否允许绑定,如果不绑定。则可以任意使用.只要有绑定和使用后,就不允许修改此属性。

func (*Coupon) ApplyTake

func (this *Coupon) ApplyTake(couponTakeId int) error

应用到订单

func (*Coupon) Bind

func (this *Coupon) Bind(memberId int) error

绑定

func (*Coupon) Binds

func (this *Coupon) Binds(memberIds []string) error

func (*Coupon) CanTake

func (this *Coupon) CanTake() bool

是否允许占用

func (*Coupon) CanUse

func (this *Coupon) CanUse(m member.IMember, fee float32) (bool, error)

是否可用

func (*Coupon) GetBind

func (this *Coupon) GetBind(memberId int) (*promotion.ValueCouponBind, error)

获取绑定

func (*Coupon) GetBinds

func (this *Coupon) GetBinds() []promotion.ValueCouponBind

func (*Coupon) GetCouponFee

func (this *Coupon) GetCouponFee(orderFee float32) float32

获取优惠的金额(四舍五入)

func (*Coupon) GetDescribe

func (this *Coupon) GetDescribe() string

获取优惠券描述

func (*Coupon) GetDomainId

func (this *Coupon) GetDomainId() int

func (*Coupon) GetTake

func (this *Coupon) GetTake(memberId int) (*promotion.ValueCouponTake, error)

获取占用

func (*Coupon) GetTakes

func (this *Coupon) GetTakes() []promotion.ValueCouponTake

func (*Coupon) GetValue

func (this *Coupon) GetValue() promotion.ValueCoupon

func (*Coupon) Save

func (this *Coupon) Save() (id int, err error)

func (*Coupon) SetValue

func (this *Coupon) SetValue(v *promotion.ValueCoupon) error

设置值

func (*Coupon) Take

func (this *Coupon) Take(memberId int) error

占用

func (*Coupon) UseCoupon

func (this *Coupon) UseCoupon(couponBindId int) error

使用优惠券

type Promotion

type Promotion struct {
	// contains filtered or unexported fields
}

func (*Promotion) CreateCoupon

func (this *Promotion) CreateCoupon(val *promotion.ValueCoupon) promotion.ICoupon

func (*Promotion) GetAggregateRootId

func (this *Promotion) GetAggregateRootId() int

func (*Promotion) GetCoupon

func (this *Promotion) GetCoupon(id int) promotion.ICoupon

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL