Skip to content

Commit

Permalink
Merge pull request #13 from mon-petit-placement/feature/awaiting-cert…
Browse files Browse the repository at this point in the history
…ification

modification allowing to send documents for advanced certification
  • Loading branch information
Celine68 authored Nov 10, 2021
2 parents aa53aa1 + 78b809c commit a56de8e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Model/RegistrationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

class RegistrationRequest
{
const DOCTYPE_ID_CARD_FR = 'id_card_fr';
const DOCTYPE_PASSPORT = 'passport_eu';
const DOCTYPE_TITLE_STAY = 'titre_sejour';
public const DOCTYPE_ID_CARD_FR = 'id_card_fr';
public const DOCTYPE_PASSPORT = 'passport_eu';
public const DOCTYPE_TITLE_STAY = 'titre_sejour';

/**
* @var array
Expand Down
22 changes: 13 additions & 9 deletions Model/Signer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

class Signer
{
const ROLE_SIGNER = 'signer';
const ROLE_OBSERVER = 'observer';
public const ROLE_SIGNER = 'signer';
public const ROLE_OBSERVER = 'observer';

/**
* @var string
Expand Down Expand Up @@ -87,7 +87,7 @@ class Signer
protected $certificateType;

/**
* @var array
* @var RegistrationRequest
*/
protected $idDocuments;

Expand Down Expand Up @@ -150,7 +150,13 @@ public static function configureData(OptionsResolver $resolver)
->setDefault('cancelRedirection', null)->setAllowedTypes('cancelRedirection', ['array', 'null'])
->setDefault('failRedirection', null)->setAllowedTypes('failRedirection', ['array', 'null'])
->setDefault('certificateType', null)->setAllowedValues('certificateType', [null, CertificateType::SIMPLE, CertificateType::CERTIFIED, CertificateType::ADVANCED])
->setDefault('idDocuments', null)->setAllowedTypes('idDocuments', ['array', 'null'])
->setDefault('idDocuments', null)->setAllowedTypes('idDocuments', ['array', RegistrationRequest::class, 'null'])->setNormalizer('idDocuments', function (Options $options, $value) {
if ($value instanceof RegistrationRequest || null === $value) {
return $value;
}

return RegistrationRequest::createFromArray($value);
})
->setDefault('validationSessionId', null)->setAllowedTypes('validationSessionId', ['null', 'string'])
->setDefault('redirectPolicy', null)->setAllowedValues('redirectPolicy', [null, 'dashboard', 'quick'])
->setDefault('redirectWait', 5)->setAllowedTypes('redirectWait', ['int'])->setNormalizer('redirectWait', function (Options $options, $value) {
Expand Down Expand Up @@ -492,19 +498,17 @@ public function getCertificateType(): ?string
*
* @return self
*/
public function setIdDocuments(?array $idDocument): self
public function setIdDocuments(?RegistrationRequest $idDocument): self
{
if (null !== $idDocument) {
$this->idDocument = RegistrationRequest::createFromArray($idDocument);
}
$this->idDocument = $idDocument;

return $this;
}

/**
* @return array|null
*/
public function getIdDocument(): ?array
public function getIdDocument(): ?RegistrationRequest
{
return $this->idDocument;
}
Expand Down

0 comments on commit a56de8e

Please sign in to comment.