lpadata

package
v0.1510.0-MLPAB2339cha... Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package lpadata provides types that describe the data used by the LPA store.

Index

Constants

This section is empty.

Variables

View Source
var AttorneysActValues = AttorneysActOptions{
	Jointly:                          Jointly,
	JointlyAndSeverally:              JointlyAndSeverally,
	JointlyForSomeSeverallyForOthers: JointlyForSomeSeverallyForOthers,
}
View Source
var CanBeUsedWhenValues = CanBeUsedWhenOptions{
	CapacityLost: CanBeUsedWhenCapacityLost,
	HasCapacity:  CanBeUsedWhenHasCapacity,
}
View Source
var CertificateProviderRelationshipValues = CertificateProviderRelationshipOptions{
	Personally:     Personally,
	Professionally: Professionally,
}
View Source
var ChannelValues = ChannelOptions{
	Paper:  ChannelPaper,
	Online: ChannelOnline,
}
View Source
var LpaTypeValues = LpaTypeOptions{
	PersonalWelfare:    LpaTypePersonalWelfare,
	PropertyAndAffairs: LpaTypePropertyAndAffairs,
}

Functions

This section is empty.

Types

type Attorney added in v0.1357.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                   Channel
}

func (Attorney) FullName added in v0.1357.0

func (a Attorney) FullName() string

type AttorneyDecisions added in v0.1357.0

type AttorneyDecisions struct {
	How     AttorneysAct
	Details string
}

type Attorneys added in v0.1357.0

type Attorneys struct {
	Attorneys        []Attorney
	TrustCorporation TrustCorporation
}

func (Attorneys) FullNames added in v0.1357.0

func (a Attorneys) FullNames() []string

func (Attorneys) Get added in v0.1357.0

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

func (Attorneys) Index added in v0.1357.0

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

func (Attorneys) Len added in v0.1357.0

func (a Attorneys) Len() int

type AttorneysAct added in v0.1341.0

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

func ParseAttorneysAct(s string) (AttorneysAct, error)

func (AttorneysAct) Empty added in v0.1341.0

func (i AttorneysAct) Empty() bool

func (AttorneysAct) IsJointly added in v0.1341.0

func (i AttorneysAct) IsJointly() bool

func (AttorneysAct) IsJointlyAndSeverally added in v0.1341.0

func (i AttorneysAct) IsJointlyAndSeverally() bool

func (AttorneysAct) IsJointlyForSomeSeverallyForOthers added in v0.1341.0

func (i AttorneysAct) IsJointlyForSomeSeverallyForOthers() bool

func (AttorneysAct) MarshalText added in v0.1341.0

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

func (AttorneysAct) String added in v0.1341.0

func (i AttorneysAct) String() string

func (*AttorneysAct) UnmarshalText added in v0.1341.0

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

type AttorneysActOptions added in v0.1341.0

type AttorneysActOptions struct {
	Jointly                          AttorneysAct
	JointlyAndSeverally              AttorneysAct
	JointlyForSomeSeverallyForOthers AttorneysAct
}

type AuthorisedSignatory added in v0.1446.0

type AuthorisedSignatory struct {
	UID        actoruid.UID
	FirstNames string
	LastName   string
}

func (AuthorisedSignatory) FullName added in v0.1446.0

func (a AuthorisedSignatory) FullName() string

type CanBeUsedWhen added in v0.1341.0

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

func ParseCanBeUsedWhen added in v0.1341.0

func ParseCanBeUsedWhen(s string) (CanBeUsedWhen, error)

func (CanBeUsedWhen) Empty added in v0.1450.0

func (i CanBeUsedWhen) Empty() bool

func (CanBeUsedWhen) IsCapacityLost added in v0.1341.0

func (i CanBeUsedWhen) IsCapacityLost() bool

func (CanBeUsedWhen) IsHasCapacity added in v0.1341.0

func (i CanBeUsedWhen) IsHasCapacity() bool

func (CanBeUsedWhen) MarshalText added in v0.1341.0

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

func (CanBeUsedWhen) String added in v0.1341.0

func (i CanBeUsedWhen) String() string

func (*CanBeUsedWhen) UnmarshalText added in v0.1341.0

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

type CanBeUsedWhenOptions added in v0.1341.0

type CanBeUsedWhenOptions struct {
	CapacityLost CanBeUsedWhen
	HasCapacity  CanBeUsedWhen
}

type CertificateProvider added in v0.1357.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                   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 CertificateProviderRelationship
}

func (CertificateProvider) FullName added in v0.1357.0

func (c CertificateProvider) FullName() string

type CertificateProviderRelationship added in v0.1341.0

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

func ParseCertificateProviderRelationship added in v0.1341.0

func ParseCertificateProviderRelationship(s string) (CertificateProviderRelationship, error)

func (CertificateProviderRelationship) Empty added in v0.1341.0

func (CertificateProviderRelationship) IsPersonally added in v0.1341.0

func (i CertificateProviderRelationship) IsPersonally() bool

func (CertificateProviderRelationship) IsProfessionally added in v0.1341.0

func (i CertificateProviderRelationship) IsProfessionally() bool

func (CertificateProviderRelationship) MarshalText added in v0.1341.0

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

func (CertificateProviderRelationship) String added in v0.1341.0

func (*CertificateProviderRelationship) UnmarshalText added in v0.1341.0

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

type CertificateProviderRelationshipOptions added in v0.1341.0

type CertificateProviderRelationshipOptions struct {
	Personally     CertificateProviderRelationship
	Professionally CertificateProviderRelationship
}

type Channel added in v0.1341.0

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

func ParseChannel added in v0.1341.0

func ParseChannel(s string) (Channel, error)

func (Channel) Empty added in v0.1341.0

func (i Channel) Empty() bool

func (Channel) IsOnline added in v0.1341.0

func (i Channel) IsOnline() bool

func (Channel) IsPaper added in v0.1341.0

func (i Channel) IsPaper() bool

func (Channel) MarshalText added in v0.1341.0

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

func (Channel) String added in v0.1341.0

func (i Channel) String() string

func (*Channel) UnmarshalText added in v0.1341.0

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

type ChannelOptions added in v0.1341.0

type ChannelOptions struct {
	Paper  Channel
	Online Channel
}

type Correspondent added in v0.1357.0

type Correspondent struct {
	FirstNames string
	LastName   string
	Email      string
}

func (Correspondent) FullName added in v0.1357.0

func (c Correspondent) FullName() string

type Donor added in v0.1357.0

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

	// Mobile is only set for online donors who have provided one
	Mobile string
}

func (Donor) FullName added in v0.1357.0

func (d Donor) FullName() string

type IdentityCheck added in v0.1357.0

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

type IndependentWitness added in v0.1437.0

type IndependentWitness struct {
	UID        actoruid.UID
	FirstNames string
	LastName   string
	Mobile     string
	Address    place.Address
}

func (IndependentWitness) FullName added in v0.1437.0

func (w IndependentWitness) FullName() string

type LifeSustainingTreatment added in v0.1341.0

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

func ParseLifeSustainingTreatment added in v0.1341.0

func ParseLifeSustainingTreatment(s string) (LifeSustainingTreatment, error)

func (LifeSustainingTreatment) Empty added in v0.1341.0

func (i LifeSustainingTreatment) Empty() bool

func (LifeSustainingTreatment) IsOptionA added in v0.1341.0

func (i LifeSustainingTreatment) IsOptionA() bool

func (LifeSustainingTreatment) IsOptionB added in v0.1341.0

func (i LifeSustainingTreatment) IsOptionB() bool

func (LifeSustainingTreatment) MarshalText added in v0.1341.0

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

func (LifeSustainingTreatment) String added in v0.1341.0

func (i LifeSustainingTreatment) String() string

func (*LifeSustainingTreatment) UnmarshalText added in v0.1341.0

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

type LifeSustainingTreatmentOptions added in v0.1341.0

type LifeSustainingTreatmentOptions struct {
	OptionA LifeSustainingTreatment
	OptionB LifeSustainingTreatment
}

type Lpa added in v0.1357.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                                       LpaType
	Donor                                      Donor
	Attorneys                                  Attorneys
	ReplacementAttorneys                       Attorneys
	CertificateProvider                        CertificateProvider
	PeopleToNotify                             []PersonToNotify
	AttorneyDecisions                          AttorneyDecisions
	ReplacementAttorneyDecisions               AttorneyDecisions
	HowShouldReplacementAttorneysStepIn        ReplacementAttorneysStepIn
	HowShouldReplacementAttorneysStepInDetails string
	Restrictions                               string
	WhenCanTheLpaBeUsed                        CanBeUsedWhen
	LifeSustainingTreatmentOption              LifeSustainingTreatment
	AuthorisedSignatory                        AuthorisedSignatory
	IndependentWitness                         IndependentWitness

	// SignedAt is when the donor signed their LPA.
	SignedAt time.Time

	// WitnessedByCertificateProviderAt is when the certificate provider signed to
	// say they witnessed the donor signing the LPA.
	WitnessedByCertificateProviderAt time.Time

	// WitnessedByIndependentWitnessAt is when the independent witness signed to
	// say they witnessed the LPA being signed on the donor's behalf, if the donor
	// said they were unable to sign themselves.
	WitnessedByIndependentWitnessAt time.Time

	// CertificateProviderNotRelatedConfirmedAt is when the donor confirmed that
	// the certificate provider is not related to them, if they have similar
	// details.
	CertificateProviderNotRelatedConfirmedAt time.Time

	// Submitted is set if SubmittedAt is non-zero for online applications, or set
	// to true for paper applications.
	Submitted bool

	// Paid is set if the PayForLpa task has been completed for online
	// applications, or set to true for paper applications as to be in the
	// lpa-store the application payment must be complete.
	Paid bool

	// IsOrganisationDonor is set to true when the Lpa is being made by a
	// supporter working for an organisation.
	IsOrganisationDonor bool

	// Drafted is set if the CheckYourLpa task has been completed for online
	// applications, or set to true for paper applications.
	Drafted bool

	// CannotRegister is set to true if the status in the lpa-store is
	// cannot-register.
	CannotRegister bool

	// Correspondent is set using the data provided by the donor for online
	// applications, but is not set for paper applications.
	Correspondent Correspondent

	// Voucher is set using the data provided by the donor for online
	// applications, but is not set for paper applications.
	Voucher Voucher
}

func (Lpa) Actors added in v0.1382.0

func (l Lpa) Actors() iter.Seq[actor.Actor]

Actors returns an iterator over all human actors named on the LPA (i.e. this excludes trust corporations, the correspondent, and the voucher).

func (Lpa) AllAttorneysSigned added in v0.1357.0

func (l Lpa) AllAttorneysSigned() bool

func (*Lpa) Attorney added in v0.1395.0

func (l *Lpa) Attorney(uid actoruid.UID) (string, actor.Type)

func (*Lpa) CorrespondentEmail added in v0.1357.0

func (l *Lpa) CorrespondentEmail() string

func (*Lpa) SignedForDonor added in v0.1470.0

func (l *Lpa) SignedForDonor() bool

SignedForDonor returns true if the Lpa has been signed and witnessed for the donor.

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

TODO: move this somewhere else

type LpaTypeOptions

type LpaTypeOptions struct {
	PersonalWelfare    LpaType
	PropertyAndAffairs LpaType
}

type PersonToNotify added in v0.1357.0

type PersonToNotify struct {
	UID        actoruid.UID
	FirstNames string
	LastName   string
	Address    place.Address
}

func (PersonToNotify) FullName added in v0.1357.0

func (p PersonToNotify) FullName() string

type ReplacementAttorneysStepIn added in v0.1341.0

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

func ParseReplacementAttorneysStepIn added in v0.1341.0

func ParseReplacementAttorneysStepIn(s string) (ReplacementAttorneysStepIn, error)

func (ReplacementAttorneysStepIn) Empty added in v0.1341.0

func (i ReplacementAttorneysStepIn) Empty() bool

func (ReplacementAttorneysStepIn) IsAnotherWay added in v0.1341.0

func (i ReplacementAttorneysStepIn) IsAnotherWay() bool

func (ReplacementAttorneysStepIn) IsWhenAllCanNoLongerAct added in v0.1341.0

func (i ReplacementAttorneysStepIn) IsWhenAllCanNoLongerAct() bool

func (ReplacementAttorneysStepIn) IsWhenOneCanNoLongerAct added in v0.1341.0

func (i ReplacementAttorneysStepIn) IsWhenOneCanNoLongerAct() bool

func (ReplacementAttorneysStepIn) MarshalText added in v0.1341.0

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

func (ReplacementAttorneysStepIn) String added in v0.1341.0

func (*ReplacementAttorneysStepIn) UnmarshalText added in v0.1341.0

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

type ReplacementAttorneysStepInOptions added in v0.1341.0

type ReplacementAttorneysStepInOptions struct {
	WhenAllCanNoLongerAct ReplacementAttorneysStepIn
	WhenOneCanNoLongerAct ReplacementAttorneysStepIn
	AnotherWay            ReplacementAttorneysStepIn
}

type TrustCorporation added in v0.1357.0

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

type TrustCorporationSignatory added in v0.1357.0

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

func (TrustCorporationSignatory) FullName added in v0.1437.0

func (s TrustCorporationSignatory) FullName() string

type Voucher added in v0.1367.0

type Voucher struct {
	UID        actoruid.UID
	FirstNames string
	LastName   string
	Email      string
}

func (Voucher) FullName added in v0.1375.0

func (v Voucher) FullName() string

Jump to

Keyboard shortcuts

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