浏览代码

Merge branch 'fix/diariaapp-gus-correcao-validacoes-dashboard' of Softpar/sfp_api_laravel_diarista into development

aprovado
zntt 3 周之前
父节点
当前提交
0c2fbb1d33

+ 1 - 0
app/Http/Requests/AddressRequest.php

@@ -26,6 +26,7 @@ class AddressRequest extends FormRequest
             'city_id' => 'nullable|integer|exists:cities,id',
             'state_id' => 'nullable|integer|exists:states,id',
             'address_type' => 'sometimes|in:home,commercial,other',
+            'is_primary' => 'sometimes|boolean',
         ];
 
         if ($this->isMethod('post')) {

+ 36 - 35
app/Http/Resources/AddressResource.php

@@ -7,39 +7,40 @@ use Illuminate\Http\Resources\Json\JsonResource;
 
 class AddressResource extends JsonResource
 {
-    /**
-     * Transform the resource into an array.
-     *
-     * @return array<string, mixed>
-     */
-    public function toArray(Request $request): array
-    {
-        return [
-            'id' => $this->id,
-            'source' => $this->source,
-            'source_id' => $this->source_id,
-            'zip_code' => $this->zip_code,
-            'address' => $this->address,
-            'number' => $this->number,
-            'district' => $this->district,
-            'has_complement' => $this->has_complement,
-            'complement' => $this->complement,
-            'nickname' => $this->nickname,
-            'instructions' => $this->instructions,
-            'city_id' => $this->city_id,
-            'state_id' => $this->state_id,
-            'address_full' => implode(', ', array_filter([
-                $this->address,
-                $this->number ? "nº {$this->number}" : null,
-                $this->district,
-                $this->city ? "{$this->city->name}/{$this->state?->code}" : null,
-            ])),
-            'city' => $this->whenLoaded('city'),
-            'state' => $this->whenLoaded('state'),
-            'address_type' => $this->address_type,
-            'created_at' => $this->created_at,
-            'updated_at' => $this->updated_at,
-            'deleted_at' => $this->deleted_at,
-        ];
-    }
+  /**
+   * Transform the resource into an array.
+   *
+   * @return array<string, mixed>
+   */
+  public function toArray(Request $request): array
+  {
+    return [
+      'id' => $this->id,
+      'source' => $this->source,
+      'source_id' => $this->source_id,
+      'zip_code' => $this->zip_code,
+      'address' => $this->address,
+      'number' => $this->number,
+      'district' => $this->district,
+      'has_complement' => $this->has_complement,
+      'complement' => $this->complement,
+      'nickname' => $this->nickname,
+      'instructions' => $this->instructions,
+      'is_primary' => $this->is_primary,
+      'city_id' => $this->city_id,
+      'state_id' => $this->state_id,
+      'address_full' => implode(', ', array_filter([
+        $this->address,
+        $this->number ? "nº {$this->number}" : null,
+        $this->district,
+        $this->city ? "{$this->city->name}/{$this->state?->code}" : null,
+      ])),
+      'city' => $this->whenLoaded('city'),
+      'state' => $this->whenLoaded('state'),
+      'address_type' => $this->address_type,
+      'created_at' => $this->created_at,
+      'updated_at' => $this->updated_at,
+      'deleted_at' => $this->deleted_at,
+    ];
+  }
 }

+ 8 - 1
app/Http/Resources/ClientFavoriteProviderResource.php

@@ -13,7 +13,14 @@ class ClientFavoriteProviderResource extends JsonResource
             'id' => $this->id,
             'client_id' => $this->client_id,
             'provider_id' => $this->provider_id,
-            'provider_name' => $this->provider->user->name ?? null,
+            'provider_name' => $this->provider_name ?? $this->provider?->user?->name,
+            'city_name' => $this->city_name ?? null,
+            'average_rating' => $this->average_rating ?? null,
+            'daily_price_8h' => $this->daily_price_8h ?? null,
+            'daily_price_6h' => $this->daily_price_6h ?? null,
+            'daily_price_4h' => $this->daily_price_4h ?? null,
+            'daily_price_2h' => $this->daily_price_2h ?? null,
+            'total_services' => $this->total_services ?? null,
             'notes' => $this->notes,
             'created_at' => $this->created_at?->format('Y-m-d H:i'),
             'updated_at' => $this->updated_at?->format('Y-m-d H:i'),

+ 2 - 0
app/Http/Resources/UserResource.php

@@ -29,6 +29,8 @@ class UserResource extends JsonResource
       'provider_daily_price_4h' => $this->provider?->daily_price_4h,
       'provider_daily_price_2h' => $this->provider?->daily_price_2h,
       'client_id' => $this->client?->id,
+      'provider' => $this->whenLoaded('provider'),
+      'client' => $this->whenLoaded('client'),
       'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i'),
       'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i'),
     ];

+ 2 - 0
app/Models/Address.php

@@ -24,10 +24,12 @@ class Address extends Model
         'city_id',
         'state_id',
         'address_type',
+        'is_primary',
     ];
 
     protected $casts = [
         'has_complement' => 'boolean',
+        'is_primary' => 'boolean',
         'created_at' => 'datetime',
         'updated_at' => 'datetime',
         'deleted_at' => 'datetime',

+ 1 - 1
app/Models/Schedule.php

@@ -43,7 +43,7 @@ class Schedule extends Model
 
     public function address()
     {
-        return $this->belongsTo(Address::class);
+        return $this->belongsTo(Address::class, 'address_id');
     }
 
     public function customSchedule()

+ 39 - 0
app/Rules/ScheduleBusinessRules.php

@@ -11,6 +11,7 @@ use App\Models\Schedule;
 use App\Models\ScheduleProposal;
 use Carbon\Carbon;
 use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Collection;
 
 class ScheduleBusinessRules
 {
@@ -279,4 +280,42 @@ class ScheduleBusinessRules
 
       return true;
     }
+
+    // -------------------------------------------------------------------------
+    // Métodos de consulta em batch — usados para filtragem em listagens.
+    // Não lançam exceção: retornam coleções de IDs para uso em whereIn/whereNotIn.
+    // -------------------------------------------------------------------------
+
+    /**
+     * Retorna os IDs de prestadores que bloquearam o cliente OU foram bloqueados por ele.
+     * Centraliza ambas as direções de bloqueio em um único método para uso em listagens.
+     *
+     * @param int $client_id
+     * @return Collection
+     */
+    public static function getBlockedProviderIdsForClient(int $client_id): Collection
+    {
+        // Prestadores que bloquearam este cliente (ProviderClientBlock)
+        $blockedByProvider = ProviderClientBlock::where('client_id', $client_id)
+            ->pluck('provider_id');
+
+        // Prestadores que este cliente bloqueou (ClientProviderBlock)
+        $blockedByClient = ClientProviderBlock::where('client_id', $client_id)
+            ->pluck('provider_id');
+
+        return $blockedByProvider->merge($blockedByClient)->unique()->values();
+    }
+
+    /**
+     * Retorna os IDs de prestadores que possuem pelo menos um dia de trabalho cadastrado.
+     * Garante que apenas prestadores ativos na plataforma apareçam em listagens.
+     *
+     * @return Collection
+     */
+    public static function getProviderIdsWithWorkingDays(): Collection
+    {
+        return ProviderWorkingDay::select('provider_id')
+            ->distinct()
+            ->pluck('provider_id');
+    }
 }

+ 11 - 0
app/Services/AddressService.php

@@ -5,6 +5,7 @@ namespace App\Services;
 use App\Http\Resources\AddressResource;
 use App\Models\Address;
 use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Support\Facades\Log;
 
 class AddressService
 {
@@ -13,6 +14,8 @@ class AddressService
         $allAddresses = Address::where('source', $data['source'])
             ->where('source_id', $data['source_id'])
             ->with(['city', 'state'])
+            ->whereNull('deleted_at')
+            ->orderBy('is_primary', 'desc')
             ->get();
 
         return $allAddresses;
@@ -32,6 +35,14 @@ class AddressService
     public function update(array $data, int $id): Address
     {
         $address = Address::findOrFail($id);
+
+        if (isset($data['is_primary']) && $data['is_primary']) {
+            Address::where('source', $address->source)
+                ->where('source_id', $address->source_id)
+                ->where('id', '!=', $id)
+                ->update(['is_primary' => false]);
+        }
+
         $address->fill($data);
         $address->save();
         return $address->fresh();

+ 28 - 6
app/Services/ClientFavoriteProviderService.php

@@ -4,18 +4,40 @@ namespace App\Services;
 
 use App\Models\ClientFavoriteProvider;
 use App\Http\Resources\ClientFavoriteProviderResource;
+use Illuminate\Database\Eloquent\Collection;
 use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
 
 class ClientFavoriteProviderService
 {
-    public function getByClientId(int $clientId): AnonymousResourceCollection
+    public function getByClientId(int $clientId): Collection
     {
-        $favorites = ClientFavoriteProvider::with('provider')
-            ->where('client_id', $clientId)
-            ->orderBy('created_at', 'desc')
+        return ClientFavoriteProvider::where('client_favorite_providers.client_id', $clientId)
+            ->leftJoin('providers', 'providers.id', '=', 'client_favorite_providers.provider_id')
+            ->leftJoin('users as provider_user', 'provider_user.id', '=', 'providers.user_id')
+            ->leftJoin('addresses as provider_address', function ($join) {
+                $join->on('provider_address.source_id', '=', 'providers.id')
+                    ->where('provider_address.source', 'provider')
+                    ->whereNull('provider_address.deleted_at');
+            })
+            ->leftJoin('cities', 'cities.id', '=', 'provider_address.city_id')
+            ->select(
+                'client_favorite_providers.id',
+                'client_favorite_providers.client_id',
+                'client_favorite_providers.provider_id',
+                'client_favorite_providers.notes',
+                'client_favorite_providers.created_at',
+                'client_favorite_providers.updated_at',
+                'provider_user.name as provider_name',
+                'providers.average_rating',
+                'providers.daily_price_8h',
+                'providers.daily_price_6h',
+                'providers.daily_price_4h',
+                'providers.daily_price_2h',
+                'providers.total_services',
+                'cities.name as city_name',
+            )
+            ->orderBy('client_favorite_providers.created_at', 'desc')
             ->get();
-
-        return ClientFavoriteProviderResource::collection($favorites);
     }
 
     public function getById(int $id): ClientFavoriteProviderResource

+ 76 - 46
app/Services/DashboardService.php

@@ -8,8 +8,10 @@ use App\Models\ClientFavoriteProvider;
 use App\Models\Provider;
 use App\Models\Review;
 use App\Models\Schedule;
+use App\Rules\ScheduleBusinessRules;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
 
 class DashboardService
 {
@@ -20,28 +22,37 @@ class DashboardService
     $user = Auth::user();
     $cliente = Client::where('user_id', $user->id)->first();
     $headerBar = [
-      'rating' => $cliente->average_rating,
-      'total_ratings' => Review::where('reviews.origin', 'provider')->leftJoin('schedules', 'schedules.id', '=', 'reviews.schedule_id')->where('schedules.client_id', $cliente->id)->count(),
+      'rating'        => $cliente->average_rating,
+      'total_ratings' => Review::where('reviews.origin', 'provider')
+        ->leftJoin('schedules', 'schedules.id', '=', 'reviews.schedule_id')
+        ->where('schedules.client_id', $cliente->id)
+        ->count(),
       'total_services' => $cliente->total_services,
     ];
 
+    $address = Address::where('source', 'client')
+      ->where('source_id', $cliente->id)
+      ->with(['city', 'state'])
+      ->first();
+
     $summaryInfos = [
-      'name' => $user->name,
-      'address' => Address::where('source', 'client')->where('source_id', $cliente->id)->with(['city', 'state'])->first(),
-      'pending_services' => Schedule::where('client_id', $cliente->id)->where('status', 'pending')->count(),
+      'name'             => $user->name,
+      'address'          => $address,
+      'pending_services' => Schedule::where('client_id', $cliente->id)
+        ->where('status', 'pending')
+        ->count(),
     ];
 
-    $nextSchedules = Schedule::where('schedules.client_id', $cliente->id)
+    $nextSchedules = Schedule::with('address:district,address,number,source_id,source,id,address_type')
+      ->where('schedules.client_id', $cliente->id)
       ->whereIn('schedules.status', ['accepted', 'paid'])
       ->leftJoin('providers', 'providers.id', '=', 'schedules.provider_id')
       ->leftJoin('users as provider_user', 'provider_user.id', '=', 'providers.user_id')
-      ->leftJoin('addresses as provider_address', function ($join) {
-        $join->on('provider_address.source_id', '=', 'providers.id')
-          ->where('provider_address.source', 'provider');
-      })
+      ->leftJoin('custom_schedules', 'custom_schedules.schedule_id', '=', 'schedules.id')
       ->where('schedules.date', '>=', now()->toDateString())
       ->select(
         'schedules.id',
+        'schedules.provider_id',
         'provider_user.name as provider_name',
         'schedules.date',
         'schedules.start_time',
@@ -49,8 +60,8 @@ class DashboardService
         'schedules.total_amount',
         'schedules.period_type',
         'schedules.schedule_type',
-        'provider_address.district',
-        'provider_address.address_type',
+        'schedules.address_id',
+        'custom_schedules.address_type as custom_address_type',
       )
       ->orderBy('schedules.date', 'asc')
       ->get();
@@ -59,56 +70,77 @@ class DashboardService
       ->where('schedules.status', 'finished')
       ->leftJoin('providers', 'providers.id', '=', 'schedules.provider_id')
       ->leftJoin('users as provider_user', 'provider_user.id', '=', 'providers.user_id')
-      ->leftJoin('addresses as provider_address', function ($join) {
-        $join->on('provider_address.source_id', '=', 'providers.id')
-          ->where('provider_address.source', 'provider');
-      })
       ->select(
         'schedules.id',
+        'schedules.provider_id',
         'provider_user.name as provider_name',
       )
       ->orderBy('schedules.date', 'desc')
       ->limit(5)
       ->get();
 
-    $favoriteProviders = ClientFavoriteProvider::where('client_id', $cliente->id)
+    $favoriteProviders = ClientFavoriteProvider::where('client_favorite_providers.client_id', $cliente->id)
       ->leftJoin('providers', 'providers.id', '=', 'client_favorite_providers.provider_id')
       ->leftJoin('users as provider_user', 'provider_user.id', '=', 'providers.user_id')
       ->select(
-        'providers.id',
+        'providers.id as provider_id',
         'provider_user.name as provider_name',
         'providers.average_rating',
+        'providers.daily_price_8h',
+        'providers.daily_price_6h',
+        'providers.daily_price_4h',
+        'providers.daily_price_2h',
       )
       ->get();
 
+    $blockedProviderIds       = ScheduleBusinessRules::getBlockedProviderIdsForClient($cliente->id);
+    $providersWithWorkingDays = ScheduleBusinessRules::getProviderIdsWithWorkingDays();
+
     $providersClose = Provider::leftJoin('users as provider_user', 'provider_user.id', '=', 'providers.user_id')
       ->leftJoin('addresses as provider_address', function ($join) {
         $join->on('provider_address.source_id', '=', 'providers.id')
           ->where('provider_address.source', 'provider');
       })
       ->leftJoin('addresses as client_address', function ($join) use ($cliente) {
-          $join->where('client_address.source_id', $cliente->id)
-              ->where('client_address.source', 'client');
+        $join->where('client_address.source_id', $cliente->id)
+          ->where('client_address.source', 'client');
       })
       ->whereColumn('provider_address.city_id', '=', 'client_address.city_id')
+      ->whereNotIn('providers.id', $blockedProviderIds)
+      ->whereIn('providers.id', $providersWithWorkingDays)
+      ->where(function ($query) {
+        $query->whereNotNull('providers.daily_price_8h')
+          ->orWhereNotNull('providers.daily_price_6h')
+          ->orWhereNotNull('providers.daily_price_4h')
+          ->orWhereNotNull('providers.daily_price_2h');
+      })
       ->select(
-        'providers.id',
+        'providers.id as provider_id',
         'provider_user.name as provider_name',
-        'provider_address.address_type', // refatorar para pegar o bairro
+        'provider_address.district',
         'providers.average_rating',
-        DB::raw("(SELECT COUNT(*) FROM reviews LEFT JOIN schedules ON schedules.id = reviews.schedule_id WHERE reviews.origin = 'provider' AND schedules.provider_id = providers.id) as total_reviews"),
+        DB::raw("(
+          SELECT COUNT(*)
+          FROM reviews
+          LEFT JOIN schedules ON schedules.id = reviews.schedule_id
+          WHERE reviews.origin = 'provider'
+          AND schedules.provider_id = providers.id
+        ) as total_reviews"),
         'providers.total_services',
         'providers.daily_price_8h',
+        'providers.daily_price_6h',
+        'providers.daily_price_4h',
+        'providers.daily_price_2h',
       )
       ->get();
 
     return [
-      'headerBar' => $headerBar,
-      'summaryInfos' => $summaryInfos,
-      'nextSchedules' => $nextSchedules,
+      'headerBar'        => $headerBar,
+      'summaryInfos'     => $summaryInfos,
+      'nextSchedules'    => $nextSchedules,
       'lastDoneSchedules' => $lastDoneSchedules,
       'favoriteProviders' => $favoriteProviders,
-      'providersClose' => $providersClose,
+      'providersClose'   => $providersClose,
     ];
   }
 
@@ -123,9 +155,10 @@ class DashboardService
       'total_services' => $provider->total_services,
     ];
 
+    $address = Address::where('source', 'provider')->where('source_id', $provider->id)->with(['city', 'state'])->first();
     $summaryInfos = [
       'name' => $user->name,
-      'address' => Address::where('source', 'provider')->where('source_id', $provider->id)->with(['city', 'state'])->first(),
+      'address' => $address,
       'pending_services' => Schedule::where('provider_id', $provider->id)->where('status', 'pending')->count(),
     ];
 
@@ -141,14 +174,11 @@ class DashboardService
       'your_price' => $priceActual,
     ];
 
-    $solicitations = Schedule::where('schedules.provider_id', $provider->id)
+    $solicitations = Schedule::with('address:district,source_id,source,id')
+      ->where('schedules.provider_id', $provider->id)
       ->where('schedules.status', 'pending')
       ->leftJoin('clients', 'clients.id', '=', 'schedules.client_id')
       ->leftJoin('users as client_user', 'client_user.id', '=', 'clients.user_id')
-      ->leftJoin('addresses as client_address', function ($join) {
-        $join->on('client_address.source_id', '=', 'clients.id')
-          ->where('client_address.source', 'client');
-      })
       ->select(
         'schedules.id',
         'client_user.name as client_name',
@@ -160,20 +190,21 @@ class DashboardService
         'schedules.total_amount',
         'schedules.period_type',
         'schedules.schedule_type',
-        'client_address.district',
+        'schedules.address_id',
+        DB::raw("CASE
+          WHEN (now() - schedules.created_at) < INTERVAL '1 day' THEN CONCAT(ROUND(EXTRACT(EPOCH FROM (now() - schedules.created_at)) / 3600), ' hours ago')
+          ELSE CONCAT(ROUND(EXTRACT(EPOCH FROM (now() - schedules.created_at)) / 86400), ' days ago')
+        END as time_since_request"),
       )
       ->orderBy('schedules.date', 'asc')
       ->get();
 
-    $nextSchedules = Schedule::where('schedules.provider_id', $provider->id)
+    $nextSchedules = Schedule::with('address:district,address,number,source_id,source,id')
+      ->where('schedules.provider_id', $provider->id)
       ->whereIn('schedules.status', ['accepted', 'paid'])
       ->leftJoin('clients', 'clients.id', '=', 'schedules.client_id')
       ->leftJoin('users as client_user', 'client_user.id', '=', 'clients.user_id')
       ->leftJoin('custom_schedules', 'custom_schedules.schedule_id', '=', 'schedules.id')
-      ->leftJoin('addresses as client_address', function ($join) {
-        $join->on('client_address.source_id', '=', 'clients.id')
-          ->where('client_address.source', 'client');
-      })
       ->select(
         'schedules.id',
         'client_user.name as client_name',
@@ -182,21 +213,19 @@ class DashboardService
         'schedules.end_time',
         'schedules.total_amount',
         'schedules.period_type',
+        'schedules.address_id',
         'schedules.schedule_type',
         'custom_schedules.offers_meal',
-        'client_address.district',
       )
       ->orderBy('schedules.date', 'asc')
       ->get();
 
-    $opportunities = Schedule::where('schedules.schedule_type', 'custom')
+    $opportunities = Schedule::with('address:district,source_id,source,id')
+      ->where('schedules.schedule_type', 'custom')
       ->where('schedules.status', 'pending')
       ->leftJoin('clients', 'clients.id', '=', 'schedules.client_id')
       ->leftJoin('users as client_user', 'client_user.id', '=', 'clients.user_id')
-      ->leftJoin('addresses as client_address', function ($join) {
-        $join->on('client_address.source_id', '=', 'clients.id')
-          ->where('client_address.source', 'client');
-      })
+      ->leftJoin('custom_schedules', 'custom_schedules.schedule_id', '=', 'schedules.id')
       ->select(
         'schedules.id',
         'client_user.name as client_name',
@@ -206,7 +235,8 @@ class DashboardService
         'schedules.end_time',
         'schedules.period_type',
         'schedules.schedule_type',
-        'client_address.district',
+        'schedules.address_id',
+        'custom_schedules.address_type'
       )
       ->orderBy('schedules.date', 'asc')
       ->get();

+ 40 - 40
app/Services/UserService.php

@@ -9,51 +9,51 @@ use Illuminate\Support\Facades\Auth;
 
 class UserService
 {
-    public function me(): ?User
-    {
-        return Auth::user();
+  public function me(): ?User
+  {
+    return User::with(['provider', 'client'])->find(Auth::id());
+  }
+
+  public function getAll(): Collection
+  {
+    return User::query()->orderBy("created_at", "desc")->get();
+  }
+
+  public function findById(int $id): ?User
+  {
+    return User::find($id);
+  }
+
+  public function create(array $data): User
+  {
+    return User::create($data);
+  }
+
+  public function update(int $id, array $data): ?User
+  {
+    $model = $this->findById($id);
+
+    if (!$model) {
+      return null;
     }
 
-    public function getAll(): Collection
-    {
-        return User::query()->orderBy("created_at", "desc")->get();
-    }
-
-    public function findById(int $id): ?User
-    {
-        return User::find($id);
-    }
-
-    public function create(array $data): User
-    {
-        return User::create($data);
-    }
+    $model->update($data);
+    return $model->fresh();
+  }
 
-    public function update(int $id, array $data): ?User
-    {
-        $model = $this->findById($id);
+  public function delete(int $id): bool
+  {
+    $model = $this->findById($id);
 
-        if (!$model) {
-            return null;
-        }
-
-        $model->update($data);
-        return $model->fresh();
+    if (!$model) {
+      return false;
     }
 
-    public function delete(int $id): bool
-    {
-        $model = $this->findById($id);
-
-        if (!$model) {
-            return false;
-        }
+    return $model->delete();
+  }
 
-        return $model->delete();
-    }
-
-    public function getUserTypes(): array
-    {
-        return UserTypeEnum::toArray();
-    }
+  public function getUserTypes(): array
+  {
+    return UserTypeEnum::toArray();
+  }
 }

+ 28 - 0
database/migrations/2026_03_27_151912_add_is_primary_to_addresses_table.php

@@ -0,0 +1,28 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     */
+    public function up(): void
+    {
+        Schema::table('addresses', function (Blueprint $table) {
+            $table->boolean('is_primary')->default(false)->after('address_type');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     */
+    public function down(): void
+    {
+        Schema::table('addresses', function (Blueprint $table) {
+            $table->dropColumn('is_primary');
+        });
+    }
+};

+ 2 - 0
database/seeders/UserTypePermissionSeeder.php

@@ -81,6 +81,8 @@ class UserTypePermissionSeeder extends Seeder
             ['scope' => 'config.address', 'bits' => 271],
             ['scope' => 'config.city', 'bits' => 1],
             ['scope' => 'config.provider_payment_method', 'bits' => 271],
+            ['scope' => 'config.client_favorite_provider', 'bits' => 271],
+            ['scope' => 'config.client_payment_method', 'bits' => 271],
           ];
           $this->seedUserTypePermissions($clientPermissions, UserTypeEnum::CLIENT->value);
           break;