donor

package
v0.916.0-MLPAB1638send... Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

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,
	notFoundHandler page.Handler,
	certificateProviderStore CertificateProviderStore,
	attorneyStore AttorneyStore,
	notifyClient NotifyClient,
	evidenceReceivedStore EvidenceReceivedStore,
	documentStore DocumentStore,
	eventClient EventClient,
	dashboardStore DashboardStore,
	lpaStoreClient LpaStoreClient,
)

Types

type AddressClient

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

type AttorneyStore added in v0.742.0

type AttorneyStore interface {
	GetAny(ctx context.Context) ([]*actor.AttorneyProvidedDetails, 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 EventClient added in v0.813.0

type EventClient interface {
	SendReducedFeeRequested(context.Context, event.ReducedFeeRequested) 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 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) 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) Handler

func ChooseAttorneys

func ChooseAttorneys(tmpl template.Template, donorStore DonorStore, uuidString func() string) 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, uuidString func() string) 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, uuidString func() string) 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) 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 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, store sesh.Store, randomString func(int) string) Handler

func IdentityWithOneLoginCallback

func IdentityWithOneLoginCallback(tmpl template.Template, oneLoginClient OneLoginClient, sessionStore sessions.Store, 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, certificateProviderStore CertificateProviderStore, attorneyStore AttorneyStore) 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 sessions.Store) 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(logger Logger, tmpl template.Template, donorStore DonorStore) Handler

func RemovePersonToNotify

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

func RemoveReplacementAttorney

func RemoveReplacementAttorney(logger Logger, 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 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 YourDetails

func YourDetails(tmpl template.Template, donorStore DonorStore, sessionStore sessions.Store) 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 YourPreferredLanguage added in v0.884.0

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

type Localizer

type Localizer interface {
	Format(string, map[string]any) string
	T(string) string
	Count(messageID string, count int) string
	FormatCount(messageID string, count int, data map[string]interface{}) string
	ShowTranslationKeys() bool
	SetShowTranslationKeys(s bool)
	Possessive(s string) string
	Concat([]string, string) string
	FormatDate(date.TimeOrDate) string
	FormatDateTime(time.Time) string
}

type Logger

type Logger interface {
	Print(v ...interface{})
}

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(context.Context, *actor.DonorProvidedDetails) error
}

type NotifyClient

type NotifyClient interface {
	SendSMS(context.Context, string, notify.SMS) (string, 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(body pay.CreatePaymentBody) (pay.CreatePaymentResponse, error)
	GetPayment(paymentId string) (pay.GetPaymentResponse, error)
}

type Payer

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 {
	Get(r *http.Request, name string) (*sessions.Session, error)
	New(r *http.Request, name string) (*sessions.Session, error)
	Save(r *http.Request, w http.ResponseWriter, s *sessions.Session) error
}

type ShareCodeSender

type ShareCodeSender interface {
	SendCertificateProviderInvite(context.Context, page.AppData, *actor.DonorProvidedDetails) error
	SendCertificateProviderPrompt(context.Context, page.AppData, *actor.DonorProvidedDetails) 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