Merge branch 'issue-72' into 'develop'
feat: ✨ add recetteValidated to TicketStatusEnum
See merge request ldc-web/projets/support-web!92
This commit is contained in:
commit
fa1d8db4b2
2 changed files with 38 additions and 2 deletions
|
|
@ -14,8 +14,9 @@ enum TicketStatusEnum: int
|
|||
case waiting = 4;
|
||||
case waitingValidation = 5;
|
||||
case recette = 6;
|
||||
case production = 7;
|
||||
case archived = 8;
|
||||
case recetteValidated = 7;
|
||||
case production = 8;
|
||||
case archived = 9;
|
||||
|
||||
/**
|
||||
* Optionnal labels definition
|
||||
|
|
@ -27,6 +28,7 @@ enum TicketStatusEnum: int
|
|||
self::waiting->name => "En attente de réponse",
|
||||
self::waitingValidation->name => "En attente de validation",
|
||||
self::recette->name => "En recettage",
|
||||
self::recetteValidated->name => "Recettage validé",
|
||||
self::production->name => "En production",
|
||||
self::archived->name => "Archivé",
|
||||
];
|
||||
|
|
@ -41,6 +43,7 @@ enum TicketStatusEnum: int
|
|||
self::waiting->name => 'text-white bg-danger',
|
||||
self::waitingValidation->name => 'text-warning bg-danger',
|
||||
self::recette->name => 'text-primary',
|
||||
self::recetteValidated->name => 'text-success',
|
||||
self::production->name => 'text-success',
|
||||
self::archived->name => 'text-secondary',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Ticket;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Ticket::query()->where('status', '>', 6)->get()->map(function (Ticket $model) {
|
||||
$model->status = $model->getRawOriginal('status') + 1;
|
||||
$model->saveQuietly();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Ticket::query()->where('status', '>', 6)->get()->map(function (Ticket $model) {
|
||||
$model->status = $model->getRawOriginal('status') - 1;
|
||||
$model->saveQuietly();
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue