supporterpage

package
v0.1461.0-MLPAB2496upd... Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnterOrganisationName

func EnterOrganisationName(logger Logger, tmpl template.Template, organisationStore OrganisationStore, memberStore MemberStore, sessionStore SessionStore) page.Handler

func EnterReferenceNumber

func EnterReferenceNumber(logger Logger, tmpl template.Template, memberStore MemberStore, sessionStore SessionStore) page.Handler

func EnterYourName

func EnterYourName(tmpl template.Template, memberStore MemberStore) page.Handler

func LoginCallback

func LoginCallback(logger Logger, oneLoginClient LoginCallbackOneLoginClient, sessionStore SessionStore, organisationStore OrganisationStore, now func() time.Time, memberStore MemberStore) page.Handler

func Register

func Register(
	rootMux *http.ServeMux,
	logger Logger,
	tmpls template.Templates,
	oneLoginClient OneLoginClient,
	sessionStore SessionStore,
	organisationStore OrganisationStore,
	errorHandler page.ErrorHandler,
	notifyClient NotifyClient,
	appPublicURL string,
	memberStore MemberStore,
	searchClient *search.Client,
	donorStore DonorStore,
	shareCodeStore ShareCodeStore,
	progressTracker ProgressTracker,
	lpaStoreResolvingService LpaStoreResolvingService,
)

Types

type CertificateProviderStore

type CertificateProviderStore interface {
	GetAny(ctx context.Context) (*certificateproviderdata.Provided, error)
}

type DonorStore

type DonorStore interface {
	DeleteDonorAccess(ctx context.Context, shareCodeData sharecodedata.Link) error
	Get(ctx context.Context) (*donordata.Provided, error)
	GetByKeys(ctx context.Context, keys []dynamo.Keys) ([]donordata.Provided, error)
	Put(ctx context.Context, donor *donordata.Provided) error
}

type ErrorHandler

type ErrorHandler func(http.ResponseWriter, *http.Request, error)

type HandleOpt

type HandleOpt byte
const (
	None HandleOpt = 1 << iota
	RequireSession
	RequireAdmin
	CanGoBack
)

type Handler

type Handler func(data appcontext.Data, w http.ResponseWriter, r *http.Request, organisation *supporterdata.Organisation, member *supporterdata.Member) error

func ConfirmDonorCanInteractOnline

func ConfirmDonorCanInteractOnline(tmpl template.Template, organisationStore OrganisationStore) Handler

func Dashboard

func Dashboard(tmpl template.Template, donorStore DonorStore, searchClient SearchClient) Handler

func DeleteOrganisation

func DeleteOrganisation(logger Logger, tmpl template.Template, organisationStore OrganisationStore, sessionStore SessionStore, searchClient SearchClient) Handler

func DonorAccess

func DonorAccess(logger Logger, tmpl template.Template, donorStore DonorStore, shareCodeStore ShareCodeStore, notifyClient NotifyClient, appPublicURL string, randomString func(int) string) Handler

func EditMember

func EditMember(logger Logger, tmpl template.Template, memberStore MemberStore) Handler

func EditOrganisationName

func EditOrganisationName(tmpl template.Template, organisationStore OrganisationStore) Handler

func Guidance

func Guidance(tmpl template.Template) Handler

func InviteMember

func InviteMember(tmpl template.Template, memberStore MemberStore, notifyClient NotifyClient, randomString func(int) string, appPublicURL string) Handler

func ManageTeamMembers

func ManageTeamMembers(tmpl template.Template, memberStore MemberStore, randomString func(int) string, notifyClient NotifyClient, appPublicURL string) Handler

func ViewLPA

func ViewLPA(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService, progressTracker ProgressTracker) Handler

type Localizer

type Localizer interface {
	page.Localizer
}

type Logger

type Logger interface {
	InfoContext(ctx context.Context, msg string, args ...any)
}

type LoginCallbackOneLoginClient

type LoginCallbackOneLoginClient interface {
	Exchange(ctx context.Context, code, nonce string) (idToken, accessToken string, err error)
	UserInfo(ctx context.Context, accessToken string) (onelogin.UserInfo, error)
}

type LpaStoreResolvingService

type LpaStoreResolvingService interface {
	Get(ctx context.Context) (*lpadata.Lpa, error)
}

type MemberStore

type MemberStore interface {
	Create(ctx context.Context, firstNames, lastName string) (*supporterdata.Member, error)
	CreateFromInvite(ctx context.Context, invite *supporterdata.MemberInvite) error
	CreateMemberInvite(ctx context.Context, organisation *supporterdata.Organisation, firstNames, lastname, email, code string, permission supporterdata.Permission) error
	DeleteMemberInvite(ctx context.Context, organisationID, email string) error
	Get(ctx context.Context) (*supporterdata.Member, error)
	GetAny(ctx context.Context) (*supporterdata.Member, error)
	GetAll(ctx context.Context) ([]*supporterdata.Member, error)
	GetByID(ctx context.Context, memberID string) (*supporterdata.Member, error)
	InvitedMember(ctx context.Context) (*supporterdata.MemberInvite, error)
	InvitedMembers(ctx context.Context) ([]*supporterdata.MemberInvite, error)
	InvitedMembersByEmail(ctx context.Context) ([]*supporterdata.MemberInvite, error)
	Put(ctx context.Context, member *supporterdata.Member) error
}

type NotifyClient

type NotifyClient interface {
	SendEmail(ctx context.Context, to string, email notify.Email) error
}

type OneLoginClient

type OneLoginClient interface {
	AuthCodeURL(state, nonce, locale string, identity bool) (string, error)
	Exchange(ctx context.Context, code, nonce string) (idToken, accessToken string, err error)
	UserInfo(ctx context.Context, accessToken string) (onelogin.UserInfo, error)
}

type OrganisationStore

type OrganisationStore interface {
	Create(ctx context.Context, member *supporterdata.Member, name string) (*supporterdata.Organisation, error)
	CreateLPA(ctx context.Context) (*donordata.Provided, error)
	Get(ctx context.Context) (*supporterdata.Organisation, error)
	Put(ctx context.Context, organisation *supporterdata.Organisation) error
	SoftDelete(ctx context.Context, organisation *supporterdata.Organisation) error
}

type ProgressTracker

type ProgressTracker interface {
	Progress(lpa *lpadata.Lpa) task.Progress
}

type SearchClient

type SearchClient interface {
	Query(ctx context.Context, req search.QueryRequest) (*search.QueryResponse, error)
	CountWithQuery(ctx context.Context, req search.CountWithQueryReq) (int, error)
}

type SessionStore

type SessionStore interface {
	ClearLogin(r *http.Request, w http.ResponseWriter) error
	Login(r *http.Request) (*sesh.LoginSession, error)
	OneLogin(r *http.Request) (*sesh.OneLoginSession, error)
	SetLogin(r *http.Request, w http.ResponseWriter, session *sesh.LoginSession) error
	SetOneLogin(r *http.Request, w http.ResponseWriter, session *sesh.OneLoginSession) error
}

type ShareCodeStore

type ShareCodeStore interface {
	PutDonor(ctx context.Context, shareCode string, data sharecodedata.Link) error
	GetDonor(ctx context.Context) (sharecodedata.Link, error)
	Delete(ctx context.Context, data sharecodedata.Link) error
}

type SupporterPath

type SupporterPath interface {
	String() string
	IsManageOrganisation() bool
}

type Template

type Template func(w io.Writer, data interface{}) error

Jump to

Keyboard shortcuts

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