Skip to content

Commit

Permalink
Merge f914af0 into 432d74f
Browse files Browse the repository at this point in the history
  • Loading branch information
hawx authored Jul 25, 2024
2 parents 432d74f + f914af0 commit d3d128f
Show file tree
Hide file tree
Showing 52 changed files with 3,397 additions and 986 deletions.
2 changes: 2 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ all: true
packages:
github.com/ministryofjustice/opg-modernising-lpa/cmd/event-received:
github.com/ministryofjustice/opg-modernising-lpa/internal/app:
github.com/ministryofjustice/opg-modernising-lpa/internal/attorney/attorneydata:
github.com/ministryofjustice/opg-modernising-lpa/internal/attorney/attorneypage:
github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo:
github.com/ministryofjustice/opg-modernising-lpa/internal/event:
github.com/ministryofjustice/opg-modernising-lpa/internal/lambda:
Expand Down
73 changes: 4 additions & 69 deletions internal/actor/attorney_provided.go
Original file line number Diff line number Diff line change
@@ -1,79 +1,14 @@
package actor

import (
"time"

"github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid"
"github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo"
"github.com/ministryofjustice/opg-modernising-lpa/internal/form"
"github.com/ministryofjustice/opg-modernising-lpa/internal/localize"
"github.com/ministryofjustice/opg-modernising-lpa/internal/attorney/attorneydata"
)

// AttorneyProvidedDetails contains details about an attorney or replacement
// attorney, provided by the attorney or replacement attorney
type AttorneyProvidedDetails struct {
PK dynamo.LpaKeyType
SK dynamo.AttorneyKeyType
// The identifier of the attorney or replacement attorney being edited
UID actoruid.UID
// The identifier of the LPA the attorney or replacement attorney is named in
LpaID string
// Tracking when AttorneyProvidedDetails is updated
UpdatedAt time.Time
// IsReplacement is true when the details relate to an attorney appointed as a
// replacement
IsReplacement bool
// IsTrustCorporation is true when the details relate to a trust corporation
IsTrustCorporation bool
// Mobile number of the attorney or replacement attorney
Mobile string
// SignedAt is when the attorney or replacement attorney submitted their
// signature
SignedAt time.Time
// WouldLikeSecondSignatory captures whether two signatories will be used for
// a trust corporation
WouldLikeSecondSignatory form.YesNo
// AuthorisedSignatories captures the details of the person who signed on
// behalf of a trust corporation, if one is acting as an attorney
AuthorisedSignatories [2]TrustCorporationSignatory
// Used to show attorney task list
Tasks AttorneyTasks
// ContactLanguagePreference is the language the attorney or replacement
// attorney prefers to receive notifications in
ContactLanguagePreference localize.Lang
// Email is the email address returned from OneLogin when the attorney logged in
Email string
}

// Signed checks whether the attorney has confirmed and if that confirmation is
// still valid by checking that it was made for the donor's current signature.
func (d AttorneyProvidedDetails) Signed() bool {
if d.IsTrustCorporation {
switch d.WouldLikeSecondSignatory {
case form.Yes:
return !d.AuthorisedSignatories[0].SignedAt.IsZero() &&
!d.AuthorisedSignatories[1].SignedAt.IsZero()
case form.No:
return !d.AuthorisedSignatories[0].SignedAt.IsZero()
default:
return false
}
}

return !d.SignedAt.IsZero()
}
type AttorneyProvidedDetails = attorneydata.Provided

type AttorneyTasks struct {
ConfirmYourDetails TaskState
ReadTheLpa TaskState
SignTheLpa TaskState
SignTheLpaSecond TaskState
}
type AttorneyTasks = attorneydata.Tasks

// TrustCorporationSignatory contains the details of a person who signed the LPA on behalf of a trust corporation
type TrustCorporationSignatory struct {
FirstNames string
LastName string
ProfessionalTitle string
SignedAt time.Time
}
type TrustCorporationSignatory = attorneydata.TrustCorporationSignatory
96 changes: 0 additions & 96 deletions internal/actor/enum_identitytask.go

This file was deleted.

114 changes: 0 additions & 114 deletions internal/actor/enum_paymenttask.go

This file was deleted.

24 changes: 2 additions & 22 deletions internal/actor/share_code_data.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
package actor

import (
"time"

"github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid"
"github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo"
"github.com/ministryofjustice/opg-modernising-lpa/internal/sharecode"
)

type ShareCodeData struct {
PK dynamo.ShareKeyType
SK dynamo.ShareSortKeyType
UpdatedAt time.Time
LpaKey dynamo.LpaKeyType
LpaOwnerKey dynamo.LpaOwnerKeyType
ActorUID actoruid.UID
IsReplacementAttorney bool
IsTrustCorporation bool

// InviteSentTo is the email address the supporter sent the invite to
InviteSentTo string
// LpaLinkedAt is the time the donor entered the access code
LpaLinkedAt time.Time
// LpaLinkedTo is set to the email address the donor used to sign-in when
// using the code
LpaLinkedTo string
}
type ShareCodeData = sharecode.ShareCodeData
Loading

0 comments on commit d3d128f

Please sign in to comment.