DONE: layout letter with letterhead and footer, notification for newly...
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AssignReferencesRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'proposer_id' => 'nullable|uuid|exists:users,id',
|
||||
'supporter_id' => 'nullable|uuid|exists:users,id',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'proposer_id.exists' => 'Pencadang tidak dijumpai.',
|
||||
'supporter_id.exists' => 'Penyokong tidak dijumpai.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class BatchCompleteRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'application_ids' => 'required|array|min:1|max:100',
|
||||
'application_ids.*' => 'required|uuid|distinct|exists:membership_applications,id',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'application_ids.required' => 'Senarai permohonan diperlukan.',
|
||||
'application_ids.min' => 'Sekurang-kurangnya satu permohonan diperlukan.',
|
||||
'application_ids.max' => 'Maksimum 100 permohonan setiap batch.',
|
||||
'application_ids.*.exists' => 'Salah satu permohonan tidak dijumpai.',
|
||||
'application_ids.*.distinct' => 'Permohonan duplikat tidak dibenarkan.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Modules\MembershipApplication\Enums\BoardDecision;
|
||||
|
||||
class BoardReviewRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'decision' => ['required', Rule::enum(BoardDecision::class)],
|
||||
'remarks' => 'nullable|string|max:1000',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'decision.required' => 'Keputusan diperlukan.',
|
||||
'decision.enum' => 'Keputusan tidak sah. Pilih PASS atau FAIL.',
|
||||
'remarks.max' => 'Catatan tidak boleh melebihi 1000 aksara.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LookupMemberRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'ic_number' => 'required|string|max:20',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'ic_number.required' => 'Nombor kad pengenalan diperlukan.',
|
||||
'ic_number.max' => 'Nombor kad pengenalan tidak sah.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Modules\MembershipApplication\Enums\ManagementDecision;
|
||||
|
||||
class ManagementReviewRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'decision' => ['required', Rule::enum(ManagementDecision::class)],
|
||||
'remarks' => 'nullable|string|max:1000',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'decision.required' => 'Keputusan diperlukan.',
|
||||
'decision.enum' => 'Keputusan tidak sah. Pilih APPROVED atau REJECTED.',
|
||||
'remarks.max' => 'Catatan tidak boleh melebihi 1000 aksara.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreMembershipApplicationRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'applicant.name' => 'required|string|max:255',
|
||||
'applicant.email' => 'required|email|max:255',
|
||||
'applicant.ic_number' => 'required|string|max:20',
|
||||
'applicant.birth_date' => 'required|date',
|
||||
'applicant.birth_place' => 'required|string|max:255',
|
||||
'applicant.gender' => ['required', Rule::in(['Lelaki', 'Perempuan'])],
|
||||
'applicant.marriage_status' => 'required|string|max:255',
|
||||
'applicant.address' => 'required|string',
|
||||
'applicant.phone_number' => 'required|string|max:20',
|
||||
'applicant.office_number' => 'nullable|string|max:20',
|
||||
'applicant.postcode' => 'required|string|max:10',
|
||||
'applicant.employer_name' => 'required|string|max:255',
|
||||
'applicant.employer_address' => 'required|string',
|
||||
'applicant.current_position' => 'required|string|max:255',
|
||||
'applicant.start_work_date' => 'required|date',
|
||||
'applicant.stock_monthly_contribution' => 'required|numeric|min:0',
|
||||
'applicant.fee_monthly_contribution' => 'required|numeric|min:0',
|
||||
|
||||
'heirs' => 'required|array|min:1',
|
||||
'heirs.*.name' => 'required|string|max:255',
|
||||
'heirs.*.ic_number' => 'required|string|max:20',
|
||||
'heirs.*.relationship' => 'required|string|max:255',
|
||||
'heirs.*.phone_number' => 'required|string|max:20',
|
||||
|
||||
'references.proposer_ic_number' => 'nullable|string|max:20',
|
||||
'references.supporter_ic_number' => 'nullable|string|max:20',
|
||||
|
||||
'documents.ic_copy' => 'required|file|mimes:pdf,jpg,jpeg,png|max:10240',
|
||||
'documents.photo' => 'nullable|file|mimes:jpg,jpeg,png|max:10240',
|
||||
'documents.salary_slip' => 'nullable|file|mimes:pdf,jpg,jpeg,png|max:10240',
|
||||
'documents.employer_letter' => 'nullable|file|mimes:pdf,jpg,jpeg,png|max:10240',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'applicant.name.required' => 'Nama penuh diperlukan.',
|
||||
'applicant.email.required' => 'Emel diperlukan.',
|
||||
'applicant.email.email' => 'Emel tidak sah.',
|
||||
'applicant.ic_number.required' => 'Nombor kad pengenalan diperlukan.',
|
||||
'applicant.birth_date.required' => 'Tarikh lahir diperlukan.',
|
||||
'applicant.birth_place.required' => 'Tempat lahir diperlukan.',
|
||||
'applicant.gender.required' => 'Jantina diperlukan.',
|
||||
'applicant.gender.in' => 'Jantina tidak sah.',
|
||||
'applicant.marriage_status.required' => 'Status perkahwinan diperlukan.',
|
||||
'applicant.address.required' => 'Alamat diperlukan.',
|
||||
'applicant.phone_number.required' => 'Nombor telefon diperlukan.',
|
||||
'applicant.postcode.required' => 'Poskod diperlukan.',
|
||||
'applicant.employer_name.required' => 'Nama majikan diperlukan.',
|
||||
'applicant.employer_address.required' => 'Alamat majikan diperlukan.',
|
||||
'applicant.current_position.required' => 'Jawatan semasa diperlukan.',
|
||||
'applicant.start_work_date.required' => 'Tarikh mula berkhidmat diperlukan.',
|
||||
'applicant.stock_monthly_contribution.required' => 'Caruman saham bulanan diperlukan.',
|
||||
'applicant.fee_monthly_contribution.required' => 'Caruman yuran bulanan diperlukan.',
|
||||
|
||||
'heirs.required' => 'Maklumat waris diperlukan.',
|
||||
'heirs.min' => 'Sekurang-kurangnya satu waris diperlukan.',
|
||||
'heirs.*.name.required' => 'Nama waris diperlukan.',
|
||||
'heirs.*.ic_number.required' => 'Nombor kad pengenalan waris diperlukan.',
|
||||
'heirs.*.relationship.required' => 'Hubungan waris diperlukan.',
|
||||
'heirs.*.phone_number.required' => 'Nombor telefon waris diperlukan.',
|
||||
|
||||
'references.proposer_ic_number.max' => 'Nombor kad pengenalan pencadang tidak sah.',
|
||||
'references.supporter_ic_number.max' => 'Nombor kad pengenalan penyokong tidak sah.',
|
||||
|
||||
'documents.ic_copy.required' => 'Salinan kad pengenalan diperlukan.',
|
||||
'documents.ic_copy.mimes' => 'Salinan kad pengenalan mestilah PDF, JPG, JPEG atau PNG.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateMembershipApplicationRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function validationData(): array
|
||||
{
|
||||
return $this->except(array_keys($this->route()?->parameters() ?? []));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'applicant' => 'sometimes|array',
|
||||
'applicant.name' => 'sometimes|required|string|max:255',
|
||||
'applicant.email' => 'sometimes|required|email|max:255',
|
||||
'applicant.ic_number' => 'sometimes|required|string|max:20',
|
||||
'applicant.birth_date' => 'sometimes|required|date',
|
||||
'applicant.birth_place' => 'sometimes|required|string|max:255',
|
||||
'applicant.gender' => ['sometimes', 'required', Rule::in(['Lelaki', 'Perempuan'])],
|
||||
'applicant.marriage_status' => 'sometimes|required|string|max:255',
|
||||
'applicant.address' => 'sometimes|required|string',
|
||||
'applicant.phone_number' => 'sometimes|required|string|max:20',
|
||||
'applicant.office_number' => 'nullable|string|max:20',
|
||||
'applicant.postcode' => 'sometimes|required|string|max:10',
|
||||
'applicant.employer_name' => 'sometimes|required|string|max:255',
|
||||
'applicant.employer_address' => 'sometimes|required|string',
|
||||
'applicant.current_position' => 'sometimes|required|string|max:255',
|
||||
'applicant.start_work_date' => 'sometimes|required|date',
|
||||
'applicant.stock_monthly_contribution' => 'sometimes|required|numeric|min:0',
|
||||
'applicant.fee_monthly_contribution' => 'sometimes|required|numeric|min:0',
|
||||
|
||||
'heirs' => 'sometimes|array|min:1',
|
||||
'heirs.*.name' => 'required|string|max:255',
|
||||
'heirs.*.ic_number' => 'required|string|max:20',
|
||||
'heirs.*.relationship' => 'required|string|max:255',
|
||||
'heirs.*.phone_number' => 'required|string|max:20',
|
||||
|
||||
'references' => 'sometimes|array',
|
||||
'references.proposer_ic_number' => 'nullable|string|max:20',
|
||||
'references.supporter_ic_number' => 'nullable|string|max:20',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'applicant.name.required' => 'Nama penuh diperlukan.',
|
||||
'applicant.email.required' => 'Emel diperlukan.',
|
||||
'applicant.email.email' => 'Emel tidak sah.',
|
||||
'applicant.ic_number.required' => 'Nombor kad pengenalan diperlukan.',
|
||||
'applicant.birth_date.required' => 'Tarikh lahir diperlukan.',
|
||||
'applicant.birth_place.required' => 'Tempat lahir diperlukan.',
|
||||
'applicant.gender.required' => 'Jantina diperlukan.',
|
||||
'applicant.gender.in' => 'Jantina tidak sah.',
|
||||
'applicant.marriage_status.required' => 'Status perkahwinan diperlukan.',
|
||||
'applicant.address.required' => 'Alamat diperlukan.',
|
||||
'applicant.phone_number.required' => 'Nombor telefon diperlukan.',
|
||||
'applicant.postcode.required' => 'Poskod diperlukan.',
|
||||
'applicant.employer_name.required' => 'Nama majikan diperlukan.',
|
||||
'applicant.employer_address.required' => 'Alamat majikan diperlukan.',
|
||||
'applicant.current_position.required' => 'Jawatan semasa diperlukan.',
|
||||
'applicant.start_work_date.required' => 'Tarikh mula berkhidmat diperlukan.',
|
||||
'applicant.stock_monthly_contribution.required' => 'Caruman saham bulanan diperlukan.',
|
||||
'applicant.fee_monthly_contribution.required' => 'Caruman yuran bulanan diperlukan.',
|
||||
|
||||
'heirs.min' => 'Sekurang-kurangnya satu waris diperlukan.',
|
||||
'heirs.*.name.required' => 'Nama waris diperlukan.',
|
||||
'heirs.*.ic_number.required' => 'Nombor kad pengenalan waris diperlukan.',
|
||||
'heirs.*.relationship.required' => 'Hubungan waris diperlukan.',
|
||||
'heirs.*.phone_number.required' => 'Nombor telefon waris diperlukan.',
|
||||
|
||||
'references.proposer_ic_number.max' => 'Nombor kad pengenalan pencadang tidak sah.',
|
||||
'references.supporter_ic_number.max' => 'Nombor kad pengenalan penyokong tidak sah.',
|
||||
];
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UploadMembershipApplicationDocumentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'type' => ['required', Rule::in(['ic_copy', 'photo', 'salary_slip', 'employer_letter'])],
|
||||
'file' => [
|
||||
'required',
|
||||
'file',
|
||||
'max:10240',
|
||||
Rule::when(
|
||||
$this->input('type') === 'photo',
|
||||
'mimes:jpg,jpeg,png',
|
||||
'mimes:pdf,jpg,jpeg,png',
|
||||
),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'type.required' => 'Jenis dokumen diperlukan.',
|
||||
'type.in' => 'Jenis dokumen tidak sah.',
|
||||
'file.required' => 'Fail diperlukan.',
|
||||
'file.mimes' => 'Format fail tidak disokong.',
|
||||
'file.max' => 'Saiz fail melebihi had maksimum 10MB.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user