This repository has been archived by the owner on Aug 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Ddpb 2724 bypass case used exception #573
Open
slizzio
wants to merge
14
commits into
master
Choose a base branch
from
DDPB-2724-bypass-case-used-exception
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
gregtyler
previously approved these changes
Jul 25, 2019
@@ -45,7 +45,7 @@ public function selfRegisterUser(SelfRegisterData $selfRegisterData) | |||
$existingClient = $this->em->getRepository('AppBundle\Entity\Client')->findOneByCaseNumber(CasRec::normaliseCaseNumber($selfRegisterData->getCaseNumber())); | |||
|
|||
// ward off non-fee-paying codeps trying to self-register | |||
if ($isMultiDeputyCase && $existingClient instanceof Client) { | |||
if ($isMultiDeputyCase && ($existingClient instanceof Client) && $existingClient->hasDeputies()) { |
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.
The extra brackets here seem unnecessary?
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.
Force of habit, I always put each condition in their own set of brackets in case anyone adds an or condition and a bug is introduced. Not necessary with all &&'s
…for clients that have been discharged
a080324
to
9e2b615
Compare
…pi into DDPB-2724-bypass-case-used-exception
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Purpose
To allow a lay deputy to register for a client when that client already exists under a professional deputyship.
Fixes DDPB-2724
Approach
After much deliberation I have made the client soft deletable. This is to avoid removing the client completely and any reports that might be associated. So the action of discharging a client is to make them soft deleted. This prevents the client appearing anywhere in client. However admin area may sttill want to access the client (and reports) from the old professional deputyship so for admin pages I have disabled the soft delete filtter and re-enabled it once the query has been run. This allows the client to appear twice in the event that a lay deputy has re-registered against the case number. To clearly identify which is which I have applied a discharged date where required on the admin pages.
Learning
Any tips and tricks, blog posts or tools which helped you. Plus anything notable you've discovered about DigiDeps
Checklist
docker-compose run --rm api sh scripts/apiunittest.sh
)docker-compose run api php app/console security:check
)