From cc4d39b6da59cc0d1b696707828af26b7127b51b Mon Sep 17 00:00:00 2001 From: Ricardo Vargas Date: Fri, 10 Feb 2023 17:36:21 -0400 Subject: [PATCH] Fixing the Status enum by validating all Status types from the API. --- src/helpers/Status.php | 8 ++++++-- tests/DgiiRncValidatorTest.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/helpers/Status.php b/src/helpers/Status.php index 902c654..8cc2e91 100644 --- a/src/helpers/Status.php +++ b/src/helpers/Status.php @@ -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', }; } } diff --git a/tests/DgiiRncValidatorTest.php b/tests/DgiiRncValidatorTest.php index 1121fd1..b12dd40 100644 --- a/tests/DgiiRncValidatorTest.php +++ b/tests/DgiiRncValidatorTest.php @@ -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();