feat: historique paiement

This commit is contained in:
2026-05-27 11:37:29 +02:00
parent 51b50aa1d0
commit a01387bb09
18 changed files with 920 additions and 13 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
namespace App\Enums;
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;
enum PaymentTransactionStatus: string implements HasColor, HasLabel
{
case PENDING = 'pending';
case PAID = 'paid';
case CREDITED = 'credited';
case FAILED = 'failed';
case IGNORED = 'ignored';
case ERROR = 'error';
public function getLabel(): string
{
return match ($this) {
self::PENDING => __('enums.payment_transaction_status.pending'),
self::PAID => __('enums.payment_transaction_status.paid'),
self::CREDITED => __('enums.payment_transaction_status.credited'),
self::FAILED => __('enums.payment_transaction_status.failed'),
self::IGNORED => __('enums.payment_transaction_status.ignored'),
self::ERROR => __('enums.payment_transaction_status.error'),
};
}
public function getColor(): string
{
return match ($this) {
self::PENDING => 'gray',
self::PAID => 'info',
self::CREDITED => 'success',
self::FAILED, self::ERROR => 'danger',
self::IGNORED => 'warning',
};
}
}