wip
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\CardRequisite\Requests;
|
||||
|
||||
use App\Modules\DateHelper\Repositories\DateHelperRepository;
|
||||
use App\Repos\System\Settings\Legal\PassportRepo;
|
||||
use App\Repos\System\Settings\Location\RegionRepo;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class CardRequisiteStoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<int, string>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
/**
|
||||
* Card type id (https://online.tbbank.gov.tm/api/base-app-enums)
|
||||
*/
|
||||
'card_type_id' => ['required', 'integer', Rule::exists('card_types', 'id')],
|
||||
|
||||
/**
|
||||
* @example 9934612100000243
|
||||
*/
|
||||
'card_number' => ['required', 'digits:16'],
|
||||
|
||||
/**
|
||||
* @example 12
|
||||
*/
|
||||
'card_month' => ['required', Rule::in(array_keys(DateHelperRepository::staticNumberMonths()))],
|
||||
|
||||
/**
|
||||
* @example 2049
|
||||
*/
|
||||
'card_year' => ['required', Rule::in(array_keys(DateHelperRepository::staticNumberYears()))],
|
||||
|
||||
/**
|
||||
* Region (https://online.tbbank.gov.tm/api/base-app-enums)
|
||||
*
|
||||
* @example ag
|
||||
*/
|
||||
'region' => ['required', 'string', Rule::in(array_keys(RegionRepo::values()))],
|
||||
|
||||
/**
|
||||
* Branch id (https://online.tbbank.gov.tm/api/branches)
|
||||
*/
|
||||
'branch_id' => ['required', 'integer', Rule::exists('branches', 'id')],
|
||||
|
||||
/**
|
||||
* Customer name
|
||||
*
|
||||
* @example Mahmyt
|
||||
*/
|
||||
'customer_name' => ['required', 'string', 'max:255'],
|
||||
|
||||
/**
|
||||
* Customer surname
|
||||
*
|
||||
* @example Allaberdiyev
|
||||
*/
|
||||
'customer_surname' => ['required', 'string', 'max:255'],
|
||||
|
||||
/**
|
||||
* Customer patronic name
|
||||
*
|
||||
* @example Öwezowiç
|
||||
*/
|
||||
'customer_patronic_name' => ['nullable', 'string', 'max:255'],
|
||||
|
||||
/**
|
||||
* Date of birth
|
||||
*
|
||||
* @example 10.10.2000
|
||||
*/
|
||||
'born_at' => ['required', 'before_or_equal:today'],
|
||||
|
||||
/**
|
||||
* Phone number
|
||||
*
|
||||
* @example 65999990
|
||||
*/
|
||||
'phone' => ['required', 'integer', 'between:61000000, 71999999'],
|
||||
/**
|
||||
* Passport serie
|
||||
*
|
||||
* @example I-AS
|
||||
*/
|
||||
'passport_serie' => ['required', Rule::in(array_keys(PassportRepo::values()))],
|
||||
|
||||
/**
|
||||
* @example 379514
|
||||
*/
|
||||
'passport_id' => ['required', 'numeric', 'digits:6'],
|
||||
|
||||
/**
|
||||
* Passport (sahypa 1)
|
||||
*/
|
||||
'passport_one' => ['required', 'file', 'max:2048', 'mimes:jpg,png,jpeg'],
|
||||
|
||||
/**
|
||||
* Pasport (2-3-nji sahypa)
|
||||
*/
|
||||
'passport_two' => ['required', 'file', 'max:2048', 'mimes:jpg,png,jpeg'],
|
||||
|
||||
/**
|
||||
* Pasport (8-9 sahypa)
|
||||
*/
|
||||
'passport_three' => ['required', 'file', 'max:2048', 'mimes:jpg,png,jpeg'],
|
||||
|
||||
/**
|
||||
* Pasport (32-nji sahypa)
|
||||
*/
|
||||
'passport_four' => ['required', 'file', 'max:2048', 'mimes:jpg,png,jpeg'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user