-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UML-3628 Request a key templates to work with combined format #2978
Merged
Merged
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9a80a2d
changes to accomodate combine format
SeemaMenon 0c65ee3
Merge branch 'main' into UML-3628-template-refactor
SeemaMenon 3900462
fixes
SeemaMenon 8afb529
test fixes
SeemaMenon a9661df
Merge branch 'main' into UML-3628-template-refactor
SeemaMenon c334389
Merge branch 'main' into UML-3628-template-refactor
SeemaMenon 59cddd0
getting ready for UAT
SeemaMenon 3c88e90
reverting the changes made for UAT
SeemaMenon 1e2f58a
Merge branch 'main' into UML-3628-template-refactor
SeemaMenon 866db82
removed debug code in file
SeemaMenon 6062d7b
Merge branch 'main' into UML-3628-template-refactor
SeemaMenon 388ee3c
Merge branch 'main' into UML-3628-template-refactor
SeemaMenon a845d5b
Merge branch 'main' into UML-3628-template-refactor
SeemaMenon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -911,6 +911,146 @@ public function iHaveAddedAnLPAToMyAccount() | |
$this->theLPAIsSuccessfullyAdded(); | ||
} | ||
|
||
/** | ||
* @Given /^I have added a Combined LPA to my account$/ | ||
*/ | ||
public function iHaveAddedACombinedLPAToMyAccount() | ||
{ | ||
$this->iHaveBeenGivenAccessToUseACombinedLPAViaCredentials(); | ||
$this->iAmOnTheAddAnLPAPage(); | ||
$this->iRequestToAddACombinedLPAWithValidDetailsUsing($this->activation_key, $this->activation_key); | ||
$this->theCorrectLPAIsFoundAndICanConfirmToAddIt(); | ||
$this->theLPAIsSuccessfullyAdded(); | ||
} | ||
|
||
/** | ||
* @Given /^I have been given access to use a Combined LPA via credentials$/ | ||
*/ | ||
public function iHaveBeenGivenAccessToUseACombinedLPAViaCredentials() | ||
{ | ||
$this->lpa = json_decode(file_get_contents(__DIR__ . '../../../../test/fixtures/combined_lpa.json')); | ||
|
||
$this->activation_key = 'XYUPHWQRECHV'; | ||
$this->referenceNo = '700000000138'; | ||
$this->userDob = '1975-10-05'; | ||
$this->actorLpaToken = '24680'; | ||
$this->actorId = 0; | ||
|
||
$this->lpaData = [ | ||
'user-lpa-actor-token' => $this->actorLpaToken, | ||
'date' => 'today', | ||
'actor' => [ | ||
'type' => 'primary-attorney', | ||
'details' => [ | ||
'addresses' => [ | ||
[ | ||
'addressLine1' => '', | ||
'addressLine2' => '', | ||
'addressLine3' => '', | ||
'country' => '', | ||
'county' => '', | ||
'id' => 0, | ||
'postcode' => '', | ||
'town' => '', | ||
'type' => 'Primary', | ||
], | ||
], | ||
'companyName' => null, | ||
'dob' => '1975-10-05', | ||
'email' => '[email protected]', | ||
'firstname' => 'Ian', | ||
'id' => 0, | ||
'middlenames' => null, | ||
'salutation' => 'Mr', | ||
'surname' => 'Deputy', | ||
'systemStatus' => true, | ||
'uId' => '700000000054', | ||
], | ||
], | ||
'lpa' => $this->lpa, | ||
]; | ||
} | ||
|
||
public function iRequestToAddACombinedLPAWithValidDetailsUsing(string $code, string $storedCode) | ||
{ | ||
// API call for checking LPA | ||
$this->apiFixtures->append( | ||
ContextUtilities::newResponse( | ||
StatusCodeInterface::STATUS_OK, | ||
json_encode($this->lpaData), | ||
self::ADD_LPA_VALIDATE | ||
) | ||
); | ||
|
||
$addLpa = $this->container->get(AddLpa::class); | ||
$lpaData = $addLpa->validate( | ||
$this->userIdentity, | ||
$storedCode, | ||
$this->referenceNo, | ||
$this->userDob | ||
); | ||
|
||
Assert::assertInstanceOf(AddLpaApiResult::class, $lpaData); | ||
Assert::assertEquals(AddLpaApiResult::ADD_LPA_FOUND, $lpaData->getResponse()); | ||
Assert::assertEquals(($lpaData->getData()['lpa'])->getUId(), $this->lpa->uId); | ||
} | ||
|
||
/** | ||
* @When /^I request to view a Combined LPA which status is "([^"]*)"$/ | ||
*/ | ||
public function iRequestToViewACombinedLPAWhichStatusIs($status) | ||
{ | ||
$this->lpa->status = $status; | ||
|
||
if ($status === 'Revoked') { | ||
// API call for getting the LPA by id | ||
$this->apiFixtures->append( | ||
ContextUtilities::newResponse( | ||
StatusCodeInterface::STATUS_OK, | ||
json_encode( | ||
[ | ||
'user-lpa-actor-token' => $this->actorLpaToken, | ||
'date' => 'date', | ||
'lpa' => [], | ||
'actor' => $this->lpaData['actor'], | ||
] | ||
) | ||
) | ||
); | ||
} else { | ||
// API call for getting the LPA by id | ||
$this->apiFixtures->append( | ||
ContextUtilities::newResponse( | ||
StatusCodeInterface::STATUS_OK, | ||
json_encode( | ||
[ | ||
'user-lpa-actor-token' => $this->actorLpaToken, | ||
'date' => 'date', | ||
'lpa' => $this->lpa, | ||
'actor' => $this->lpaData['actor'], | ||
] | ||
), | ||
self::LPA_SERVICE_GET_LPA_BY_ID | ||
) | ||
); | ||
|
||
// InstAndPrefImagesService::getImagesById | ||
$this->apiFixtures->append( | ||
ContextUtilities::newResponse( | ||
StatusCodeInterface::STATUS_OK, | ||
json_encode( | ||
[ | ||
'uId' => (int) $this->lpa->uId, | ||
'status' => 'COLLECTION_COMPLETE', | ||
'signedUrls' => [], | ||
] | ||
), | ||
self::INPSERVICE_GET_BY_ID | ||
) | ||
); | ||
} | ||
} | ||
|
||
/** | ||
* @Given /^I have been given access to use an LPA via a paper document$/ | ||
*/ | ||
|
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
116 changes: 116 additions & 0 deletions
116
service-front/app/src/Actor/templates/actor/check-combined-lpa.html.twig
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,116 @@ | ||
{% extends '@actor/layout.html.twig' %} | ||
|
||
{% block html_title %}{% trans %}Confirm this is the correct LPA{% endtrans %} - {{ parent() }} {% endblock %} | ||
|
||
{% block content %} | ||
<div class="govuk-width-container"> | ||
<div role="navigation" aria-labelledby="back-link-navigation"> | ||
<a href="{{ path('lpa.add-by-key') }}" class="govuk-back-link" id="back-link-navigation"> | ||
{% trans %}Back{% endtrans %}</a> | ||
</div> | ||
|
||
<main class="govuk-main-wrapper" id="main-content" role="main"> | ||
|
||
<h1 class="govuk-heading-xl">{% trans %}Confirm this is the correct LPA{% endtrans %}</h1> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
|
||
<dl class="govuk-summary-list govuk-summary-list"> | ||
<div class="govuk-summary-list__row"> | ||
<dt class="govuk-summary-list__key"> | ||
{% trans %}Type of LPA{% endtrans %} | ||
</dt> | ||
<dd class="govuk-summary-list__value"> | ||
{% if lpa.caseSubtype.value|lower == "pfa" %} | ||
{% trans %}Property and finance{% endtrans %} | ||
{% else %} | ||
{% trans %}Health and welfare{% endtrans %} | ||
{% endif %} | ||
</dd> | ||
</div> | ||
<div class="govuk-summary-list__row"> | ||
<dt class="govuk-summary-list__key"> | ||
{% trans %}Donor name{% endtrans %} | ||
</dt> | ||
<dd class="govuk-summary-list__value"> | ||
{{ actor_name(lpa.donor) }} | ||
</dd> | ||
</div> | ||
<div class="govuk-summary-list__row"> | ||
<dt class="govuk-summary-list__key"> | ||
{% trans %}Your name{% endtrans %} | ||
</dt> | ||
<dd class="govuk-summary-list__value"> | ||
{% if userRole == "Trust corporation" %} | ||
{{ actor.companyName }} {% trans %}(Trust corporation){% endtrans %} | ||
{% else %} | ||
{{ actor_name(actor) }} | ||
{% endif %} | ||
</dd> | ||
</div> | ||
<div class="govuk-summary-list__row"> | ||
<dt class="govuk-summary-list__key"> | ||
{% trans %}Your role on this LPA{% endtrans %} | ||
</dt> | ||
<dd class="govuk-summary-list__value"> | ||
{% if userRole == "Attorney" or userRole == "Trust corporation" %} | ||
{% trans %}Attorney{% endtrans %} | ||
{% elseif userRole == "Donor" %} | ||
{% trans %}Donor{% endtrans %} | ||
{% endif %} | ||
</dd> | ||
</div> | ||
</dl> | ||
|
||
<div class="govuk-warning-text"> | ||
<span class="govuk-warning-text__icon" aria-hidden="true">!</span> | ||
<strong class="govuk-warning-text__text"> | ||
<span class="govuk-visually-hidden">{% trans %}Warning{% endtrans %}</span> | ||
{% trans %}Check that these details are correct before continuing{% endtrans %} | ||
</strong> | ||
</div> | ||
|
||
<details class="govuk-details" data-module="govuk-details" data-gaEventType="onClick" | ||
data-gaAction="Details" data-gaCategory="Wrong Details" | ||
data-gaLabel="What to do if the details are wrong"> | ||
<summary class="govuk-details__summary"> | ||
<span class="govuk-details__summary-text"> | ||
{% trans %}What to do if the details are wrong{% endtrans %} | ||
</span> | ||
</summary> | ||
<div class="govuk-details__text"> | ||
<p> | ||
{% trans %}If the information is wrong, or if a name is misspelt, please call us:{% endtrans %} | ||
</p> | ||
{{ include('@partials/contact-details/telephone.html.twig', {heading_level: 2 }) }} | ||
</div> | ||
</details> | ||
|
||
{{ govuk_form_open(form) }} | ||
|
||
{{ govuk_form_element(form.get('__csrf')) }} | ||
|
||
<div class="moj-button-menu"> | ||
<div class="moj-button-menu__wrapper"> | ||
|
||
<button role="button" data-prevent-double-click="true" type="submit" draggable="false" | ||
class="govuk-button moj-button-menu__item " data-module="govuk-button"> | ||
{% trans %}Confirm{% endtrans %}</button> | ||
</button> | ||
|
||
<a href="{{ path('lpa.dashboard') }}" role="button" draggable="false" | ||
class="govuk-button moj-button-menu__item govuk-button--secondary " | ||
data-module="govuk-button"> | ||
{% trans %}Cancel{% endtrans %} | ||
</a> | ||
</div> | ||
</div> | ||
|
||
|
||
{{ govuk_form_close() }} | ||
</div> | ||
</div> | ||
</main> | ||
</div> | ||
{% endblock %} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be set to false as the feature isn't ready for production yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I need a run to get the dev links for UAT. will revert after UAT