referral

package
v1.37.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type Event

type Event string
const (
	NewOrder Event = "new-order"
	NewUser  Event = "new-user"
)

type Fee

type Fee struct {
	Currency currency.Type  `json:"currency,omitempty"`
	Id       string         `json:"id,omitempty"`
	Amount   currency.Cents `json:"amount,omitempty"`
}

type Referral

type Referral struct {
	mixin.Model[Referral]

	Type Event `json:"event"`

	// User created by referral
	UserId string `json:"userId"`

	// Order created by referral
	OrderId string `json:"orderId"`

	// Referred by
	Referrer Referrer `json:"referrer,omitempty"`

	Fee Fee `json:"fee,omitempty"`

	Client      client.Client `json:"-"`
	Blacklisted bool          `json:"blacklisted,omitempty"`
	Duplicate   bool          `json:"duplicate,omitempty"`
	Revoked     bool          `json:"revoked"`
}

func Fake

func Fake(db *datastore.Datastore, userId, orderId string) *Referral

func New

func New(db *datastore.Datastore) *Referral

type Referrer

type Referrer struct {
	Id            string `json:"id"`
	UserId        string `json:"userId"`
	AffiliateId   string `json:"affiliateId"`
	WoopraDomains string `json:"woopraDomains"`
}

Jump to

Keyboard shortcuts

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