first
This commit is contained in:
40
src/app/Http/Requests/ImportBulkPaymentRequest.php
Normal file
40
src/app/Http/Requests/ImportBulkPaymentRequest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ImportBulkPaymentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'file' => [
|
||||
'required',
|
||||
'file',
|
||||
'max:10240',
|
||||
function (string $attribute, mixed $value, \Closure $fail): void {
|
||||
$extension = strtolower((string) $value?->getClientOriginalExtension());
|
||||
|
||||
if (! in_array($extension, ['xlsx', 'xls', 'csv'], true)) {
|
||||
$fail('Format fail mestilah xlsx, xls atau csv.');
|
||||
}
|
||||
},
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'file.required' => 'Sila pilih fail Excel/CSV bayaran pukal untuk diproses.',
|
||||
'file.mimes' => 'Format fail mestilah xlsx, xls atau csv.',
|
||||
'file.max' => 'Saiz fail terlalu besar. Sila muat naik fail tidak melebihi 10MB.',
|
||||
];
|
||||
}
|
||||
}
|
||||
20
src/app/Http/Requests/ImportPropertyAccountRequest.php
Normal file
20
src/app/Http/Requests/ImportPropertyAccountRequest.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ImportPropertyAccountRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'file' => ['required', 'file', 'mimes:xlsx,xls,csv', 'max:10240'],
|
||||
];
|
||||
}
|
||||
}
|
||||
21
src/app/Http/Requests/LoginRequest.php
Normal file
21
src/app/Http/Requests/LoginRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoginRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => ['required', 'email'],
|
||||
'password' => ['required', 'string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
20
src/app/Http/Requests/LookupPropertyAccountRequest.php
Normal file
20
src/app/Http/Requests/LookupPropertyAccountRequest.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LookupPropertyAccountRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'no_akaun_tunggakan' => ['required', 'string', 'max:255'],
|
||||
];
|
||||
}
|
||||
}
|
||||
28
src/app/Http/Requests/ManageUserRequest.php
Normal file
28
src/app/Http/Requests/ManageUserRequest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class ManageUserRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
$userId = $this->route('user')?->id;
|
||||
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'email', Rule::unique('users', 'email')->ignore($userId)],
|
||||
'role_id' => ['required', 'exists:roles,id'],
|
||||
'department_id' => ['nullable', 'exists:departments,id'],
|
||||
'is_active' => ['nullable', 'boolean'],
|
||||
'password' => [$userId ? 'nullable' : 'required', 'string', 'min:8'],
|
||||
];
|
||||
}
|
||||
}
|
||||
21
src/app/Http/Requests/RegisterRequest.php
Normal file
21
src/app/Http/Requests/RegisterRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RegisterRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => ['required', 'email', 'max:255', 'unique:users,email'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
class ReviewInstallmentApplicationRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'action' => ['required', 'in:processing,active,cancel,failed,complete,none'],
|
||||
'total_arrears' => ['nullable', 'numeric', 'min:0'],
|
||||
'property_tax_half_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'staff_remarks' => ['nullable', 'string'],
|
||||
'schedules' => ['array'],
|
||||
'schedules.*.due_date' => ['nullable', 'date'],
|
||||
'schedules.*.amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'schedules.*.notes' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(function (Validator $validator): void {
|
||||
if (in_array($this->input('action'), ['cancel', 'failed'], true) && blank($this->input('staff_remarks'))) {
|
||||
$validator->errors()->add('staff_remarks', 'Ulasan staff wajib diisi apabila akaun dibatalkan atau disahkan gagal.');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
49
src/app/Http/Requests/StoreInstallmentApplicationRequest.php
Normal file
49
src/app/Http/Requests/StoreInstallmentApplicationRequest.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreInstallmentApplicationRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'property_account_id' => ['required', 'exists:property_accounts,id'],
|
||||
'no_akaun_tunggakan' => ['required', 'string'],
|
||||
'category' => ['required', 'string'],
|
||||
'installment_months' => ['required', 'integer', 'min:2', 'max:6'],
|
||||
'identification_type' => ['required', 'string'],
|
||||
'identification_number' => ['required', 'string'],
|
||||
'no_lot' => ['nullable', 'string', 'max:255'],
|
||||
'no_dhm' => ['nullable', 'string', 'max:255'],
|
||||
'no_syarikat' => ['nullable', 'string'],
|
||||
'alamat_harta' => ['required', 'string'],
|
||||
'alamat_surat_menyurat' => ['required', 'string'],
|
||||
'country_code' => ['required', 'string'],
|
||||
'mobile_no' => ['required', 'string'],
|
||||
'email' => ['required', 'email'],
|
||||
'alamat_tempat_bekerja' => ['nullable', 'string'],
|
||||
'pekerjaan' => ['nullable', 'string'],
|
||||
'pendapatan_sebulan' => ['nullable', 'numeric', 'min:0'],
|
||||
'declaration_name' => ['required', 'string', 'max:255'],
|
||||
'declaration_identification_type' => ['required', 'string'],
|
||||
'declaration_identification_number' => ['required', 'string'],
|
||||
'declaration_date' => ['required', 'date'],
|
||||
'declaration_accepted' => ['accepted'],
|
||||
'ic_attachment' => ['nullable', 'file', 'mimes:jpg,jpeg,png,pdf', 'max:4096'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'declaration_accepted.accepted' => 'Sila tandakan perakuan pemohon sebelum menghantar permohonan.',
|
||||
];
|
||||
}
|
||||
}
|
||||
34
src/app/Http/Requests/StoreManualPaymentRequest.php
Normal file
34
src/app/Http/Requests/StoreManualPaymentRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreManualPaymentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'installment_schedule_id' => ['required', 'integer', 'exists:installment_schedules,id'],
|
||||
'receipt_no' => ['required', 'string', 'max:255'],
|
||||
'transaction_no' => ['nullable', 'string', 'max:255', Rule::unique('payments', 'transaction_no')],
|
||||
'amount' => ['required', 'numeric', 'min:0.01'],
|
||||
'paid_at' => ['required', 'date'],
|
||||
'remarks' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'receipt_no.required' => 'No. resit wajib diisi untuk rekod bayaran manual.',
|
||||
'installment_schedule_id.required' => 'Sila pilih ansuran yang ingin direkodkan.',
|
||||
];
|
||||
}
|
||||
}
|
||||
23
src/app/Http/Requests/StorePaymentRequest.php
Normal file
23
src/app/Http/Requests/StorePaymentRequest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StorePaymentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'biller_code' => ['required', 'string'],
|
||||
'ref_1' => ['required', 'string'],
|
||||
'ref_2' => ['required', 'string'],
|
||||
'amount' => ['required', 'numeric', 'min:1'],
|
||||
];
|
||||
}
|
||||
}
|
||||
32
src/app/Http/Requests/StorePropertyAccountRequest.php
Normal file
32
src/app/Http/Requests/StorePropertyAccountRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StorePropertyAccountRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'no_akaun' => ['required', 'string', 'max:255'],
|
||||
'no_akaun_tunggakan' => ['required', 'string', 'max:255'],
|
||||
'no_bgnn' => ['nullable', 'string', 'max:255'],
|
||||
'nama_jalan' => ['nullable', 'string', 'max:255'],
|
||||
'pemilik' => ['required', 'string', 'max:255'],
|
||||
'bandar' => ['nullable', 'string', 'max:255'],
|
||||
'taman' => ['nullable', 'string', 'max:255'],
|
||||
'rupacara' => ['nullable', 'string', 'max:255'],
|
||||
'kadar' => ['nullable', 'string', 'max:255'],
|
||||
'cukai_harta' => ['nullable', 'numeric', 'min:0'],
|
||||
'tunggakan' => ['required', 'numeric', 'min:0'],
|
||||
'category' => ['nullable', 'string', 'max:255'],
|
||||
'alamat_harta' => ['nullable', 'string', 'max:500'],
|
||||
];
|
||||
}
|
||||
}
|
||||
31
src/app/Http/Requests/UpdateProfileRequest.php
Normal file
31
src/app/Http/Requests/UpdateProfileRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateProfileRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'email', Rule::unique('users', 'email')->ignore($this->user()?->id)],
|
||||
'public_name' => ['required', 'string', 'max:255'],
|
||||
'identification_type' => ['required', 'string'],
|
||||
'identification_number' => ['required', 'string', 'max:100'],
|
||||
'country_code' => ['required', 'string', 'max:10'],
|
||||
'mobile_no' => ['required', 'string', 'max:30'],
|
||||
'correspondence_address' => ['required', 'string', 'max:500'],
|
||||
'workplace_address' => ['nullable', 'string', 'max:500'],
|
||||
'occupation' => ['nullable', 'string', 'max:255'],
|
||||
'monthly_income' => ['nullable', 'numeric', 'min:0'],
|
||||
];
|
||||
}
|
||||
}
|
||||
21
src/app/Http/Requests/UpdateSystemSettingRequest.php
Normal file
21
src/app/Http/Requests/UpdateSystemSettingRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateSystemSettingRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'settings' => ['required', 'array'],
|
||||
'settings.*' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user