lpastore

package
v0.1318.0-renovateallm... Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("lpa not found in lpa-store")

Functions

This section is empty.

Types

type Attorney added in v0.1139.0

type Attorney struct {
	UID                       actoruid.UID
	FirstNames                string
	LastName                  string
	DateOfBirth               date.Date
	Email                     string
	Address                   place.Address
	Mobile                    string
	SignedAt                  time.Time
	ContactLanguagePreference localize.Lang
	Channel                   actor.Channel
}

func (Attorney) FullName added in v0.1139.0

func (a Attorney) FullName() string

type Attorneys added in v0.1139.0

type Attorneys struct {
	Attorneys        []Attorney
	TrustCorporation TrustCorporation
}

func (Attorneys) FullNames added in v0.1139.0

func (a Attorneys) FullNames() []string

func (Attorneys) Get added in v0.1139.0

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

func (Attorneys) Index added in v0.1139.0

func (a Attorneys) Index(uid actoruid.UID) int

func (Attorneys) Len added in v0.1139.0

func (a Attorneys) Len() int

type CertificateProvider added in v0.1139.0

type CertificateProvider struct {
	UID                       actoruid.UID  `json:"uid"`
	FirstNames                string        `json:"firstNames"`
	LastName                  string        `json:"lastName"`
	Email                     string        `json:"email,omitempty"`
	Phone                     string        `json:"phone,omitempty"`
	Address                   place.Address `json:"address"`
	Channel                   actor.Channel `json:"channel"`
	SignedAt                  time.Time     `json:"signedAt"`
	ContactLanguagePreference localize.Lang `json:"contactLanguagePreference"`
	IdentityCheck             IdentityCheck `json:"identityCheck"`
	// Relationship is not stored in the lpa-store so is defaulted to
	// Professional. We require it to determine whether to show the home address
	// page to a certificate provider.
	Relationship actor.CertificateProviderRelationship
}

func (CertificateProvider) FullName added in v0.1139.0

func (c CertificateProvider) FullName() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(baseURL string, secretsClient SecretsClient, lambdaClient Doer) *Client

func (*Client) CheckHealth

func (c *Client) CheckHealth(ctx context.Context) error

func (*Client) Lpa added in v0.1099.0

func (c *Client) Lpa(ctx context.Context, lpaUID string) (*Lpa, error)

func (*Client) Lpas added in v0.1150.0

func (c *Client) Lpas(ctx context.Context, lpaUIDs []string) ([]*Lpa, error)

func (*Client) SendAttorney added in v0.926.0

func (c *Client) SendAttorney(ctx context.Context, lpa *Lpa, attorney *actor.AttorneyProvidedDetails) error

func (*Client) SendCertificateProvider added in v0.922.0

func (c *Client) SendCertificateProvider(ctx context.Context, certificateProvider *actor.CertificateProviderProvidedDetails, lpa *Lpa) error

func (*Client) SendCertificateProviderConfirmIdentity added in v0.1247.0

func (c *Client) SendCertificateProviderConfirmIdentity(ctx context.Context, lpaUID string, certificateProvider *actor.CertificateProviderProvidedDetails) error

func (*Client) SendCertificateProviderOptOut added in v0.1181.0

func (c *Client) SendCertificateProviderOptOut(ctx context.Context, lpaUID string, actorUID actoruid.UID) error

func (*Client) SendDonorConfirmIdentity added in v0.1247.0

func (c *Client) SendDonorConfirmIdentity(ctx context.Context, donor *actor.DonorProvidedDetails) error

func (*Client) SendLpa

func (c *Client) SendLpa(ctx context.Context, donor *actor.DonorProvidedDetails) error

func (*Client) SendPerfect added in v0.1231.0

func (c *Client) SendPerfect(ctx context.Context, lpaUID string) error

func (*Client) SendRegister added in v0.1145.0

func (c *Client) SendRegister(ctx context.Context, lpaUID string) error

type Doer

type Doer interface {
	Do(*http.Request) (*http.Response, error)
}

type Donor added in v0.1247.0

type Donor struct {
	UID                       actoruid.UID
	FirstNames                string
	LastName                  string
	Email                     string
	OtherNames                string
	DateOfBirth               date.Date
	Address                   place.Address
	Channel                   actor.Channel
	ContactLanguagePreference localize.Lang
	IdentityCheck             IdentityCheck
}

func (Donor) FullName added in v0.1247.0

func (d Donor) FullName() string

type DonorStore added in v0.1116.0

type DonorStore interface {
	GetAny(ctx context.Context) (*actor.DonorProvidedDetails, error)
}

type IdentityCheck added in v0.1247.0

type IdentityCheck struct {
	CheckedAt time.Time `json:"checkedAt"`
	Type      string    `json:"type"`
}

type Lpa added in v0.1116.0

type Lpa struct {
	LpaKey                                     dynamo.LpaKeyType
	LpaOwnerKey                                dynamo.LpaOwnerKeyType
	LpaID                                      string
	LpaUID                                     string
	RegisteredAt                               time.Time
	WithdrawnAt                                time.Time
	PerfectAt                                  time.Time
	UpdatedAt                                  time.Time
	Type                                       actor.LpaType
	Donor                                      Donor
	Attorneys                                  Attorneys
	ReplacementAttorneys                       Attorneys
	CertificateProvider                        CertificateProvider
	PeopleToNotify                             actor.PeopleToNotify
	AttorneyDecisions                          actor.AttorneyDecisions
	ReplacementAttorneyDecisions               actor.AttorneyDecisions
	HowShouldReplacementAttorneysStepIn        actor.ReplacementAttorneysStepIn
	HowShouldReplacementAttorneysStepInDetails string
	Restrictions                               string
	WhenCanTheLpaBeUsed                        actor.CanBeUsedWhen
	LifeSustainingTreatmentOption              actor.LifeSustainingTreatment
	// SignedAt is the date the Donor signed their LPA (and signifies it has been
	// witnessed by their CertificateProvider)
	SignedAt                                 time.Time
	CertificateProviderNotRelatedConfirmedAt time.Time
	Submitted                                bool
	Paid                                     bool
	IsOrganisationDonor                      bool
	Drafted                                  bool
	CannotRegister                           bool
}

func FromDonorProvidedDetails added in v0.1139.0

func FromDonorProvidedDetails(l *actor.DonorProvidedDetails) *Lpa

func (Lpa) AllAttorneysSigned added in v0.1116.0

func (l Lpa) AllAttorneysSigned() bool

type LpaClient added in v0.1116.0

type LpaClient interface {
	Lpa(ctx context.Context, lpaUID string) (*Lpa, error)
	Lpas(ctx context.Context, lpaUIDs []string) ([]*Lpa, error)
}

type ResolvingService added in v0.1116.0

type ResolvingService struct {
	// contains filtered or unexported fields
}

A ResolvingService wraps a Client so that an Lpa can be retrieved without passing its UID.

func NewResolvingService added in v0.1116.0

func NewResolvingService(donorStore DonorStore, client LpaClient) *ResolvingService

func (*ResolvingService) Get added in v0.1116.0

func (s *ResolvingService) Get(ctx context.Context) (*Lpa, error)

func (*ResolvingService) ResolveList added in v0.1150.0

func (s *ResolvingService) ResolveList(ctx context.Context, donors []*actor.DonorProvidedDetails) ([]*Lpa, error)

type SecretsClient

type SecretsClient interface {
	Secret(ctx context.Context, name string) (string, error)
}

type TrustCorporation added in v0.1139.0

type TrustCorporation struct {
	UID                       actoruid.UID
	Name                      string
	CompanyNumber             string
	Email                     string
	Address                   place.Address
	Mobile                    string
	Signatories               []TrustCorporationSignatory
	ContactLanguagePreference localize.Lang
	Channel                   actor.Channel
}

type TrustCorporationSignatory added in v0.1139.0

type TrustCorporationSignatory struct {
	FirstNames        string    `json:"firstNames"`
	LastName          string    `json:"lastName"`
	ProfessionalTitle string    `json:"professionalTitle"`
	SignedAt          time.Time `json:"signedAt"`
}

Jump to

Keyboard shortcuts

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