Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct {
Type ActionType `json:"type"`
Name string `json:"name"`
Once bool `json:"once"`
CreditAction
// PercentAction
SendTransactionalUserEmailAction
SendWoopraEvent
Trigger Trigger `json:"trigger"`
}
Union of possible actions
type ActionType ¶
type ActionType string
const ( StoreCredit ActionType = "Credit" // Add credit to user's balance // Refund ActionType = "Refund" // Refund part of the payment on a order SendUserEmail ActionType = "SendUserEmail" SendWoopra ActionType = "SendWoopraEvent" )
type CreditAction ¶
type ReferralProgram ¶
type ReferralProgram struct {
mixin.Model
Name string `json:"name"`
// Trigger is the number of referrals, 0 means it triggers on every referral
Triggers []int `json:"triggers"` // Deprecate soon, keep until that point in time
Actions []Action `json:"actions"`
}
func New ¶
func New(db *datastore.Datastore) *ReferralProgram
func (*ReferralProgram) Defaults ¶
func (r *ReferralProgram) Defaults()
func (*ReferralProgram) Init ¶
func (r *ReferralProgram) Init(db *datastore.Datastore)
func (ReferralProgram) Kind ¶
func (r ReferralProgram) Kind() string
type ReferralsGreaterThanOrEqualsTrigger ¶
type ReferralsGreaterThanOrEqualsTrigger struct {
ReferralsGreaterThanOrEquals int `json:"referralsGreaterThanOrEquals,omitempty"`
}
type SendTransactionalUserEmailAction ¶
type SendTransactionalUserEmailAction struct {
EmailTemplate string `json:"template"`
}
type SendWoopraEvent ¶
type SendWoopraEvent struct {
Domain string `json:"domain"`
}
type Trigger ¶
type Trigger struct {
Event referral.Event `json:"event"`
Type TriggerType `json:"type"`
CreditGreaterThanOrEqualsTrigger
ReferralsGreaterThanOrEqualsTrigger
}
Union of possible triggers
type TriggerType ¶
type TriggerType string
const ( CreditGreaterThanOrEquals TriggerType = "CreditGreaterThanOrEquals" ReferralsGreaterThanOrEquals TriggerType = "ReferralsGreaterThanOrEquals" Always TriggerType = "Always" )
Click to show internal directories.
Click to hide internal directories.