deploy commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class DoctorUpdateSubmissionRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'diagnosis' => ['required', Rule::in(['Melanoma', 'Bukan Melanoma'])],
|
||||
'doctorNote' => ['required','string'],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoginRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => ['required','email'],
|
||||
'password' => ['required'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PublicDetectionRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'image' => ['required','image','max:2048'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RegisterDoctorRequest extends FormRequest
|
||||
{
|
||||
public function authorize() { return true; }
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required','string'],
|
||||
'email' => ['required','email','unique:accounts,email'],
|
||||
'phone' => ['required','string','unique:accounts,phone'],
|
||||
'password' => ['required','string','min:8','confirmed'],
|
||||
|
||||
'practice_address' => ['required','string'],
|
||||
'specialization' => ['required','string'],
|
||||
'license_number' => ['required','string','unique:doctor_profiles,license_number'],
|
||||
'license_file' => ['required','file','mimes:pdf,jpg,png','max:4096'],
|
||||
'diploma_file' => ['required','file','mimes:pdf,jpg,png','max:4096'],
|
||||
'certification_file' => ['sometimes','file','mimes:pdf,jpg,png','max:5120'],
|
||||
'current_institution'=> ['required','string'],
|
||||
'work_history' => ['required','string'],
|
||||
'publications' => ['sometimes','string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class RegisterRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required','string'],
|
||||
'email' => ['required','email','unique:accounts,email'],
|
||||
'phone' => ['required','string','unique:accounts,phone'],
|
||||
'dob' => ['required','date'],
|
||||
'password' => ['required','min:6','confirmed'],
|
||||
//'role' => ['required', Rule::in(['patient','doctor'])],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreAccountRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required'],
|
||||
'email' => ['required', 'email'],
|
||||
'phone' => ['required'],
|
||||
'dob' => ['required'],
|
||||
'role' => ['required', Rule::in(['patient', 'doctor', 'admin'])],
|
||||
'password' => ['required'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreDoctorProfileRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => ['required'],
|
||||
'specialization' => ['required'],
|
||||
'license_number' => ['required'],
|
||||
'license_file_path' => ['required'],
|
||||
'diploma_file_path' => ['required'],
|
||||
'certification' => ['required'],
|
||||
'current_institution' => ['required'],
|
||||
//'years_of_experience' => ['required'],
|
||||
'work_history' => ['required'],
|
||||
'publications' => ['required'],
|
||||
'practice_address' => ['required'],
|
||||
];
|
||||
}
|
||||
|
||||
protected function prepareForValidation() {
|
||||
$data = [];
|
||||
|
||||
foreach ($this->validated() as $key => $obj) {
|
||||
$obj['user_id'] = $obj['userId'] ?? null;
|
||||
$obj['license_number'] = $obj['licenseNumber'] ?? null;
|
||||
$obj['license_file_path'] = $obj['licenseFilePath'] ?? null;
|
||||
$obj['diploma_file_path'] = $obj['diplomaFilePath'] ?? null;
|
||||
$obj['current_institution'] = $obj['currentInstitution'] ?? null;
|
||||
//$obj['years_of_experience'] = $obj['yearsOfExperience'] ?? null;
|
||||
$obj['work_history'] = $obj['workHistory'] ?? null;
|
||||
$data[] = $obj;
|
||||
}
|
||||
$this->merge($data);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreSubmissionRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'patient_id' => ['required', 'integer'],
|
||||
'doctor_id' => ['sometimes', 'integer'],
|
||||
'image' => ['required', 'image', 'max:2048'],
|
||||
'complaint' => ['sometimes', 'string'],
|
||||
'status' => ['sometimes', Rule::in(['pending','verified','rejected'])],
|
||||
'diagnosis' => ['sometimes','string'],
|
||||
'doctor_note'=> ['sometimes','string'],
|
||||
// 'submitted_at' => ['sometimes','date'],
|
||||
// 'verified_at' => ['sometimes','date'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreVerificationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateAccountRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$method = $this->method();
|
||||
if ($method == 'PUT') {
|
||||
return [
|
||||
'name' => ['required'],
|
||||
'email' => ['required', 'email'],
|
||||
'phone' => ['required'],
|
||||
'dob' => ['required'],
|
||||
'role' => ['required', Rule::in(['patient', 'doctor', 'admin'])],
|
||||
'password' => ['required'],
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
'name' => ['sometimes', 'required'],
|
||||
'email' => ['sometimes', 'required', 'email'],
|
||||
'phone' => ['sometimes', 'required'],
|
||||
'dob' => ['sometimes', 'required'],
|
||||
'role' => ['sometimes', 'required', Rule::in(['patient', 'doctor', 'admin'])],
|
||||
'password' => ['sometimes', 'required'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateDoctorProfileRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$method = $this->method();
|
||||
if ($method == 'PUT') {
|
||||
return [
|
||||
'userId' => ['required'],
|
||||
'specialization' => ['required'],
|
||||
'licenseNumber' => ['required'],
|
||||
'licenseFilePath' => ['required'],
|
||||
'diplomaFilePath' => ['required'],
|
||||
'certification' => ['required'],
|
||||
'currentInstitution' => ['required'],
|
||||
//'yearsOfExperience' => ['required'],
|
||||
'workHistory' => ['required'],
|
||||
'publications' => ['required']
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
'userId' => ['sometimes', 'required'],
|
||||
'specialization' => ['sometimes', 'required'],
|
||||
'licenseNumber' => ['sometimes', 'required'],
|
||||
'licenseFilePath' => ['sometimes', 'required'],
|
||||
'diplomaFilePath' => ['sometimes', 'required'],
|
||||
'certification' => ['sometimes', 'required'],
|
||||
'currentInstitution' => ['sometimes', 'required'],
|
||||
//'yearsOfExperience' => ['sometimes', 'required'],
|
||||
'workHistory' => ['sometimes', 'required'],
|
||||
'publications' => ['sometimes', 'required'],
|
||||
'practice_address' => ['sometimes', 'required'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
$data = $this->all();
|
||||
$data['user_id'] = $data['userId'] ?? $data['user_id'] ?? null;
|
||||
$data['license_number'] = $data['licenseNumber'] ?? $data['license_number'] ?? null;
|
||||
$data['license_file_path'] = $data['licenseFilePath'] ?? $data['license_file_path'] ?? null;
|
||||
$data['diploma_file_path'] = $data['diplomaFilePath'] ?? $data['diploma_file_path'] ?? null;
|
||||
$data['current_institution'] = $data['currentInstitution'] ?? $data['current_institution'] ?? null;
|
||||
//$data['years_of_experience'] = $data['yearsOfExperience'] ?? $data['years_of_experience'] ?? null;
|
||||
$data['work_history'] = $data['workHistory'] ?? $data['work_history'] ?? null;
|
||||
|
||||
$this->merge($data);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateSubmissionRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$method = $this->method();
|
||||
if ($method == 'PUT') {
|
||||
return [
|
||||
'doctorId' => ['required'],
|
||||
'status' => ['required', Rule::in(['pending', 'verified', 'rejected'])],
|
||||
'diagnosis' => ['required'],
|
||||
'doctorNote' => ['required'],
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
'doctorId' => ['required'],
|
||||
'status' => ['sometimes', 'required', Rule::in(['pending', 'verified', 'rejected'])],
|
||||
'diagnosis' => ['sometimes', 'required'],
|
||||
'doctorNote' => ['sometimes', 'required'],
|
||||
'complaint' => ['sometimes', 'required'],
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
$mapped = [];
|
||||
|
||||
if ($this->has('doctorId')) {
|
||||
$mapped['doctor_id'] = $this->input('doctorId');
|
||||
}
|
||||
if ($this->has('doctorNote')) {
|
||||
$mapped['doctor_note'] = $this->input('doctorNote');
|
||||
}
|
||||
if ($this->has('isSubmitted')) {
|
||||
$mapped['is_submitted'] = $this->input('isSubmitted');
|
||||
}
|
||||
|
||||
$this->merge($mapped);
|
||||
} */
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateVerificationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user