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;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
@@ -29,11 +30,11 @@ class ReimbursementBatch extends BaseModel
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'created_by' => 'integer',
|
||||
'closed_by' => 'integer',
|
||||
'created_by' => 'integer',
|
||||
'closed_by' => 'integer',
|
||||
'yearly_batch_number' => 'integer',
|
||||
'opened_at' => 'datetime',
|
||||
'closed_at' => 'datetime',
|
||||
'opened_at' => 'datetime',
|
||||
'closed_at' => 'datetime',
|
||||
];
|
||||
|
||||
/* ============================================================
|
||||
@@ -41,11 +42,9 @@ class ReimbursementBatch extends BaseModel
|
||||
* ============================================================
|
||||
*/
|
||||
|
||||
public const STATUS_OPEN = 'open';
|
||||
|
||||
public const STATUS_OPEN = 'open';
|
||||
public const STATUS_CLOSED = 'closed';
|
||||
|
||||
public const STATUS_DRAFT = 'draft';
|
||||
public const STATUS_DRAFT = 'draft';
|
||||
|
||||
public static function allowedStatuses(): array
|
||||
{
|
||||
@@ -156,16 +155,16 @@ class ReimbursementBatch extends BaseModel
|
||||
public static function rules(?int $id = null): array
|
||||
{
|
||||
return [
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'status' => ['required', 'string', 'in:'.implode(',', self::allowedStatuses())],
|
||||
'created_by' => ['nullable', 'integer'],
|
||||
'closed_by' => ['nullable', 'integer'],
|
||||
'opened_at' => ['nullable', 'date'],
|
||||
'closed_at' => ['nullable', 'date', 'after_or_equal:opened_at'],
|
||||
'notes' => ['nullable', 'string', 'max:5000'],
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'semester' => ['nullable', 'string', 'max:20'],
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'status' => ['required', 'string', 'in:' . implode(',', self::allowedStatuses())],
|
||||
'created_by' => ['nullable', 'integer'],
|
||||
'closed_by' => ['nullable', 'integer'],
|
||||
'opened_at' => ['nullable', 'date'],
|
||||
'closed_at' => ['nullable', 'date', 'after_or_equal:opened_at'],
|
||||
'notes' => ['nullable', 'string', 'max:5000'],
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'semester' => ['nullable', 'string', 'max:20'],
|
||||
'yearly_batch_number' => ['nullable', 'integer', 'min:1'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user