card orders done

This commit is contained in:
2025-06-11 18:05:30 +05:00
parent 10361e9422
commit 5dfce35a84
10 changed files with 522 additions and 10 deletions

View File

@@ -0,0 +1,166 @@
<?php
namespace App\Http\Controllers\Api\CardOrder\Requests;
use App\Repos\System\Settings\Legal\PassportRepo;
use App\Repos\System\Settings\Location\RegionRepo;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class CardOrderUpdateRequest 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 state id (https://online.tbbank.gov.tm/api/base-app-enums)
*/
'card_state_id' => ['sometimes', 'integer', Rule::exists('card_states', 'id')],
/**
* Card type id (https://online.tbbank.gov.tm/api/base-app-enums)
*/
'card_type_id' => ['sometimes', 'integer', Rule::exists('card_types', 'id')],
/**
* Region (https://online.tbbank.gov.tm/api/base-app-enums)
*
* @example ag
*/
'region' => ['sometimes', 'string', Rule::in(array_keys(RegionRepo::values()))],
/**
* Branch id (https://online.tbbank.gov.tm/api/branches)
*/
'branch_id' => ['sometimes', 'integer', Rule::exists('branches', 'id')],
/**
* Customer name
*
* @example Mahmyt
*/
'customer_name' => ['sometimes', 'string', 'max:255'],
/**
* Customer surname
*
* @example Allaberdiyev
*/
'customer_surname' => ['sometimes', 'string', 'max:255'],
/**
* Customer patronic name
*
* @example Öwezowiç
*/
'customer_patronic_name' => ['nullable', 'string', 'max:255'],
/**
* Date of birth
*
* @example 10.10.2000
*/
'born_at' => ['sometimes', 'before_or_equal:today'],
/**
* Old surname
*/
'old_surname' => ['nullable', 'string', 'max:255'],
/**
* Passport serie
*
* @example I-AS
*/
'passport_serie' => ['sometimes', 'string', Rule::in(PassportRepo::values())],
/**
* Passport number
*
* @example 100999
*/
'passport_id' => ['sometimes', 'numeric', 'digits:6'],
/**
* Passport date of issue
*
* @example 10.10.2020
*/
'passport_given_at' => ['sometimes', 'date', 'before_or_equal:today'],
/**
* Passport given by
*
* @example Ashgabat shaher polisiya tarapyndan
*/
'passport_given_by' => ['sometimes', 'string', 'max:255'],
/**
* Born place
*
* @example Ashgabat shaher
*/
'born_place' => ['sometimes', 'string', 'max:255'],
/**
* Işleýän ýeriňiz we wezipäňiz
*
* @example Aşgabat şäheriniň "TÜRKMENBAŞY" PAÝDARLAR TÄJIRÇILIK bankynyň Baş bugalteri
*/
'job_location' => ['sometimes', 'string', 'max:255'],
/**
* Passport address
*
* @example Kemine 100/190
*/
'passport_address' => ['sometimes', 'string', 'max:255'],
/**
* Real address
*
* @example Kemine 100/190
*/
'real_address' => ['sometimes', 'string', 'max:255'],
/**
* Phone number
*
* @example 65999990
*/
'phone' => ['sometimes', 'integer', 'between:61000000, 71999999'],
/**
* Phone number (additional)
*
* @example 65999990
*/
'phone_additional' => ['nullable', 'integer', 'between:61000000, 71999999'],
/**
* Passport (sahypa 1)
*/
'passport_one' => ['sometimes', 'file', 'max:2048', 'mimes:jpg,png,jpeg'],
/**
* Pasport (2-3-nji sahypa)
*/
'passport_two' => ['sometimes', 'file', 'max:2048', 'mimes:jpg,png,jpeg'],
/**
* Pasport (8-9 sahypa)
*/
'passport_three' => ['sometimes', 'file', 'max:2048', 'mimes:jpg,png,jpeg'],
/**
* Pasport (32-nji sahypa)
*/
'passport_four' => ['sometimes', 'file', 'max:2048', 'mimes:jpg,png,jpeg'],
];
}
}