Skip to content

Commit

Permalink
Merge pull request #13 from seisigmasrl/fix/utils
Browse files Browse the repository at this point in the history
Fixing the Status enum by validating all Status types from the API.
  • Loading branch information
ricardov03 authored Feb 10, 2023
2 parents 872188c + cc4d39b commit 5234679
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/helpers/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@

enum Status: int
{
case DECOMMISSIONED = 3;
case ACTIVE = 2;
case INACTIVE = 1;
case SUSPENSE = 0;

public function toString(): string
{
return match ($this) {
self::ACTIVE => 'Active',
self::INACTIVE => 'Inactive'
self::DECOMMISSIONED => 'DADO DE BAJA',
self::ACTIVE => 'ACTIVO',
self::INACTIVE => 'INACTIVO',
self::SUSPENSE => 'SUSPENDIDO',
};
}
}
2 changes: 1 addition & 1 deletion tests/DgiiRncValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'rnc' => $id,
'name' => 'KOI CORPORATION BY SAIKOV SRL',
'commercial_name' => 'KOI CORPORATION BY SAIKOV',
'status' => 'Active',
'status' => 'ACTIVO',
])
->and(DgiiRncValidator::check('123456789'))
->toBeFalse();
Expand Down

0 comments on commit 5234679

Please sign in to comment.