donorpage

package
v0.1563.0-MLPAB2548can... Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 45 Imported by: 0

Documentation

Overview

Package donorpage provides the pages that a donor interacts with.

Index

Constants

View Source
const (
	WantToSignLpa     = "want-to-sign"
	WantToApplyForLpa = "want-to-apply"
)

Variables

This section is empty.

Functions

func EnterAccessCode

func EnterAccessCode(logger Logger, tmpl template.Template, shareCodeStore ShareCodeStore, donorStore DonorStore) page.Handler

func ParseHowYouWillConfirmYourIdentity added in v0.1548.0

func ParseHowYouWillConfirmYourIdentity(s string) (howYouWillConfirmYourIdentity, error)

func Register

func Register(
	rootMux *http.ServeMux,
	logger Logger,
	tmpls template.Templates,
	sessionStore SessionStore,
	donorStore DonorStore,
	oneLoginClient OneLoginClient,
	addressClient AddressClient,
	appPublicURL string,
	payClient PayClient,
	shareCodeSender ShareCodeSender,
	witnessCodeSender WitnessCodeSender,
	errorHandler page.ErrorHandler,
	certificateProviderStore CertificateProviderStore,
	notifyClient NotifyClient,
	evidenceReceivedStore EvidenceReceivedStore,
	documentStore DocumentStore,
	eventClient EventClient,
	dashboardStore DashboardStore,
	lpaStoreClient LpaStoreClient,
	shareCodeStore ShareCodeStore,
	progressTracker ProgressTracker,
	lpaStoreResolvingService LpaStoreResolvingService,
	scheduledStore ScheduledStore,
)

Types

type AddressClient

type AddressClient interface {
	LookupPostcode(ctx context.Context, postcode string) ([]place.Address, error)
}

type CertificateProviderStore

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

type DashboardStore

type DashboardStore interface {
	GetAll(ctx context.Context) (results dashboarddata.Results, err error)
	SubExistsForActorType(ctx context.Context, sub string, actorType actor.Type) (bool, error)
}

type DonorStore

type DonorStore interface {
	Get(ctx context.Context) (*donordata.Provided, error)
	Latest(ctx context.Context) (*donordata.Provided, error)
	Put(ctx context.Context, donor *donordata.Provided) error
	Delete(ctx context.Context) error
	Link(ctx context.Context, data sharecodedata.Link, donorEmail string) error
	DeleteVoucher(ctx context.Context, provided *donordata.Provided) error
}

type ErrorHandler

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

type EventClient

type EventClient interface {
	SendReducedFeeRequested(ctx context.Context, e event.ReducedFeeRequested) error
	SendPaymentReceived(ctx context.Context, e event.PaymentReceived) error
	SendUidRequested(ctx context.Context, e event.UidRequested) error
	SendCertificateProviderStarted(ctx context.Context, e event.CertificateProviderStarted) error
	SendIdentityCheckMismatched(ctx context.Context, e event.IdentityCheckMismatched) error
}

type EvidenceReceivedStore

type EvidenceReceivedStore interface {
	Get(context.Context) (bool, error)
}

type File

type File struct {
	Data     []byte
	Filename string
	Error    error
}

type GetDonorStore

type GetDonorStore interface {
	Get(context.Context) (*donordata.Provided, error)
}

type Handler

type Handler func(data appcontext.Data, w http.ResponseWriter, r *http.Request, donor *donordata.Provided) error

func AddCorrespondent

func AddCorrespondent(tmpl template.Template, donorStore DonorStore) Handler

func AreYouApplyingForFeeDiscountOrExemption

func AreYouApplyingForFeeDiscountOrExemption(tmpl template.Template, payer Handler, donorStore DonorStore) Handler

func AreYouSureYouNoLongerNeedVoucher added in v0.1513.0

func AreYouSureYouNoLongerNeedVoucher(tmpl template.Template, donorStore DonorStore) Handler

func CanYouSignYourLpa

func CanYouSignYourLpa(tmpl template.Template, donorStore DonorStore) Handler

func CertificateProviderAddress

func CertificateProviderAddress(logger Logger, tmpl template.Template, addressClient AddressClient, donorStore DonorStore) Handler

func CertificateProviderDetails

func CertificateProviderDetails(tmpl template.Template, donorStore DonorStore, newUID func() actoruid.UID) Handler

func ChangeMobileNumber

func ChangeMobileNumber(tmpl template.Template, witnessCodeSender WitnessCodeSender, actorType actor.Type) Handler

func CheckYouCanSign

func CheckYouCanSign(tmpl template.Template, donorStore DonorStore) Handler

func CheckYourDetails

func CheckYourDetails(tmpl template.Template, shareCodeSender ShareCodeSender) Handler

func CheckYourLpa

func CheckYourLpa(tmpl template.Template, donorStore DonorStore, shareCodeSender ShareCodeSender, notifyClient NotifyClient, certificateProviderStore CertificateProviderStore, now func() time.Time, appPublicURL string) Handler

func ChooseAttorneys

func ChooseAttorneys(tmpl template.Template, donorStore DonorStore) Handler

func ChooseAttorneysAddress

func ChooseAttorneysAddress(logger Logger, tmpl template.Template, addressClient AddressClient, donorStore DonorStore) Handler

func ChooseAttorneysGuidance

func ChooseAttorneysGuidance(tmpl template.Template, newUID func() actoruid.UID) Handler

func ChooseAttorneysSummary

func ChooseAttorneysSummary(tmpl template.Template, newUID func() actoruid.UID) Handler

func ChooseNewCertificateProvider

func ChooseNewCertificateProvider(tmpl template.Template, donorStore DonorStore) Handler

func ChoosePeopleToNotify

func ChoosePeopleToNotify(tmpl template.Template, donorStore DonorStore, newUID func() actoruid.UID) Handler

func ChoosePeopleToNotifyAddress

func ChoosePeopleToNotifyAddress(logger Logger, tmpl template.Template, addressClient AddressClient, donorStore DonorStore) Handler

func ChoosePeopleToNotifySummary

func ChoosePeopleToNotifySummary(tmpl template.Template) Handler

func ChooseReplacementAttorneys

func ChooseReplacementAttorneys(tmpl template.Template, donorStore DonorStore) Handler

func ChooseReplacementAttorneysAddress

func ChooseReplacementAttorneysAddress(logger Logger, tmpl template.Template, addressClient AddressClient, donorStore DonorStore) Handler

func ChooseReplacementAttorneysSummary

func ChooseReplacementAttorneysSummary(tmpl template.Template, newUID func() actoruid.UID) Handler

func ChooseSomeoneToVouchForYou added in v0.1529.0

func ChooseSomeoneToVouchForYou(tmpl template.Template, donorStore DonorStore) Handler

func CompletingYourIdentityConfirmation added in v0.1554.0

func CompletingYourIdentityConfirmation(tmpl template.Template) Handler

func ConfirmPersonAllowedToVouch

func ConfirmPersonAllowedToVouch(tmpl template.Template, donorStore DonorStore) Handler

func ConfirmYourCertificateProviderIsNotRelated

func ConfirmYourCertificateProviderIsNotRelated(tmpl template.Template, donorStore DonorStore, now func() time.Time) Handler

func ConfirmYourIdentity added in v0.1548.0

func ConfirmYourIdentity(tmpl template.Template, donorStore DonorStore) Handler

func DeleteLpa

func DeleteLpa(tmpl template.Template, donorStore DonorStore) Handler

func DoYouWantToNotifyPeople

func DoYouWantToNotifyPeople(tmpl template.Template, donorStore DonorStore) Handler

func EnterCorrespondentAddress

func EnterCorrespondentAddress(logger Logger, tmpl template.Template, addressClient AddressClient, donorStore DonorStore) Handler

func EnterCorrespondentDetails

func EnterCorrespondentDetails(tmpl template.Template, donorStore DonorStore) Handler

func EnterReplacementTrustCorporation

func EnterReplacementTrustCorporation(tmpl template.Template, donorStore DonorStore) Handler

func EnterReplacementTrustCorporationAddress

func EnterReplacementTrustCorporationAddress(logger Logger, tmpl template.Template, addressClient AddressClient, donorStore DonorStore) Handler

func EnterTrustCorporation

func EnterTrustCorporation(tmpl template.Template, donorStore DonorStore) Handler

func EnterTrustCorporationAddress

func EnterTrustCorporationAddress(logger Logger, tmpl template.Template, addressClient AddressClient, donorStore DonorStore) Handler

func EnterVoucher

func EnterVoucher(tmpl template.Template, donorStore DonorStore, newUID func() actoruid.UID) Handler

func FeeDenied

func FeeDenied(tmpl template.Template, payer Handler) Handler

func Guidance

func Guidance(tmpl template.Template) Handler

func HowDoYouKnowYourCertificateProvider

func HowDoYouKnowYourCertificateProvider(tmpl template.Template, donorStore DonorStore) Handler

func HowLongHaveYouKnownCertificateProvider

func HowLongHaveYouKnownCertificateProvider(tmpl template.Template, donorStore DonorStore) Handler

func HowShouldAttorneysMakeDecisions

func HowShouldAttorneysMakeDecisions(tmpl template.Template, donorStore DonorStore) Handler

func HowShouldReplacementAttorneysMakeDecisions

func HowShouldReplacementAttorneysMakeDecisions(tmpl template.Template, donorStore DonorStore) Handler

func HowShouldReplacementAttorneysStepIn

func HowShouldReplacementAttorneysStepIn(tmpl template.Template, donorStore DonorStore) Handler

func HowWillYouConfirmYourIdentity added in v0.1548.0

func HowWillYouConfirmYourIdentity(tmpl template.Template, donorStore DonorStore) Handler

func HowWouldCertificateProviderPreferToCarryOutTheirRole

func HowWouldCertificateProviderPreferToCarryOutTheirRole(tmpl template.Template, donorStore DonorStore) Handler

func HowWouldYouLikeToSendEvidence

func HowWouldYouLikeToSendEvidence(tmpl template.Template, donorStore DonorStore) Handler

func IdentityWithOneLogin

func IdentityWithOneLogin(oneLoginClient OneLoginClient, sessionStore SessionStore, randomString func(int) string) Handler

func IdentityWithOneLoginCallback

func IdentityWithOneLoginCallback(oneLoginClient OneLoginClient, sessionStore SessionStore, donorStore DonorStore, scheduledStore ScheduledStore, eventClient EventClient) Handler

func LifeSustainingTreatment

func LifeSustainingTreatment(tmpl template.Template, donorStore DonorStore) Handler

func LpaDetailsSaved

func LpaDetailsSaved(tmpl template.Template) Handler

func LpaProgress

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

func LpaType

func LpaType(tmpl template.Template, donorStore DonorStore, eventClient EventClient) Handler

func OneLoginIdentityDetails

func OneLoginIdentityDetails(tmpl template.Template, donorStore DonorStore) Handler

func Pay

func Pay(
	logger Logger,
	sessionStore SessionStore,
	donorStore DonorStore,
	payClient PayClient,
	appPublicURL string,
) Handler

func PaymentConfirmation

func PaymentConfirmation(logger Logger, payClient PayClient, donorStore DonorStore, sessionStore SessionStore, shareCodeSender ShareCodeSender, lpaStoreClient LpaStoreClient, eventClient EventClient, notifyClient NotifyClient) Handler

func PreviousApplicationNumber

func PreviousApplicationNumber(tmpl template.Template, donorStore DonorStore) Handler

func PreviousFee

func PreviousFee(tmpl template.Template, payer Handler, donorStore DonorStore) Handler

func RegisterWithCourtOfProtection

func RegisterWithCourtOfProtection(tmpl template.Template, donorStore DonorStore) Handler

func RemoveAttorney

func RemoveAttorney(tmpl template.Template, donorStore DonorStore) Handler

func RemovePersonToNotify

func RemovePersonToNotify(tmpl template.Template, donorStore DonorStore) Handler

func RemoveReplacementAttorney

func RemoveReplacementAttorney(tmpl template.Template, donorStore DonorStore) Handler

func RemoveTrustCorporation

func RemoveTrustCorporation(tmpl template.Template, donorStore DonorStore, isReplacement bool) Handler

func ResendWitnessCode

func ResendWitnessCode(tmpl template.Template, witnessCodeSender WitnessCodeSender, actorType actor.Type) Handler

func Restrictions

func Restrictions(tmpl template.Template, donorStore DonorStore) Handler

func SendUsYourEvidenceByPost

func SendUsYourEvidenceByPost(tmpl template.Template, payer Handler, eventClient EventClient) Handler

func SignYourLpa

func SignYourLpa(tmpl template.Template, donorStore DonorStore, now func() time.Time) Handler

func TaskList

func TaskList(tmpl template.Template, evidenceReceivedStore EvidenceReceivedStore) Handler

func UploadEvidence

func UploadEvidence(tmpl template.Template, logger Logger, payer Handler, documentStore DocumentStore) Handler

func UploadEvidenceSSE

func UploadEvidenceSSE(documentStore DocumentStore, ttl time.Duration, flushFrequency time.Duration, now func() time.Time) Handler

func ViewLpa added in v0.1437.0

func ViewLpa(tmpl template.Template, lpaStoreClient LpaStoreClient) Handler

func WantReplacementAttorneys

func WantReplacementAttorneys(tmpl template.Template, donorStore DonorStore, newUID func() actoruid.UID) Handler

func WhatYouCanDoNow

func WhatYouCanDoNow(tmpl template.Template, donorStore DonorStore) Handler

func WhatYouCanDoNowExpired added in v0.1431.0

func WhatYouCanDoNowExpired(tmpl template.Template, donorStore DonorStore) Handler

func WhenCanTheLpaBeUsed

func WhenCanTheLpaBeUsed(tmpl template.Template, donorStore DonorStore) Handler

func WhichFeeTypeAreYouApplyingFor

func WhichFeeTypeAreYouApplyingFor(tmpl template.Template, donorStore DonorStore) Handler

func WithdrawLpa

func WithdrawLpa(tmpl template.Template, donorStore DonorStore, now func() time.Time, lpaStoreClient LpaStoreClient) Handler

func WitnessingAsCertificateProvider

func WitnessingAsCertificateProvider(
	tmpl template.Template,
	donorStore DonorStore,
	shareCodeSender ShareCodeSender,
	lpaStoreClient LpaStoreClient,
	eventClient EventClient,
	now func() time.Time,
) Handler

func WitnessingAsIndependentWitness

func WitnessingAsIndependentWitness(tmpl template.Template, donorStore DonorStore, now func() time.Time) Handler

func WitnessingYourSignature

func WitnessingYourSignature(tmpl template.Template, witnessCodeSender WitnessCodeSender, donorStore DonorStore) Handler

func YouCannotSignYourLpaYet

func YouCannotSignYourLpaYet(tmpl template.Template) Handler

func YourAddress

func YourAddress(logger Logger, tmpl template.Template, addressClient AddressClient, donorStore DonorStore) Handler

func YourAuthorisedSignatory

func YourAuthorisedSignatory(tmpl template.Template, donorStore DonorStore, newUID func() actoruid.UID) Handler

func YourDateOfBirth

func YourDateOfBirth(tmpl template.Template, donorStore DonorStore) Handler

func YourEmail

func YourEmail(tmpl template.Template, donorStore DonorStore) Handler

func YourIndependentWitness

func YourIndependentWitness(tmpl template.Template, donorStore DonorStore, newUID func() actoruid.UID) Handler

func YourIndependentWitnessAddress

func YourIndependentWitnessAddress(logger Logger, tmpl template.Template, addressClient AddressClient, donorStore DonorStore) Handler

func YourIndependentWitnessMobile

func YourIndependentWitnessMobile(tmpl template.Template, donorStore DonorStore) Handler

func YourLpaLanguage

func YourLpaLanguage(tmpl template.Template, donorStore DonorStore) Handler

func YourMobile added in v0.1389.0

func YourMobile(tmpl template.Template, donorStore DonorStore) Handler

func YourName

func YourName(tmpl template.Template, donorStore DonorStore, sessionStore SessionStore) Handler

func YourPreferredLanguage

func YourPreferredLanguage(tmpl template.Template, donorStore DonorStore) Handler

type Localizer

type Localizer interface {
	page.Localizer
}

type Logger

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

type LpaDetailsSavedData

type LpaDetailsSavedData struct {
	App          appcontext.Data
	Donor        *donordata.Provided
	IsFirstCheck bool
	Errors       validation.List
}

type LpaStoreClient

type LpaStoreClient interface {
	Lpa(ctx context.Context, lpaUID string) (*lpadata.Lpa, error)
	SendDonorConfirmIdentity(ctx context.Context, donor *donordata.Provided) error
	SendLpa(ctx context.Context, details *donordata.Provided) error
	SendDonorWithdrawLPA(ctx context.Context, lpaUID string) error
}

type LpaStoreResolvingService

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

type NotifyClient

type NotifyClient interface {
	SendActorSMS(ctx context.Context, lang localize.Lang, to, lpaUID string, sms notify.SMS) error
	SendEmail(ctx context.Context, lang localize.Lang, 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)
	ParseIdentityClaim(userInfo onelogin.UserInfo) (identity.UserData, error)
}

type PayClient

type PayClient interface {
	CreatePayment(ctx context.Context, lpaUID string, body pay.CreatePaymentBody) (*pay.CreatePaymentResponse, error)
	GetPayment(ctx context.Context, id string) (pay.GetPaymentResponse, error)
	CanRedirect(url string) bool
}

type ProgressTracker

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

type RequestSigner

type RequestSigner interface {
	Sign(context.Context, *http.Request, string) error
}

type S3Client

type S3Client interface {
	PutObject(context.Context, string, []byte) error
	DeleteObject(context.Context, string) error
}

type ScheduledStore added in v0.1393.0

type ScheduledStore interface {
	Put(ctx context.Context, row scheduled.Event) error
}

type SessionStore

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

type ShareCodeSender

type ShareCodeSender interface {
	SendCertificateProviderInvite(context.Context, appcontext.Data, sharecode.CertificateProviderInvite) error
	SendCertificateProviderPrompt(context.Context, appcontext.Data, *donordata.Provided) error
	SendVoucherAccessCode(ctx context.Context, donor *donordata.Provided, appData appcontext.Data) error
}

type ShareCodeStore

type ShareCodeStore interface {
	Get(ctx context.Context, actorType actor.Type, code string) (sharecodedata.Link, error)
}

type Template

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

type UidClient

type UidClient interface {
	CreateCase(context.Context, *uid.CreateCaseRequestBody) (uid.CreateCaseResponse, error)
}

type WitnessCodeSender

type WitnessCodeSender interface {
	SendToCertificateProvider(context.Context, *donordata.Provided) error
	SendToIndependentWitness(context.Context, *donordata.Provided) error
}

Source Files

Jump to

Keyboard shortcuts

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