feat: clean credits users
CI / 🧪 Tests Laravel (push) Successful in 2m0s
CI / 🐳 Build & Push Image (push) Successful in 35s

This commit is contained in:
2026-08-07 15:32:40 +02:00
parent eac86afa53
commit 68560655f3
44 changed files with 417 additions and 661 deletions
-38
View File
@@ -1,38 +0,0 @@
<?php
namespace App\Enums;
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;
enum CreditLedgerEntryType: string implements HasColor, HasLabel
{
case FREE_GRANT = 'free_grant';
case PURCHASE = 'purchase';
case SUBSCRIPTION_RENEWAL = 'subscription_renewal';
case USAGE = 'usage';
case REFUND = 'refund';
case ADJUSTMENT = 'adjustment';
public function getLabel(): string
{
return match ($this) {
self::FREE_GRANT => __('enums.credit_ledger_entry_type.free_grant'),
self::PURCHASE => __('enums.credit_ledger_entry_type.purchase'),
self::SUBSCRIPTION_RENEWAL => __('enums.credit_ledger_entry_type.subscription_renewal'),
self::USAGE => __('enums.credit_ledger_entry_type.usage'),
self::REFUND => __('enums.credit_ledger_entry_type.refund'),
self::ADJUSTMENT => __('enums.credit_ledger_entry_type.adjustment'),
};
}
public function getColor(): string
{
return match ($this) {
self::FREE_GRANT, self::PURCHASE, self::SUBSCRIPTION_RENEWAL => 'success',
self::USAGE => 'warning',
self::REFUND => 'info',
self::ADJUSTMENT => 'gray',
};
}
}
-28
View File
@@ -1,28 +0,0 @@
<?php
namespace App\Enums;
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;
enum CreditProductType: string implements HasColor, HasLabel
{
case MONTHLY = 'monthly';
case ONE_TIME = 'one_time';
public function getLabel(): string
{
return match ($this) {
self::MONTHLY => __('enums.credit_product_type.monthly'),
self::ONE_TIME => __('enums.credit_product_type.one_time'),
};
}
public function getColor(): string
{
return match ($this) {
self::MONTHLY => 'info',
self::ONE_TIME => 'success',
};
}
}
+1 -4
View File
@@ -9,7 +9,6 @@ enum PaymentTransactionStatus: string implements HasColor, HasLabel
{
case PENDING = 'pending';
case PAID = 'paid';
case CREDITED = 'credited';
case FAILED = 'failed';
case IGNORED = 'ignored';
case ERROR = 'error';
@@ -19,7 +18,6 @@ enum PaymentTransactionStatus: string implements HasColor, HasLabel
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'),
@@ -30,8 +28,7 @@ enum PaymentTransactionStatus: string implements HasColor, HasLabel
{
return match ($this) {
self::PENDING => 'gray',
self::PAID => 'info',
self::CREDITED => 'success',
self::PAID => 'success',
self::FAILED, self::ERROR => 'danger',
self::IGNORED => 'warning',
};