fix gitlab tests
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Models\BaseModel;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Reimbursement extends BaseModel
|
||||
@@ -32,13 +33,13 @@ class Reimbursement extends BaseModel
|
||||
public $timestamps = true;
|
||||
|
||||
protected $casts = [
|
||||
'amount' => 'decimal:2',
|
||||
'expense_id' => 'integer',
|
||||
'approved_by' => 'integer',
|
||||
'added_by' => 'integer',
|
||||
'batch_number' => 'integer',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'amount' => 'decimal:2',
|
||||
'expense_id' => 'integer',
|
||||
'approved_by' => 'integer',
|
||||
'added_by' => 'integer',
|
||||
'batch_number' => 'integer',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
/* ============================================================
|
||||
@@ -46,15 +47,11 @@ class Reimbursement extends BaseModel
|
||||
* ============================================================
|
||||
*/
|
||||
|
||||
public const STATUS_DRAFT = 'draft';
|
||||
|
||||
public const STATUS_PENDING = 'pending';
|
||||
|
||||
public const STATUS_APPROVED = 'approved';
|
||||
|
||||
public const STATUS_DRAFT = 'draft';
|
||||
public const STATUS_PENDING = 'pending';
|
||||
public const STATUS_APPROVED = 'approved';
|
||||
public const STATUS_REIMBURSED = 'reimbursed';
|
||||
|
||||
public const STATUS_REJECTED = 'rejected';
|
||||
public const STATUS_REJECTED = 'rejected';
|
||||
|
||||
public static function allowedStatuses(): array
|
||||
{
|
||||
@@ -152,22 +149,22 @@ class Reimbursement extends BaseModel
|
||||
public static function rules(bool $updating = false): array
|
||||
{
|
||||
return [
|
||||
'amount' => [$updating ? 'sometimes' : 'required', 'numeric', 'min:0'],
|
||||
'reimbursed_to' => ['nullable', 'string', 'max:255'],
|
||||
'expense_id' => ['nullable', 'integer', 'exists:expenses,id'],
|
||||
'description' => ['nullable', 'string', 'max:5000'],
|
||||
'status' => ['nullable', 'string', 'in:'.implode(',', self::allowedStatuses())],
|
||||
'receipt_path' => ['nullable', 'string', 'max:255'],
|
||||
'amount' => [$updating ? 'sometimes' : 'required', 'numeric', 'min:0'],
|
||||
'reimbursed_to' => ['nullable', 'string', 'max:255'],
|
||||
'expense_id' => ['nullable', 'integer', 'exists:expenses,id'],
|
||||
'description' => ['nullable', 'string', 'max:5000'],
|
||||
'status' => ['nullable', 'string', 'in:' . implode(',', self::allowedStatuses())],
|
||||
'receipt_path' => ['nullable', 'string', 'max:255'],
|
||||
|
||||
'approved_by' => ['nullable', 'integer'],
|
||||
'added_by' => ['nullable', 'integer'],
|
||||
'approved_by' => ['nullable', 'integer'],
|
||||
'added_by' => ['nullable', 'integer'],
|
||||
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'semester' => ['nullable', 'string', 'max:20'],
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'semester' => ['nullable', 'string', 'max:20'],
|
||||
|
||||
'check_number' => ['nullable', 'string', 'max:80'],
|
||||
'check_number' => ['nullable', 'string', 'max:80'],
|
||||
'reimbursement_method' => ['nullable', 'string', 'max:50'],
|
||||
'batch_number' => ['nullable', 'integer', 'min:1'],
|
||||
'batch_number' => ['nullable', 'integer', 'min:1'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user