Compare commits

..

1 Commits

Author SHA1 Message Date
5ea986db40 separate any gateways 2026-05-18 14:34:28 +03:30
169 changed files with 313 additions and 179 deletions

0
backend/.dockerignore Normal file → Executable file
View File

0
backend/.editorconfig Normal file → Executable file
View File

0
backend/.env.example Normal file → Executable file
View File

0
backend/.gitattributes vendored Normal file → Executable file
View File

0
backend/.gitignore vendored Normal file → Executable file
View File

0
backend/.npmrc Normal file → Executable file
View File

0
backend/Dockerfile Normal file → Executable file
View File

0
backend/Dockerfile.production Normal file → Executable file
View File

0
backend/README.md Normal file → Executable file
View File

0
backend/app/Admin/Controllers/AuthController.php Normal file → Executable file
View File

View File

View File

View File

20
backend/app/Admin/Controllers/ProfileController.php Normal file → Executable file
View File

@@ -3,7 +3,6 @@
namespace App\Admin\Controllers; namespace App\Admin\Controllers;
use App\Admin\Requests\Profile\ChangePasswordRequest; use App\Admin\Requests\Profile\ChangePasswordRequest;
use App\Admin\Requests\Profile\EditRequest;
use App\Admin\Resources\ExpertResource; use App\Admin\Resources\ExpertResource;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Traits\ApiResponse; use App\Traits\ApiResponse;
@@ -20,24 +19,6 @@ class ProfileController extends Controller
return $this->successResponse(new ExpertResource(Auth::guard('expert')->user())); return $this->successResponse(new ExpertResource(Auth::guard('expert')->user()));
} }
public function edit(EditRequest $request): JsonResponse
{
$expert = $request->user('expert');
$expert->update([
'username' => $request->username,
'first_name' => $request->first_name,
'last_name' => $request->last_name,
'email' => $expert->email,
'national_id' => $request->national_id,
'phone_number' => $request->phone_number,
'province_id' => $request->province_id,
'city_id' => $request->city_id,
]);
return $this->successResponse();
}
public function changePassword(ChangePasswordRequest $request): JsonResponse public function changePassword(ChangePasswordRequest $request): JsonResponse
{ {
$expert = Auth::guard('expert')->user(); $expert = Auth::guard('expert')->user();
@@ -53,5 +34,4 @@ class ProfileController extends Controller
return $this->successResponse(); return $this->successResponse();
} }
} }

View File

0
backend/app/Admin/Requests/Auth/LoginRequest.php Normal file → Executable file
View File

0
backend/app/Admin/Requests/Auth/RegisterRequest.php Normal file → Executable file
View File

View File

View File

View File

View File

View File

View File

View File

@@ -1,36 +0,0 @@
<?php
namespace App\Admin\Requests\Profile;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class EditRequest 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, ValidationRule|array|string>
*/
public function rules(): array
{
return [
'username' => 'string|max:255',
'first_name' => 'string',
'last_name' => 'string',
'email' => 'string|email|max:255',
'national_id' => 'string',
'phone_number' => 'string',
'province_id' => 'string',
'city_id' => 'string',
];
}
}

View File

View File

View File

View File

0
backend/app/Admin/Resources/ExpertResource.php Normal file → Executable file
View File

0
backend/app/Facades/DataTable/DataTable.php Normal file → Executable file
View File

0
backend/app/Facades/DataTable/DataTableFacade.php Normal file → Executable file
View File

0
backend/app/Facades/File/File.php Normal file → Executable file
View File

0
backend/app/Facades/File/FileFacade.php Normal file → Executable file
View File

0
backend/app/Http/Controllers/Controller.php Normal file → Executable file
View File

0
backend/app/Mail/LoginNotificationMail.php Normal file → Executable file
View File

View File

@@ -2,13 +2,13 @@
namespace App\Models; namespace App\Models;
use Database\Factories\GatewayCategoryFactory; use Database\Factories\BusinessTypeFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class GatewayCategory extends Model class BusinessType extends Model
{ {
/** @use HasFactory<GatewayCategoryFactory> */ /** @use HasFactory<BusinessTypeFactory> */
use HasFactory; use HasFactory;
protected $guarded = ['id']; protected $guarded = ['id'];

0
backend/app/Models/City.php Normal file → Executable file
View File

0
backend/app/Models/Document.php Normal file → Executable file
View File

0
backend/app/Models/Expert.php Normal file → Executable file
View File

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class FibTransaction extends Model
{
/** @use HasFactory<\Database\Factories\FibTransactionFactory> */
use HasFactory;
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class FibTransactionStatus extends Model
{
/** @use HasFactory<\Database\Factories\FibTransactionStatusFactory> */
use HasFactory;
}

0
backend/app/Models/Province.php Normal file → Executable file
View File

View File

@@ -2,13 +2,13 @@
namespace App\Models; namespace App\Models;
use Database\Factories\GatewayFactory; use Database\Factories\TransactionFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class Gateway extends Model class Transaction extends Model
{ {
/** @use HasFactory<GatewayFactory> */ /** @use HasFactory<TransactionFactory> */
use HasFactory; use HasFactory;
protected $guarded = ['id']; protected $guarded = ['id'];

View File

@@ -10,6 +10,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\MorphToMany; use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Hash;
use Laravel\Passport\Bridge\Client;
use Laravel\Passport\HasApiTokens; use Laravel\Passport\HasApiTokens;
#[Guarded(['id'])] #[Guarded(['id'])]
@@ -24,4 +26,14 @@ class User extends Authenticatable
{ {
return $this->morphToMany(Document::class, 'documentable'); return $this->morphToMany(Document::class, 'documentable');
} }
public function validateForPassportPasswordGrant(string $password): bool
{
return Hash::check($password, $this->password);
}
public function findForPassport(string $username, Client $client): User
{
return $this->where('username', $username)->first();
}
} }

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Database\Factories\UserGatewayFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class UserGateway extends Model
{
/** @use HasFactory<UserGatewayFactory> */
use HasFactory;
protected $guarded = ['id'];
}

View File

@@ -22,6 +22,8 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void public function boot(): void
{ {
Passport::enablePasswordGrant(); Passport::enablePasswordGrant();
Passport::tokensExpireIn(CarbonInterval::minutes(1));
Passport::refreshTokensExpireIn(CarbonInterval::minutes(5));
Passport::personalAccessTokensExpireIn(CarbonInterval::minutes(1)); Passport::personalAccessTokensExpireIn(CarbonInterval::minutes(1));
} }
} }

0
backend/app/Providers/DataTableServiceProvider.php Normal file → Executable file
View File

0
backend/app/Providers/FileServiceProvider.php Normal file → Executable file
View File

0
backend/app/Services/DataTable/DataTableInput.php Normal file → Executable file
View File

0
backend/app/Services/DataTable/DataTableService.php Normal file → Executable file
View File

0
backend/app/Services/DataTable/Enums/DataType.php Normal file → Executable file
View File

0
backend/app/Services/DataTable/Enums/SearchType.php Normal file → Executable file
View File

View File

View File

View File

0
backend/app/Services/DataTable/Filter/ApplyFilter.php Normal file → Executable file
View File

0
backend/app/Services/DataTable/Filter/Filter.php Normal file → Executable file
View File

View File

View File

0
backend/app/Services/DataTable/Sort/ApplySort.php Normal file → Executable file
View File

0
backend/app/Services/DataTable/Sort/Sort.php Normal file → Executable file
View File

View File

View File

View File

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\User\Services\FIB; namespace App\Services\FIB;
use Exception; use Exception;
use Illuminate\Http\Client\ConnectionException; use Illuminate\Http\Client\ConnectionException;

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\User\Services\FIB; namespace App\Services\FIB;
use Exception; use Exception;
use Illuminate\Http\Client\ConnectionException; use Illuminate\Http\Client\ConnectionException;

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\User\Services\FIB; namespace App\Services\FIB;
use Exception; use Exception;
use Illuminate\Http\Client\ConnectionException; use Illuminate\Http\Client\ConnectionException;

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\User\Services\FIB; namespace App\Services\FIB;
use Exception; use Exception;
use Illuminate\Http\Client\ConnectionException; use Illuminate\Http\Client\ConnectionException;

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\User\Services\FIB; namespace App\Services\FIB;
use Exception; use Exception;
use Illuminate\Http\Client\ConnectionException; use Illuminate\Http\Client\ConnectionException;

0
backend/app/User/Controllers/AuthController.php Normal file → Executable file
View File

View File

@@ -1,14 +0,0 @@
<?php
namespace App\User\Controllers\Dashboard;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class ConfirmController extends Controller
{
public function index()
{
//
}
}

View File

@@ -1,24 +0,0 @@
<?php
namespace App\User\Controller\Dashboard;
use App\Http\Controllers\Controller;
use App\Traits\ApiResponse;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class DocumentationController extends Controller
{
use ApiResponse;
public function store(StoreRequest $request): jsonResponse
{
//
}
public function update(UpdateRequest $request): JsonResponse
{
//
}
}

0
backend/app/User/Controllers/ProfileController.php Normal file → Executable file
View File

0
backend/app/User/Requests/Auth/LoginRequest.php Normal file → Executable file
View File

0
backend/app/User/Requests/Auth/RegisterRequest.php Normal file → Executable file
View File

View File

0
backend/app/User/Requests/Profile/EditRequest.php Normal file → Executable file
View File

0
backend/app/User/Resources/UserResource.php Normal file → Executable file
View File

0
backend/artisan Normal file → Executable file
View File

0
backend/bootstrap/providers.php Normal file → Executable file
View File

0
backend/composer.json Normal file → Executable file
View File

0
backend/composer.lock generated Normal file → Executable file
View File

0
backend/config/app.php Normal file → Executable file
View File

0
backend/config/cache.php Normal file → Executable file
View File

0
backend/config/database.php Normal file → Executable file
View File

0
backend/config/fib.php Normal file → Executable file
View File

0
backend/config/filesystems.php Normal file → Executable file
View File

0
backend/config/logging.php Normal file → Executable file
View File

0
backend/config/mail.php Normal file → Executable file
View File

0
backend/config/passport.php Normal file → Executable file
View File

0
backend/config/permission.php Normal file → Executable file
View File

0
backend/config/queue.php Normal file → Executable file
View File

Some files were not shown because too many files have changed in this diff Show More