-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
109 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums\Beneficiary; | ||
|
||
use App\Concerns; | ||
|
||
enum ReasonRemoved: string | ||
{ | ||
use Concerns\Enums\Arrayable; | ||
use Concerns\Enums\Comparable; | ||
use Concerns\Enums\HasLabel; | ||
|
||
case DECEASED_HOME = 'deceased_home'; | ||
case DECEASED_HOSPITAL = 'deceased_hospital'; | ||
case RELOCATED_CITY = 'relocated_city'; | ||
case RELOCATED_ABROAD = 'relocated_abroad'; | ||
case OTHER = 'other'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'beneficiary.reason_removed'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...ase/migrations/2024_10_01_105008_extend_reason_removed_columns_in_beneficiaries_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use App\Enums\Beneficiary\ReasonRemoved; | ||
use App\Models\Beneficiary; | ||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('beneficiaries', function (Blueprint $table) { | ||
$table->renameColumn('reason_removed', 'reason_removed_notes'); | ||
}); | ||
|
||
Schema::table('beneficiaries', function (Blueprint $table) { | ||
$table->string('reason_removed') | ||
->nullable() | ||
->after('family_id'); | ||
}); | ||
|
||
Beneficiary::query() | ||
->whereNotNull('reason_removed_notes') | ||
->whereNull('reason_removed') | ||
->update([ | ||
'reason_removed' => ReasonRemoved::OTHER, | ||
]); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters