-
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.
Send independent witness and authorised signatory to lpa-store
- Loading branch information
Showing
8 changed files
with
254 additions
and
174 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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 |
---|---|---|
|
@@ -31,6 +31,8 @@ func TestClientSendLpa(t *testing.T) { | |
replacementAttorney2UID := actoruid.New() | ||
certificateProviderUID := actoruid.New() | ||
personToNotifyUID := actoruid.New() | ||
authorisedSignatoryUID := actoruid.New() | ||
independentWitnessUID := actoruid.New() | ||
|
||
testcases := map[string]struct { | ||
donor *donordata.Provided | ||
|
@@ -242,6 +244,25 @@ func TestClientSendLpa(t *testing.T) { | |
Country: "GB", | ||
}, | ||
}}, | ||
AuthorisedSignatory: donordata.AuthorisedSignatory{ | ||
UID: authorisedSignatoryUID, | ||
FirstNames: "Author", | ||
LastName: "Signor", | ||
}, | ||
IndependentWitness: donordata.IndependentWitness{ | ||
UID: independentWitnessUID, | ||
FirstNames: "Indiana", | ||
LastName: "Witness", | ||
Mobile: "0777777777", | ||
Address: place.Address{ | ||
Line1: "i-line-1", | ||
Line2: "i-line-2", | ||
Line3: "i-line-3", | ||
TownOrCity: "i-town", | ||
Postcode: "I1 1WW", | ||
Country: "GB", | ||
}, | ||
}, | ||
IdentityUserData: identity.UserData{ | ||
Status: identity.StatusConfirmed, | ||
FirstNames: "John Johnson", | ||
|
@@ -268,6 +289,8 @@ func TestClientSendLpa(t *testing.T) { | |
], | ||
"certificateProvider":{"uid":"` + certificateProviderUID.String() + `","firstNames":"Carol","lastName":"Cert","email":"[email protected]","phone":"0700009000","address":{"line1":"c-line-1","line2":"c-line-2","line3":"c-line-3","town":"c-town","postcode":"C1 1FF","country":"GB"},"channel":"online"}, | ||
"peopleToNotify":[{"uid":"` + personToNotifyUID.String() + `","firstNames":"Peter","lastName":"Notify","address":{"line1":"p-line-1","line2":"p-line-2","line3":"p-line-3","town":"p-town","postcode":"P1 1FF","country":"GB"}}], | ||
"authorisedSignatory":{"uid":"` + authorisedSignatoryUID.String() + `","firstNames":"Author","lastName":"Signor"}, | ||
"independentWitness":{"uid":"` + independentWitnessUID.String() + `","firstNames":"Indiana","lastName":"Witness","phone":"0777777777","address":{"line1":"i-line-1","line2":"i-line-2","line3":"i-line-3","town":"i-town","postcode":"I1 1WW","country":"GB"}}, | ||
"howAttorneysMakeDecisions":"jointly", | ||
"howReplacementAttorneysMakeDecisions":"jointly-for-some-severally-for-others", | ||
"howReplacementAttorneysMakeDecisionsDetails":"umm", | ||
|
@@ -393,6 +416,8 @@ func TestClientLpa(t *testing.T) { | |
replacementAttorney2UID := actoruid.New() | ||
certificateProviderUID := actoruid.New() | ||
personToNotifyUID := actoruid.New() | ||
authorisedSignatoryUID := actoruid.New() | ||
independentWitnessUID := actoruid.New() | ||
|
||
testcases := map[string]struct { | ||
donor *lpadata.Lpa | ||
|
@@ -616,6 +641,25 @@ func TestClientLpa(t *testing.T) { | |
Country: "GB", | ||
}, | ||
}}, | ||
AuthorisedSignatory: lpadata.AuthorisedSignatory{ | ||
UID: authorisedSignatoryUID, | ||
FirstNames: "Author", | ||
LastName: "Signor", | ||
}, | ||
IndependentWitness: lpadata.IndependentWitness{ | ||
UID: independentWitnessUID, | ||
FirstNames: "Indiana", | ||
LastName: "Witness", | ||
Mobile: "0777777777", | ||
Address: place.Address{ | ||
Line1: "i-line-1", | ||
Line2: "i-line-2", | ||
Line3: "i-line-3", | ||
TownOrCity: "i-town", | ||
Postcode: "I1 1WW", | ||
Country: "GB", | ||
}, | ||
}, | ||
SignedAt: time.Date(2000, time.January, 2, 3, 4, 5, 6, time.UTC), | ||
CertificateProviderNotRelatedConfirmedAt: time.Date(2001, time.February, 3, 4, 5, 6, 7, time.UTC), | ||
}, | ||
|
@@ -636,6 +680,9 @@ func TestClientLpa(t *testing.T) { | |
], | ||
"certificateProvider":{"uid":"` + certificateProviderUID.String() + `","firstNames":"Carol","lastName":"Cert","email":"[email protected]","phone":"0700009000","address":{"line1":"c-line-1","line2":"c-line-2","line3":"c-line-3","town":"c-town","postcode":"C1 1FF","country":"GB"},"channel":"online","identityCheck":{"checkedAt":"2002-01-01T13:14:15.000000016Z","type":"one-login"}}, | ||
"peopleToNotify":[{"uid":"` + personToNotifyUID.String() + `","firstNames":"Peter","lastName":"Notify","address":{"line1":"p-line-1","line2":"p-line-2","line3":"p-line-3","town":"p-town","postcode":"P1 1FF","country":"GB"}}], | ||
"authorisedSignatory":{"uid":"` + authorisedSignatoryUID.String() + `","firstNames":"Author","lastName":"Signor"}, | ||
"independentWitness":{"uid":"` + independentWitnessUID.String() + `","firstNames":"Indiana","lastName":"Witness","phone":"0777777777", | ||
"address":{"line1":"i-line-1","line2":"i-line-2","line3":"i-line-3","town":"i-town","postcode":"I1 1WW","country":"GB"}}, | ||
"howAttorneysMakeDecisions":"jointly", | ||
"howReplacementAttorneysMakeDecisions":"jointly-for-some-severally-for-others", | ||
"howReplacementAttorneysMakeDecisionsDetails":"umm", | ||
|
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package lpadata | ||
|
||
import "github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid" | ||
|
||
type AuthorisedSignatory struct { | ||
UID actoruid.UID | ||
FirstNames string | ||
LastName string | ||
} | ||
|
||
func (a AuthorisedSignatory) FullName() string { | ||
return a.FirstNames + " " + a.LastName | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package lpadata | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestAuthorisedSignatoryFullName(t *testing.T) { | ||
assert.Equal(t, "John Smith", AuthorisedSignatory{FirstNames: "John", LastName: "Smith"}.FullName()) | ||
} |
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
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