Fix Laravel Pint formatting
This commit is contained in:
+33
-28
@@ -3,7 +3,6 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Models\BaseModel;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Refund extends BaseModel
|
||||
@@ -31,23 +30,24 @@ class Refund extends BaseModel
|
||||
'check_nbr',
|
||||
'check_file',
|
||||
];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
protected $casts = [
|
||||
'parent_id' => 'integer',
|
||||
'invoice_id' => 'integer',
|
||||
'approved_by' => 'integer',
|
||||
'updated_by' => 'integer',
|
||||
'parent_id' => 'integer',
|
||||
'invoice_id' => 'integer',
|
||||
'approved_by' => 'integer',
|
||||
'updated_by' => 'integer',
|
||||
|
||||
'refund_amount' => 'decimal:2',
|
||||
'refund_amount' => 'decimal:2',
|
||||
'refund_paid_amount' => 'decimal:2',
|
||||
|
||||
'requested_at' => 'datetime',
|
||||
'approved_at' => 'datetime',
|
||||
'refunded_at' => 'datetime',
|
||||
'requested_at' => 'datetime',
|
||||
'approved_at' => 'datetime',
|
||||
'refunded_at' => 'datetime',
|
||||
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
/* ============================================================
|
||||
@@ -56,10 +56,15 @@ class Refund extends BaseModel
|
||||
*/
|
||||
|
||||
public const STATUS_PENDING = 'Pending';
|
||||
|
||||
public const STATUS_APPROVED = 'Approved';
|
||||
|
||||
public const STATUS_PARTIAL = 'Partial';
|
||||
|
||||
public const STATUS_PAID = 'Paid';
|
||||
|
||||
public const STATUS_REJECTED = 'Rejected';
|
||||
|
||||
public const STATUS_CANCELED = 'Canceled';
|
||||
|
||||
public static function paidOutStatuses(): array
|
||||
@@ -139,18 +144,18 @@ class Refund extends BaseModel
|
||||
public static function rules(?int $id = null): array
|
||||
{
|
||||
return [
|
||||
'parent_id' => ['required', 'integer', 'min:1', 'exists:parents,id'], // adjust table name
|
||||
'school_year' => ['required', 'string', 'max:20'],
|
||||
'invoice_id' => ['nullable', 'integer', 'exists:invoices,id'],
|
||||
'parent_id' => ['required', 'integer', 'min:1', 'exists:parents,id'], // adjust table name
|
||||
'school_year' => ['required', 'string', 'max:20'],
|
||||
'invoice_id' => ['nullable', 'integer', 'exists:invoices,id'],
|
||||
|
||||
'refund_amount' => ['required', 'numeric', 'min:0'],
|
||||
'refund_amount' => ['required', 'numeric', 'min:0'],
|
||||
'refund_paid_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
|
||||
'requested_at' => ['nullable', 'date'],
|
||||
'approved_at' => ['nullable', 'date', 'after_or_equal:requested_at'],
|
||||
'refunded_at' => ['nullable', 'date', 'after_or_equal:approved_at'],
|
||||
'requested_at' => ['nullable', 'date'],
|
||||
'approved_at' => ['nullable', 'date', 'after_or_equal:requested_at'],
|
||||
'refunded_at' => ['nullable', 'date', 'after_or_equal:approved_at'],
|
||||
|
||||
'status' => ['required', 'string', 'in:' . implode(',', [
|
||||
'status' => ['required', 'string', 'in:'.implode(',', [
|
||||
self::STATUS_PENDING,
|
||||
self::STATUS_APPROVED,
|
||||
self::STATUS_PARTIAL,
|
||||
@@ -159,17 +164,17 @@ class Refund extends BaseModel
|
||||
self::STATUS_CANCELED,
|
||||
])],
|
||||
|
||||
'reason' => ['nullable', 'string', 'max:2000'],
|
||||
'request' => ['nullable', 'string'],
|
||||
'note' => ['nullable', 'string', 'max:5000'],
|
||||
'semester' => ['nullable', 'string', 'max:20'],
|
||||
'reason' => ['nullable', 'string', 'max:2000'],
|
||||
'request' => ['nullable', 'string'],
|
||||
'note' => ['nullable', 'string', 'max:5000'],
|
||||
'semester' => ['nullable', 'string', 'max:20'],
|
||||
|
||||
'approved_by' => ['nullable', 'integer'],
|
||||
'updated_by' => ['nullable', 'integer'],
|
||||
'approved_by' => ['nullable', 'integer'],
|
||||
'updated_by' => ['nullable', 'integer'],
|
||||
|
||||
'refund_method' => ['nullable', 'string', 'max:50'], // cash/check/cc/etc.
|
||||
'check_nbr' => ['nullable', 'string', 'max:80'],
|
||||
'check_file' => ['nullable', 'string', 'max:255'],
|
||||
'check_nbr' => ['nullable', 'string', 'max:80'],
|
||||
'check_file' => ['nullable', 'string', 'max:255'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user