Skip to content

Commit

Permalink
LP-10 registration request proof_of address required added
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 committed Nov 17, 2023
1 parent 71b97bc commit 4fcc284
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 65 deletions.
8 changes: 4 additions & 4 deletions config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@
'photo' => ['string', 'nullable'],
'documents' => ['array', 'required', 'min:1'],
'documents.*.type' => ['string', 'required'],
'documents.*.front' => ['string', 'required'],
'documents.*.back' => ['string', 'nullable'],
'documents.*.back' => ['string', 'required_without:documents.*.front'],
'documents.*.front' => ['string', 'required_without:documents.*.back'],
'proof_of_address' => ['array', 'required', 'min:1'],
'proof_of_address.*.type' => ['string', 'required'],
'proof_of_address.*.front' => ['string', 'required'],
'proof_of_address.*.back' => ['string', 'nullable'],
'proof_of_address.*.back' => ['string', 'required_without:proof_of_address.*.front'],
'proof_of_address.*.front' => ['string', 'required_without:proof_of_address.*.back'],
'date_of_birth' => ['date', 'nullable'],
'permanent_address' => ['string', 'nullable'],
'city_id' => ['integer', 'nullable'],
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __invoke(RegistrationRequest $request): JsonResponse

$profile = Auth::profile()->create($user->getKey(), $request->except($userFields));

// event(new Registered($user));
event(new Registered($user));

return $this->created('Registration Successful.');

Expand Down
86 changes: 43 additions & 43 deletions src/Http/Requests/RegistrationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,50 +23,50 @@ public function authorize(): bool
public function rules(): array
{
$rules = config('fintech.auth.register_rules', [
//user
'name' => ['required', 'string', 'min:2', 'max:255'],
'mobile' => ['required', 'string', 'min:10'],
'email' => ['required', 'string', 'email:rfc,dns', 'min:2', 'max:255'],
'pin' => ['required', 'string', 'min:4', 'max:16'],
'app_version' => ['nullable', 'string'],
'fcm_token' => ['nullable', 'string'],
'language' => ['nullable', 'string'],
'currency' => ['nullable', 'string'],
//user
'name' => ['required', 'string', 'min:2', 'max:255'],
'mobile' => ['required', 'string', 'min:10'],
'email' => ['required', 'string', 'email:rfc,dns', 'min:2', 'max:255'],
'pin' => ['required', 'string', 'min:4', 'max:16'],
'app_version' => ['nullable', 'string'],
'fcm_token' => ['nullable', 'string'],
'language' => ['nullable', 'string'],
'currency' => ['nullable', 'string'],

//profile
'father_name' => ['string', 'nullable'],
'mother_name' => ['string', 'nullable'],
'gender' => ['string', 'nullable'],
'marital_status' => ['string', 'nullable'],
'occupation' => ['string', 'nullable'],
'source_of_income' => ['string', 'nullable'],
'id_type' => ['string', 'nullable'],
'id_no' => ['string', 'nullable'],
'id_issue_country' => ['string', 'nullable'],
'id_expired_at' => ['string', 'nullable'],
'id_issue_at' => ['string', 'nullable'],
'photo' => ['string', 'nullable'],
'documents' => ['array', 'required', 'min:1'],
'documents.*.type' => ['string', 'required'],
'documents.*.front' => ['string', 'required'],
'documents.*.back' => ['string', 'nullable'],
'proof_of_address' => ['array', 'required', 'min:1'],
'proof_of_address.*.type' => ['string', 'required'],
'proof_of_address.*.front' => ['string', 'required'],
'proof_of_address.*.back' => ['string', 'nullable'],
'date_of_birth' => ['date', 'nullable'],
'permanent_address' => ['string', 'nullable'],
'city_id' => ['integer', 'nullable'],
'state_id' => ['integer', 'nullable'],
'country_id' => ['integer', 'nullable'],
'post_code' => ['string', 'nullable'],
'present_address' => ['string', 'nullable'],
'present_city_id' => ['integer', 'nullable'],
'present_state_id' => ['integer', 'nullable'],
'present_country_id' => ['integer', 'nullable'],
'present_post_code' => ['string', 'nullable'],
'nationality' => ['string', 'nullable'],
]);
//profile
'father_name' => ['string', 'nullable'],
'mother_name' => ['string', 'nullable'],
'gender' => ['string', 'nullable'],
'marital_status' => ['string', 'nullable'],
'occupation' => ['string', 'nullable'],
'source_of_income' => ['string', 'nullable'],
'id_type' => ['string', 'nullable'],
'id_no' => ['string', 'nullable'],
'id_issue_country' => ['string', 'nullable'],
'id_expired_at' => ['string', 'nullable'],
'id_issue_at' => ['string', 'nullable'],
'photo' => ['string', 'nullable'],
'documents' => ['array', 'required', 'min:1'],
'documents.*.type' => ['string', 'required'],
'documents.*.back' => ['string', 'required_without:documents.*.front'],
'documents.*.front' => ['string', 'required_without:documents.*.back'],
'proof_of_address' => ['array', 'required', 'min:1'],
'proof_of_address.*.type' => ['string', 'required'],
'proof_of_address.*.front' => ['string', 'required_without:proof_of_address.*.back'],
'proof_of_address.*.back' => ['string', 'required_without:proof_of_address.*.front'],
'date_of_birth' => ['date', 'nullable'],
'permanent_address' => ['string', 'nullable'],
'city_id' => ['integer', 'nullable'],
'state_id' => ['integer', 'nullable'],
'country_id' => ['integer', 'nullable'],
'post_code' => ['string', 'nullable'],
'present_address' => ['string', 'nullable'],
'present_city_id' => ['integer', 'nullable'],
'present_state_id' => ['integer', 'nullable'],
'present_country_id' => ['integer', 'nullable'],
'present_post_code' => ['string', 'nullable'],
'nationality' => ['string', 'nullable'],
]);

$rules[config('fintech.auth.auth_field', 'login_id')] = config('fintech.auth.auth_field_rules', ['required', 'string', 'min:6', 'max:255']);

Expand Down
12 changes: 6 additions & 6 deletions src/Http/Requests/StoreUserRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function authorize(): bool
*/
public function rules(): array
{
$rules = [
$rules = config('fintech.auth.register_rules', [
//user
'name' => ['required', 'string', 'min:2', 'max:255'],
'mobile' => ['required', 'string', 'min:10'],
Expand All @@ -48,12 +48,12 @@ public function rules(): array
'photo' => ['string', 'nullable'],
'documents' => ['array', 'required', 'min:1'],
'documents.*.type' => ['string', 'required'],
'documents.*.front' => ['string', 'required'],
'documents.*.back' => ['string', 'nullable'],
'documents.*.back' => ['string', 'required_without:documents.*.front'],
'documents.*.front' => ['string', 'required_without:documents.*.back'],
'proof_of_address' => ['array', 'required', 'min:1'],
'proof_of_address.*.type' => ['string', 'required'],
'proof_of_address.*.front' => ['string', 'required'],
'proof_of_address.*.back' => ['string', 'nullable'],
'proof_of_address.*.front' => ['string', 'required_without:proof_of_address.*.back'],
'proof_of_address.*.back' => ['string', 'required_without:proof_of_address.*.front'],
'date_of_birth' => ['date', 'nullable'],
'permanent_address' => ['string', 'nullable'],
'city_id' => ['integer', 'nullable'],
Expand All @@ -66,7 +66,7 @@ public function rules(): array
'present_country_id' => ['integer', 'nullable'],
'present_post_code' => ['string', 'nullable'],
'nationality' => ['string', 'nullable'],
];
]);

$rules[config('fintech.auth.auth_field', 'login_id')] = config('fintech.auth.auth_field_rules', ['required', 'string', 'min:6', 'max:255']);

Expand Down
25 changes: 14 additions & 11 deletions src/Http/Requests/UpdateUserRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public function authorize(): bool
*/
public function rules(): array
{
$rules = [
$rules = config('fintech.auth.register_rules', [
//user
'name' => ['required', 'string', 'min:2', 'max:255'],
'mobile' => ['required', 'string', 'min:10'],
'email' => ['required', 'string', 'email:rfc,dns', 'min:2', 'max:255'],
'pin' => ['nullable', 'string', 'min:4', 'max:16'],
'pin' => ['required', 'string', 'min:4', 'max:16'],
'app_version' => ['nullable', 'string'],
'fcm_token' => ['nullable', 'string'],
'language' => ['nullable', 'string'],
Expand All @@ -46,14 +46,14 @@ public function rules(): array
'id_expired_at' => ['string', 'nullable'],
'id_issue_at' => ['string', 'nullable'],
'photo' => ['string', 'nullable'],
'documents' => ['array', 'nullable', 'min:1'],
'documents' => ['array', 'required', 'min:1'],
'documents.*.type' => ['string', 'required'],
'documents.*.front' => ['string', 'required'],
'documents.*.back' => ['string', 'nullable'],
'proof_of_address' => ['array', 'nullable', 'min:1'],
'documents.*.back' => ['string', 'required_without:documents.*.front'],
'documents.*.front' => ['string', 'required_without:documents.*.back'],
'proof_of_address' => ['array', 'required', 'min:1'],
'proof_of_address.*.type' => ['string', 'required'],
'proof_of_address.*.front' => ['string', 'required'],
'proof_of_address.*.back' => ['string', 'nullable'],
'proof_of_address.*.back' => ['string', 'required_without:proof_of_address.*.front'],
'proof_of_address.*.front' => ['string', 'required_without:proof_of_address.*.back'],
'date_of_birth' => ['date', 'nullable'],
'permanent_address' => ['string', 'nullable'],
'city_id' => ['integer', 'nullable'],
Expand All @@ -66,13 +66,16 @@ public function rules(): array
'present_country_id' => ['integer', 'nullable'],
'present_post_code' => ['string', 'nullable'],
'nationality' => ['string', 'nullable'],
'roles' => ['array', 'required'],
'roles.*' => ['integer', 'required'],
];
]);

$rules[config('fintech.auth.auth_field', 'login_id')] = config('fintech.auth.auth_field_rules', ['required', 'string', 'min:6', 'max:255']);

$rules[config('fintech.auth.password_field', 'password')] = ['nullable', ...config('fintech.auth.password_field_rules', ['string', Password::default()])];

$rules['roles'] = ['array', 'required'];

$rules['roles.*'] = ['integer', 'required'];

return $rules;
}

Expand Down

0 comments on commit 4fcc284

Please sign in to comment.