donordata

package
v0.1336.0-moredonorstu... Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Code generated by "enumerator -type AttorneysAct -linecomment -empty"; DO NOT EDIT.

Code generated by "enumerator -type CanBeUsedWhen -linecomment -trimprefix"; DO NOT EDIT.

Code generated by "enumerator -type CertificateProviderRelationship -linecomment -empty"; DO NOT EDIT.

Code generated by "enumerator -type CertificateProviderRelationshipLength -linecomment"; DO NOT EDIT.

Code generated by "enumerator -type Channel -linecomment -empty -trimprefix"; DO NOT EDIT.

Code generated by "enumerator -type CorrespondentShare -linecomment -trimprefix -empty -bits"; DO NOT EDIT.

Code generated by "enumerator -type LifeSustainingTreatment -linecomment -trimprefix -empty"; DO NOT EDIT.

Code generated by "enumerator -type LpaType -linecomment -trimprefix -empty"; DO NOT EDIT.

Code generated by "enumerator -type ReplacementAttorneysStepIn -linecomment -trimprefix -empty"; DO NOT EDIT.

Code generated by "enumerator -type YesNoMaybe -linecomment -empty"; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var AttorneysActValues = AttorneysActOptions{
	Jointly:                          Jointly,
	JointlyAndSeverally:              JointlyAndSeverally,
	JointlyForSomeSeverallyForOthers: JointlyForSomeSeverallyForOthers,
}
View Source
var CanBeUsedWhenValues = CanBeUsedWhenOptions{
	Unknown:      CanBeUsedWhenUnknown,
	CapacityLost: CanBeUsedWhenCapacityLost,
	HasCapacity:  CanBeUsedWhenHasCapacity,
}
View Source
var CertificateProviderRelationshipLengthValues = CertificateProviderRelationshipLengthOptions{
	RelationshipLengthUnknown:  RelationshipLengthUnknown,
	LessThanTwoYears:           LessThanTwoYears,
	GreaterThanEqualToTwoYears: GreaterThanEqualToTwoYears,
}
View Source
var CertificateProviderRelationshipValues = CertificateProviderRelationshipOptions{
	Personally:     Personally,
	Professionally: Professionally,
}
View Source
var ChannelValues = ChannelOptions{
	Paper:  ChannelPaper,
	Online: ChannelOnline,
}
View Source
var CorrespondentShareValues = CorrespondentShareOptions{
	Attorneys:           CorrespondentShareAttorneys,
	CertificateProvider: CorrespondentShareCertificateProvider,
}
View Source
var LpaTypeValues = LpaTypeOptions{
	PersonalWelfare:    LpaTypePersonalWelfare,
	PropertyAndAffairs: LpaTypePropertyAndAffairs,
}
View Source
var YesNoMaybeValues = YesNoMaybeOptions{
	Yes:   Yes,
	No:    No,
	Maybe: Maybe,
}

Functions

func NewStore added in v0.1334.0

func NewStore(dynamoClient DynamoClient, eventClient EventClient, logger Logger, searchClient SearchClient) *donorStore

Types

type Attorney

type Attorney struct {
	// UID for the actor
	UID actoruid.UID
	// First names of the attorney
	FirstNames string
	// Last name of the attorney
	LastName string
	// Email of the attorney
	Email string
	// Date of birth of the attorney
	DateOfBirth date.Date
	// Address of the attorney
	Address place.Address
}

Attorney contains details about an attorney or replacement attorney, provided by the applicant

func (Attorney) Channel

func (a Attorney) Channel() Channel

func (Attorney) FullName

func (a Attorney) FullName() string

type AttorneyDecisions

type AttorneyDecisions struct {
	// How attorneys should make decisions
	How AttorneysAct
	// Details on how attorneys should make decisions if acting jointly for some decisions, and jointly and severally for other decisions
	Details string
}

AttorneyDecisions contains details about how an attorney or replacement attorney should act, provided by the applicant

func MakeAttorneyDecisions

func MakeAttorneyDecisions(existing AttorneyDecisions, how AttorneysAct, details string) AttorneyDecisions

func (AttorneyDecisions) IsComplete

func (d AttorneyDecisions) IsComplete() bool

type Attorneys

type Attorneys struct {
	TrustCorporation TrustCorporation
	Attorneys        []Attorney
}

func (Attorneys) Addresses

func (as Attorneys) Addresses() []place.Address

func (Attorneys) Complete

func (as Attorneys) Complete() bool

func (*Attorneys) Delete

func (as *Attorneys) Delete(attorney Attorney) bool

func (Attorneys) FirstNames

func (as Attorneys) FirstNames() []string

func (Attorneys) FullNames

func (as Attorneys) FullNames() []string

func (Attorneys) Get

func (as Attorneys) Get(uid actoruid.UID) (Attorney, bool)

func (*Attorneys) Index

func (as *Attorneys) Index(uid actoruid.UID) int

func (Attorneys) Len

func (as Attorneys) Len() int

func (*Attorneys) Put

func (as *Attorneys) Put(attorney Attorney)

type AttorneysAct

type AttorneysAct uint8
const (
	// Jointly indicates attorneys or replacement attorneys should act jointly
	Jointly AttorneysAct = iota + 1 // jointly

	// JointlyAndSeverally indicates attorneys or replacement attorneys should act
	// jointly and severally
	JointlyAndSeverally // jointly-and-severally

	// JointlyForSomeSeverallyForOthers indicates attorneys or replacement
	// attorneys should act jointly for some decisions, and jointly and severally
	// for other decisions
	JointlyForSomeSeverallyForOthers // jointly-for-some-severally-for-others
)

func ParseAttorneysAct

func ParseAttorneysAct(s string) (AttorneysAct, error)

func (AttorneysAct) Empty

func (i AttorneysAct) Empty() bool

func (AttorneysAct) IsJointly

func (i AttorneysAct) IsJointly() bool

func (AttorneysAct) IsJointlyAndSeverally

func (i AttorneysAct) IsJointlyAndSeverally() bool

func (AttorneysAct) IsJointlyForSomeSeverallyForOthers

func (i AttorneysAct) IsJointlyForSomeSeverallyForOthers() bool

func (AttorneysAct) MarshalText

func (i AttorneysAct) MarshalText() ([]byte, error)

func (AttorneysAct) String

func (i AttorneysAct) String() string

func (*AttorneysAct) UnmarshalText

func (i *AttorneysAct) UnmarshalText(text []byte) error

type AttorneysActOptions

type AttorneysActOptions struct {
	Jointly                          AttorneysAct
	JointlyAndSeverally              AttorneysAct
	JointlyForSomeSeverallyForOthers AttorneysAct
}

type AuthorisedSignatory

type AuthorisedSignatory struct {
	FirstNames string
	LastName   string
}

AuthorisedSignatory contains details of the person who will sign the LPA on the donor's behalf

func (AuthorisedSignatory) FullName

func (s AuthorisedSignatory) FullName() string

type CanBeUsedWhen

type CanBeUsedWhen uint8
const (
	CanBeUsedWhenUnknown      CanBeUsedWhen = iota
	CanBeUsedWhenCapacityLost               // when-capacity-lost
	CanBeUsedWhenHasCapacity                // when-has-capacity
)

func ParseCanBeUsedWhen

func ParseCanBeUsedWhen(s string) (CanBeUsedWhen, error)

func (CanBeUsedWhen) IsCapacityLost

func (i CanBeUsedWhen) IsCapacityLost() bool

func (CanBeUsedWhen) IsHasCapacity

func (i CanBeUsedWhen) IsHasCapacity() bool

func (CanBeUsedWhen) IsUnknown

func (i CanBeUsedWhen) IsUnknown() bool

func (CanBeUsedWhen) MarshalText

func (i CanBeUsedWhen) MarshalText() ([]byte, error)

func (CanBeUsedWhen) String

func (i CanBeUsedWhen) String() string

func (*CanBeUsedWhen) UnmarshalText

func (i *CanBeUsedWhen) UnmarshalText(text []byte) error

type CanBeUsedWhenOptions

type CanBeUsedWhenOptions struct {
	Unknown      CanBeUsedWhen
	CapacityLost CanBeUsedWhen
	HasCapacity  CanBeUsedWhen
}

type CertificateProvider

type CertificateProvider struct {
	// UID for the actor
	UID actoruid.UID
	// First names of the certificate provider
	FirstNames string
	// Last name of the certificate provider
	LastName string
	// Address of the certificate provider
	Address place.Address
	// Mobile number of the certificate provider, used to send witness codes
	Mobile string
	// HasNonUKMobile indicates whether the value of Mobile is a non-UK mobile number
	HasNonUKMobile bool
	// Email of the certificate provider
	Email string
	// How the certificate provider wants to perform their role (paper or online)
	CarryOutBy Channel
	// The certificate provider's relationship to the applicant
	Relationship CertificateProviderRelationship
	// Amount of time Relationship has been in place if Personally
	RelationshipLength CertificateProviderRelationshipLength
}

CertificateProvider contains details about the certificate provider, provided by the applicant

func (CertificateProvider) FullName

func (c CertificateProvider) FullName() string

type CertificateProviderRelationship

type CertificateProviderRelationship uint8
const (
	Personally     CertificateProviderRelationship = iota + 1 // personally
	Professionally                                            // professionally
)

func ParseCertificateProviderRelationship

func ParseCertificateProviderRelationship(s string) (CertificateProviderRelationship, error)

func (CertificateProviderRelationship) Empty

func (CertificateProviderRelationship) IsPersonally

func (i CertificateProviderRelationship) IsPersonally() bool

func (CertificateProviderRelationship) IsProfessionally

func (i CertificateProviderRelationship) IsProfessionally() bool

func (CertificateProviderRelationship) MarshalText

func (i CertificateProviderRelationship) MarshalText() ([]byte, error)

func (CertificateProviderRelationship) String

func (*CertificateProviderRelationship) UnmarshalText

func (i *CertificateProviderRelationship) UnmarshalText(text []byte) error

type CertificateProviderRelationshipLength

type CertificateProviderRelationshipLength uint8
const (
	RelationshipLengthUnknown  CertificateProviderRelationshipLength = iota // unknown
	LessThanTwoYears                                                        // lt-2-years
	GreaterThanEqualToTwoYears                                              // gte-2-years
)

func ParseCertificateProviderRelationshipLength

func ParseCertificateProviderRelationshipLength(s string) (CertificateProviderRelationshipLength, error)

func (CertificateProviderRelationshipLength) IsGreaterThanEqualToTwoYears

func (i CertificateProviderRelationshipLength) IsGreaterThanEqualToTwoYears() bool

func (CertificateProviderRelationshipLength) IsLessThanTwoYears

func (i CertificateProviderRelationshipLength) IsLessThanTwoYears() bool

func (CertificateProviderRelationshipLength) IsRelationshipLengthUnknown

func (i CertificateProviderRelationshipLength) IsRelationshipLengthUnknown() bool

func (CertificateProviderRelationshipLength) MarshalText

func (i CertificateProviderRelationshipLength) MarshalText() ([]byte, error)

func (CertificateProviderRelationshipLength) String

func (*CertificateProviderRelationshipLength) UnmarshalText

func (i *CertificateProviderRelationshipLength) UnmarshalText(text []byte) error

type CertificateProviderRelationshipLengthOptions

type CertificateProviderRelationshipLengthOptions struct {
	RelationshipLengthUnknown  CertificateProviderRelationshipLength
	LessThanTwoYears           CertificateProviderRelationshipLength
	GreaterThanEqualToTwoYears CertificateProviderRelationshipLength
}

type CertificateProviderRelationshipOptions

type CertificateProviderRelationshipOptions struct {
	Personally     CertificateProviderRelationship
	Professionally CertificateProviderRelationship
}

type Channel

type Channel uint8
const (
	ChannelPaper  Channel = iota + 1 // paper
	ChannelOnline                    // online
)

func ParseChannel

func ParseChannel(s string) (Channel, error)

func (Channel) Empty

func (i Channel) Empty() bool

func (Channel) IsOnline

func (i Channel) IsOnline() bool

func (Channel) IsPaper

func (i Channel) IsPaper() bool

func (Channel) MarshalText

func (i Channel) MarshalText() ([]byte, error)

func (Channel) String

func (i Channel) String() string

func (*Channel) UnmarshalText

func (i *Channel) UnmarshalText(text []byte) error

type ChannelOptions

type ChannelOptions struct {
	Paper  Channel
	Online Channel
}

type Correspondent

type Correspondent struct {
	FirstNames   string
	LastName     string
	Email        string
	Organisation string
	Telephone    string
	WantAddress  form.YesNo
	Address      place.Address
	Share        CorrespondentShare
}

func (Correspondent) FullName

func (c Correspondent) FullName() string

type CorrespondentShare

type CorrespondentShare uint8
const (
	CorrespondentShareAttorneys CorrespondentShare = 2 << iota
	CorrespondentShareCertificateProvider
)

func ParseCorrespondentShare

func ParseCorrespondentShare(strs []string) (CorrespondentShare, error)

func (CorrespondentShare) Empty

func (i CorrespondentShare) Empty() bool

func (CorrespondentShare) HasAttorneys

func (i CorrespondentShare) HasAttorneys() bool

func (CorrespondentShare) HasCertificateProvider

func (i CorrespondentShare) HasCertificateProvider() bool

func (CorrespondentShare) String

func (i CorrespondentShare) String() string

func (CorrespondentShare) Strings

func (i CorrespondentShare) Strings() []string

type CorrespondentShareOptions

type CorrespondentShareOptions struct {
	Attorneys           CorrespondentShare
	CertificateProvider CorrespondentShare
}

type Donor

type Donor struct {
	// UID for the actor
	UID actoruid.UID
	// First names of the donor
	FirstNames string
	// Last name of the donor
	LastName string
	// Email of the donor
	Email string
	// Other names the donor is known by
	OtherNames string
	// Date of birth of the donor
	DateOfBirth date.Date
	// Address of the donor
	Address place.Address
	// ThinksCanSign is what the donor thinks about their ability to sign online
	ThinksCanSign YesNoMaybe
	// CanSign is Yes if the donor has said they will sign online
	CanSign form.YesNo
	// Channel is how the Donor is applying for their LPA (paper or online)
	Channel Channel
	// ContactLanguagePreference is the language the donor prefers to receive notifications in
	ContactLanguagePreference localize.Lang
	// LpaLanguagePreference is the language the donor prefers to receive the registered LPA in
	LpaLanguagePreference localize.Lang
}

Donor contains details about the donor, provided by the applicant

func (Donor) FullName

func (d Donor) FullName() string

type DonorProvidedDetails

type DonorProvidedDetails struct {
	PK dynamo.LpaKeyType      `hash:"-"`
	SK dynamo.LpaOwnerKeyType `hash:"-"`
	// Hash is used to determine whether the Lpa has been changed since last read
	Hash uint64 `hash:"-"`
	// HashVersion is used to determine the fields used to calculate Hash
	HashVersion uint8 `hash:"-"`
	// LpaID identifies the LPA being drafted
	LpaID string
	// LpaUID is a unique identifier created after sending basic LPA details to the UID service
	LpaUID string `dynamodbav:",omitempty"`
	// CreatedAt is when the LPA was created
	CreatedAt time.Time
	// UpdatedAt is when the LPA was last updated
	UpdatedAt time.Time `hash:"-"`
	// The donor the LPA relates to
	Donor Donor
	// Attorneys named in the LPA
	Attorneys Attorneys
	// Information on how the applicant wishes their attorneys to act
	AttorneyDecisions AttorneyDecisions
	// The certificate provider named in the LPA
	CertificateProvider CertificateProvider
	// Type of LPA being drafted
	Type LpaType
	// Whether the applicant wants to add replacement attorneys
	WantReplacementAttorneys form.YesNo
	// When the LPA can be used
	WhenCanTheLpaBeUsed CanBeUsedWhen
	// Preferences on life sustaining treatment (applicable to personal welfare LPAs only)
	LifeSustainingTreatmentOption LifeSustainingTreatment
	// Restrictions on attorneys actions
	Restrictions string
	// Used to show the task list
	Tasks DonorTasks
	// PaymentDetails are records of payments made for the LPA via GOV.UK Pay
	PaymentDetails []Payment
	// Information returned by the identity service related to the applicant
	DonorIdentityUserData identity.UserData
	// Replacement attorneys named in the LPA
	ReplacementAttorneys Attorneys
	// Information on how the applicant wishes their replacement attorneys to act
	ReplacementAttorneyDecisions AttorneyDecisions
	// How to bring in replacement attorneys, if set
	HowShouldReplacementAttorneysStepIn ReplacementAttorneysStepIn
	// Details on how replacement attorneys must step in if HowShouldReplacementAttorneysStepIn is set to "other"
	HowShouldReplacementAttorneysStepInDetails string
	// Whether the applicant wants to add a correspondent
	AddCorrespondent form.YesNo
	// Correspondent is sent updates on an application in place of a (supporter) donor
	Correspondent Correspondent
	// Whether the applicant wants to notify people about the application
	DoYouWantToNotifyPeople form.YesNo
	// People to notify about the application
	PeopleToNotify PeopleToNotify
	// The AuthorisedSignatory signs on the donor's behalf if they are unable to sign
	AuthorisedSignatory AuthorisedSignatory
	// The IndependentWitness acts as an additional witness when the LPA is signed
	IndependentWitness IndependentWitness
	// Confirmation that the applicant wants to apply to register the LPA
	WantToApplyForLpa bool
	// Confirmation that the applicant wants to sign the LPA
	WantToSignLpa bool
	// CertificateProviderNotRelatedConfirmedAt is when the donor confirmed the
	// certificate provider is not related to another similar actor
	CertificateProviderNotRelatedConfirmedAt time.Time
	// CheckedAt is when the donor checked their LPA
	CheckedAt time.Time
	// CheckedHash is the Hash value of the LPA when last checked
	CheckedHash uint64 `hash:"-"`
	// CheckedHashVersion is used to determine the fields used to calculate CheckedHash
	CheckedHashVersion uint8 `hash:"-"`
	// SignedAt is when the donor submitted their signature
	SignedAt time.Time
	// SubmittedAt is when the Lpa was sent to the OPG
	SubmittedAt time.Time
	// WithdrawnAt is when the Lpa was withdrawn by the donor
	WithdrawnAt time.Time
	// PerfectAt is when the Lpa transitioned to the PERFECT status in the lpa-store
	PerfectAt time.Time
	// RegisteringWithCourtOfProtection is set when the donor wishes to take the
	// Lpa to the Court of Protection for registration.
	RegisteringWithCourtOfProtection bool
	// Version is the number of times the LPA has been updated (auto-incremented
	// on PUT)
	Version int `hash:"-"`

	// WantVoucher indicates if the donor knows someone who can vouch for them and wants
	// then to do so
	WantVoucher form.YesNo
	// Voucher is a person the donor has nominated to vouch for their identity
	Voucher Voucher

	// Codes used for the certificate provider to witness signing
	CertificateProviderCodes WitnessCodes
	// When the signing was witnessed by the certificate provider
	WitnessedByCertificateProviderAt time.Time
	// Codes used for the independent witness to witness signing
	IndependentWitnessCodes WitnessCodes
	// When the signing was witnessed by the independent witness
	WitnessedByIndependentWitnessAt time.Time
	// Used to rate limit witness code attempts
	WitnessCodeLimiter *Limiter

	// FeeType is the type of fee the user is applying for
	FeeType pay.FeeType
	// EvidenceDelivery is the method by which the user wants to send evidence
	EvidenceDelivery pay.EvidenceDelivery
	// PreviousApplicationNumber if the application is related to an existing application
	PreviousApplicationNumber string
	// PreviousFee is the fee previously paid for an LPA
	PreviousFee pay.PreviousFee

	HasSentApplicationUpdatedEvent bool `hash:"-"`
}

DonorProvidedDetails contains all the data related to the LPA application

func (*DonorProvidedDetails) ActorAddresses

func (l *DonorProvidedDetails) ActorAddresses() []place.Address

func (*DonorProvidedDetails) AllLayAttorneysFirstNames

func (l *DonorProvidedDetails) AllLayAttorneysFirstNames() []string

func (*DonorProvidedDetails) AllLayAttorneysFullNames

func (l *DonorProvidedDetails) AllLayAttorneysFullNames() []string

func (*DonorProvidedDetails) AttorneysAndCpSigningDeadline

func (l *DonorProvidedDetails) AttorneysAndCpSigningDeadline() time.Time

func (*DonorProvidedDetails) CertificateProviderSharesDetails

func (l *DonorProvidedDetails) CertificateProviderSharesDetails() bool

CertificateProviderSharesDetails will return true if the last name or address of the certificate provider matches that of the donor or one of the attorneys. For a match of the last name we break on '-' to account for double-barrelled names.

func (*DonorProvidedDetails) CheckedHashChanged

func (l *DonorProvidedDetails) CheckedHashChanged() bool

func (*DonorProvidedDetails) Cost

func (l *DonorProvidedDetails) Cost() int

func (*DonorProvidedDetails) DonorIdentityConfirmed

func (l *DonorProvidedDetails) DonorIdentityConfirmed() bool

func (*DonorProvidedDetails) FeeAmount

func (l *DonorProvidedDetails) FeeAmount() pay.AmountPence

func (*DonorProvidedDetails) HashChanged

func (l *DonorProvidedDetails) HashChanged() bool

func (*DonorProvidedDetails) HashInclude

func (d *DonorProvidedDetails) HashInclude(field string, _ any) (bool, error)

func (*DonorProvidedDetails) NamesChanged

func (l *DonorProvidedDetails) NamesChanged(firstNames, lastName, otherNames string) bool

func (*DonorProvidedDetails) TrustCorporationsNames

func (l *DonorProvidedDetails) TrustCorporationsNames() []string

func (*DonorProvidedDetails) Under18ActorDetails

func (l *DonorProvidedDetails) Under18ActorDetails() []Under18ActorDetails

func (*DonorProvidedDetails) UpdateCheckedHash

func (l *DonorProvidedDetails) UpdateCheckedHash() (err error)

func (*DonorProvidedDetails) UpdateHash

func (l *DonorProvidedDetails) UpdateHash() (err error)

type DonorTasks

type DonorTasks struct {
	YourDetails                task.State
	ChooseAttorneys            task.State
	ChooseReplacementAttorneys task.State
	WhenCanTheLpaBeUsed        task.State // property and affairs only
	LifeSustainingTreatment    task.State // personal welfare only
	Restrictions               task.State
	CertificateProvider        task.State
	PeopleToNotify             task.State
	AddCorrespondent           task.State
	ChooseYourSignatory        task.State // if .Donor.CanSign.IsNo only
	CheckYourLpa               task.State
	PayForLpa                  task.PaymentState
	ConfirmYourIdentityAndSign task.IdentityState
}

type DynamoClient added in v0.1334.0

type DynamoClient interface {
	One(ctx context.Context, pk dynamo.PK, sk dynamo.SK, v interface{}) error
	OneByPK(ctx context.Context, pk dynamo.PK, v interface{}) error
	OneByPartialSK(ctx context.Context, pk dynamo.PK, partialSK dynamo.SK, v interface{}) error
	AllByPartialSK(ctx context.Context, pk dynamo.PK, partialSK dynamo.SK, v interface{}) error
	LatestForActor(ctx context.Context, sk dynamo.SK, v interface{}) error
	AllBySK(ctx context.Context, sk dynamo.SK, v interface{}) error
	AllByKeys(ctx context.Context, keys []dynamo.Keys) ([]map[string]dynamodbtypes.AttributeValue, error)
	AllKeysByPK(ctx context.Context, pk dynamo.PK) ([]dynamo.Keys, error)
	Put(ctx context.Context, v interface{}) error
	Create(ctx context.Context, v interface{}) error
	DeleteKeys(ctx context.Context, keys []dynamo.Keys) error
	DeleteOne(ctx context.Context, pk dynamo.PK, sk dynamo.SK) error
	Update(ctx context.Context, pk dynamo.PK, sk dynamo.SK, values map[string]dynamodbtypes.AttributeValue, expression string) error
	BatchPut(ctx context.Context, items []interface{}) error
	OneBySK(ctx context.Context, sk dynamo.SK, v interface{}) error
	OneByUID(ctx context.Context, uid string, v interface{}) error
	WriteTransaction(ctx context.Context, transaction *dynamo.Transaction) error
}

type EventClient added in v0.1334.0

type EventClient interface {
	SendUidRequested(context.Context, event.UidRequested) error
	SendApplicationUpdated(context.Context, event.ApplicationUpdated) error
	SendPreviousApplicationLinked(context.Context, event.PreviousApplicationLinked) error
	SendReducedFeeRequested(context.Context, event.ReducedFeeRequested) error
}

type IndependentWitness

type IndependentWitness struct {
	FirstNames     string
	LastName       string
	HasNonUKMobile bool
	Mobile         string
	Address        place.Address
}

IndependentWitness contains details of the person who will also witness the signing of the LPA

func (IndependentWitness) FullName

func (w IndependentWitness) FullName() string

type LifeSustainingTreatment

type LifeSustainingTreatment uint8
const (
	LifeSustainingTreatmentOptionA LifeSustainingTreatment = iota + 1 // option-a
	LifeSustainingTreatmentOptionB                                    // option-b
)

func ParseLifeSustainingTreatment

func ParseLifeSustainingTreatment(s string) (LifeSustainingTreatment, error)

func (LifeSustainingTreatment) Empty

func (i LifeSustainingTreatment) Empty() bool

func (LifeSustainingTreatment) IsOptionA

func (i LifeSustainingTreatment) IsOptionA() bool

func (LifeSustainingTreatment) IsOptionB

func (i LifeSustainingTreatment) IsOptionB() bool

func (LifeSustainingTreatment) MarshalText

func (i LifeSustainingTreatment) MarshalText() ([]byte, error)

func (LifeSustainingTreatment) String

func (i LifeSustainingTreatment) String() string

func (*LifeSustainingTreatment) UnmarshalText

func (i *LifeSustainingTreatment) UnmarshalText(text []byte) error

type LifeSustainingTreatmentOptions

type LifeSustainingTreatmentOptions struct {
	OptionA LifeSustainingTreatment
	OptionB LifeSustainingTreatment
}

type Limiter

type Limiter struct {
	TokenPer  time.Duration
	MaxTokens float64

	Tokens   float64
	TokensAt time.Time
	// contains filtered or unexported fields
}

Limiter is a basic rate limiter that can be serialised.

func NewLimiter

func NewLimiter(tokenPer time.Duration, initialTokens, maxTokens float64) *Limiter

func (*Limiter) Allow

func (l *Limiter) Allow(now time.Time) bool

type Logger added in v0.1334.0

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 LpaType

type LpaType uint8
const (
	LpaTypePersonalWelfare    LpaType = iota + 1 // personal-welfare
	LpaTypePropertyAndAffairs                    // property-and-affairs
)

func ParseLpaType

func ParseLpaType(s string) (LpaType, error)

func (LpaType) Empty

func (i LpaType) Empty() bool

func (LpaType) IsPersonalWelfare

func (i LpaType) IsPersonalWelfare() bool

func (LpaType) IsPropertyAndAffairs

func (i LpaType) IsPropertyAndAffairs() bool

func (LpaType) MarshalText

func (i LpaType) MarshalText() ([]byte, error)

func (LpaType) String

func (i LpaType) String() string

func (*LpaType) UnmarshalText

func (i *LpaType) UnmarshalText(text []byte) error

func (LpaType) WhatLPACoversTransKey

func (e LpaType) WhatLPACoversTransKey() string

type LpaTypeOptions

type LpaTypeOptions struct {
	PersonalWelfare    LpaType
	PropertyAndAffairs LpaType
}

type Payment

type Payment struct {
	// Reference generated for the payment
	PaymentReference string
	// ID returned from GOV.UK Pay
	PaymentId string
	// Amount is the amount paid in pence
	Amount int
}

type PeopleToNotify

type PeopleToNotify []PersonToNotify

func (*PeopleToNotify) Delete

func (ps *PeopleToNotify) Delete(personToNotify PersonToNotify) bool

func (PeopleToNotify) Get

func (PeopleToNotify) Put

func (ps PeopleToNotify) Put(person PersonToNotify) bool

type PersonToNotify

type PersonToNotify struct {
	UID actoruid.UID
	// First names of the person to notify
	FirstNames string
	// Last name of the person to notify
	LastName string
	// Address of the person to notify
	Address place.Address
}

PersonToNotify contains details about a person to notify, provided by the applicant

func (PersonToNotify) FullName

func (p PersonToNotify) FullName() string

type ReplacementAttorneysStepIn

type ReplacementAttorneysStepIn uint8
const (
	ReplacementAttorneysStepInWhenAllCanNoLongerAct ReplacementAttorneysStepIn = iota + 1 // all-can-no-longer-act
	ReplacementAttorneysStepInWhenOneCanNoLongerAct                                       // one-can-no-longer-act
	ReplacementAttorneysStepInAnotherWay                                                  // another-way
)

func ParseReplacementAttorneysStepIn

func ParseReplacementAttorneysStepIn(s string) (ReplacementAttorneysStepIn, error)

func (ReplacementAttorneysStepIn) Empty

func (i ReplacementAttorneysStepIn) Empty() bool

func (ReplacementAttorneysStepIn) IsAnotherWay

func (i ReplacementAttorneysStepIn) IsAnotherWay() bool

func (ReplacementAttorneysStepIn) IsWhenAllCanNoLongerAct

func (i ReplacementAttorneysStepIn) IsWhenAllCanNoLongerAct() bool

func (ReplacementAttorneysStepIn) IsWhenOneCanNoLongerAct

func (i ReplacementAttorneysStepIn) IsWhenOneCanNoLongerAct() bool

func (ReplacementAttorneysStepIn) MarshalText

func (i ReplacementAttorneysStepIn) MarshalText() ([]byte, error)

func (ReplacementAttorneysStepIn) String

func (*ReplacementAttorneysStepIn) UnmarshalText

func (i *ReplacementAttorneysStepIn) UnmarshalText(text []byte) error

type ReplacementAttorneysStepInOptions

type ReplacementAttorneysStepInOptions struct {
	WhenAllCanNoLongerAct ReplacementAttorneysStepIn
	WhenOneCanNoLongerAct ReplacementAttorneysStepIn
	AnotherWay            ReplacementAttorneysStepIn
}

type SearchClient added in v0.1334.0

type SearchClient interface {
	Index(ctx context.Context, lpa search.Lpa) error
}

type TrustCorporation

type TrustCorporation struct {
	// UID for the actor
	UID actoruid.UID
	// Name of the company
	Name string
	// CompanyNumber as registered by Companies House
	CompanyNumber string
	// Email to contact the company
	Email string
	// Address of the company
	Address place.Address
}

TrustCorporation contains details about a trust corporation, provided by the applicant

func (TrustCorporation) Channel

func (tc TrustCorporation) Channel() Channel

type UidClient added in v0.1334.0

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

type Under18ActorDetails

type Under18ActorDetails struct {
	FullName    string
	DateOfBirth date.Date
	UID         actoruid.UID
	Type        temporary.ActorType
}

type Voucher

type Voucher struct {
	FirstNames string
	LastName   string
	Email      string
	Allowed    bool
}

func (Voucher) FullName

func (v Voucher) FullName() string

func (Voucher) Matches

func (v Voucher) Matches(donor *DonorProvidedDetails) (match []temporary.ActorType)

type WitnessCode

type WitnessCode struct {
	Code    string
	Created time.Time
}

func (WitnessCode) HasExpired

func (w WitnessCode) HasExpired() bool

type WitnessCodes

type WitnessCodes []WitnessCode

func (WitnessCodes) CanRequest

func (ws WitnessCodes) CanRequest(now time.Time) bool

func (WitnessCodes) Find

func (ws WitnessCodes) Find(code string) (WitnessCode, bool)

type YesNoMaybe

type YesNoMaybe uint8
const (
	Yes YesNoMaybe = iota + 1
	No
	Maybe
)

func ParseYesNoMaybe

func ParseYesNoMaybe(s string) (YesNoMaybe, error)

func (YesNoMaybe) Empty

func (i YesNoMaybe) Empty() bool

func (YesNoMaybe) IsMaybe

func (i YesNoMaybe) IsMaybe() bool

func (YesNoMaybe) IsNo

func (i YesNoMaybe) IsNo() bool

func (YesNoMaybe) IsYes

func (i YesNoMaybe) IsYes() bool

func (YesNoMaybe) MarshalText

func (i YesNoMaybe) MarshalText() ([]byte, error)

func (YesNoMaybe) String

func (i YesNoMaybe) String() string

func (*YesNoMaybe) UnmarshalText

func (i *YesNoMaybe) UnmarshalText(text []byte) error

type YesNoMaybeOptions

type YesNoMaybeOptions struct {
	Yes   YesNoMaybe
	No    YesNoMaybe
	Maybe YesNoMaybe
}

Jump to

Keyboard shortcuts

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