pricing strategy defaul is subscription
This commit is contained in:
@@ -41,14 +41,14 @@ type BuyingStrategy int
|
|||||||
|
|
||||||
// should except... on
|
// should except... on
|
||||||
const (
|
const (
|
||||||
PERMANENT BuyingStrategy = iota // is a permanent buying ( predictible )
|
SUBSCRIPTION BuyingStrategy = iota // is a permanent buying ( predictible )
|
||||||
UNDEFINED_SUBSCRIPTION // a endless subscription ( unpredictible )
|
UNDEFINED_SUBSCRIPTION // a endless subscription ( unpredictible )
|
||||||
SUBSCRIPTION // a defined subscription ( predictible )
|
PERMANENT // a defined subscription ( predictible )
|
||||||
// PAY_PER_USE // per request. ( unpredictible )
|
// PAY_PER_USE // per request. ( unpredictible )
|
||||||
)
|
)
|
||||||
|
|
||||||
func (t BuyingStrategy) String() string {
|
func (t BuyingStrategy) String() string {
|
||||||
return [...]string{"PERMANENT", "UNDEFINED_SUBSCRIPTION", "SUBSCRIPTION"}[t]
|
return [...]string{"SUBSCRIPTION", "UNDEFINED_SUBSCRIPTION", "PERMANENT"}[t]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t BuyingStrategy) IsBillingStrategyAllowed(bs BillingStrategy) (BillingStrategy, bool) {
|
func (t BuyingStrategy) IsBillingStrategyAllowed(bs BillingStrategy) (BillingStrategy, bool) {
|
||||||
@@ -65,7 +65,7 @@ func (t BuyingStrategy) IsBillingStrategyAllowed(bs BillingStrategy) (BillingStr
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BuyingStrategyList() []BuyingStrategy {
|
func BuyingStrategyList() []BuyingStrategy {
|
||||||
return []BuyingStrategy{PERMANENT, UNDEFINED_SUBSCRIPTION, SUBSCRIPTION}
|
return []BuyingStrategy{SUBSCRIPTION, UNDEFINED_SUBSCRIPTION, PERMANENT}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Strategy interface {
|
type Strategy interface {
|
||||||
|
|||||||
Reference in New Issue
Block a user