Compare commits

..

6 Commits

Author SHA1 Message Date
d04637b1ef fix code 2026-05-18 14:10:45 +03:30
3c61e279ec create profile for expert 2026-05-18 13:59:05 +03:30
e9f6ee71fa create profile for expert 2026-05-18 13:58:20 +03:30
60129f5abb create profile for expert 2026-05-18 13:57:03 +03:30
2d8f2dbcc5 create profile for expert 2026-05-18 13:50:37 +03:30
86e353749a create profile for expert 2026-05-18 13:49:33 +03:30
148 changed files with 65 additions and 110 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

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

@@ -53,5 +53,4 @@ class ProfileController extends Controller
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

9
backend/app/Admin/Requests/Profile/EditRequest.php Normal file → Executable file
View File

@@ -4,6 +4,8 @@ namespace App\Admin\Requests\Profile;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Validator;
class EditRequest extends FormRequest
{
@@ -22,12 +24,13 @@ class EditRequest extends FormRequest
*/
public function rules(): array
{
$user = $this->user();
return [
'username' => 'string|max:255',
'first_name' => 'string',
'last_name' => 'string',
'first_name' => 'required|string',
'last_name' => 'required|string',
'national_id' => 'required',
'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

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

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

View File

@@ -10,6 +10,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Hash;
use Laravel\Passport\Bridge\Client;
use Laravel\Passport\HasApiTokens;
#[Guarded(['id'])]
@@ -24,4 +26,14 @@ class User extends Authenticatable
{
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

@@ -22,6 +22,8 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void
{
Passport::enablePasswordGrant();
Passport::tokensExpireIn(CarbonInterval::minutes(1));
Passport::refreshTokensExpireIn(CarbonInterval::minutes(5));
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
namespace App\User\Services\FIB;
namespace App\Services\FIB;
use Exception;
use Illuminate\Http\Client\ConnectionException;

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
<?php
namespace App\User\Services\FIB;
namespace App\Services\FIB;
use Exception;
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
{
//
}
}

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

@@ -24,17 +24,7 @@ class ProfileController extends Controller
{
$user = Auth::user();
$user->update([
'first_name' => $request->first_name,
'last_name' => $request->last_name,
'national_id' => $request->national_id,
'address' => $request->address,
'postal_code' => $request->postal_code,
'phone_number' => $request->phone_number,
'province_id' => $request->province_id,
'city_id' => $request->city_id,
'status' => 1
]);
$user->update($request->validated());
return $this->successResponse();
}

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

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

@@ -4,6 +4,8 @@ namespace App\User\Requests\Profile;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Validator;
class EditRequest extends FormRequest
{
@@ -22,10 +24,18 @@ class EditRequest extends FormRequest
*/
public function rules(): array
{
$user = $this->user();
return [
'first_name' => 'required|string',
'last_name' => 'required|string',
'national_id' => 'required',
'first_name' => [
Rule::prohibitedIf($user->kyc_status == 1), 'string',
],
'last_name' => [
Rule::prohibitedIf($user->kyc_status == 1), 'string',
],
'national_id' => [
Rule::prohibitedIf($user->kyc_status == 1), 'string',
],
'address' => 'required',
'postal_code' => 'required',
'phone_number' => 'required',
@@ -33,4 +43,28 @@ class EditRequest extends FormRequest
'city_id' => 'required',
];
}
public function after(): array
{
return [
function (Validator $validator) {
$user = $this->user();
if ($user->kyc_status == 1) {
$lockedFields = [
'first_name',
'last_name',
'national_id',
];
foreach ($lockedFields as $field) {
if ($this->filled($field)) {
$validator->errors()->add(
$field,
'you cannot change this field.'
);
}
}
}
},
];
}
}

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

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

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

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

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

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

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