From 792aaf3b6e5fa56da88982f5f668e2acc8f37ca9 Mon Sep 17 00:00:00 2001 From: Ian Lindsay Date: Thu, 24 Oct 2024 09:28:35 +0100 Subject: [PATCH 1/4] feat: VOL-5664 selfserve accounts require t&c signup on first login --- config/backend-routes/user/user.php | 6 ++++++ src/Command/User/AgreeTerms.php | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/Command/User/AgreeTerms.php diff --git a/config/backend-routes/user/user.php b/config/backend-routes/user/user.php index a6cb198d..fa629a76 100644 --- a/config/backend-routes/user/user.php +++ b/config/backend-routes/user/user.php @@ -96,6 +96,12 @@ 'POST' => CommandConfig::getPostConfig(Command\User\RemindUsernameSelfserve::class), ] ), + 'agree-terms' => RouteConfig::getRouteConfig( + 'agree-terms', + [ + 'POST' => CommandConfig::getPostConfig(Command\User\AgreeTerms::class), + ] + ), 'single' => RouteConfig::getSingleConfig( [ 'GET' => QueryConfig::getConfig(Query\User\UserSelfserve::class), diff --git a/src/Command/User/AgreeTerms.php b/src/Command/User/AgreeTerms.php new file mode 100644 index 00000000..ce29e7da --- /dev/null +++ b/src/Command/User/AgreeTerms.php @@ -0,0 +1,18 @@ + Date: Fri, 1 Nov 2024 12:07:09 +0000 Subject: [PATCH 2/4] Update src/Command/User/AgreeTerms.php Co-authored-by: Andrew Newton --- src/Command/User/AgreeTerms.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Command/User/AgreeTerms.php b/src/Command/User/AgreeTerms.php index ce29e7da..9f120952 100644 --- a/src/Command/User/AgreeTerms.php +++ b/src/Command/User/AgreeTerms.php @@ -4,8 +4,6 @@ namespace Dvsa\Olcs\Transfer\Command\User; -use Dvsa\Olcs\Transfer\FieldType\Traits\Identity; -use Dvsa\Olcs\Transfer\FieldType\Traits\TranslateToWelshOptional; use Dvsa\Olcs\Transfer\Util\Annotation as Transfer; use Dvsa\Olcs\Transfer\Command\AbstractCommand; From 3bcf63dcf5fbd8a4f5f79508ee8d720a1300614d Mon Sep 17 00:00:00 2001 From: Ian Lindsay Date: Fri, 1 Nov 2024 12:11:07 +0000 Subject: [PATCH 3/4] correct discrepancy between post/put --- src/Command/User/AgreeTerms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/User/AgreeTerms.php b/src/Command/User/AgreeTerms.php index 9f120952..119f7d51 100644 --- a/src/Command/User/AgreeTerms.php +++ b/src/Command/User/AgreeTerms.php @@ -9,7 +9,7 @@ /** * @Transfer\RouteName("backend/user/selfserve/agree-terms") - * @Transfer\Method("PUT") + * @Transfer\Method("POST") */ final class AgreeTerms extends AbstractCommand { From 7e0d1cde1cae452e79bc4b8fd50bbf20691c9e10 Mon Sep 17 00:00:00 2001 From: Ian Lindsay Date: Fri, 1 Nov 2024 12:11:07 +0000 Subject: [PATCH 4/4] add distinction for users created by a consultant --- src/Command/User/RegisterUserSelfserve.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Command/User/RegisterUserSelfserve.php b/src/Command/User/RegisterUserSelfserve.php index 6bb1a567..a74717a8 100644 --- a/src/Command/User/RegisterUserSelfserve.php +++ b/src/Command/User/RegisterUserSelfserve.php @@ -52,6 +52,12 @@ final class RegisterUserSelfserve extends AbstractCommand */ protected $businessType; + /** + * @Transfer\Filter("Laminas\Filter\Boolean") + * @Transfer\Optional + */ + protected $createdByConsultant = false; + public function getLoginId() { return $this->loginId; @@ -76,4 +82,9 @@ public function getBusinessType() { return $this->businessType; } + + public function getCreatedByConsultant() + { + return $this->createdByConsultant; + } }