-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
3,397 additions
and
986 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.