Skip to content

Commit

Permalink
Revert "rename OrganizerModel to UiTdatabankOrganizerModel"
Browse files Browse the repository at this point in the history
This reverts commit 6efbd1c.
  • Loading branch information
JonasVHG committed Aug 2, 2024
1 parent 29877aa commit 77254db
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions app/Domain/Integrations/Models/IntegrationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ public function keyVisibilityUpgrade(): HasOne
}

/**
* @return HasMany<UiTdatabankOrganizerModel>
* @return HasMany<OrganizerModel>
*/
public function organizers(): HasMany
{
return $this->hasMany(UiTdatabankOrganizerModel::class, 'integration_id');
return $this->hasMany(OrganizerModel::class, 'integration_id');
}

/**
Expand Down Expand Up @@ -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()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
14 changes: 7 additions & 7 deletions app/Domain/Integrations/Policies/OrganizerPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
Expand All @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions app/Nova/Resources/Organizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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';

Expand Down
4 changes: 2 additions & 2 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 77254db

Please sign in to comment.