models

package
v1.9.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeFreeWeekly           = "free_weekly"
	TypeBeReferred           = "be_referred"
	TypeReferralSpecific     = "referral_specific"
	TypePassportScan         = "passport_scan"
	TypeInternalPassportScan = "internal_passport_scan"
	TypeExternalPassportScan = "external_passport_scan"
	TypePollParticipation    = "poll_participation"
	TypeEarlyTest            = "early_test"
	TypeDailyQuestion        = "daily_question"
	TypeBonusCode            = "bonus_code"
)
View Source
const (
	FlagActive     = "active"
	FlagNotStarted = "not_started"
	FlagExpired    = "expired"
	FlagDisabled   = "disabled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType struct {
	Name             string          `fig:"name,required" db:"name"`
	Reward           int64           `fig:"reward,required" db:"reward"`
	Title            string          `fig:"title,required" db:"title"`
	Description      string          `fig:"description,required" db:"description"`
	ShortDescription string          `fig:"short_description,required" db:"short_description"`
	Localized        LocalizationMap `fig:"localized" db:"localized"`
	Frequency        Frequency       `fig:"frequency,required" db:"frequency"`
	StartsAt         *time.Time      `fig:"starts_at" db:"starts_at"`
	ExpiresAt        *time.Time      `fig:"expires_at" db:"expires_at"`
	NoAutoOpen       bool            `fig:"no_auto_open" db:"no_auto_open"`
	AutoClaim        bool            `fig:"auto_claim" db:"auto_claim"`
	Disabled         bool            `fig:"disabled" db:"disabled"`
	ActionURL        *string         `fig:"action_url" db:"action_url"`
	QRCodeValue      *string         `db:"qr_code_value"`
	PollEventID      *string         `db:"poll_event_id"`
	PollContract     *string         `db:"poll_contract"`
}

func ResourceToModel

func ResourceToModel(r resources.EventStaticMeta) EventType

func (EventType) Flag

func (e EventType) Flag() string

func (EventType) ForUpdate

func (e EventType) ForUpdate() map[string]any

func (EventType) GetLocalized added in v1.0.0

func (e EventType) GetLocalized(locale string) Localized

func (EventType) Resource

func (e EventType) Resource(locale string) resources.EventStaticMeta

type Frequency

type Frequency string
const (
	OneTime   Frequency = "one-time"
	Daily     Frequency = "daily"
	Weekly    Frequency = "weekly"
	Unlimited Frequency = "unlimited"
)

func (Frequency) String

func (f Frequency) String() string

type LocalizationMap added in v1.0.0

type LocalizationMap map[string]Localized

LocalizationMap maps 2-letter locales to Localized data and implements interfaces to work with DB

func (*LocalizationMap) Scan added in v1.0.0

func (l *LocalizationMap) Scan(src interface{}) error

func (*LocalizationMap) Value added in v1.0.0

func (l *LocalizationMap) Value() (driver.Value, error)

type Localized added in v1.0.0

type Localized struct {
	Title            string `fig:"title,required" json:"title"`
	Description      string `fig:"description,required" json:"description"`
	ShortDescription string `fig:"short_description,required" json:"short_description"`
}

Jump to

Keyboard shortcuts

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