-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MLPAB-2088: Add channel and email to trust corp sign (#186)
- Loading branch information
Showing
10 changed files
with
194 additions
and
7 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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -29,6 +29,21 @@ | |
"channel": "paper" | ||
} | ||
], | ||
"trustCorporations": [ | ||
{ | ||
"uid": "1d95993a-ffbb-484c-b2fe-f4cca51801da", | ||
"name": "Trust us Corp.", | ||
"companyNumber": "666123321", | ||
"address": { | ||
"line1": "103 Line 1", | ||
"town": "Town", | ||
"country": "GB" | ||
}, | ||
"email": "[email protected]", | ||
"status": "active", | ||
"channel": "paper" | ||
} | ||
], | ||
"certificateProvider": { | ||
"uid": "6808960d-12cf-47c5-a2bc-3177deb8599c", | ||
"firstNames": "Vone", | ||
|
@@ -44,5 +59,6 @@ | |
}, | ||
"lifeSustainingTreatmentOption": "option-a", | ||
"signedAt": "2024-01-10T23:00:00Z", | ||
"certificateProviderNotRelatedConfirmedAt": "2024-01-11T22:00:00Z" | ||
"certificateProviderNotRelatedConfirmedAt": "2024-01-11T22:00:00Z", | ||
"howAttorneysMakeDecisions": "jointly" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"type": "TRUST_CORPORATION_SIGN", | ||
"changes": [ | ||
{ | ||
"key": "/trustCorporations/0/mobile", | ||
"new": "07700900000", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/contactLanguagePreference", | ||
"new": "en", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/channel", | ||
"new": "online", | ||
"old": "paper" | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/email", | ||
"new": "[email protected]", | ||
"old": "[email protected]" | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/signatories/0/firstNames", | ||
"new": "Sam", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/signatories/0/lastName", | ||
"new": "Smith", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/signatories/0/professionalTitle", | ||
"new": "President", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/signatories/0/signedAt", | ||
"new": "2024-01-13T22:00:00Z", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/signatories/1/firstNames", | ||
"new": "Sandra", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/signatories/1/lastName", | ||
"new": "Smith", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/signatories/1/professionalTitle", | ||
"new": "Vice President", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/signatories/1/signedAt", | ||
"new": "2024-01-13T22:00:00Z", | ||
"old": null | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,63 @@ func TestValidateUpdateTrustCorporationSign(t *testing.T) { | |
errors []shared.FieldError | ||
}{ | ||
"valid": { | ||
update: shared.Update{ | ||
Type: "TRUST_CORPORATION_SIGN", | ||
Changes: []shared.Change{ | ||
{ | ||
Key: "/trustCorporations/1/mobile", | ||
New: json.RawMessage(`"07777"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/signatories/0/firstNames", | ||
New: json.RawMessage(`"John"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/signatories/0/lastName", | ||
New: json.RawMessage(`"Smith"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/signatories/0/professionalTitle", | ||
New: json.RawMessage(`"Director"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/signatories/0/signedAt", | ||
New: json.RawMessage(`"` + time.Now().Format(time.RFC3339) + `"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/signatories/1/firstNames", | ||
New: json.RawMessage(`"Jane"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/signatories/1/lastName", | ||
New: json.RawMessage(`"Smith"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/signatories/1/professionalTitle", | ||
New: json.RawMessage(`"Deputy Director"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/signatories/1/signedAt", | ||
New: json.RawMessage(`"` + time.Now().Format(time.RFC3339) + `"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/contactLanguagePreference", | ||
New: json.RawMessage(`"cy"`), | ||
Old: jsonNull, | ||
}, | ||
}, | ||
}, | ||
}, | ||
"valid - existing values": { | ||
update: shared.Update{ | ||
Type: "TRUST_CORPORATION_SIGN", | ||
Changes: []shared.Change{ | ||
|
@@ -86,6 +143,16 @@ func TestValidateUpdateTrustCorporationSign(t *testing.T) { | |
New: json.RawMessage(`"cy"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/email", | ||
New: json.RawMessage(`"[email protected]"`), | ||
Old: json.RawMessage(`"[email protected]"`), | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/channel", | ||
New: json.RawMessage(`"online"`), | ||
Old: json.RawMessage(`"paper"`), | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -146,7 +213,7 @@ func TestValidateUpdateTrustCorporationSign(t *testing.T) { | |
{Source: "/changes/7", Detail: "unexpected change provided"}, | ||
}, | ||
}, | ||
"invalid contact language": { | ||
"invalid values": { | ||
update: shared.Update{ | ||
Type: "TRUST_CORPORATION_SIGN", | ||
Changes: []shared.Change{ | ||
|
@@ -180,10 +247,16 @@ func TestValidateUpdateTrustCorporationSign(t *testing.T) { | |
New: json.RawMessage(`"xy"`), | ||
Old: jsonNull, | ||
}, | ||
{ | ||
Key: "/trustCorporations/1/channel", | ||
New: json.RawMessage(`"digital"`), | ||
Old: json.RawMessage(`"paper"`), | ||
}, | ||
}, | ||
}, | ||
errors: []shared.FieldError{ | ||
{Source: "/changes/5/new", Detail: "invalid value"}, | ||
{Source: "/changes/6/new", Detail: "invalid value"}, | ||
}, | ||
}, | ||
"multiple trust corporations": { | ||
|
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 |
---|---|---|
|
@@ -155,6 +155,21 @@ func handlePactState(r *http.Request) error { | |
"channel": "paper" | ||
} | ||
], | ||
"trustCorporations": [ | ||
{ | ||
"uid": "1d95993a-ffbb-484c-b2fe-f4cca51801da", | ||
"name": "Trust us Corp.", | ||
"companyNumber": "666123321", | ||
"address": { | ||
"line1": "103 Line 1", | ||
"town": "Town", | ||
"country": "GB" | ||
}, | ||
"email": "[email protected]", | ||
"status": "active", | ||
"channel": "paper" | ||
} | ||
], | ||
"certificateProvider": { | ||
"uid": "4fe2ac67-17cc-4e9b-a9d6-ce30b5f9c82e", | ||
"firstNames": "Some", | ||
|
@@ -168,7 +183,8 @@ func handlePactState(r *http.Request) error { | |
} | ||
}, | ||
"lifeSustainingTreatmentOption": "option-a", | ||
"signedAt": "2000-01-02T12:13:14Z" | ||
"signedAt": "2000-01-02T12:13:14Z", | ||
"howAttorneysMakeDecisions": "jointly" | ||
}` | ||
|
||
req, err := http.NewRequest("PUT", url, strings.NewReader(body)) | ||
|