Compare commits

..

3 Commits

Author SHA1 Message Date
85d3baa2c4 fix onfilixt 2026-05-17 15:15:17 +03:30
81401060b0 fix confilict 2026-05-17 14:48:07 +03:30
c994a3cbd0 create edit in profile controller foe expert and this dependency 2026-05-16 16:11:57 +03:30
174 changed files with 152 additions and 569 deletions

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

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

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

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

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

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

0
backend/Dockerfile Executable file → Normal file
View File

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

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

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

View File

View File

@@ -4,6 +4,7 @@ namespace App\Admin\Controllers;
use App\Admin\Requests\ExpertManagement\StoreRequest;
use App\Admin\Requests\ExpertManagement\UpdateRequest;
use App\Admin\Resources\ExpertManagementResource;
use App\Facades\DataTable\DataTableFacade;
use App\Http\Controllers\Controller;
use App\Models\City;

View File

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

@@ -3,6 +3,7 @@
namespace App\Admin\Controllers;
use App\Admin\Requests\Profile\ChangePasswordRequest;
use App\Admin\Requests\Profile\EditRequest;
use App\Admin\Resources\ExpertResource;
use App\Http\Controllers\Controller;
use App\Traits\ApiResponse;
@@ -19,6 +20,24 @@ class ProfileController extends Controller
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
{
$expert = Auth::guard('expert')->user();
@@ -34,4 +53,5 @@ class ProfileController extends Controller
return $this->successResponse();
}
}

View File

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

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

View File

View File

View File

View File

View File

View File

View File

@@ -1,11 +1,11 @@
<?php
namespace App\User\Requests\Gateway;
namespace App\Admin\Requests\Profile;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class UpdateRequest extends FormRequest
class EditRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
@@ -23,10 +23,14 @@ class UpdateRequest extends FormRequest
public function rules(): array
{
return [
'name' => 'required|string|max:255',
'domain' => 'required|string|max:255',
'business_type_id' => 'required|string|exists:business_types,id',
'logo' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'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 Executable file → Normal file
View File

View File

@@ -1,66 +0,0 @@
<?php
namespace App\Enums;
enum BusinessTypeEnum: int
{
case MEDICAL = 1;
case LEGAL = 2;
case ENGINEERING = 3;
case EDUCATION = 4;
case CONSULTING = 5;
case BEAUTY = 6;
case TECHNICAL_SERVICES = 7;
case FINANCIAL = 8;
case REAL_ESTATE = 9;
case RESTAURANT = 10;
case SHOP = 11;
case TRANSPORTATION = 12;
case ART = 13;
case SPORT = 14;
case OTHER = 15;
public function label(): string
{
return match ($this) {
self::MEDICAL => 'medical',
self::LEGAL => 'legal',
self::ENGINEERING => 'engineering',
self::EDUCATION => 'education',
self::CONSULTING => 'consulting',
self::BEAUTY => 'beauty',
self::TECHNICAL_SERVICES => 'technical_services',
self::FINANCIAL => 'financial',
self::REAL_ESTATE => 'real_estate',
self::RESTAURANT => 'restaurant',
self::SHOP => 'shop',
self::TRANSPORTATION => 'transportation',
self::ART => 'art',
self::SPORT => 'sport',
self::OTHER => 'other',
};
}
public function name($id): string
{
$mapArray = [
1 => 'medical',
2 => 'legal',
3 => 'engineering',
4 => 'education',
5 => 'consulting',
6 => 'beauty',
7 => 'technical_services',
8 => 'financial',
9 => 'real_estate',
10 => 'restaurant',
11 => 'shop',
12 => 'transportation',
13 => 'art',
14 => 'sport',
15 => 'other',
];
return $mapArray[$id];
}
}

View File

@@ -1,23 +0,0 @@
<?php
namespace App\Enums;
enum PaymentStatusEnum:int
{
case Unpaid = 0;
case Cancelled = 1;
case Expired = 2;
case Paid = 3;
case Refunded = 4;
public function label(): string
{
return match ($this) {
self::Unpaid => 'unpaid',
self::Cancelled => 'cancelled',
self::Expired => 'expired',
self::Paid => 'paid',
self::Refunded => 'refunded',
};
}
}

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

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

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

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

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

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

View File

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

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

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

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

View File

@@ -1,12 +0,0 @@
<?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

@@ -1,12 +0,0 @@
<?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;
}

View File

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

View File

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

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

View File

@@ -10,8 +10,6 @@ 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'])]
@@ -26,14 +24,4 @@ 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,8 +22,6 @@ 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 Executable file → Normal file
View File

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

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

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

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

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

View File

View File

View File

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

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

View File

View File

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

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

View File

View File

View File

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

View File

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

View File

@@ -0,0 +1,24 @@
<?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
{
//
}
}

View File

@@ -1,87 +0,0 @@
<?php
namespace App\User\Controllers;
use App\Enums\BusinessTypeEnum;
use App\Facades\DataTable\DataTableFacade;
use App\Facades\File\FileFacade;
use App\Http\Controllers\Controller;
use App\Models\UserGateway;
use App\Traits\ApiResponse;
use App\User\Requests\Gateway\StoreRequest;
use App\User\Requests\Gateway\UpdateRequest;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class GatewayManagementController extends Controller
{
use ApiResponse;
public function index(Request $request)
{
return DataTableFacade::run(
UserGateway::query()->where('user_id', '=', Auth::guard('web')->id()),
$request,
allowedFilters: ['*'],
allowedSortings: ['*'],
allowedSelects: ['id', 'name', 'domain', 'tax_id', 'bank_name', 'account_holder', 'iban', 'business_type_id', 'business_type_name'],
);
}
public function store(StoreRequest $request): JsonResponse
{
$user = Auth::guard('web')->user();
$logo = $request->has('logo') ? FileFacade::save($request->file('logo'), "{$user->id}") : null;
UserGateway::query()->create([
'user_id' => $user->id,
'username' => $user->username,
'name' => $request->name,
'domain' => $request->domain,
'tax_id' => $request->tax_id,
'bank_name' => $request->bank_name,
'account_holder' => $request->account_holder,
'iban' => $request->iban,
'business_type_id' => $request->business_type_id,
'business_type_name' => BusinessTypeEnum::name($request->business_type_id),
'logo' => $logo,
]);
return $this->successResponse();
}
public function show(UserGateway $gateway): JsonResponse
{
return $this->successResponse($gateway);
}
public function update(UpdateRequest $request, UserGateway $gateway): JsonResponse
{
$logo = null;
$user = Auth::guard('web')->user();
if ($request->has('logo'))
{
FileFacade::delete($gateway->logo, true);
$logo = FileFacade::save(request()->file('logo'), "{$user->id}");
}
$gateway->update([
'name' => $request->name,
'domain' => $request->domain,
'business_type_id' => $request->business_type_id,
'business_type_name' => BusinessTypeEnum::name($request->business_type_id),
'logo' => $logo,
]);
return $this->successResponse();
}
public function destroy(UserGateway $gateway): JsonResponse
{
$gateway->delete();
return $this->successResponse();
}
}

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

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

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

View File

@@ -1,36 +0,0 @@
<?php
namespace App\User\Requests\Gateway;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class StoreRequest 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 [
'name' => 'required|string|max:255',
'domain' => 'required|string|max:255',
'tax_id' => 'required|string',
'bank_name' => 'required|string|max:255',
'account_holder' => 'required|string',
'iban' => 'required|string|max:255',
'logo' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'business_type_id' => 'required|string|exists:business_types,id',
];
}
}

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

0
backend/artisan Executable file → Normal file
View File

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

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

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

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

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

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

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

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

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

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