models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2016 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Title        string
	FirstName    string
	LastName     string
	Email        mail.Address
	Password     string
	AddressLine1 string
	AddressLine2 string
	County       string
	TownOrCity   string
	Postcode     string
	Country      string
}

Account represents a JustGiving user account

func (Account) HasValidCountry

func (acc Account) HasValidCountry(vs AccountValidationService) (bool, error)

HasValidCountry checks the Country is in the published JustGiving Countries list

func (Account) PlainEmail

func (acc Account) PlainEmail() string

PlainEmail returns a plainer email address (mail.Address stores email in the format <rob@golang.org>, this simply removes the `<` `>`

type AccountValidationService

type AccountValidationService interface {
	IsValidCountry(name string) (bool, error)
}

AccountValidationService defines the validation methods requiring calls to the JustGiving API.

For an implementation see justin.Service

type FundraisingPageForEvent

type FundraisingPageForEvent struct {
	CharityID uint

	EventID uint

	PageShortName string

	PageTitle string

	PageStory string

	Images []Image

	CustomCodes [6]string

	// TargetAmount for this fundraising effort expressed as a valid currency amount e.g. "999.99" or "9999"
	TargetAmount string

	// CurrencyCode
	CurrencyCode string

	CharityFunded bool

	JustGivingOptIn bool

	CharityOptIn bool

	TeamID uint
}

FundraisingPageForEvent represents a JustGiving fundraising page for a pre-defined JustGiving event

func (FundraisingPageForEvent) HasValidCurrencyCode

HasValidCurrencyCode checks the CurrencyCode is in the published JustGiving currency code list

func (FundraisingPageForEvent) HasValidTargetAmount

func (fp FundraisingPageForEvent) HasValidTargetAmount() bool

HasValidTargetAmount performs basic validation on the TargetAmount

type FundraisingPageForEventValidationService

type FundraisingPageForEventValidationService interface {
	IsValidCurrencyCode(currencyCode string) (bool, error)
}

FundraisingPageForEventValidationService defines the validation methods requiring calls to the JustGiving API.

For an implementation see justin.Service

type Image

type Image struct {
	Caption string
	URL     url.URL
}

Image represents a JustGiving fundraising page image

Jump to

Keyboard shortcuts

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