diff --git a/app/Domain/Integrations/Models/IntegrationModel.php b/app/Domain/Integrations/Models/IntegrationModel.php index bb7364786..f9305ab58 100644 --- a/app/Domain/Integrations/Models/IntegrationModel.php +++ b/app/Domain/Integrations/Models/IntegrationModel.php @@ -191,11 +191,11 @@ public function keyVisibilityUpgrade(): HasOne } /** - * @return HasMany + * @return HasMany */ public function organizers(): HasMany { - return $this->hasMany(UiTdatabankOrganizerModel::class, 'integration_id'); + return $this->hasMany(OrganizerModel::class, 'integration_id'); } /** @@ -353,7 +353,7 @@ public function toDomain(): Integration )->withOrganizers( ...$this->organizers() ->get() - ->map(fn (UiTdatabankOrganizerModel $organizerModel) => $organizerModel->toDomain()) + ->map(fn (OrganizerModel $organizerModel) => $organizerModel->toDomain()) ->toArray() ); diff --git a/app/Domain/Integrations/Models/UiTdatabankOrganizerModel.php b/app/Domain/Integrations/Models/OrganizerModel.php similarity index 90% rename from app/Domain/Integrations/Models/UiTdatabankOrganizerModel.php rename to app/Domain/Integrations/Models/OrganizerModel.php index 915edc998..a367ce263 100644 --- a/app/Domain/Integrations/Models/UiTdatabankOrganizerModel.php +++ b/app/Domain/Integrations/Models/OrganizerModel.php @@ -8,7 +8,7 @@ use App\Models\UuidModel; use Ramsey\Uuid\Uuid; -final class UiTdatabankOrganizerModel extends UuidModel +final class OrganizerModel extends UuidModel { protected $table = 'organizers'; diff --git a/app/Domain/Integrations/Policies/OrganizerPolicy.php b/app/Domain/Integrations/Policies/OrganizerPolicy.php index a3ca32ac4..844bce90c 100644 --- a/app/Domain/Integrations/Policies/OrganizerPolicy.php +++ b/app/Domain/Integrations/Policies/OrganizerPolicy.php @@ -5,7 +5,7 @@ namespace App\Domain\Integrations\Policies; use App\Domain\Auth\Models\UserModel; -use App\Domain\Integrations\Models\UiTdatabankOrganizerModel; +use App\Domain\Integrations\Models\OrganizerModel; final class OrganizerPolicy { @@ -14,7 +14,7 @@ public function viewAny(UserModel $userModel): bool return true; } - public function view(UserModel $userModel, UiTdatabankOrganizerModel $organizerModel): bool + public function view(UserModel $userModel, OrganizerModel $organizerModel): bool { return true; } @@ -24,27 +24,27 @@ public function create(UserModel $userModel): bool return false; } - public function update(UserModel $userModel, UiTdatabankOrganizerModel $organizerModel): bool + public function update(UserModel $userModel, OrganizerModel $organizerModel): bool { return false; } - public function delete(UserModel $userModel, UiTdatabankOrganizerModel $organizerModel): bool + public function delete(UserModel $userModel, OrganizerModel $organizerModel): bool { return true; } - public function restore(UserModel $userModel, UiTdatabankOrganizerModel $organizerModel): bool + public function restore(UserModel $userModel, OrganizerModel $organizerModel): bool { return false; } - public function replicate(UserModel $userModel, UiTdatabankOrganizerModel $organizerModel): bool + public function replicate(UserModel $userModel, OrganizerModel $organizerModel): bool { return false; } - public function forceDelete(UserModel $userModel, UiTdatabankOrganizerModel $organizerModel): bool + public function forceDelete(UserModel $userModel, OrganizerModel $organizerModel): bool { return false; } diff --git a/app/Domain/Integrations/Repositories/EloquentOrganizerRepository.php b/app/Domain/Integrations/Repositories/EloquentOrganizerRepository.php index def0e571e..cbd956512 100644 --- a/app/Domain/Integrations/Repositories/EloquentOrganizerRepository.php +++ b/app/Domain/Integrations/Repositories/EloquentOrganizerRepository.php @@ -4,7 +4,7 @@ namespace App\Domain\Integrations\Repositories; -use App\Domain\Integrations\Models\UiTdatabankOrganizerModel; +use App\Domain\Integrations\Models\OrganizerModel; use App\Domain\Integrations\UiTdatabankOrganizer; use Illuminate\Support\Facades\DB; @@ -14,7 +14,7 @@ public function create(UiTdatabankOrganizer ...$organizers): void { DB::transaction(function () use ($organizers): void { foreach ($organizers as $organizer) { - UiTdatabankOrganizerModel::query()->create([ + OrganizerModel::query()->create([ 'id' => $organizer->id->toString(), 'integration_id' => $organizer->integrationId->toString(), 'organizer_id' => $organizer->organizerId, @@ -25,7 +25,7 @@ public function create(UiTdatabankOrganizer ...$organizers): void public function delete(UiTdatabankOrganizer $organizer): void { - UiTdatabankOrganizerModel::query() + OrganizerModel::query() ->where('organizer_id', $organizer->organizerId) ->where('integration_id', $organizer->integrationId->toString()) ->delete(); diff --git a/app/Nova/Resources/Organizer.php b/app/Nova/Resources/Organizer.php index a05519000..f5b2a2da6 100644 --- a/app/Nova/Resources/Organizer.php +++ b/app/Nova/Resources/Organizer.php @@ -4,7 +4,7 @@ namespace App\Nova\Resources; -use App\Domain\Integrations\Models\UiTdatabankOrganizerModel; +use App\Domain\Integrations\Models\OrganizerModel; use App\Nova\Resource; use Laravel\Nova\Fields\Field; use Laravel\Nova\Fields\HasMany; @@ -13,11 +13,11 @@ use Laravel\Nova\Http\Requests\NovaRequest; /** - * @mixin UiTdatabankOrganizerModel + * @mixin OrganizerModel */ final class Organizer extends Resource { - public static string $model = UiTdatabankOrganizerModel::class; + public static string $model = OrganizerModel::class; public static $title = 'organizer_id'; diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 03ca1d23a..b4f304122 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -15,7 +15,7 @@ use App\Domain\Coupons\Policies\CouponPolicy; use App\Domain\Integrations\Models\IntegrationModel; use App\Domain\Integrations\Models\IntegrationUrlModel; -use App\Domain\Integrations\Models\UiTdatabankOrganizerModel; +use App\Domain\Integrations\Models\OrganizerModel; use App\Domain\Integrations\Policies\IntegrationPolicy; use App\Domain\Integrations\Policies\IntegrationUrlPolicy; use App\Domain\Integrations\Policies\OrganizerPolicy; @@ -45,7 +45,7 @@ final class AuthServiceProvider extends ServiceProvider IntegrationModel::class => IntegrationPolicy::class, IntegrationUrlModel::class => IntegrationUrlPolicy::class, OrganizationModel::class => OrganizationPolicy::class, - UiTdatabankOrganizerModel::class => OrganizerPolicy::class, + OrganizerModel::class => OrganizerPolicy::class, SubscriptionModel::class => SubscriptionPolicy::class, UiTiDv1ConsumerModel::class => UiTiDv1ConsumerPolicy::class, Auth0ClientModel::class => Auth0ClientPolicy::class,