test loan remaining

This commit is contained in:
2025-05-08 20:24:47 +05:00
parent a941dbc0bb
commit f51de7b2aa
3 changed files with 44 additions and 9 deletions

View File

@@ -2,7 +2,6 @@
namespace App\Http\Controllers;
use App\Modules\LoanRemainingOrder\Actions\FetchRemainingLoanFromBilling;
use App\Repos\System\Settings\Legal\PassportRepo;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -23,11 +22,42 @@ class FetchLoanRemainingController extends Controller
'account_number' => ['required', 'string', 'max:255'],
]);
$response = FetchRemainingLoanFromBilling::make()->handle(
passport_serie: $request->passport_serie,
passport_id: $request->passport_id,
account_number: $request->account_number,
);
$passport_serie = $request->passport_serie;
$passport_id = $request->passport_id;
$account_number = $request->account_number;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://10.3.158.102:9999/api/loaninfo',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => sprintf('
{
"idSeria": "%s",
"idNo": "%s",
"accountCode": "%s"
}
',
$passport_serie,
$passport_id,
$account_number,
),
CURLOPT_HTTPHEADER => [
'Authorization: Basic dGJ1c2VyOlFBWndzeDEyMw==',
'Content-Type: application/json',
],
]);
/** @var array<string, int|bool|null|string>|bool */
$response = curl_exec($curl);
curl_close($curl);
return response()->json($response);
}

View File

@@ -15,10 +15,10 @@ use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Hidden;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\MorphToMany;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Password;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Nurmuhammet\NovaInputmask\NovaInputmask;
/**
* @mixin \App\Models\User
@@ -119,8 +119,12 @@ class User extends Resource
->sortable()
->rules('required', 'max:255'),
Number::make(__('Phone'), 'phone')
->rules('required', 'integer', 'between:61000000,71999999', 'unique:users,phone'),
NovaInputmask::make(__('Phone'), 'phone')
->mask('+(\\9\\93)-99-99-99-99')
->storeRawValue()
->rules('required', 'integer', 'between:61000000, 71999999')
->creationRules('unique:users,phone')
->updateRules('unique:users,phone,{{resourceId}}'),
Text::make(__('Email'), 'email')
->sortable()

View File

@@ -206,6 +206,7 @@
"Use Proxy": "Proksi ulanyň",
"User": "Ulanyjy",
"Users": "Ulanyjylar",
"All users": "Ähli ulanyjylar",
"Variant Also Negotiates": "Wariant hem gepleşik geçirýär",
"Verify Phone Number": "Telefon beligiňizi tassyklaň",
"Phone verified": "Telefon tassyklanan",