lpastore

package
v0.1117.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 16 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 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) SendAttorney added in v0.926.0

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

func (*Client) SendCertificateProvider added in v0.922.0

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

func (*Client) SendLpa

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

type Doer

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

type DonorStore added in v0.1116.0

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

type Lpa added in v0.1116.0

type Lpa struct {
	LpaID                                      string
	LpaUID                                     string
	RegisteredAt                               date.Date
	UpdatedAt                                  date.Date
	Type                                       actor.LpaType
	Donor                                      actor.Donor
	Attorneys                                  actor.Attorneys
	ReplacementAttorneys                       actor.Attorneys
	CertificateProvider                        actor.CertificateProvider
	PeopleToNotify                             actor.PeopleToNotify
	AttorneyDecisions                          actor.AttorneyDecisions
	ReplacementAttorneyDecisions               actor.AttorneyDecisions
	HowShouldReplacementAttorneysStepIn        actor.ReplacementAttorneysStepIn
	HowShouldReplacementAttorneysStepInDetails string
	Restrictions                               string
	WhenCanTheLpaBeUsed                        actor.CanBeUsedWhen
	LifeSustainingTreatmentOption              actor.LifeSustainingTreatment
	SignedAt                                   time.Time
	CertificateProviderNotRelatedConfirmedAt   time.Time
	DonorIdentityConfirmed                     bool
	Submitted                                  bool
	Paid                                       bool
	IsOrganisationDonor                        bool
}

func (*Lpa) AllAttorneysSigned added in v0.1116.0

func (l *Lpa) AllAttorneysSigned(attorneys []*actor.AttorneyProvidedDetails) bool

TODO: this will need removing once attorney signing is captured in the lpa store, as this implementation will not work for paper attorneys

type LpaClient added in v0.1116.0

type LpaClient interface {
	Lpa(ctx context.Context, lpaUID 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)

type SecretsClient

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

Jump to

Keyboard shortcuts

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