donor

package
v0.1207.0-MLPAB2144fee... Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func EnterAccessCode added in v0.1089.0

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

func Register

func Register(
	rootMux *http.ServeMux,
	logger Logger,
	commonTmpls, 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,
)

Types

type AddressClient

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

type CertificateProviderStore

type CertificateProviderStore interface {
	GetAny(ctx context.Context) (*actor.CertificateProviderProvidedDetails, error)
}

type DashboardStore added in v0.899.0

type DashboardStore interface {
	GetAll(ctx context.Context) (donor, attorney, certificateProvider []page.LpaAndActorTasks, err error)
	SubExistsForActorType(ctx context.Context, sub string, actorType actor.Type) (bool, error)
}

type DonorStore

type DonorStore interface {
	Get(ctx context.Context) (*actor.DonorProvidedDetails, error)
	Latest(ctx context.Context) (*actor.DonorProvidedDetails, error)
	Put(ctx context.Context, donor *actor.DonorProvidedDetails) error
	Delete(ctx context.Context) error
	Link(ctx context.Context, data actor.ShareCodeData) error
}

type ErrorHandler added in v0.930.0

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

type EventClient added in v0.813.0

type EventClient interface {
	SendReducedFeeRequested(ctx context.Context, e event.ReducedFeeRequested) error
	SendPaymentCreated(ctx context.Context, e event.PaymentCreated) error
}

type EvidenceReceivedStore

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

type File added in v0.692.0

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

type GetDonorStore

type GetDonorStore interface {
	Get(context.Context) (*actor.DonorProvidedDetails, error)
}

type Handler

type Handler func(data page.AppData, w http.ResponseWriter, r *http.Request, donor *actor.DonorProvidedDetails) error

func AddCorrespondent added in v0.1105.0

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

func AreYouApplyingForFeeDiscountOrExemption added in v0.747.0

func AreYouApplyingForFeeDiscountOrExemption(tmpl template.Template, payer Payer, 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 added in v0.755.0

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

func CheckYouCanSign added in v0.681.0

func CheckYouCanSign(tmpl template.Template, donorStore DonorStore) 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, newUID func() actoruid.UID) Handler

func ChooseAttorneysAddress

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

func ChooseAttorneysSummary

func ChooseAttorneysSummary(tmpl template.Template) Handler

func ChooseNewCertificateProvider added in v0.732.0

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, newUID func() actoruid.UID) Handler

func ChooseReplacementAttorneysAddress

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

func ChooseReplacementAttorneysSummary

func ChooseReplacementAttorneysSummary(tmpl template.Template) Handler

func ConfirmYourCertificateProviderIsNotRelated added in v0.773.0

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

func DeleteLpa added in v0.785.0

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

func DoYouWantToNotifyPeople

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

func EnterCorrespondentAddress added in v0.1105.0

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

func EnterCorrespondentDetails added in v0.1105.0

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

func EnterReplacementTrustCorporation added in v0.651.0

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

func EnterReplacementTrustCorporationAddress added in v0.651.0

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 FeeDenied added in v0.685.0

func FeeDenied(tmpl template.Template, payer Payer) 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 HowWouldCertificateProviderPreferToCarryOutTheirRole

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

func HowWouldYouLikeToSendEvidence added in v0.747.0

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(tmpl template.Template, oneLoginClient OneLoginClient, sessionStore SessionStore, donorStore DonorStore) 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) Handler

func PaymentConfirmation

func PaymentConfirmation(logger Logger, tmpl template.Template, payClient PayClient, donorStore DonorStore, sessionStore SessionStore) Handler

func PreviousApplicationNumber

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

func PreviousFee added in v0.791.0

func PreviousFee(tmpl template.Template, payer Payer, 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 added in v0.820.0

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 added in v0.795.0

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

func SignYourLpa

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

func TaskList

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

func UploadEvidence

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

func UploadEvidenceSSE added in v0.794.0

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

func WantReplacementAttorneys

func WantReplacementAttorneys(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 WhoCanCorrespondentsDetailsBeSharedWith added in v0.1105.0

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

func WithdrawLpa added in v0.785.0

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

func WitnessingAsCertificateProvider

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

func WitnessingAsIndependentWitness added in v0.691.0

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 added in v0.910.0

func YouCannotSignYourLpaYet(tmpl template.Template) Handler

func YourAddress

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

func YourAuthorisedSignatory added in v0.686.0

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

func YourDateOfBirth added in v0.938.0

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

func YourDetails

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

func YourIndependentWitness added in v0.686.0

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

func YourIndependentWitnessAddress added in v0.686.0

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

func YourIndependentWitnessMobile added in v0.686.0

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

func YourName added in v0.938.0

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

func YourPreferredLanguage added in v0.884.0

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          page.AppData
	Donor        *actor.DonorProvidedDetails
	IsFirstCheck bool
	Errors       validation.List
}

type LpaStoreClient added in v0.901.0

type LpaStoreClient interface {
	SendLpa(ctx context.Context, details *actor.DonorProvidedDetails) error
	Lpa(ctx context.Context, lpaUID string) (*lpastore.Lpa, error)
}

type LpaStoreResolvingService added in v0.1116.0

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

type NotifyClient

type NotifyClient interface {
	SendActorSMS(ctx context.Context, to, lpaUID string, sms notify.SMS) 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(ctx context.Context, 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)
}

type Payer

type ProgressTracker added in v0.1090.0

type ProgressTracker interface {
	Progress(lpa *lpastore.Lpa) page.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 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, page.AppData, page.CertificateProviderInvite) error
	SendCertificateProviderPrompt(context.Context, page.AppData, *actor.DonorProvidedDetails) error
}

type ShareCodeStore added in v0.1089.0

type ShareCodeStore interface {
	Get(ctx context.Context, actorType actor.Type, code string) (actor.ShareCodeData, error)
	Linked(ctx context.Context, data actor.ShareCodeData, email string) 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, *actor.DonorProvidedDetails, page.Localizer) error
	SendToIndependentWitness(context.Context, *actor.DonorProvidedDetails, page.Localizer) error
}

Source Files

Jump to

Keyboard shortcuts

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