Skip to content

Commit

Permalink
feat: add consultant create account journey implementation (#89)
Browse files Browse the repository at this point in the history
* feat: Add DTO to register consultant and operator simultaneously

* feat: Add optional organisation ID
  • Loading branch information
fibble authored Aug 23, 2024
1 parent 27a0b12 commit e3904dd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/backend-routes/user/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
'register',
[
'POST' => CommandConfig::getPostConfig(Command\User\RegisterUserSelfserve::class),
'register-consultant-operator' => RouteConfig::getRouteConfig(
'register-consultant-operator',
[
'POST' => CommandConfig::getPostConfig(Command\User\RegisterConsultantAndOperator::class),
]
),
]
),
'remind-username' => RouteConfig::getRouteConfig(
Expand Down
33 changes: 33 additions & 0 deletions src/Command/User/RegisterConsultantAndOperator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Dvsa\Olcs\Transfer\Command\User;

use Dvsa\Olcs\Transfer\Util\Annotation as Transfer;
use Dvsa\Olcs\Transfer\Command\AbstractCommand;

/**
* @Transfer\RouteName("backend/user/selfserve/register/register-consultant-operator")
* @Transfer\Method("POST")
*/
final class RegisterConsultantAndOperator extends AbstractCommand
{
/**
* @Transfer\Partial("Dvsa\Olcs\Transfer\Command\User\RegisterUserSelfserve")
*/
protected $operatorDetails;

/**
* @Transfer\Partial("Dvsa\Olcs\Transfer\Command\User\RegisterUserSelfserve")
*/
protected $consultantDetails;

public function getOperatorDetails()
{
return $this->operatorDetails;
}

public function getConsultantDetails()
{
return $this->consultantDetails;
}
}
2 changes: 2 additions & 0 deletions src/Command/User/RegisterUserSelfserve.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Dvsa\Olcs\Transfer\Command\User;

use Dvsa\Olcs\Transfer\FieldType\Traits\OrganisationOptional;
use Dvsa\Olcs\Transfer\FieldType\Traits\TranslateToWelshOptional;
use Dvsa\Olcs\Transfer\Util\Annotation as Transfer;
use Dvsa\Olcs\Transfer\Command\AbstractCommand;
Expand All @@ -17,6 +18,7 @@
final class RegisterUserSelfserve extends AbstractCommand
{
use TranslateToWelshOptional;
use OrganisationOptional;

/**
* @Transfer\Filter("Laminas\Filter\StringTrim")
Expand Down

0 comments on commit e3904dd

Please sign in to comment.