feat: implement deposit request validation and transaction API, refactor client routes, and update transaction schema.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum TransactionStatus: int
|
||||
{
|
||||
case PENDING = 0;
|
||||
case COMPLETED = 1;
|
||||
case FAILED = 2;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::PENDING => 'Chờ xử lý',
|
||||
self::COMPLETED => 'Thành công',
|
||||
self::FAILED => 'Thất bại',
|
||||
};
|
||||
}
|
||||
|
||||
public static function getOptions(): array
|
||||
{
|
||||
return [
|
||||
self::PENDING->value => self::PENDING->label(),
|
||||
self::COMPLETED->value => self::COMPLETED->label(),
|
||||
self::FAILED->value => self::FAILED->label(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user