From d9c132ad25a6ec3c0eb99bb747339d0f1a5cdac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 16 Aug 2023 12:30:43 +0200 Subject: [PATCH] Fix comp alleg --- database/migrations/2023_08_14_124752_migrate_oci_tables.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/database/migrations/2023_08_14_124752_migrate_oci_tables.php b/database/migrations/2023_08_14_124752_migrate_oci_tables.php index b65e0e9..45d5779 100644 --- a/database/migrations/2023_08_14_124752_migrate_oci_tables.php +++ b/database/migrations/2023_08_14_124752_migrate_oci_tables.php @@ -303,7 +303,10 @@ return new class extends Migration $claim = null; if ($row->COMP_ALLEG) { try { - $claim = $resolveAllegation($row->COMP_ALLEG); + if (!$resolveAllegation($row->COMP_ALLEG)->equals(ClaimEnum::others)) { + throw new \Error("`{$row->COMP_ALLEG}` is not resolved as `other`"); + } + $claim = $row->COMP_ALLEG; } catch (\Exception) { throw new \Error("`{$row->COMP_ALLEG}` not found"); }