-
+
-
+
+ [tooltipText]="'Portal.ViewTournamentPlanner.InvitationLink.Tournaments.AllowNewRegistrationsTooltip'" />
-
+
+ [tooltipText]="'Portal.ViewTournamentPlanner.InvitationLink.Tournaments.MaxTeamsPerRegistrationTooltip'" />
-
+
@if (writeAllowed) {
}
@@ -138,11 +138,11 @@
@if (entry.allowNewRegistrations) {
+ [ngbTooltip]="'Portal.ViewTournamentPlanner.InvitationLink.Tournaments.ActiveTooltip' | translate">
} @else {
+ [ngbTooltip]="'Portal.ViewTournamentPlanner.InvitationLink.Tournaments.InactiveTooltip' | translate">
}
@@ -162,7 +162,7 @@
@if (invitationLink.id > 0) {
-
+
@for (tournamentClass of tournamentClassesToAdd; track tournamentClass) {
@@ -209,14 +209,14 @@
@if (addButtonDisabled) {
-
+
}
}
-
-
+
+
@let activeFormInputId = 'invitationLink_' + invitationLink.id + '_isActive';
@@ -231,7 +231,7 @@
+ translate="Portal.ViewTournamentPlanner.InvitationLink.IsActive.Label">
@@ -240,17 +240,17 @@
@let canDelete = invitationLink.numberOfApplications === 0;
@if (!canDelete) {
-
+
}
}
@if (invitationLink.id > 0) {
}
@@ -258,17 +258,17 @@
@@ -307,7 +307,7 @@
class="form-control"
formControlName="validUntil"
[ngClass]="control.invalid ? 'is-invalid' : ''"
- [attr.aria-labelledby]="'Portal.ViewPlanningRealm.InvitationLink.Properties.ValidUntil' | translate" />
+ [attr.aria-labelledby]="'Portal.ViewTournamentPlanner.InvitationLink.Properties.ValidUntil' | translate" />
}
@@ -316,25 +316,31 @@
+ [text]="'Portal.ViewTournamentPlanner.InvitationLink.EditPropertiesDialog.PublicInformation'" />
-
+
-
+
-
+
-
+
@@ -342,14 +348,14 @@
+ translate="Portal.ViewTournamentPlanner.InvitationLink.Properties.ContactTelephone">
-
+
@@ -364,8 +370,10 @@
class="form-control form-control-sm"
[ngClass]="linkNameControl.invalid && linkNameControl.touched ? 'is-invalid' : ''"
formControlName="name"
- [placeholder]="'Portal.ViewPlanningRealm.InvitationLink.EditPropertiesDialog.ExternalLinkName' | translate"
- [attr.aria-labelledby]="'Portal.ViewPlanningRealm.InvitationLink.EditPropertiesDialog.ExternalLinkName' | translate" />
+ [placeholder]="'Portal.ViewTournamentPlanner.InvitationLink.EditPropertiesDialog.ExternalLinkName' | translate"
+ [attr.aria-labelledby]="
+ 'Portal.ViewTournamentPlanner.InvitationLink.EditPropertiesDialog.ExternalLinkName' | translate
+ " />
@let linkUrlControl = editPropertiesFormExternalLinks.get('' + i)!.get('url')!;
@@ -374,8 +382,8 @@
class="form-control form-control-sm"
[ngClass]="linkUrlControl.invalid && linkUrlControl.touched ? 'is-invalid' : ''"
formControlName="url"
- [placeholder]="'Portal.ViewPlanningRealm.InvitationLink.EditPropertiesDialog.ExternalLinkUrl' | translate"
- [attr.aria-labelledby]="'Portal.ViewPlanningRealm.InvitationLink.EditPropertiesDialog.ExternalLinkUrl' | translate" />
+ [placeholder]="'Portal.ViewTournamentPlanner.InvitationLink.EditPropertiesDialog.ExternalLinkUrl' | translate"
+ [attr.aria-labelledby]="'Portal.ViewTournamentPlanner.InvitationLink.EditPropertiesDialog.ExternalLinkUrl' | translate" />
@@ -383,7 +391,7 @@
} @empty {
+ translate="Portal.ViewTournamentPlanner.InvitationLink.EditPropertiesDialog.NoExternalLinks">
}
@@ -400,7 +408,7 @@
@@ -416,7 +424,7 @@
+ translate="Portal.ViewTournamentPlanner.InvitationLink.EditEntryDialog.AllowNewRegistrations">
@@ -435,7 +443,7 @@
+ translate="Portal.ViewTournamentPlanner.InvitationLink.EditEntryDialog.LimitTeamsPerRegistration">
@@ -449,7 +457,7 @@
[required]="true"
formControlName="maxTeamsPerRegistration"
[ngClass]="control.invalid ? 'is-invalid' : ''"
- [attr.aria-labelledby]="'Portal.ViewPlanningRealm.InvitationLink.EditEntryDialog.MaxTeamsPerRegistration' | translate" />
+ [attr.aria-labelledby]="'Portal.ViewTournamentPlanner.InvitationLink.EditEntryDialog.MaxTeamsPerRegistration' | translate" />
}
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/invitation-link-tile/invitation-link-tile.component.ts b/src/Turnierplan.App/Client/src/app/portal/components/invitation-link-tile/invitation-link-tile.component.ts
index a00caf28..0103af3e 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/invitation-link-tile/invitation-link-tile.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/components/invitation-link-tile/invitation-link-tile.component.ts
@@ -1,7 +1,7 @@
import { Component, EventEmitter, Input, Output, TemplateRef } from '@angular/core';
import { Actions } from '../../../generated/actions';
import { AuthorizationService } from '../../../core/services/authorization.service';
-import { UpdatePlanningRealmFunc } from '../../pages/view-planning-realm/view-planning-realm.component';
+import { UpdateTournamentPlannerFunc } from '../../pages/view-tournament-planner/view-tournament-planner.component';
import { NgbModal, NgbTooltip, NgbDropdown, NgbDropdownToggle, NgbDropdownMenu, NgbDropdownItem } from '@ng-bootstrap/ng-bootstrap';
import { FormArray, FormControl, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { formatDate, NgStyle, NgClass, AsyncPipe } from '@angular/common';
@@ -15,7 +15,7 @@ import { IsActionAllowedDirective } from '../../directives/is-action-allowed.dir
import { DeleteButtonComponent } from '../delete-button/delete-button.component';
import { AlertComponent } from '../alert/alert.component';
import { TranslateDatePipe } from '../../pipes/translate-date.pipe';
-import { PlanningRealmDto } from '../../../api/models/planning-realm-dto';
+import { TournamentPlannerDto } from '../../../api/models/tournament-planner-dto';
import { InvitationLinkDto } from '../../../api/models/invitation-link-dto';
import { TournamentClassDto } from '../../../api/models/tournament-class-dto';
import { InvitationLinkEntryDto } from '../../../api/models/invitation-link-entry-dto';
@@ -48,11 +48,11 @@ import { ImageDto } from '../../../api/models/image-dto';
]
})
export class InvitationLinkTileComponent {
- private _planningRealm!: PlanningRealmDto;
+ private _tournamentPlanner!: TournamentPlannerDto;
private _invitationLink!: InvitationLinkDto;
@Input()
- public updatePlanningRealm!: UpdatePlanningRealmFunc;
+ public updateTournamentPlanner!: UpdateTournamentPlannerFunc;
@Output()
public errorOccured = new EventEmitter();
@@ -100,8 +100,8 @@ export class InvitationLinkTileComponent {
}
@Input()
- public set planningRealm(value: PlanningRealmDto) {
- this._planningRealm = value;
+ public set tournamentPlanner(value: TournamentPlannerDto) {
+ this._tournamentPlanner = value;
this.determineTournamentClassesToAdd();
}
@@ -109,8 +109,8 @@ export class InvitationLinkTileComponent {
return this._invitationLink;
}
- public get planningRealm(): PlanningRealmDto {
- return this._planningRealm;
+ public get tournamentPlanner(): TournamentPlannerDto {
+ return this._tournamentPlanner;
}
protected get editPropertiesFormExternalLinks(): FormArray {
@@ -118,10 +118,10 @@ export class InvitationLinkTileComponent {
}
protected findTournamentClassById(id: number): TournamentClassDto {
- const tournamentClass = this.planningRealm.tournamentClasses.find((x) => x.id === id);
+ const tournamentClass = this.tournamentPlanner.tournamentClasses.find((x) => x.id === id);
if (!tournamentClass) {
- throw new Error(`Tournament class id ${id} does not exist in planning realm.`);
+ throw new Error(`Tournament class id ${id} does not exist in tournament planner.`);
}
return tournamentClass;
@@ -271,8 +271,8 @@ export class InvitationLinkTileComponent {
protected onImageDeleted(imageId: string): void {
// If an image is deleted, make sure to remove it from all invitation links that refer to it
- this.updatePlanningRealm((planningRealm) => {
- for (const invitationLink of planningRealm.invitationLinks) {
+ this.updateTournamentPlanner((tournamentPlanner) => {
+ for (const invitationLink of tournamentPlanner.invitationLinks) {
if (invitationLink.primaryLogo?.id === imageId) {
invitationLink.primaryLogo = undefined;
}
@@ -315,14 +315,14 @@ export class InvitationLinkTileComponent {
}
protected deleteInvitationLink(): void {
- this.updatePlanningRealm((planningRealm) => {
- const index = planningRealm.invitationLinks.findIndex((x) => x.id === this.invitationLink.id);
+ this.updateTournamentPlanner((tournamentPlanner) => {
+ const index = tournamentPlanner.invitationLinks.findIndex((x) => x.id === this.invitationLink.id);
if (index === -1) {
return false;
}
- planningRealm.invitationLinks.splice(index, 1);
+ tournamentPlanner.invitationLinks.splice(index, 1);
return true;
});
}
@@ -341,8 +341,8 @@ export class InvitationLinkTileComponent {
}
private updateInvitationLink(updateFunc: (invitationLink: InvitationLinkDto) => boolean): void {
- this.updatePlanningRealm((planningRealm) => {
- const invitationLink = planningRealm.invitationLinks.find((x) => x.id === this.invitationLink.id);
+ this.updateTournamentPlanner((tournamentPlanner) => {
+ const invitationLink = tournamentPlanner.invitationLinks.find((x) => x.id === this.invitationLink.id);
if (!invitationLink) {
return false;
@@ -357,8 +357,8 @@ export class InvitationLinkTileComponent {
}
private determineTournamentClassesToAdd(): void {
- if (this.planningRealm && this.invitationLink) {
- this.tournamentClassesToAdd = this.planningRealm.tournamentClasses.filter(
+ if (this.tournamentPlanner && this.invitationLink) {
+ this.tournamentClassesToAdd = this.tournamentPlanner.tournamentClasses.filter(
(tc) => tc.id > 0 && !this.invitationLink.entries.some((entry) => entry.tournamentClassId === tc.id)
);
} else {
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/labels-manager/labels-manager.component.html b/src/Turnierplan.App/Client/src/app/portal/components/labels-manager/labels-manager.component.html
index 7da69d38..64078831 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/labels-manager/labels-manager.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/components/labels-manager/labels-manager.component.html
@@ -1,10 +1,10 @@
-@let writeAllowed = (authorizationService.isActionAllowed$(planningRealm.id, Actions.GenericWrite) | async) ?? false;
+@let writeAllowed = (authorizationService.isActionAllowed$(tournamentPlanner.id, Actions.GenericWrite) | async) ?? false;
-
-
+
+
@if (writeAllowed) {
@@ -13,7 +13,7 @@
- @for (label of planningRealm.labels; track label.id) {
+ @for (label of tournamentPlanner.labels; track label.id) {
@@ -26,7 +26,7 @@
[container]="'body'">
0 }"
- [translationKey]="'Portal.ViewPlanningRealm.Labels.ChangeDescription'"
+ [translationKey]="'Portal.ViewTournamentPlanner.Labels.ChangeDescription'"
[displayLabel]="false"
[current]="label.description"
[allowReset]="true"
@@ -50,7 +50,7 @@
@if (label.id > 0) {
@@ -69,20 +69,20 @@
} @empty {
-
+
}
-
+
-
+
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/labels-manager/labels-manager.component.ts b/src/Turnierplan.App/Client/src/app/portal/components/labels-manager/labels-manager.component.ts
index a4f8fc8a..904eaf2e 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/labels-manager/labels-manager.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/components/labels-manager/labels-manager.component.ts
@@ -1,6 +1,9 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
-import { PlanningRealmDto } from '../../../api/models/planning-realm-dto';
-import { UpdatePlanningRealmFunc, ViewPlanningRealmComponent } from '../../pages/view-planning-realm/view-planning-realm.component';
+import { TournamentPlannerDto } from '../../../api/models/tournament-planner-dto';
+import {
+ UpdateTournamentPlannerFunc,
+ ViewTournamentPlannerComponent
+} from '../../pages/view-tournament-planner/view-tournament-planner.component';
import { ApplicationsFilter } from '../../models/applications-filter';
import { TranslateDirective } from '@ngx-translate/core';
import { Actions } from '../../../generated/actions';
@@ -29,22 +32,22 @@ import { DeleteButtonComponent } from '../delete-button/delete-button.component'
})
export class LabelsManagerComponent {
@Input()
- public planningRealm!: PlanningRealmDto;
+ public tournamentPlanner!: TournamentPlannerDto;
@Input()
- public updatePlanningRealm!: UpdatePlanningRealmFunc;
+ public updateTournamentPlanner!: UpdateTournamentPlannerFunc;
@Output()
public filterRequested = new EventEmitter();
protected readonly Actions = Actions;
- protected readonly availableColors = ViewPlanningRealmComponent.DefaultLabelColorCodes;
+ protected readonly availableColors = ViewTournamentPlannerComponent.DefaultLabelColorCodes;
constructor(protected readonly authorizationService: AuthorizationService) {}
protected setLabelName(id: number, name: string): void {
- this.updatePlanningRealm((planningRealm) => {
- const label = planningRealm.labels.find((x) => x.id == id);
+ this.updateTournamentPlanner((tournamentPlanner) => {
+ const label = tournamentPlanner.labels.find((x) => x.id == id);
if (!label) {
return false;
@@ -57,8 +60,8 @@ export class LabelsManagerComponent {
}
protected setLabelDescription(id: number, description: string): void {
- this.updatePlanningRealm((planningRealm) => {
- const label = planningRealm.labels.find((x) => x.id == id);
+ this.updateTournamentPlanner((tournamentPlanner) => {
+ const label = tournamentPlanner.labels.find((x) => x.id == id);
if (!label) {
return false;
@@ -71,8 +74,8 @@ export class LabelsManagerComponent {
}
protected setLabelColor(id: any, color: string): void {
- this.updatePlanningRealm((planningRealm) => {
- const label = planningRealm.labels.find((x) => x.id == id);
+ this.updateTournamentPlanner((tournamentPlanner) => {
+ const label = tournamentPlanner.labels.find((x) => x.id == id);
if (!label) {
return false;
@@ -86,14 +89,14 @@ export class LabelsManagerComponent {
}
protected deleteLabel(id: number): void {
- this.updatePlanningRealm((planningRealm) => {
- const index = planningRealm.labels.findIndex((x) => x.id === id);
+ this.updateTournamentPlanner((tournamentPlanner) => {
+ const index = tournamentPlanner.labels.findIndex((x) => x.id === id);
if (index === -1) {
return false;
}
- planningRealm.labels.splice(index, 1);
+ tournamentPlanner.labels.splice(index, 1);
return true;
});
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-add-team/manage-applications-add-team.component.html b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-add-team/manage-applications-add-team.component.html
index 433e8f2b..45e0b17b 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-add-team/manage-applications-add-team.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-add-team/manage-applications-add-team.component.html
@@ -1,10 +1,13 @@
-
+
@for (tournamentClass of tournamentClasses; track tournamentClass.id) {
{{ tournamentClass.name }}
@@ -13,15 +16,15 @@
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-add-team/manage-applications-add-team.component.ts b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-add-team/manage-applications-add-team.component.ts
index 526cac40..baee0768 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-add-team/manage-applications-add-team.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-add-team/manage-applications-add-team.component.ts
@@ -3,7 +3,7 @@ import { TranslateDirective } from '@ngx-translate/core';
import { FormsModule } from '@angular/forms';
import { ActionButtonComponent } from '../action-button/action-button.component';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { PlanningRealmDto } from '../../../api/models/planning-realm-dto';
+import { TournamentPlannerDto } from '../../../api/models/tournament-planner-dto';
import { TournamentClassDto } from '../../../api/models/tournament-class-dto';
import { CreateApplicationTeamEndpointRequest } from '../../../api/models/create-application-team-endpoint-request';
@@ -19,8 +19,8 @@ export class ManageApplicationsAddTeamComponent {
constructor(protected readonly modal: NgbActiveModal) {}
- public init(planningRealm: PlanningRealmDto): void {
- this.tournamentClasses = [...planningRealm.tournamentClasses].sort((a, b) => a.name.localeCompare(b.name));
+ public init(tournamentPlanner: TournamentPlannerDto): void {
+ this.tournamentClasses = [...tournamentPlanner.tournamentClasses].sort((a, b) => a.name.localeCompare(b.name));
this.tournamentClassId = this.tournamentClasses[0].id;
}
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-filter/manage-applications-filter.component.html b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-filter/manage-applications-filter.component.html
index d78245c4..4e61ab8a 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-filter/manage-applications-filter.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-filter/manage-applications-filter.component.html
@@ -2,27 +2,27 @@
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-filter/manage-applications-filter.component.ts b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-filter/manage-applications-filter.component.ts
index a2277dac..3b2295a1 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-filter/manage-applications-filter.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications-filter/manage-applications-filter.component.ts
@@ -5,7 +5,7 @@ import { FormsModule } from '@angular/forms';
import { ActionButtonComponent } from '../action-button/action-button.component';
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
import { TranslatePipe } from '@ngx-translate/core';
-import { PlanningRealmDto } from '../../../api/models/planning-realm-dto';
+import { TournamentPlannerDto } from '../../../api/models/tournament-planner-dto';
@Component({
selector: 'tp-manage-applications-filter',
@@ -24,7 +24,7 @@ export class ManageApplicationsFilterComponent {
protected labelFilterOptions: MultiSelectFilterOption[] = [];
@Input()
- public set planningRealm(value: PlanningRealmDto) {
+ public set tournamentPlanner(value: TournamentPlannerDto) {
this.tournamentClassFilterOptions = value.tournamentClasses.map((x) => ({ value: x.id, label: x.name }));
this.invitationLinkFilterOptions = value.invitationLinks.map((x) => ({ value: x.id, label: x.name }));
this.labelFilterOptions = value.labels.map((x) => ({ value: x.id, label: x.name }));
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications/manage-applications.component.html b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications/manage-applications.component.html
index 29a5ba0e..8937e8ed 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications/manage-applications.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications/manage-applications.component.html
@@ -1,4 +1,4 @@
-@let writeAllowed = (authorizationService.isActionAllowed$(planningRealm.id, Actions.GenericWrite) | async) ?? false;
+@let writeAllowed = (authorizationService.isActionAllowed$(tournamentPlanner.id, Actions.GenericWrite) | async) ?? false;
@if (isLoading) {
@@ -6,7 +6,7 @@
} @else if (result) {
@if (result.totalItems === 0) {
-
+
} @else {
@@ -15,38 +15,38 @@
@if (allApplicationsExpanded) {
} @else {
}
-
-
+
+
-
-
-
+
+
+
-
+
@if (combinedEmailAddresses && combinedEmailAddresses.length > 0) {
}
-
+
-
-
+
+
-
-
+
+
@@ -76,7 +76,7 @@
class="d-inline-block text-center text-white"
style="width: 1.5em; border-radius: 0.4em"
[ngStyle]="{ 'background-color': '#' + invitationLink.colorCode }"
- [ngbTooltip]="'Portal.ViewPlanningRealm.Applications.SourceLinkTooltip' | translate: { name: invitationLink.name }">
+ [ngbTooltip]="'Portal.ViewTournamentPlanner.Applications.SourceLinkTooltip' | translate: { name: invitationLink.name }">
}
@@ -85,7 +85,7 @@
[margin]="false"
[icon]="'vector-pen'"
[iconClass]="'text-secondary'"
- [tooltipText]="'Portal.ViewPlanningRealm.Applications.NoSourceLinkTooltip'" />
+ [tooltipText]="'Portal.ViewTournamentPlanner.Applications.NoSourceLinkTooltip'" />
}
@@ -101,7 +101,7 @@
@if (visibleTeamsCount !== application.teams.length) {
+ [tooltipText]="'Portal.ViewTournamentPlanner.Applications.HiddenTeamsTooltip'" />
}
}
@@ -170,7 +170,7 @@
@@ -181,10 +181,10 @@
-
-
-
-
+
+
+
+
@@ -198,7 +198,7 @@
@if (writeAllowed) {
+ [translate]="'Portal.ViewTournamentPlanner.Applications.NoLabels'">
}
@if (updatingLabelsOfApplicationTeamId === team.id) {
@@ -236,19 +236,19 @@
} @else {
+ translate="Portal.ViewTournamentPlanner.Applications.NoLinkedTournament">
}
@if (team.linkedTournament) {
+ [tooltipText]="'Portal.ViewTournamentPlanner.Applications.CannotDeleteTeamWhileLinked'" />
} @else {
}
@@ -258,7 +258,9 @@
} @empty {
-
+
}
@@ -268,11 +270,11 @@
@@ -283,7 +285,7 @@
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications/manage-applications.component.ts b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications/manage-applications.component.ts
index c2310196..82769ede 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/manage-applications/manage-applications.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/components/manage-applications/manage-applications.component.ts
@@ -19,7 +19,7 @@ import { LocalStorageService } from '../../services/local-storage.service';
import { Router } from '@angular/router';
import { RenameButtonComponent } from '../rename-button/rename-button.component';
import { TurnierplanApi } from '../../../api/turnierplan-api';
-import { PlanningRealmDto } from '../../../api/models/planning-realm-dto';
+import { TournamentPlannerDto } from '../../../api/models/tournament-planner-dto';
import { PaginationResultDtoOfApplicationDto } from '../../../api/models/pagination-result-dto-of-application-dto';
import { getApplications } from '../../../api/fn/applications/get-applications';
import { InvitationLinkDto } from '../../../api/models/invitation-link-dto';
@@ -74,7 +74,7 @@ import { setApplicationContactTelephone } from '../../../api/fn/applications/set
})
export class ManageApplicationsComponent implements OnDestroy {
@Input()
- public planningRealm!: PlanningRealmDto;
+ public tournamentPlanner!: TournamentPlannerDto;
@Input()
public set filter(value: ApplicationsFilter) {
@@ -127,7 +127,7 @@ export class ManageApplicationsComponent implements OnDestroy {
tap(() => (this.isLoading = true)),
switchMap(([filter, _]) => {
return this.turnierplanApi.invoke(getApplications, {
- planningRealmId: this.planningRealm.id,
+ tournamentPlannerId: this.tournamentPlanner.id,
page: this.currentPage,
pageSize: this.pageSize,
...applicationsFilterToQueryParameters(filter)
@@ -183,15 +183,15 @@ export class ManageApplicationsComponent implements OnDestroy {
}
protected getTournamentClassName(id: number): string {
- return this.planningRealm.tournamentClasses.find((x) => x.id === id)?.name ?? '?';
+ return this.tournamentPlanner.tournamentClasses.find((x) => x.id === id)?.name ?? '?';
}
protected getInvitationLink(id: number): InvitationLinkDto {
- return this.planningRealm.invitationLinks.find((x) => x.id === id)!;
+ return this.tournamentPlanner.invitationLinks.find((x) => x.id === id)!;
}
protected getLabel(id: number): LabelDto {
- return this.planningRealm.labels.find((x) => x.id === id)!;
+ return this.tournamentPlanner.labels.find((x) => x.id === id)!;
}
protected isTeamVisible(team: ApplicationTeamDto): boolean {
@@ -293,7 +293,7 @@ export class ManageApplicationsComponent implements OnDestroy {
});
const component = ref.componentInstance as ApplicationChangeLogComponent;
- component.init(this.planningRealm.id, application);
+ component.init(this.tournamentPlanner.id, application);
component.error$.subscribe({
next: (value) => {
@@ -316,7 +316,7 @@ export class ManageApplicationsComponent implements OnDestroy {
});
const component = ref.componentInstance as ManageApplicationsAddTeamComponent;
- component.init(this.planningRealm);
+ component.init(this.tournamentPlanner);
ref.closed
.pipe(
@@ -324,7 +324,7 @@ export class ManageApplicationsComponent implements OnDestroy {
switchMap((request: CreateApplicationTeamEndpointRequest) =>
this.turnierplanApi
.invoke(createApplicationTeam, {
- planningRealmId: this.planningRealm.id,
+ tournamentPlannerId: this.tournamentPlanner.id,
applicationId: applicationId,
body: request
})
@@ -335,9 +335,9 @@ export class ManageApplicationsComponent implements OnDestroy {
next: (tournamentClassId: number) => {
this.reload$.next(undefined); // reload will eventually set isLoading to false
- // Modify the planning realm stored in the client to account for the newly added team. By doing this "hack" we can prevent
- // a separate request for querying the entire planning realm when only the "numberOfTeams" property has changed.
- const tournamentClass = this.planningRealm.tournamentClasses?.find((x) => x.id === tournamentClassId);
+ // Modify the tournament planner stored in the client to account for the newly added team. By doing this "hack" we can prevent
+ // a separate request for querying the entire tournament planner when only the "numberOfTeams" property has changed.
+ const tournamentClass = this.tournamentPlanner.tournamentClasses?.find((x) => x.id === tournamentClassId);
if (tournamentClass) {
tournamentClass.numberOfTeams++;
}
@@ -351,7 +351,7 @@ export class ManageApplicationsComponent implements OnDestroy {
protected renameTeam(applicationId: number, applicationTeam: ApplicationTeamDto, name: string): void {
this.turnierplanApi
.invoke(setApplicationTeamName, {
- planningRealmId: this.planningRealm.id,
+ tournamentPlannerId: this.tournamentPlanner.id,
applicationId: applicationId,
applicationTeamId: applicationTeam.id,
body: {
@@ -381,7 +381,7 @@ export class ManageApplicationsComponent implements OnDestroy {
});
const component = ref.componentInstance as LabelsSelectComponent;
- component.init(this.planningRealm.labels, applicationTeam.labelIds);
+ component.init(this.tournamentPlanner.labels, applicationTeam.labelIds);
ref.closed
.pipe(
@@ -389,7 +389,7 @@ export class ManageApplicationsComponent implements OnDestroy {
switchMap((labelIds) =>
this.turnierplanApi
.invoke(setApplicationTeamLabels, {
- planningRealmId: this.planningRealm.id,
+ tournamentPlannerId: this.tournamentPlanner.id,
applicationId: applicationId,
applicationTeamId: applicationTeam.id,
body: { labelIds: labelIds }
@@ -413,7 +413,7 @@ export class ManageApplicationsComponent implements OnDestroy {
this.turnierplanApi
.invoke(deleteApplicationTeam, {
- planningRealmId: this.planningRealm.id,
+ tournamentPlannerId: this.tournamentPlanner.id,
applicationId: applicationId,
applicationTeamId: applicationTeamId
})
@@ -454,7 +454,7 @@ export class ManageApplicationsComponent implements OnDestroy {
apiFunction: (
http: HttpClient,
rootUrl: string,
- params: { planningRealmId: string; applicationId: number; body: TRequestBody },
+ params: { tournamentPlannerId: string; applicationId: number; body: TRequestBody },
context?: HttpContext
) => Observable>,
requestBodyFactory: (value: string) => TRequestBody,
@@ -475,7 +475,7 @@ export class ManageApplicationsComponent implements OnDestroy {
});
const component = ref.componentInstance as TextInputDialogComponent;
- component.init(`Portal.ViewPlanningRealm.Applications.${translationKey}`, currentValue, textArea, isRequired);
+ component.init(`Portal.ViewTournamentPlanner.Applications.${translationKey}`, currentValue, textArea, isRequired);
ref.closed
.pipe(
@@ -483,7 +483,7 @@ export class ManageApplicationsComponent implements OnDestroy {
switchMap((value) =>
this.turnierplanApi
.invoke(apiFunction, {
- planningRealmId: this.planningRealm.id,
+ tournamentPlannerId: this.tournamentPlanner.id,
applicationId: applicationId,
body: requestBodyFactory(value)
})
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/new-application-dialog/new-application-dialog.component.html b/src/Turnierplan.App/Client/src/app/portal/components/new-application-dialog/new-application-dialog.component.html
index 9ee40675..ef0598da 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/new-application-dialog/new-application-dialog.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/components/new-application-dialog/new-application-dialog.component.html
@@ -1,12 +1,12 @@
}
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/team-list/team-list.component.ts b/src/Turnierplan.App/Client/src/app/portal/components/team-list/team-list.component.ts
index c51ddde4..114d40ac 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/team-list/team-list.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/components/team-list/team-list.component.ts
@@ -13,7 +13,7 @@ import { IsActionAllowedDirective } from '../../directives/is-action-allowed.dir
import { LocalStorageService } from '../../services/local-storage.service';
import { Router } from '@angular/router';
import { defaultApplicationsFilter } from '../../models/applications-filter';
-import { ViewPlanningRealmComponent } from '../../pages/view-planning-realm/view-planning-realm.component';
+import { ViewTournamentPlannerComponent } from '../../pages/view-tournament-planner/view-tournament-planner.component';
import { PublicId } from '../../../api/models/public-id';
import { TeamLinkDto } from '../../../api/models/team-link-dto';
@@ -139,12 +139,12 @@ export class TeamListComponent {
this.teamSetOutOfCompetition.emit({ teamId: teamId, outOfCompetition: !team.outOfCompetition });
}
- protected navigateToPlanningRealm(planningRealmId: PublicId, applicationTeamId: number): void {
- this.localStorageService.setNavigationTab(planningRealmId, ViewPlanningRealmComponent.ApplicationsManagerPageId);
- this.localStorageService.setPlanningRealmApplicationsFilter(planningRealmId, {
+ protected navigateToTournamentPlanner(tournamentPlannerId: PublicId, applicationTeamId: number): void {
+ this.localStorageService.setNavigationTab(tournamentPlannerId, ViewTournamentPlannerComponent.ApplicationsManagerPageId);
+ this.localStorageService.setTournamentPlannerApplicationsFilter(tournamentPlannerId, {
...defaultApplicationsFilter,
searchTerm: `!${applicationTeamId}`
});
- void this.router.navigate(['/portal/planning-realm/', planningRealmId]);
+ void this.router.navigate(['/portal/tournament-planner/', tournamentPlannerId]);
}
}
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/tournament-class-manager/tournament-class-manager.component.html b/src/Turnierplan.App/Client/src/app/portal/components/tournament-class-manager/tournament-class-manager.component.html
index 106c0c1a..fc067476 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/tournament-class-manager/tournament-class-manager.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/components/tournament-class-manager/tournament-class-manager.component.html
@@ -1,11 +1,11 @@
-@let writeAllowed = (authorizationService.isActionAllowed$(planningRealm.id, Actions.GenericWrite) | async) ?? false;
+@let writeAllowed = (authorizationService.isActionAllowed$(tournamentPlanner.id, Actions.GenericWrite) | async) ?? false;
-
-
-
+
+
+
@if (writeAllowed) {
@@ -15,7 +15,7 @@
- @for (tournamentClass of planningRealm.tournamentClasses; track tournamentClass.id) {
+ @for (tournamentClass of tournamentPlanner.tournamentClasses; track tournamentClass.id) {
{{ tournamentClass.name }}
{{ getNumberOfReferencingLinks(tournamentClass.id) }}
@@ -24,7 +24,7 @@
@if (tournamentClass.id > 0) {
@@ -44,7 +44,7 @@
@if (!canDelete) {
-
+
}
@@ -52,7 +52,7 @@
} @empty {
-
+
}
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/tournament-class-manager/tournament-class-manager.component.ts b/src/Turnierplan.App/Client/src/app/portal/components/tournament-class-manager/tournament-class-manager.component.ts
index 0121ec9d..d0412753 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/tournament-class-manager/tournament-class-manager.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/components/tournament-class-manager/tournament-class-manager.component.ts
@@ -1,7 +1,7 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Actions } from '../../../generated/actions';
import { AuthorizationService } from '../../../core/services/authorization.service';
-import { UpdatePlanningRealmFunc } from '../../pages/view-planning-realm/view-planning-realm.component';
+import { UpdateTournamentPlannerFunc } from '../../pages/view-tournament-planner/view-tournament-planner.component';
import { ApplicationsFilter } from '../../models/applications-filter';
import { TranslateDirective } from '@ngx-translate/core';
import { IsActionAllowedDirective } from '../../directives/is-action-allowed.directive';
@@ -10,7 +10,7 @@ import { RenameButtonComponent } from '../rename-button/rename-button.component'
import { DeleteButtonComponent } from '../delete-button/delete-button.component';
import { TooltipIconComponent } from '../tooltip-icon/tooltip-icon.component';
import { AsyncPipe } from '@angular/common';
-import { PlanningRealmDto } from '../../../api/models/planning-realm-dto';
+import { TournamentPlannerDto } from '../../../api/models/tournament-planner-dto';
@Component({
selector: 'tp-tournament-classes-manager',
@@ -27,10 +27,10 @@ import { PlanningRealmDto } from '../../../api/models/planning-realm-dto';
})
export class TournamentClassManagerComponent {
@Input()
- public planningRealm!: PlanningRealmDto;
+ public tournamentPlanner!: TournamentPlannerDto;
@Input()
- public updatePlanningRealm!: UpdatePlanningRealmFunc;
+ public updateTournamentPlanner!: UpdateTournamentPlannerFunc;
@Output()
public filterRequested = new EventEmitter();
@@ -40,12 +40,12 @@ export class TournamentClassManagerComponent {
constructor(protected readonly authorizationService: AuthorizationService) {}
protected getNumberOfReferencingLinks(id: number): number {
- return this.planningRealm.invitationLinks.filter((link) => link.entries.some((entry) => entry.tournamentClassId == id)).length;
+ return this.tournamentPlanner.invitationLinks.filter((link) => link.entries.some((entry) => entry.tournamentClassId == id)).length;
}
protected renameTournamentClass(id: number, name: string): void {
- this.updatePlanningRealm((planningRealm) => {
- const tournamentClass = planningRealm.tournamentClasses.find((x) => x.id == id);
+ this.updateTournamentPlanner((tournamentPlanner) => {
+ const tournamentClass = tournamentPlanner.tournamentClasses.find((x) => x.id == id);
if (!tournamentClass) {
return false;
@@ -58,14 +58,14 @@ export class TournamentClassManagerComponent {
}
protected deleteTournamentClass(id: number): void {
- this.updatePlanningRealm((planningRealm) => {
- const index = planningRealm.tournamentClasses.findIndex((x) => x.id === id);
+ this.updateTournamentPlanner((tournamentPlanner) => {
+ const index = tournamentPlanner.tournamentClasses.findIndex((x) => x.id === id);
if (index === -1) {
return false;
}
- planningRealm.tournamentClasses.splice(index, 1);
+ tournamentPlanner.tournamentClasses.splice(index, 1);
return true;
});
diff --git a/src/Turnierplan.App/Client/src/app/portal/pages/configure-tournament/configure-tournament.component.html b/src/Turnierplan.App/Client/src/app/portal/pages/configure-tournament/configure-tournament.component.html
index e127ba5d..946d590f 100644
--- a/src/Turnierplan.App/Client/src/app/portal/pages/configure-tournament/configure-tournament.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/pages/configure-tournament/configure-tournament.component.html
@@ -131,9 +131,9 @@
}
diff --git a/src/Turnierplan.App/Client/src/app/portal/pages/configure-tournament/configure-tournament.component.ts b/src/Turnierplan.App/Client/src/app/portal/pages/configure-tournament/configure-tournament.component.ts
index d1c74a6a..768da9e5 100644
--- a/src/Turnierplan.App/Client/src/app/portal/pages/configure-tournament/configure-tournament.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/pages/configure-tournament/configure-tournament.component.ts
@@ -46,8 +46,8 @@ interface TemporaryGroup {
}
export interface TemporaryTeamLink {
- planningRealmId: string;
- planningRealmName: string;
+ tournamentPlannerId: string;
+ tournamentPlannerName: string;
tournamentClassName: string;
applicationTeamId: number;
}
@@ -517,8 +517,8 @@ export class ConfigureTournamentComponent implements OnInit, OnDestroy, DiscardC
id: participant.teamId,
name: team.name,
teamLink: {
- planningRealmId: team.link.planningRealmId,
- planningRealmName: team.link.planningRealmName,
+ tournamentPlannerId: team.link.tournamentPlannerId,
+ tournamentPlannerName: team.link.tournamentPlannerName,
tournamentClassName: team.link.tournamentClassName,
applicationTeamId: team.link.applicationTeamId
}
@@ -729,7 +729,7 @@ export class ConfigureTournamentComponent implements OnInit, OnDestroy, DiscardC
teamLink:
team.teamLink === undefined
? undefined
- : { planningRealmId: team.teamLink.planningRealmId, applicationTeamId: team.teamLink.applicationTeamId }
+ : { tournamentPlannerId: team.teamLink.tournamentPlannerId, applicationTeamId: team.teamLink.applicationTeamId }
})
)
})
diff --git a/src/Turnierplan.App/Client/src/app/portal/pages/create-planning-realm/create-planning-realm.component.html b/src/Turnierplan.App/Client/src/app/portal/pages/create-planning-realm/create-planning-realm.component.html
deleted file mode 100644
index 5a2f0468..00000000
--- a/src/Turnierplan.App/Client/src/app/portal/pages/create-planning-realm/create-planning-realm.component.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Turnierplan.App/Client/src/app/portal/pages/create-tournament-planner/create-tournament-planner.component.html b/src/Turnierplan.App/Client/src/app/portal/pages/create-tournament-planner/create-tournament-planner.component.html
new file mode 100644
index 00000000..6b755d8b
--- /dev/null
+++ b/src/Turnierplan.App/Client/src/app/portal/pages/create-tournament-planner/create-tournament-planner.component.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Turnierplan.App/Client/src/app/portal/pages/create-planning-realm/create-planning-realm.component.ts b/src/Turnierplan.App/Client/src/app/portal/pages/create-tournament-planner/create-tournament-planner.component.ts
similarity index 80%
rename from src/Turnierplan.App/Client/src/app/portal/pages/create-planning-realm/create-planning-realm.component.ts
rename to src/Turnierplan.App/Client/src/app/portal/pages/create-tournament-planner/create-tournament-planner.component.ts
index e3d2a531..bc8d1537 100644
--- a/src/Turnierplan.App/Client/src/app/portal/pages/create-planning-realm/create-planning-realm.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/pages/create-tournament-planner/create-tournament-planner.component.ts
@@ -12,10 +12,10 @@ import { ActionButtonComponent } from '../../components/action-button/action-but
import { OrganizationDto } from '../../../api/models/organization-dto';
import { TurnierplanApi } from '../../../api/turnierplan-api';
import { getOrganization } from '../../../api/fn/organizations/get-organization';
-import { createPlanningRealm } from '../../../api/fn/planning-realms/create-planning-realm';
+import { createTournamentPlanner } from '../../../api/fn/tournament-planners/create-tournament-planner';
@Component({
- templateUrl: './create-planning-realm.component.html',
+ templateUrl: './create-tournament-planner.component.html',
imports: [
LoadingStateDirective,
PageFrameComponent,
@@ -27,11 +27,11 @@ import { createPlanningRealm } from '../../../api/fn/planning-realms/create-plan
TranslatePipe
]
})
-export class CreatePlanningRealmComponent implements OnDestroy {
+export class CreateTournamentPlannerComponent implements OnDestroy {
protected loadingState: LoadingState = { isLoading: false };
protected organization?: OrganizationDto;
- protected planningRealmName = new FormControl('', { nonNullable: true });
+ protected tournamentPlannerName = new FormControl('', { nonNullable: true });
private readonly destroyed$ = new Subject();
@@ -72,18 +72,18 @@ export class CreatePlanningRealmComponent implements OnDestroy {
}
protected confirmButtonClicked(): void {
- if (this.planningRealmName.valid && !this.loadingState.isLoading && this.organization) {
+ if (this.tournamentPlannerName.valid && !this.loadingState.isLoading && this.organization) {
this.loadingState = { isLoading: true };
this.turnierplanApi
- .invoke(createPlanningRealm, {
+ .invoke(createTournamentPlanner, {
body: {
organizationId: this.organization.id,
- name: this.planningRealmName.value
+ name: this.tournamentPlannerName.value
}
})
.pipe(
- switchMap((planningRealm) =>
- from(this.router.navigate(['../../../../planning-realm/', planningRealm.id], { relativeTo: this.route }))
+ switchMap((tournamentPlanner) =>
+ from(this.router.navigate(['../../../../tournament-planner/', tournamentPlanner.id], { relativeTo: this.route }))
)
)
.subscribe({
diff --git a/src/Turnierplan.App/Client/src/app/portal/pages/view-organization/view-organization.component.html b/src/Turnierplan.App/Client/src/app/portal/pages/view-organization/view-organization.component.html
index 19625bf4..20bc9832 100644
--- a/src/Turnierplan.App/Client/src/app/portal/pages/view-organization/view-organization.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/pages/view-organization/view-organization.component.html
@@ -29,10 +29,10 @@
@case (4) {
+ [routerLink]="'create/tournament-planner'" />
}
@case (5) {
} @else {
- @if (planningRealms.length === 0) {
+ @if (tournamentPlanners.length === 0) {
-
+
} @else {
- @for (planningRealm of planningRealms; track planningRealm.id) {
+ @for (tournamentPlanner of tournamentPlanners; track tournamentPlanner.id) {
-
{{ planningRealm.name }}
+
{{ tournamentPlanner.name }}
diff --git a/src/Turnierplan.App/Client/src/app/portal/pages/view-organization/view-organization.component.ts b/src/Turnierplan.App/Client/src/app/portal/pages/view-organization/view-organization.component.ts
index 90765ba0..c3d78356 100644
--- a/src/Turnierplan.App/Client/src/app/portal/pages/view-organization/view-organization.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/pages/view-organization/view-organization.component.ts
@@ -28,13 +28,13 @@ import { IdWidgetComponent } from '../../components/id-widget/id-widget.componen
import { OrganizationDto } from '../../../api/models/organization-dto';
import { TournamentHeaderDto } from '../../../api/models/tournament-header-dto';
import { VenueDto } from '../../../api/models/venue-dto';
-import { PlanningRealmHeaderDto } from '../../../api/models/planning-realm-header-dto';
+import { TournamentPlannerHeaderDto } from '../../../api/models/tournament-planner-header-dto';
import { ApiKeyDto } from '../../../api/models/api-key-dto';
import { TurnierplanApi } from '../../../api/turnierplan-api';
import { getOrganization } from '../../../api/fn/organizations/get-organization';
import { getTournaments } from '../../../api/fn/tournaments/get-tournaments';
import { getVenues } from '../../../api/fn/venues/get-venues';
-import { getPlanningRealms } from '../../../api/fn/planning-realms/get-planning-realms';
+import { getTournamentPlanners } from '../../../api/fn/tournament-planners/get-tournament-planners';
import { setOrganizationName } from '../../../api/fn/organizations/set-organization-name';
import { deleteOrganization } from '../../../api/fn/organizations/delete-organization';
import { deleteApiKey } from '../../../api/fn/api-keys/delete-api-key';
@@ -88,7 +88,7 @@ export class ViewOrganizationComponent implements OnInit, OnDestroy {
private static readonly venuesPageId = 1;
private static readonly apiKeysPageId = 2;
- private static readonly planningRealmsPageId = 4;
+ private static readonly tournamentPlannersPageId = 4;
protected readonly Actions = Actions;
@@ -96,13 +96,13 @@ export class ViewOrganizationComponent implements OnInit, OnDestroy {
protected organization?: OrganizationDto;
protected tournaments?: TournamentHeaderDto[];
protected venues?: VenueDto[];
- protected planningRealms?: PlanningRealmHeaderDto[];
+ protected tournamentPlanners?: TournamentPlannerHeaderDto[];
protected images?: GetImagesEndpointResponse;
protected imagesTotalSize?: number;
protected apiKeys?: ApiKeyDto[];
protected displayApiKeyUsage?: string;
protected isLoadingVenues = false;
- protected isLoadingPlanningRealms = false;
+ protected isLoadingTournamentPlanners = false;
protected isLoadingImages = false;
protected isLoadingApiKeys = false;
@@ -121,8 +121,8 @@ export class ViewOrganizationComponent implements OnInit, OnDestroy {
icon: 'bi-buildings'
},
{
- id: ViewOrganizationComponent.planningRealmsPageId,
- title: 'Portal.ViewOrganization.Pages.PlanningRealms',
+ id: ViewOrganizationComponent.tournamentPlannersPageId,
+ title: 'Portal.ViewOrganization.Pages.TournamentPlanners',
icon: 'bi-ticket-perforated'
},
{
@@ -230,13 +230,13 @@ export class ViewOrganizationComponent implements OnInit, OnDestroy {
});
}
- if (number === ViewOrganizationComponent.planningRealmsPageId && !this.planningRealms && !this.isLoadingPlanningRealms) {
- // Load planning realms only when the page is opened
- this.isLoadingPlanningRealms = true;
- this.turnierplanApi.invoke(getPlanningRealms, { organizationId: this.organization.id }).subscribe({
- next: (planningRealms) => {
- this.planningRealms = planningRealms;
- this.isLoadingPlanningRealms = false;
+ if (number === ViewOrganizationComponent.tournamentPlannersPageId && !this.tournamentPlanners && !this.isLoadingTournamentPlanners) {
+ // Load tournament planners only when the page is opened
+ this.isLoadingTournamentPlanners = true;
+ this.turnierplanApi.invoke(getTournamentPlanners, { organizationId: this.organization.id }).subscribe({
+ next: (tournamentPlanner) => {
+ this.tournamentPlanners = tournamentPlanner;
+ this.isLoadingTournamentPlanners = false;
},
error: (error) => {
this.loadingState = { isLoading: false, error: error };
diff --git a/src/Turnierplan.App/Client/src/app/portal/pages/view-planning-realm/view-planning-realm.component.html b/src/Turnierplan.App/Client/src/app/portal/pages/view-tournament-planner/view-tournament-planner.component.html
similarity index 60%
rename from src/Turnierplan.App/Client/src/app/portal/pages/view-planning-realm/view-planning-realm.component.html
rename to src/Turnierplan.App/Client/src/app/portal/pages/view-tournament-planner/view-tournament-planner.component.html
index d4f83e26..af7e215f 100644
--- a/src/Turnierplan.App/Client/src/app/portal/pages/view-planning-realm/view-planning-realm.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/pages/view-tournament-planner/view-tournament-planner.component.html
@@ -1,11 +1,11 @@
- @if (planningRealm) {
+ @if (tournamentPlanner) {
@@ -13,8 +13,8 @@
@case (0) {
@@ -22,8 +22,8 @@
@case (1) {
@@ -31,31 +31,31 @@
@case (4) {
}
@case (2) {
-
+
-
- @let canAddApplications = !_hasUnsavedChanges && planningRealm.tournamentClasses.length > 0;
+
+ @let canAddApplications = !_hasUnsavedChanges && tournamentPlanner.tournamentClasses.length > 0;
@if (!canAddApplications) {
+ [tooltipText]="'Portal.ViewTournamentPlanner.AddApplication.TournamentClassRequired'" />
}
+ translationKey="Portal.ViewTournamentPlanner.Settings.Rename"
+ [current]="tournamentPlanner.name"
+ (renamed)="renameTournamentPlanner($event)" />
}
}
@if (_hasUnsavedChanges) {
-
+
}
@@ -81,32 +81,35 @@
@case (0) {
}
@case (1) {
- @if (planningRealm.invitationLinks.length === 0) {
+ @if (tournamentPlanner.invitationLinks.length === 0) {
-
+
} @else {
- @for (invitationLink of planningRealm.invitationLinks; track invitationLink.id) {
+ @for (invitationLink of tournamentPlanner.invitationLinks; track invitationLink.id) {
}
@@ -117,12 +120,12 @@
@case (4) {
}
@@ -130,13 +133,16 @@
@if (hasUnsavedChanges()) {
-
+
} @else {
@@ -144,20 +150,20 @@
}
@case (3) {
-
+
+ [translationKey]="'Portal.ViewTournamentPlanner.DeleteWidget'"
+ [targetObjectName]="tournamentPlanner.name"
+ (deleteClick)="deleteTournamentPlanner()" />
}
}
@@ -168,7 +174,7 @@
diff --git a/src/Turnierplan.App/Client/src/app/portal/pages/view-planning-realm/view-planning-realm.component.ts b/src/Turnierplan.App/Client/src/app/portal/pages/view-tournament-planner/view-tournament-planner.component.ts
similarity index 69%
rename from src/Turnierplan.App/Client/src/app/portal/pages/view-planning-realm/view-planning-realm.component.ts
rename to src/Turnierplan.App/Client/src/app/portal/pages/view-tournament-planner/view-tournament-planner.component.ts
index 31a06a6a..02e4ebc7 100644
--- a/src/Turnierplan.App/Client/src/app/portal/pages/view-planning-realm/view-planning-realm.component.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/pages/view-tournament-planner/view-tournament-planner.component.ts
@@ -27,21 +27,21 @@ import { ManageApplicationsFilterComponent } from '../../components/manage-appli
import { RbacWidgetComponent } from '../../components/rbac-widget/rbac-widget.component';
import { DeleteWidgetComponent } from '../../components/delete-widget/delete-widget.component';
import { ManageApplicationsComponent } from '../../components/manage-applications/manage-applications.component';
-import { PlanningRealmDto } from '../../../api/models/planning-realm-dto';
+import { TournamentPlannerDto } from '../../../api/models/tournament-planner-dto';
import { TurnierplanApi } from '../../../api/turnierplan-api';
import { CreateApplicationEndpointRequest } from '../../../api/models/create-application-endpoint-request';
-import { UpdatePlanningRealmEndpointRequest } from '../../../api/models/update-planning-realm-endpoint-request';
-import { getPlanningRealm } from '../../../api/fn/planning-realms/get-planning-realm';
+import { UpdateTournamentPlannerEndpointRequest } from '../../../api/models/update-tournament-planner-endpoint-request';
+import { getTournamentPlanner } from '../../../api/fn/tournament-planners/get-tournament-planner';
import { createApplication } from '../../../api/fn/applications/create-application';
-import { updatePlanningRealm } from '../../../api/fn/planning-realms/update-planning-realm';
-import { deletePlanningRealm } from '../../../api/fn/planning-realms/delete-planning-realm';
+import { updateTournamentPlanner } from '../../../api/fn/tournament-planners/update-tournament-planner';
+import { deleteTournamentPlanner } from '../../../api/fn/tournament-planners/delete-tournament-planner';
import { LabelsManagerComponent } from '../../components/labels-manager/labels-manager.component';
import { ExportApplicationsDialogComponent } from '../../components/export-applications-dialog/export-applications-dialog.component';
-export type UpdatePlanningRealmFunc = (modifyFunc: (planningRealm: PlanningRealmDto) => boolean) => void;
+export type UpdateTournamentPlannerFunc = (modifyFunc: (tournamentPlanner: TournamentPlannerDto) => boolean) => void;
@Component({
- templateUrl: './view-planning-realm.component.html',
+ templateUrl: './view-tournament-planner.component.html',
imports: [
LoadingStateDirective,
PageFrameComponent,
@@ -62,7 +62,7 @@ export type UpdatePlanningRealmFunc = (modifyFunc: (planningRealm: PlanningRealm
LabelsManagerComponent
]
})
-export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardChangesDetector {
+export class ViewTournamentPlannerComponent implements OnInit, OnDestroy, DiscardChangesDetector {
// Note: The color codes are written with '#' such that the IDE detects it as a color code and displays the color preview.
private static readonly DefaultInvitationLinkColorCodes: string[] = [
'#ff9900',
@@ -100,8 +100,8 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
protected pageFrame!: PageFrameComponent;
protected loadingState: LoadingState = { isLoading: true };
- protected updateFunction: UpdatePlanningRealmFunc;
- protected planningRealm?: PlanningRealmDto;
+ protected updateFunction: UpdateTournamentPlannerFunc;
+ protected tournamentPlanner?: TournamentPlannerDto;
protected applicationsFilter: ApplicationsFilter = defaultApplicationsFilter;
protected _hasUnsavedChanges = false;
@@ -114,28 +114,28 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
protected pages: PageFrameNavigationTab[] = [
{
id: 0,
- title: 'Portal.ViewPlanningRealm.Pages.TournamentClasses',
+ title: 'Portal.ViewTournamentPlanner.Pages.TournamentClasses',
icon: 'bi-x-diamond'
},
{
id: 1,
- title: 'Portal.ViewPlanningRealm.Pages.InvitationLinks',
+ title: 'Portal.ViewTournamentPlanner.Pages.InvitationLinks',
icon: 'bi-link-45deg'
},
{
id: 4,
- title: 'Portal.ViewPlanningRealm.Pages.Labels',
+ title: 'Portal.ViewTournamentPlanner.Pages.Labels',
icon: 'bi-tags'
},
{
- id: ViewPlanningRealmComponent.ApplicationsManagerPageId,
- title: 'Portal.ViewPlanningRealm.Pages.Applications',
+ id: ViewTournamentPlannerComponent.ApplicationsManagerPageId,
+ title: 'Portal.ViewTournamentPlanner.Pages.Applications',
icon: 'bi-card-checklist',
authorization: Actions.ApplicationsRead
},
{
id: 3,
- title: 'Portal.ViewPlanningRealm.Pages.Settings',
+ title: 'Portal.ViewTournamentPlanner.Pages.Settings',
icon: 'bi-gear',
authorization: Actions.GenericWrite
}
@@ -152,9 +152,9 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
private readonly modalService: NgbModal,
private readonly localStorageService: LocalStorageService
) {
- this.updateFunction = (modifyFunc: (planningRealm: PlanningRealmDto) => boolean) => {
- if (this.planningRealm) {
- if (modifyFunc(this.planningRealm)) {
+ this.updateFunction = (modifyFunc: (tournamentPlanner: TournamentPlannerDto) => boolean) => {
+ if (this.tournamentPlanner) {
+ if (modifyFunc(this.tournamentPlanner)) {
this._hasUnsavedChanges = true;
}
}
@@ -166,18 +166,18 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
.pipe(
takeUntil(this.destroyed$),
switchMap((params) => {
- const planningRealmId = params.get('id');
- if (planningRealmId === null) {
+ const tournamentPlannerId = params.get('id');
+ if (tournamentPlannerId === null) {
this.loadingState = { isLoading: false };
return of();
}
this.loadingState = { isLoading: true };
- return this.turnierplanApi.invoke(getPlanningRealm, { id: planningRealmId });
+ return this.turnierplanApi.invoke(getTournamentPlanner, { id: tournamentPlannerId });
})
)
.subscribe({
- next: (planningRealm) => {
- this.setPlanningRealm(planningRealm);
+ next: (tournamentPlanner) => {
+ this.setTournamentPlanner(tournamentPlanner);
this.loadingState = { isLoading: false };
},
error: (error) => {
@@ -201,8 +201,8 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
protected addTournamentClass(): void {
this.openModalForEnteringName('NewTournamentClass').subscribe({
next: (name) => {
- this.updateFunction((planningRealm) => {
- planningRealm.tournamentClasses.push({
+ this.updateFunction((tournamentPlanner) => {
+ tournamentPlanner.tournamentClasses.push({
id: this.nextId--,
name: name.trim(),
numberOfTeams: 0
@@ -217,8 +217,8 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
protected addInvitationLink(): void {
this.openModalForEnteringName('NewInvitationLink', true).subscribe({
next: (name) => {
- this.updateFunction((planningRealm) => {
- planningRealm.invitationLinks.push({
+ this.updateFunction((tournamentPlanner) => {
+ tournamentPlanner.invitationLinks.push({
colorCode: this.getColorCodeForInvitationLink(),
isActive: true,
contactEmail: undefined,
@@ -246,8 +246,8 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
protected addLabel(): void {
this.openModalForEnteringName('NewLabel').subscribe({
next: (name) => {
- this.updateFunction((planningRealm) => {
- planningRealm.labels.push({
+ this.updateFunction((tournamentPlanner) => {
+ tournamentPlanner.labels.push({
colorCode: this.getColorCodeForLabel(),
description: '',
id: this.nextId--,
@@ -261,11 +261,11 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
}
protected addApplication(): void {
- if (!this.planningRealm || this._hasUnsavedChanges || this.planningRealm.tournamentClasses.length === 0) {
+ if (!this.tournamentPlanner || this._hasUnsavedChanges || this.tournamentPlanner.tournamentClasses.length === 0) {
return;
}
- const planningRealmId = this.planningRealm.id;
+ const tournamentPlannerId = this.tournamentPlanner.id;
const ref = this.modalService.open(NewApplicationDialogComponent, {
centered: true,
@@ -274,24 +274,26 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
});
const component = ref.componentInstance as NewApplicationDialogComponent;
- component.init(this.planningRealm);
+ component.init(this.tournamentPlanner);
ref.closed
.pipe(
tap(() => (this.loadingState = { isLoading: true })),
switchMap((request: CreateApplicationEndpointRequest) =>
- this.turnierplanApi.invoke(createApplication, { planningRealmId: planningRealmId, body: request }).pipe(map(() => request))
+ this.turnierplanApi
+ .invoke(createApplication, { tournamentPlannerId: tournamentPlannerId, body: request })
+ .pipe(map(() => request))
)
)
.subscribe({
next: (request: CreateApplicationEndpointRequest) => {
this.loadingState = { isLoading: false };
- // Modify the planning realm stored in the client to account for the newly added teams. By doing this "hack" we can prevent
- // a separate request for querying the entire planning realm when only the "numberOfTeams" property has changed.
- if (this.planningRealm) {
+ // Modify the tournament planner stored in the client to account for the newly added teams. By doing this "hack" we can prevent
+ // a separate request for querying the entire tournament planner when only the "numberOfTeams" property has changed.
+ if (this.tournamentPlanner) {
for (const entry of request.entries) {
- const tournamentClass = this.planningRealm.tournamentClasses?.find((x) => x.id === entry.tournamentClassId);
+ const tournamentClass = this.tournamentPlanner.tournamentClasses?.find((x) => x.id === entry.tournamentClassId);
if (tournamentClass) {
tournamentClass.numberOfTeams += entry.numberOfTeams;
}
@@ -305,7 +307,7 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
}
protected exportApplications(): void {
- if (!this.planningRealm) {
+ if (!this.tournamentPlanner) {
return;
}
@@ -315,7 +317,7 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
fullscreen: 'md'
});
- (ref.componentInstance as ExportApplicationsDialogComponent).initialize(this.planningRealm);
+ (ref.componentInstance as ExportApplicationsDialogComponent).initialize(this.tournamentPlanner);
ref.dismissed.subscribe({
next: (reason?: { isApiError?: boolean; apiError?: unknown }) => {
@@ -327,34 +329,34 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
});
}
- protected renamePlanningRealm(name: string): void {
- if (!this.planningRealm) {
+ protected renameTournamentPlanner(name: string): void {
+ if (!this.tournamentPlanner) {
return;
}
- this.updateFunction((planningRealm) => {
- planningRealm.name = name;
+ this.updateFunction((tournamentPlanner) => {
+ tournamentPlanner.name = name;
return true;
});
- this.titleService.setTitleFrom(this.planningRealm);
+ this.titleService.setTitleFrom(this.tournamentPlanner);
}
- protected savePlanningRealm(): void {
- if (!this.planningRealm || this.loadingState.isLoading) {
+ protected saveTournamentPlanner(): void {
+ if (!this.tournamentPlanner || this.loadingState.isLoading) {
return;
}
- const planningRealmId = this.planningRealm.id;
+ const tournamentPlannerId = this.tournamentPlanner.id;
this.loadingState = { isLoading: true };
- const request: UpdatePlanningRealmEndpointRequest = {
- name: this.planningRealm.name,
- tournamentClasses: this.planningRealm.tournamentClasses.map((x) => ({
+ const request: UpdateTournamentPlannerEndpointRequest = {
+ name: this.tournamentPlanner.name,
+ tournamentClasses: this.tournamentPlanner.tournamentClasses.map((x) => ({
id: x.id < 0 ? undefined : x.id,
name: x.name
})),
- invitationLinks: this.planningRealm.invitationLinks.map((x) => ({
+ invitationLinks: this.tournamentPlanner.invitationLinks.map((x) => ({
id: x.id < 0 ? undefined : x.id,
name: x.name,
colorCode: x.colorCode,
@@ -374,7 +376,7 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
allowNewRegistrations: y.allowNewRegistrations
}))
})),
- labels: this.planningRealm.labels.map((x) => ({
+ labels: this.tournamentPlanner.labels.map((x) => ({
id: x.id < 0 ? undefined : x.id,
name: x.name,
description: x.description,
@@ -383,11 +385,11 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
};
this.turnierplanApi
- .invoke(updatePlanningRealm, { id: planningRealmId, body: request })
- .pipe(switchMap(() => this.turnierplanApi.invoke(getPlanningRealm, { id: planningRealmId })))
+ .invoke(updateTournamentPlanner, { id: tournamentPlannerId, body: request })
+ .pipe(switchMap(() => this.turnierplanApi.invoke(getTournamentPlanner, { id: tournamentPlannerId })))
.subscribe({
- next: (planningRealm) => {
- this.setPlanningRealm(planningRealm);
+ next: (tournamentPlanner) => {
+ this.setTournamentPlanner(tournamentPlanner);
this.loadingState = { isLoading: false };
},
error: (error) => {
@@ -396,19 +398,19 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
});
}
- protected deletePlanningRealm(): void {
- if (!this.planningRealm) {
+ protected deleteTournamentPlanner(): void {
+ if (!this.tournamentPlanner) {
return;
}
- const organizationId = this.planningRealm.organizationId;
+ const organizationId = this.tournamentPlanner.organizationId;
this.loadingState = { isLoading: true, error: undefined };
- this.turnierplanApi.invoke(deletePlanningRealm, { id: this.planningRealm.id }).subscribe({
+ this.turnierplanApi.invoke(deleteTournamentPlanner, { id: this.tournamentPlanner.id }).subscribe({
next: () => {
this.notificationService.showNotification(
'info',
- 'Portal.ViewPlanningRealm.DeleteWidget.SuccessToast.Title',
- 'Portal.ViewPlanningRealm.DeleteWidget.SuccessToast.Message'
+ 'Portal.ViewTournamentPlanner.DeleteWidget.SuccessToast.Title',
+ 'Portal.ViewTournamentPlanner.DeleteWidget.SuccessToast.Message'
);
void this.router.navigate([`../../organization/${organizationId}`], { relativeTo: this.route });
},
@@ -421,26 +423,26 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
protected onApplicationsFilterChange(filter: ApplicationsFilter): void {
this.applicationsFilter = filter;
- if (this.planningRealm) {
- this.localStorageService.setPlanningRealmApplicationsFilter(this.planningRealm.id, filter);
+ if (this.tournamentPlanner) {
+ this.localStorageService.setTournamentPlannerApplicationsFilter(this.tournamentPlanner.id, filter);
}
}
protected navigateToApplicationsWithFilter(filter: ApplicationsFilter): void {
this.onApplicationsFilterChange(filter);
- if (this.currentPage !== ViewPlanningRealmComponent.ApplicationsManagerPageId) {
- this.pageFrame.toggleNavigationTab(ViewPlanningRealmComponent.ApplicationsManagerPageId);
+ if (this.currentPage !== ViewTournamentPlannerComponent.ApplicationsManagerPageId) {
+ this.pageFrame.toggleNavigationTab(ViewTournamentPlannerComponent.ApplicationsManagerPageId);
}
}
- private setPlanningRealm(planningRealm: PlanningRealmDto): void {
- this.planningRealm = planningRealm;
+ private setTournamentPlanner(tournamentPlanner: TournamentPlannerDto): void {
+ this.tournamentPlanner = tournamentPlanner;
this._hasUnsavedChanges = false;
- this.titleService.setTitleFrom(this.planningRealm);
+ this.titleService.setTitleFrom(this.tournamentPlanner);
- this.applicationsFilter = this.localStorageService.getPlanningRealmApplicationsFilter(planningRealm.id);
+ this.applicationsFilter = this.localStorageService.getTournamentPlannerApplicationsFilter(tournamentPlanner.id);
}
private openModalForEnteringName(key: string, showAlert: boolean = false): Observable
{
@@ -452,7 +454,7 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
const component = ref.componentInstance as TextInputDialogComponent;
component.init(
- `Portal.ViewPlanningRealm.${key}`,
+ `Portal.ViewTournamentPlanner.${key}`,
'',
false,
true,
@@ -463,22 +465,25 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
}
private getColorCodeForInvitationLink(): string {
- if (!this.planningRealm) {
+ if (!this.tournamentPlanner) {
return 'aaaaaa';
}
- return ViewPlanningRealmComponent.getColorCode(
- ViewPlanningRealmComponent.DefaultInvitationLinkColorCodes,
- this.planningRealm.invitationLinks
+ return ViewTournamentPlannerComponent.getColorCode(
+ ViewTournamentPlannerComponent.DefaultInvitationLinkColorCodes,
+ this.tournamentPlanner.invitationLinks
);
}
private getColorCodeForLabel(): string {
- if (!this.planningRealm) {
+ if (!this.tournamentPlanner) {
return 'aaaaaa';
}
- return ViewPlanningRealmComponent.getColorCode(ViewPlanningRealmComponent.DefaultLabelColorCodes, this.planningRealm.labels);
+ return ViewTournamentPlannerComponent.getColorCode(
+ ViewTournamentPlannerComponent.DefaultLabelColorCodes,
+ this.tournamentPlanner.labels
+ );
}
private static getColorCode(from: string[], currentlyUsed: { colorCode: string }[]): string {
diff --git a/src/Turnierplan.App/Client/src/app/portal/portal.routes.ts b/src/Turnierplan.App/Client/src/app/portal/portal.routes.ts
index df381dfd..8b2c9bad 100644
--- a/src/Turnierplan.App/Client/src/app/portal/portal.routes.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/portal.routes.ts
@@ -7,10 +7,10 @@ import { CreateUserComponent } from './pages/create-user/create-user.component';
import { CreateOrganizationComponent } from './pages/create-organization/create-organization.component';
import { ViewOrganizationComponent } from './pages/view-organization/view-organization.component';
import { CreateApiKeyComponent } from './pages/create-api-key/create-api-key.component';
-import { CreatePlanningRealmComponent } from './pages/create-planning-realm/create-planning-realm.component';
+import { CreateTournamentPlannerComponent } from './pages/create-tournament-planner/create-tournament-planner.component';
import { CreateTournamentComponent } from './pages/create-tournament/create-tournament.component';
import { CreateVenueComponent } from './pages/create-venue/create-venue.component';
-import { ViewPlanningRealmComponent } from './pages/view-planning-realm/view-planning-realm.component';
+import { ViewTournamentPlannerComponent } from './pages/view-tournament-planner/view-tournament-planner.component';
import { discardChangesGuard } from '../core/guards/discard-changes.guard';
import { FolderStatisticsComponent } from './pages/folder-statistics/folder-statistics.component';
import { FolderTimetableComponent } from './pages/folder-timetable/folder-timetable.component';
@@ -57,7 +57,14 @@ export const portalRoutes: Routes = [
},
{
path: 'organization/:id/create/planning-realm',
- component: CreatePlanningRealmComponent
+ redirectTo: (data): string => {
+ // TODO: Test redirect works as expected
+ return `organization/${data.params['id']}/create-tournament-planner`;
+ }
+ },
+ {
+ path: 'organization/:id/create/tournament-planner',
+ component: CreateTournamentPlannerComponent
},
{
path: 'organization/:id/create/tournament',
@@ -69,7 +76,14 @@ export const portalRoutes: Routes = [
},
{
path: 'planning-realm/:id',
- component: ViewPlanningRealmComponent,
+ redirectTo: (data): string => {
+ // TODO: Test redirect works as expected
+ return `tournament-planner/${data.params['id']}`;
+ }
+ },
+ {
+ path: 'tournament-planner/:id',
+ component: ViewTournamentPlannerComponent,
canDeactivate: [discardChangesGuard]
},
{
diff --git a/src/Turnierplan.App/Client/src/app/portal/services/local-storage.service.ts b/src/Turnierplan.App/Client/src/app/portal/services/local-storage.service.ts
index 09a03b29..d04df279 100644
--- a/src/Turnierplan.App/Client/src/app/portal/services/local-storage.service.ts
+++ b/src/Turnierplan.App/Client/src/app/portal/services/local-storage.service.ts
@@ -44,12 +44,12 @@ export class LocalStorageService {
return this.getValueFromLocalStorage('tp_openTournamentInNewTab', (x) => x === 'true') ?? true;
}
- public setPlanningRealmApplicationsFilter(planningRealmId: string, filter: ApplicationsFilter): void {
- localStorage.setItem(`tp_applicationsFilter_${planningRealmId}`, JSON.stringify(filter));
+ public setTournamentPlannerApplicationsFilter(tournamentPlanner: string, filter: ApplicationsFilter): void {
+ localStorage.setItem(`tp_applicationsFilter_${tournamentPlanner}`, JSON.stringify(filter));
}
- public getPlanningRealmApplicationsFilter(planningRealmId: string): ApplicationsFilter {
- const value = this.getValueFromLocalStorage(`tp_applicationsFilter_${planningRealmId}`, (x) => x);
+ public getTournamentPlannerApplicationsFilter(tournamentPlanner: string): ApplicationsFilter {
+ const value = this.getValueFromLocalStorage(`tp_applicationsFilter_${tournamentPlanner}`, (x) => x);
if (value) {
return { ...defaultApplicationsFilter, ...(JSON.parse(value) as ApplicationsFilter) };
@@ -66,12 +66,12 @@ export class LocalStorageService {
return this.getValueFromLocalStorage('tp_addTeamDialogMode', (x) => x);
}
- public setSelectApplicationTeamPlanningRealmId(organizationId: string, planningRealmId: string): void {
- localStorage.setItem(`tp_selectApplicationTeamPlanningRealmId_${organizationId}`, planningRealmId);
+ public setSelectApplicationTeamTournamentPlannerId(organizationId: string, tournamentPlannerId: string): void {
+ localStorage.setItem(`tp_selectApplicationTeamTournamentPlannerId_${organizationId}`, tournamentPlannerId);
}
- public getSelectApplicationTeamPlanningRealmId(organizationId: string): string | undefined {
- return this.getValueFromLocalStorage(`tp_selectApplicationTeamPlanningRealmId_${organizationId}`, (x) => x);
+ public getSelectApplicationTeamTournamentPlannerId(organizationId: string): string | undefined {
+ return this.getValueFromLocalStorage(`tp_selectApplicationTeamTournamentPlannerId_${organizationId}`, (x) => x);
}
public setColorTheme(theme: string): void {
diff --git a/src/Turnierplan.App/Endpoints/ApplicationTeams/CreateApplicationTeamEndpoint.cs b/src/Turnierplan.App/Endpoints/ApplicationTeams/CreateApplicationTeamEndpoint.cs
index 18e14c27..f63dd3de 100644
--- a/src/Turnierplan.App/Endpoints/ApplicationTeams/CreateApplicationTeamEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/ApplicationTeams/CreateApplicationTeamEndpoint.cs
@@ -11,15 +11,15 @@ internal sealed class CreateApplicationTeamEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Post;
- protected override string Route => "/api/planning-realms/{planningRealmId}/applications/{applicationId:int}/teams";
+ protected override string Route => "/api/tournament-planners/{tournamentPlannerId}/applications/{applicationId:int}/teams";
protected override Delegate Handler => Handle;
private static async Task Handle(
- [FromRoute] PublicId planningRealmId,
+ [FromRoute] PublicId tournamentPlannerId,
[FromRoute] long applicationId,
[FromBody] CreateApplicationTeamEndpointRequest request,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
CancellationToken cancellationToken)
{
@@ -28,20 +28,20 @@ private static async Task Handle(
return result;
}
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.TournamentClasses | IPlanningRealmRepository.Includes.Applications);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.TournamentClasses | ITournamentPlannerRepository.Includes.Applications);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsWrite))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsWrite))
{
return Results.Forbid();
}
- var application = planningRealm.Applications.FirstOrDefault(x => x.Id == applicationId);
- var tournamentClass = planningRealm.TournamentClasses.FirstOrDefault(x => x.Id == request.TournamentClassId);
+ var application = tournamentPlanner.Applications.FirstOrDefault(x => x.Id == applicationId);
+ var tournamentClass = tournamentPlanner.TournamentClasses.FirstOrDefault(x => x.Id == request.TournamentClassId);
if (application is null || tournamentClass is null)
{
@@ -50,7 +50,7 @@ private static async Task Handle(
application.AddTeam(tournamentClass, request.TeamName);
- await planningRealmRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
+ await tournamentPlannerRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
return Results.NoContent();
}
diff --git a/src/Turnierplan.App/Endpoints/ApplicationTeams/DeleteApplicationTeamEndpoint.cs b/src/Turnierplan.App/Endpoints/ApplicationTeams/DeleteApplicationTeamEndpoint.cs
index 4ba9858d..ab095640 100644
--- a/src/Turnierplan.App/Endpoints/ApplicationTeams/DeleteApplicationTeamEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/ApplicationTeams/DeleteApplicationTeamEndpoint.cs
@@ -9,31 +9,31 @@ internal sealed class DeleteApplicationTeamEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Delete;
- protected override string Route => "/api/planning-realms/{planningRealmId}/applications/{applicationId:int}/teams/{applicationTeamId:int}";
+ protected override string Route => "/api/tournament-planners/{tournamentPlannerId}/applications/{applicationId:int}/teams/{applicationTeamId:int}";
protected override Delegate Handler => Handle;
private static async Task Handle(
- [FromRoute] PublicId planningRealmId,
+ [FromRoute] PublicId tournamentPlannerId,
[FromRoute] long applicationId,
[FromRoute] long applicationTeamId,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
CancellationToken cancellationToken)
{
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.ApplicationsWithTeams);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.ApplicationsWithTeams);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsWrite))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsWrite))
{
return Results.Forbid();
}
- var application = planningRealm.Applications.FirstOrDefault(x => x.Id == applicationId);
+ var application = tournamentPlanner.Applications.FirstOrDefault(x => x.Id == applicationId);
if (application is null)
{
@@ -54,7 +54,7 @@ private static async Task Handle(
application.RemoveTeam(applicationTeam);
- await planningRealmRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
+ await tournamentPlannerRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
return Results.NoContent();
}
diff --git a/src/Turnierplan.App/Endpoints/ApplicationTeams/SetApplicationTeamLabelsEndpoint.cs b/src/Turnierplan.App/Endpoints/ApplicationTeams/SetApplicationTeamLabelsEndpoint.cs
index ece052f8..69f792bd 100644
--- a/src/Turnierplan.App/Endpoints/ApplicationTeams/SetApplicationTeamLabelsEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/ApplicationTeams/SetApplicationTeamLabelsEndpoint.cs
@@ -11,16 +11,16 @@ internal sealed class SetApplicationTeamLabelsEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Patch;
- protected override string Route => "/api/planning-realms/{planningRealmId}/applications/{applicationId:int}/teams/{applicationTeamId:int}/labels";
+ protected override string Route => "/api/tournament-planners/{tournamentPlannerId}/applications/{applicationId:int}/teams/{applicationTeamId:int}/labels";
protected override Delegate Handler => Handle;
private static async Task Handle(
- [FromRoute] PublicId planningRealmId,
+ [FromRoute] PublicId tournamentPlannerId,
[FromRoute] long applicationId,
[FromRoute] long applicationTeamId,
[FromBody] SetApplicationTeamLabelsEndpointRequest request,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
CancellationToken cancellationToken)
{
@@ -29,19 +29,19 @@ private static async Task Handle(
return result;
}
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.ApplicationsWithTeams | IPlanningRealmRepository.Includes.Labels);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.ApplicationsWithTeams | ITournamentPlannerRepository.Includes.Labels);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsWrite))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsWrite))
{
return Results.Forbid();
}
- var application = planningRealm.Applications.FirstOrDefault(x => x.Id == applicationId);
+ var application = tournamentPlanner.Applications.FirstOrDefault(x => x.Id == applicationId);
if (application is null)
{
@@ -65,7 +65,7 @@ private static async Task Handle(
foreach (var labelId in labelsToAdd)
{
- var label = planningRealm.Labels.FirstOrDefault(x => x.Id == labelId);
+ var label = tournamentPlanner.Labels.FirstOrDefault(x => x.Id == labelId);
if (label is null)
{
@@ -75,7 +75,7 @@ private static async Task Handle(
applicationTeam.AddLabel(label);
}
- await planningRealmRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
+ await tournamentPlannerRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
return Results.NoContent();
}
diff --git a/src/Turnierplan.App/Endpoints/ApplicationTeams/SetApplicationTeamNameEndpoint.cs b/src/Turnierplan.App/Endpoints/ApplicationTeams/SetApplicationTeamNameEndpoint.cs
index 26937c42..3820f942 100644
--- a/src/Turnierplan.App/Endpoints/ApplicationTeams/SetApplicationTeamNameEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/ApplicationTeams/SetApplicationTeamNameEndpoint.cs
@@ -11,16 +11,16 @@ internal sealed class SetApplicationTeamNameEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Patch;
- protected override string Route => "/api/planning-realms/{planningRealmId}/applications/{applicationId:int}/teams/{applicationTeamId:int}/name";
+ protected override string Route => "/api/tournament-planners/{tournamentPlannerId}/applications/{applicationId:int}/teams/{applicationTeamId:int}/name";
protected override Delegate Handler => Handle;
private static async Task Handle(
- [FromRoute] PublicId planningRealmId,
+ [FromRoute] PublicId tournamentPlannerId,
[FromRoute] long applicationId,
[FromRoute] long applicationTeamId,
[FromBody] SetApplicationTeamNameEndpointRequest request,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
CancellationToken cancellationToken)
{
@@ -30,19 +30,19 @@ private static async Task Handle(
}
// Note: We must use 'ApplicationsWithTeamsAndTournamentLinks' because if a team link exists, the tournament team must also be renamed
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.ApplicationsWithTeamsAndTournamentLinks);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.ApplicationsWithTeamsAndTournamentLinks);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsWrite))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsWrite))
{
return Results.Forbid();
}
- var application = planningRealm.Applications.FirstOrDefault(x => x.Id == applicationId);
+ var application = tournamentPlanner.Applications.FirstOrDefault(x => x.Id == applicationId);
if (application is null)
{
@@ -58,7 +58,7 @@ private static async Task Handle(
applicationTeam.SetName(request.Name);
- await planningRealmRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
+ await tournamentPlannerRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
return Results.NoContent();
}
diff --git a/src/Turnierplan.App/Endpoints/Applications/CreateApplicationEndpoint.cs b/src/Turnierplan.App/Endpoints/Applications/CreateApplicationEndpoint.cs
index 5b18777d..4b220a3f 100644
--- a/src/Turnierplan.App/Endpoints/Applications/CreateApplicationEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Applications/CreateApplicationEndpoint.cs
@@ -13,14 +13,14 @@ internal sealed class CreateApplicationEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Post;
- protected override string Route => "/api/planning-realms/{planningRealmId}/applications";
+ protected override string Route => "/api/tournament-planners/{tournamentPlannerId}/applications";
protected override Delegate Handler => Handle;
private static async Task Handle(
- [FromRoute] PublicId planningRealmId,
+ [FromRoute] PublicId tournamentPlannerId,
[FromBody] CreateApplicationEndpointRequest request,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
IMapper mapper,
CancellationToken cancellationToken)
@@ -30,26 +30,26 @@ private static async Task Handle(
return result;
}
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.TournamentClasses);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.TournamentClasses);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsWrite))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsWrite))
{
return Results.Forbid();
}
- var application = planningRealm.AddApplication(null, request.Contact);
+ var application = tournamentPlanner.AddApplication(null, request.Contact);
application.ContactEmail = request.ContactEmail;
application.ContactTelephone = request.ContactTelephone;
foreach (var entry in request.Entries)
{
- var tournamentClass = planningRealm.TournamentClasses.FirstOrDefault(x => x.Id == entry.TournamentClassId);
+ var tournamentClass = tournamentPlanner.TournamentClasses.FirstOrDefault(x => x.Id == entry.TournamentClassId);
if (tournamentClass is null)
{
@@ -66,7 +66,7 @@ private static async Task Handle(
// don't add change log entries for the previously changed properties & added teams
application.ClearChangeLog();
- await planningRealmRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
+ await tournamentPlannerRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
return Results.Ok(mapper.Map(application));
}
diff --git a/src/Turnierplan.App/Endpoints/Applications/ExportApplicationsEndpoint.cs b/src/Turnierplan.App/Endpoints/Applications/ExportApplicationsEndpoint.cs
index 0eaac5aa..1b83afd8 100644
--- a/src/Turnierplan.App/Endpoints/Applications/ExportApplicationsEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Applications/ExportApplicationsEndpoint.cs
@@ -12,7 +12,7 @@ internal sealed class ExportApplicationsEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Get;
- protected override string Route => "/api/planning-realms/{planningRealmId}/applications-export";
+ protected override string Route => "/api/tournament-planners/{tournamentPlannerId}/applications-export";
protected override Delegate Handler => Handle;
@@ -22,10 +22,10 @@ protected override void ConfigureMetadata(RouteHandlerBuilder builder)
}
private static async Task Handle(
- [FromRoute] PublicId planningRealmId,
+ [FromRoute] PublicId tournamentPlannerId,
[FromQuery] string languageCode,
[FromQuery] bool includeApplicationTeams,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
ILocalizationProvider localizationProvider)
{
@@ -34,14 +34,14 @@ private static async Task Handle(
return Results.BadRequest("Invalid language code specified.");
}
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.ApplicationsWithTeams);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.ApplicationsWithTeams);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsRead))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsRead))
{
return Results.Forbid();
}
@@ -77,7 +77,7 @@ await csv.WriteHeaderAsync(
);
}
- foreach (var application in planningRealm.Applications.OrderBy(x => x.CreatedAt))
+ foreach (var application in tournamentPlanner.Applications.OrderBy(x => x.CreatedAt))
{
if (includeApplicationTeams)
{
diff --git a/src/Turnierplan.App/Endpoints/Applications/GetApplicationChangeLogEndpoint.cs b/src/Turnierplan.App/Endpoints/Applications/GetApplicationChangeLogEndpoint.cs
index 28edab38..13a2b724 100644
--- a/src/Turnierplan.App/Endpoints/Applications/GetApplicationChangeLogEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Applications/GetApplicationChangeLogEndpoint.cs
@@ -11,31 +11,31 @@ internal sealed class GetApplicationChangeLogEndpoint : EndpointBase HttpMethod.Get;
- protected override string Route => "/api/planning-realms/{planningRealmId}/applications/{applicationId:int}/changelog";
+ protected override string Route => "/api/tournament-planners/{tournamentPlannerId}/applications/{applicationId:int}/changelog";
protected override Delegate Handler => Handle;
private static async Task Handle(
- [FromRoute] PublicId planningRealmId,
+ [FromRoute] PublicId tournamentPlannerId,
[FromRoute] long applicationId,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
IApplicationChangeLogRepository applicationChangeLogRepository,
IMapper mapper)
{
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.Applications);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.Applications);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsRead))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsRead))
{
return Results.Forbid();
}
- var application = planningRealm.Applications.FirstOrDefault(x => x.Id == applicationId);
+ var application = tournamentPlanner.Applications.FirstOrDefault(x => x.Id == applicationId);
if (application is null)
{
diff --git a/src/Turnierplan.App/Endpoints/Applications/GetApplicationsEndpoint.cs b/src/Turnierplan.App/Endpoints/Applications/GetApplicationsEndpoint.cs
index 5d1afc53..14295978 100644
--- a/src/Turnierplan.App/Endpoints/Applications/GetApplicationsEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Applications/GetApplicationsEndpoint.cs
@@ -4,8 +4,8 @@
using Turnierplan.App.Mapping;
using Turnierplan.App.Models;
using Turnierplan.App.Security;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Dal.Repositories;
namespace Turnierplan.App.Endpoints.Applications;
@@ -14,19 +14,19 @@ internal sealed class GetApplicationsEndpoint : EndpointBase HttpMethod.Get;
- protected override string Route => "/api/planning-realms/{planningRealmId}/applications";
+ protected override string Route => "/api/tournament-planners/{tournamentPlannerId}/applications";
protected override Delegate Handler => Handle;
private static async Task Handle(
- [FromRoute] PublicId planningRealmId,
+ [FromRoute] PublicId tournamentPlannerId,
[FromQuery] int? page,
[FromQuery] int? pageSize,
[FromQuery] string? searchTerm,
[FromQuery] string[] tournamentClass,
[FromQuery] string[] invitationLink,
[FromQuery] string[] label,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
IMapper mapper)
{
@@ -45,20 +45,20 @@ private static async Task Handle(
return Results.BadRequest("Invalid label filter provided.");
}
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.TournamentClasses | IPlanningRealmRepository.Includes.ApplicationsWithTeamsAndTournamentLinks);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.TournamentClasses | ITournamentPlannerRepository.Includes.ApplicationsWithTeamsAndTournamentLinks);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsRead))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsRead))
{
return Results.Forbid();
}
var queryLogic = new QueryLogic(page, pageSize, searchTerm, tournamentClassFilter, invitationLinkFilter, labelFilter);
- var result = queryLogic.Process(planningRealm, mapper);
+ var result = queryLogic.Process(tournamentPlanner, mapper);
return Results.Ok(result);
}
@@ -90,9 +90,9 @@ public QueryLogic(
_labelFilter = labelFilter;
}
- public PaginationResultDto Process(PlanningRealm planningRealm, IMapper mapper)
+ public PaginationResultDto Process(TournamentPlanner tournamentPlanner, IMapper mapper)
{
- var applications = planningRealm.Applications.AsEnumerable();
+ var applications = tournamentPlanner.Applications.AsEnumerable();
if (_tournamentClassFilter is not null)
{
diff --git a/src/Turnierplan.App/Endpoints/Applications/PatchApplicationEndpointBase.cs b/src/Turnierplan.App/Endpoints/Applications/PatchApplicationEndpointBase.cs
index 69a817f1..c3e6d627 100644
--- a/src/Turnierplan.App/Endpoints/Applications/PatchApplicationEndpointBase.cs
+++ b/src/Turnierplan.App/Endpoints/Applications/PatchApplicationEndpointBase.cs
@@ -2,8 +2,8 @@
using Microsoft.AspNetCore.Mvc;
using Turnierplan.App.Extensions;
using Turnierplan.App.Security;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Dal.Repositories;
namespace Turnierplan.App.Endpoints.Applications;
@@ -12,7 +12,7 @@ internal abstract class PatchApplicationEndpointBase : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Patch;
- protected override string Route => $"/api/planning-realms/{{planningRealmId}}/applications/{{applicationId:int}}/{RouteSuffix}";
+ protected override string Route => $"/api/tournament-planners/{{tournamentPlannerId}}/applications/{{applicationId:int}}/{RouteSuffix}";
protected override Delegate Handler => Handle;
@@ -26,10 +26,10 @@ internal abstract class PatchApplicationEndpointBase : EndpointBase
protected abstract void UpdateApplication(Application application, TRequest request);
private async Task Handle(
- [FromRoute] PublicId planningRealmId,
+ [FromRoute] PublicId tournamentPlannerId,
[FromRoute] long applicationId,
[FromBody] TRequest request,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
CancellationToken cancellationToken)
{
@@ -38,19 +38,19 @@ private async Task Handle(
return result;
}
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.Applications);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.Applications);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsWrite))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsWrite))
{
return Results.Forbid();
}
- var application = planningRealm.Applications.FirstOrDefault(x => x.Id == applicationId);
+ var application = tournamentPlanner.Applications.FirstOrDefault(x => x.Id == applicationId);
if (application is null)
{
@@ -59,7 +59,7 @@ private async Task Handle(
UpdateApplication(application, request);
- await planningRealmRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
+ await tournamentPlannerRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
return Results.NoContent();
}
diff --git a/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactEmailEndpoint.cs b/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactEmailEndpoint.cs
index 20484ab3..4c03a6cb 100644
--- a/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactEmailEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactEmailEndpoint.cs
@@ -1,5 +1,5 @@
using FluentValidation;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.App.Endpoints.Applications;
diff --git a/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactEndpoint.cs b/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactEndpoint.cs
index 0a90a36c..33036d8e 100644
--- a/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactEndpoint.cs
@@ -1,5 +1,5 @@
using FluentValidation;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.App.Endpoints.Applications;
diff --git a/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactTelephoneEndpoint.cs b/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactTelephoneEndpoint.cs
index 6bfdc3a3..de63054d 100644
--- a/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactTelephoneEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Applications/SetApplicationContactTelephoneEndpoint.cs
@@ -1,5 +1,5 @@
using FluentValidation;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.App.Endpoints.Applications;
diff --git a/src/Turnierplan.App/Endpoints/Applications/SetApplicationNotesEndpoint.cs b/src/Turnierplan.App/Endpoints/Applications/SetApplicationNotesEndpoint.cs
index 22e7d9e3..9b0f5d7a 100644
--- a/src/Turnierplan.App/Endpoints/Applications/SetApplicationNotesEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Applications/SetApplicationNotesEndpoint.cs
@@ -1,5 +1,5 @@
using FluentValidation;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.App.Endpoints.Applications;
diff --git a/src/Turnierplan.App/Endpoints/Organizations/DeleteOrganizationEndpoint.cs b/src/Turnierplan.App/Endpoints/Organizations/DeleteOrganizationEndpoint.cs
index f034f167..ef310201 100644
--- a/src/Turnierplan.App/Endpoints/Organizations/DeleteOrganizationEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Organizations/DeleteOrganizationEndpoint.cs
@@ -21,7 +21,7 @@ private static async Task Handle(
IDeletionHelper deletionHelper,
CancellationToken cancellationToken)
{
- var organization = await repository.GetByPublicIdAsync(id, IOrganizationRepository.Includes.Tournaments | IOrganizationRepository.Includes.Venues | IOrganizationRepository.Includes.Images | IOrganizationRepository.Includes.PlanningRealms);
+ var organization = await repository.GetByPublicIdAsync(id, IOrganizationRepository.Includes.Tournaments | IOrganizationRepository.Includes.Venues | IOrganizationRepository.Includes.Images | IOrganizationRepository.Includes.TournamentPlanners);
if (organization is null)
{
diff --git a/src/Turnierplan.App/Endpoints/RoleAssignments/CreateRoleAssignmentEndpoint.cs b/src/Turnierplan.App/Endpoints/RoleAssignments/CreateRoleAssignmentEndpoint.cs
index 39f134bf..3da34ccb 100644
--- a/src/Turnierplan.App/Endpoints/RoleAssignments/CreateRoleAssignmentEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/RoleAssignments/CreateRoleAssignmentEndpoint.cs
@@ -11,10 +11,10 @@
using Turnierplan.Core.Folder;
using Turnierplan.Core.Image;
using Turnierplan.Core.Organization;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
using Turnierplan.Core.RoleAssignment;
using Turnierplan.Core.Tournament;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Core.Venue;
using Turnierplan.Dal.Repositories;
@@ -51,8 +51,8 @@ private static async Task Handle(
"Folder" => CreateRoleAssignmentAsync(request, serviceProvider, accessValidator, mapper, targetId, cancellationToken),
"Image" => CreateRoleAssignmentAsync(request, serviceProvider, accessValidator, mapper, targetId, cancellationToken),
"Organization" => CreateRoleAssignmentAsync(request, serviceProvider, accessValidator, mapper, targetId, cancellationToken),
- "PlanningRealm" => CreateRoleAssignmentAsync(request, serviceProvider, accessValidator, mapper, targetId, cancellationToken),
"Tournament" => CreateRoleAssignmentAsync(request, serviceProvider, accessValidator, mapper, targetId, cancellationToken),
+ "TournamentPlanner" => CreateRoleAssignmentAsync(request, serviceProvider, accessValidator, mapper, targetId, cancellationToken),
"Venue" => CreateRoleAssignmentAsync(request, serviceProvider, accessValidator, mapper, targetId, cancellationToken),
_ => null
};
diff --git a/src/Turnierplan.App/Endpoints/RoleAssignments/DeleteRoleAssignmentEndpoint.cs b/src/Turnierplan.App/Endpoints/RoleAssignments/DeleteRoleAssignmentEndpoint.cs
index 795d7efb..7f672125 100644
--- a/src/Turnierplan.App/Endpoints/RoleAssignments/DeleteRoleAssignmentEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/RoleAssignments/DeleteRoleAssignmentEndpoint.cs
@@ -6,10 +6,10 @@
using Turnierplan.Core.Folder;
using Turnierplan.Core.Image;
using Turnierplan.Core.Organization;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
using Turnierplan.Core.RoleAssignment;
using Turnierplan.Core.Tournament;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Core.Venue;
using Turnierplan.Dal.Repositories;
@@ -46,8 +46,8 @@ private static async Task Handle(
"Folder" => DeleteRoleAssignmentAsync(serviceProvider, accessValidator, targetId, roleAssignmentGuid, cancellationToken),
"Image" => DeleteRoleAssignmentAsync(serviceProvider, accessValidator, targetId, roleAssignmentGuid, cancellationToken),
"Organization" => DeleteRoleAssignmentAsync(serviceProvider, accessValidator, targetId, roleAssignmentGuid, cancellationToken),
- "PlanningRealm" => DeleteRoleAssignmentAsync(serviceProvider, accessValidator, targetId, roleAssignmentGuid, cancellationToken),
"Tournament" => DeleteRoleAssignmentAsync(serviceProvider, accessValidator, targetId, roleAssignmentGuid, cancellationToken),
+ "TournamentPlanner" => DeleteRoleAssignmentAsync(serviceProvider, accessValidator, targetId, roleAssignmentGuid, cancellationToken),
"Venue" => DeleteRoleAssignmentAsync(serviceProvider, accessValidator, targetId, roleAssignmentGuid, cancellationToken),
_ => null
};
diff --git a/src/Turnierplan.App/Endpoints/RoleAssignments/GetRoleAssignmentsEndpoint.cs b/src/Turnierplan.App/Endpoints/RoleAssignments/GetRoleAssignmentsEndpoint.cs
index 2377d317..5551825a 100644
--- a/src/Turnierplan.App/Endpoints/RoleAssignments/GetRoleAssignmentsEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/RoleAssignments/GetRoleAssignmentsEndpoint.cs
@@ -8,9 +8,9 @@
using Turnierplan.Core.Folder;
using Turnierplan.Core.Image;
using Turnierplan.Core.Organization;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
using Turnierplan.Core.Tournament;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Core.Venue;
using Turnierplan.Dal.Repositories;
@@ -41,8 +41,8 @@ private static async Task Handle(
"Folder" => GetRoleAssignmentsAsync(serviceProvider, accessValidator, mapper, targetId),
"Image" => GetRoleAssignmentsAsync(serviceProvider, accessValidator, mapper, targetId),
"Organization" => GetRoleAssignmentsAsync(serviceProvider, accessValidator, mapper, targetId),
- "PlanningRealm" => GetRoleAssignmentsAsync(serviceProvider, accessValidator, mapper, targetId),
"Tournament" => GetRoleAssignmentsAsync(serviceProvider, accessValidator, mapper, targetId),
+ "TournamentPlanner" => GetRoleAssignmentsAsync(serviceProvider, accessValidator, mapper, targetId),
"Venue" => GetRoleAssignmentsAsync(serviceProvider, accessValidator, mapper, targetId),
_ => null
};
diff --git a/src/Turnierplan.App/Endpoints/PlanningRealms/CreatePlanningRealmEndpoint.cs b/src/Turnierplan.App/Endpoints/TournamentPlanners/CreateTournamentPlannerEndpoint.cs
similarity index 59%
rename from src/Turnierplan.App/Endpoints/PlanningRealms/CreatePlanningRealmEndpoint.cs
rename to src/Turnierplan.App/Endpoints/TournamentPlanners/CreateTournamentPlannerEndpoint.cs
index 95defcc4..97b591ca 100644
--- a/src/Turnierplan.App/Endpoints/PlanningRealms/CreatePlanningRealmEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/TournamentPlanners/CreateTournamentPlannerEndpoint.cs
@@ -4,25 +4,25 @@
using Turnierplan.App.Mapping;
using Turnierplan.App.Models;
using Turnierplan.App.Security;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Dal.Repositories;
-namespace Turnierplan.App.Endpoints.PlanningRealms;
+namespace Turnierplan.App.Endpoints.TournamentPlanners;
-internal sealed class CreatePlanningRealmEndpoint : EndpointBase
+internal sealed class CreateTournamentPlannerEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Post;
- protected override string Route => "/api/planning-realms";
+ protected override string Route => "/api/tournament-planners";
protected override Delegate Handler => Handle;
private static async Task Handle(
- [FromBody] CreatePlanningRealmEndpointRequest request,
+ [FromBody] CreateTournamentPlannerEndpointRequest request,
IOrganizationRepository organizationRepository,
IAccessValidator accessValidator,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IMapper mapper,
CancellationToken cancellationToken)
{
@@ -43,24 +43,24 @@ private static async Task Handle(
return Results.Forbid();
}
- var planningRealm = new PlanningRealm(organization, request.Name.Trim());
+ var tournamentPlanner = new TournamentPlanner(organization, request.Name.Trim());
- await planningRealmRepository.CreateAsync(planningRealm);
- await planningRealmRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
+ await tournamentPlannerRepository.CreateAsync(tournamentPlanner);
+ await tournamentPlannerRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
- accessValidator.AddRolesToResponseHeader(planningRealm);
+ accessValidator.AddRolesToResponseHeader(tournamentPlanner);
- return Results.Ok(mapper.Map(planningRealm));
+ return Results.Ok(mapper.Map(tournamentPlanner));
}
- public sealed record CreatePlanningRealmEndpointRequest
+ public sealed record CreateTournamentPlannerEndpointRequest
{
public required PublicId OrganizationId { get; init; }
public required string Name { get; init; }
}
- internal sealed class Validator : AbstractValidator
+ internal sealed class Validator : AbstractValidator
{
public static readonly Validator Instance = new();
diff --git a/src/Turnierplan.App/Endpoints/PlanningRealms/DeletePlanningRealmEndpoint.cs b/src/Turnierplan.App/Endpoints/TournamentPlanners/DeleteTournamentPlannerEndpoint.cs
similarity index 57%
rename from src/Turnierplan.App/Endpoints/PlanningRealms/DeletePlanningRealmEndpoint.cs
rename to src/Turnierplan.App/Endpoints/TournamentPlanners/DeleteTournamentPlannerEndpoint.cs
index cc105de5..5f9988f9 100644
--- a/src/Turnierplan.App/Endpoints/PlanningRealms/DeletePlanningRealmEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/TournamentPlanners/DeleteTournamentPlannerEndpoint.cs
@@ -3,35 +3,35 @@
using Turnierplan.Core.PublicId;
using Turnierplan.Dal.Repositories;
-namespace Turnierplan.App.Endpoints.PlanningRealms;
+namespace Turnierplan.App.Endpoints.TournamentPlanners;
-internal sealed class DeletePlanningRealmEndpoint : EndpointBase
+internal sealed class DeleteTournamentPlannerEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Delete;
- protected override string Route => "/api/planning-realm/{id}";
+ protected override string Route => "/api/tournament-planners/{id}";
protected override Delegate Handler => Handle;
private static async Task Handle(
[FromRoute] PublicId id,
- IPlanningRealmRepository repository,
+ ITournamentPlannerRepository repository,
IAccessValidator accessValidator,
CancellationToken cancellationToken)
{
- var planningRealm = await repository.GetByPublicIdAsync(id);
+ var tournamentPlanner = await repository.GetByPublicIdAsync(id);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.GenericWrite))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.GenericWrite))
{
return Results.Forbid();
}
- repository.Remove(planningRealm);
+ repository.Remove(tournamentPlanner);
await repository.UnitOfWork.SaveChangesAsync(cancellationToken);
diff --git a/src/Turnierplan.App/Endpoints/PlanningRealms/GetPlanningRealmEndpoint.cs b/src/Turnierplan.App/Endpoints/TournamentPlanners/GetTournamentPlannerEndpoint.cs
similarity index 50%
rename from src/Turnierplan.App/Endpoints/PlanningRealms/GetPlanningRealmEndpoint.cs
rename to src/Turnierplan.App/Endpoints/TournamentPlanners/GetTournamentPlannerEndpoint.cs
index e63b42f1..e6306a11 100644
--- a/src/Turnierplan.App/Endpoints/PlanningRealms/GetPlanningRealmEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/TournamentPlanners/GetTournamentPlannerEndpoint.cs
@@ -5,37 +5,37 @@
using Turnierplan.Core.PublicId;
using Turnierplan.Dal.Repositories;
-namespace Turnierplan.App.Endpoints.PlanningRealms;
+namespace Turnierplan.App.Endpoints.TournamentPlanners;
-internal sealed class GetPlanningRealmEndpoint : EndpointBase
+internal sealed class GetTournamentPlannerEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Get;
- protected override string Route => "/api/planning-realms/{id}";
+ protected override string Route => "/api/tournament-planners/{id}";
protected override Delegate Handler => Handle;
private static async Task Handle(
[FromRoute] PublicId id,
- IPlanningRealmRepository repository,
+ ITournamentPlannerRepository repository,
IAccessValidator accessValidator,
IMapper mapper)
{
// Note: We must use 'ApplicationsWithTeams' in order to have access to the number of applications/teams per invitation link/tournament class
- var planningRealm = await repository.GetByPublicIdAsync(id, IPlanningRealmRepository.Includes.All | IPlanningRealmRepository.Includes.ApplicationsWithTeams);
+ var tournamentPlanner = await repository.GetByPublicIdAsync(id, ITournamentPlannerRepository.Includes.All | ITournamentPlannerRepository.Includes.ApplicationsWithTeams);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.GenericRead))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.GenericRead))
{
return Results.Forbid();
}
- accessValidator.AddRolesToResponseHeader(planningRealm);
+ accessValidator.AddRolesToResponseHeader(tournamentPlanner);
- return Results.Ok(mapper.Map(planningRealm));
+ return Results.Ok(mapper.Map(tournamentPlanner));
}
}
diff --git a/src/Turnierplan.App/Endpoints/PlanningRealms/GetPlanningRealmsEndpoint.cs b/src/Turnierplan.App/Endpoints/TournamentPlanners/GetTournamentPlannersEndpoint.cs
similarity index 71%
rename from src/Turnierplan.App/Endpoints/PlanningRealms/GetPlanningRealmsEndpoint.cs
rename to src/Turnierplan.App/Endpoints/TournamentPlanners/GetTournamentPlannersEndpoint.cs
index 7089e16f..8ce77bdc 100644
--- a/src/Turnierplan.App/Endpoints/PlanningRealms/GetPlanningRealmsEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/TournamentPlanners/GetTournamentPlannersEndpoint.cs
@@ -5,13 +5,13 @@
using Turnierplan.Core.PublicId;
using Turnierplan.Dal.Repositories;
-namespace Turnierplan.App.Endpoints.PlanningRealms;
+namespace Turnierplan.App.Endpoints.TournamentPlanners;
-internal sealed class GetPlanningRealmsEndpoint : EndpointBase>
+internal sealed class GetTournamentPlannersEndpoint : EndpointBase>
{
protected override HttpMethod Method => HttpMethod.Get;
- protected override string Route => "/api/planning-realms";
+ protected override string Route => "/api/tournament-planners";
protected override Delegate Handler => Handle;
@@ -21,7 +21,7 @@ private static async Task Handle(
IAccessValidator accessValidator,
IMapper mapper)
{
- var organization = await organizationRepository.GetByPublicIdAsync(organizationId.Value, IOrganizationRepository.Includes.PlanningRealms);
+ var organization = await organizationRepository.GetByPublicIdAsync(organizationId.Value, IOrganizationRepository.Includes.TournamentPlanners);
if (organization is null)
{
@@ -33,6 +33,6 @@ private static async Task Handle(
return Results.Forbid();
}
- return Results.Ok(mapper.MapCollection(organization.PlanningRealms));
+ return Results.Ok(mapper.MapCollection(organization.TournamentPlanners));
}
}
diff --git a/src/Turnierplan.App/Endpoints/PlanningRealms/UpdatePlanningRealmEndpoint.cs b/src/Turnierplan.App/Endpoints/TournamentPlanners/UpdateTournamentPlannerEndpoint.cs
similarity index 72%
rename from src/Turnierplan.App/Endpoints/PlanningRealms/UpdatePlanningRealmEndpoint.cs
rename to src/Turnierplan.App/Endpoints/TournamentPlanners/UpdateTournamentPlannerEndpoint.cs
index f3c8c827..0c4de565 100644
--- a/src/Turnierplan.App/Endpoints/PlanningRealms/UpdatePlanningRealmEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/TournamentPlanners/UpdateTournamentPlannerEndpoint.cs
@@ -6,24 +6,24 @@
using Turnierplan.App.Extensions;
using Turnierplan.App.Security;
using Turnierplan.Core.Image;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Dal.Repositories;
-namespace Turnierplan.App.Endpoints.PlanningRealms;
+namespace Turnierplan.App.Endpoints.TournamentPlanners;
-internal sealed partial class UpdatePlanningRealmEndpoint : EndpointBase
+internal sealed partial class UpdateTournamentPlannerEndpoint : EndpointBase
{
protected override HttpMethod Method => HttpMethod.Put;
- protected override string Route => "/api/planning-realms/{id}";
+ protected override string Route => "/api/tournament-planners/{id}";
protected override Delegate Handler => Handle;
private static async Task Handle(
[FromRoute] PublicId id,
- [FromBody] UpdatePlanningRealmEndpointRequest request,
- IPlanningRealmRepository planningRealmRepository,
+ [FromBody] UpdateTournamentPlannerEndpointRequest request,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
IImageRepository imageRepository,
CancellationToken cancellationToken)
@@ -33,26 +33,26 @@ private static async Task Handle(
return result;
}
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(id, IPlanningRealmRepository.Includes.All);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(id, ITournamentPlannerRepository.Includes.All);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.GenericWrite))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.GenericWrite))
{
return Results.Forbid();
}
- if (!TryApplyChangesToPlanningRealm(planningRealm, request, out var error))
+ if (!TryApplyChangesToTournamentPlanner(tournamentPlanner, request, out var error))
{
return Results.BadRequest(error);
}
// The invitation links are updated separately to avoid having to pass required services along multiple
// nested method calls, and so we can use the Try..() pattern for the other apply methods.
- var applyImageResult = await UpdateInvitationLinkImagesAsync(imageRepository, accessValidator, planningRealm, request);
+ var applyImageResult = await UpdateInvitationLinkImagesAsync(imageRepository, accessValidator, tournamentPlanner, request);
if (applyImageResult is not null)
{
@@ -60,21 +60,21 @@ private static async Task Handle(
return applyImageResult;
}
- await planningRealmRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
+ await tournamentPlannerRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
return Results.NoContent();
}
- private static bool TryApplyChangesToPlanningRealm(PlanningRealm planningRealm, UpdatePlanningRealmEndpointRequest request, [NotNullWhen(false)] out string? error)
+ private static bool TryApplyChangesToTournamentPlanner(TournamentPlanner tournamentPlanner, UpdateTournamentPlannerEndpointRequest request, [NotNullWhen(false)] out string? error)
{
- planningRealm.Name = request.Name.Trim();
-
- if (!TryDeleteNoLongerNeededTournamentClasses(planningRealm, request, out error)
- || !TryDeleteNoLongerNeededInvitationLinks(planningRealm, request, out error)
- || !TryDeleteNoLongerNeededLabels(planningRealm, request, out error)
- || !TryCreateOrUpdateTournamentClasses(planningRealm, request, out error)
- || !TryCreateOrUpdateInvitationLinks(planningRealm, request, out error)
- || !TryCreateOrUpdateLabels(planningRealm, request, out error))
+ tournamentPlanner.Name = request.Name.Trim();
+
+ if (!TryDeleteNoLongerNeededTournamentClasses(tournamentPlanner, request, out error)
+ || !TryDeleteNoLongerNeededInvitationLinks(tournamentPlanner, request, out error)
+ || !TryDeleteNoLongerNeededLabels(tournamentPlanner, request, out error)
+ || !TryCreateOrUpdateTournamentClasses(tournamentPlanner, request, out error)
+ || !TryCreateOrUpdateInvitationLinks(tournamentPlanner, request, out error)
+ || !TryCreateOrUpdateLabels(tournamentPlanner, request, out error))
{
return false;
}
@@ -83,9 +83,9 @@ private static bool TryApplyChangesToPlanningRealm(PlanningRealm planningRealm,
return true;
}
- private static bool TryDeleteNoLongerNeededTournamentClasses(PlanningRealm planningRealm, UpdatePlanningRealmEndpointRequest request, [NotNullWhen(false)] out string? error)
+ private static bool TryDeleteNoLongerNeededTournamentClasses(TournamentPlanner tournamentPlanner, UpdateTournamentPlannerEndpointRequest request, [NotNullWhen(false)] out string? error)
{
- foreach (var tournamentClass in planningRealm.TournamentClasses.ToList())
+ foreach (var tournamentClass in tournamentPlanner.TournamentClasses.ToList())
{
var shouldDelete = request.TournamentClasses.None(x => x.Id == tournamentClass.Id);
@@ -94,7 +94,7 @@ private static bool TryDeleteNoLongerNeededTournamentClasses(PlanningRealm plann
continue;
}
- var numberOfAppliedTeams = planningRealm.Applications
+ var numberOfAppliedTeams = tournamentPlanner.Applications
.SelectMany(x => x.Teams)
.Count(x => x.Class == tournamentClass);
@@ -104,16 +104,16 @@ private static bool TryDeleteNoLongerNeededTournamentClasses(PlanningRealm plann
return false;
}
- planningRealm.RemoveTournamentClass(tournamentClass);
+ tournamentPlanner.RemoveTournamentClass(tournamentClass);
}
error = null;
return true;
}
- private static bool TryDeleteNoLongerNeededInvitationLinks(PlanningRealm planningRealm, UpdatePlanningRealmEndpointRequest request, [NotNullWhen(false)] out string? error)
+ private static bool TryDeleteNoLongerNeededInvitationLinks(TournamentPlanner tournamentPlanner, UpdateTournamentPlannerEndpointRequest request, [NotNullWhen(false)] out string? error)
{
- foreach (var invitationLink in planningRealm.InvitationLinks.ToList())
+ foreach (var invitationLink in tournamentPlanner.InvitationLinks.ToList())
{
var shouldDelete = request.InvitationLinks.None(x => x.Id == invitationLink.Id);
@@ -122,7 +122,7 @@ private static bool TryDeleteNoLongerNeededInvitationLinks(PlanningRealm plannin
continue;
}
- var numberOfApplications = planningRealm.Applications.Count(x => x.SourceLink == invitationLink);
+ var numberOfApplications = tournamentPlanner.Applications.Count(x => x.SourceLink == invitationLink);
if (numberOfApplications > 0)
{
@@ -130,22 +130,22 @@ private static bool TryDeleteNoLongerNeededInvitationLinks(PlanningRealm plannin
return false;
}
- planningRealm.RemoveInvitationLink(invitationLink);
+ tournamentPlanner.RemoveInvitationLink(invitationLink);
}
error = null;
return true;
}
- private static bool TryDeleteNoLongerNeededLabels(PlanningRealm planningRealm, UpdatePlanningRealmEndpointRequest request, [NotNullWhen(false)] out string? error)
+ private static bool TryDeleteNoLongerNeededLabels(TournamentPlanner tournamentPlanner, UpdateTournamentPlannerEndpointRequest request, [NotNullWhen(false)] out string? error)
{
- foreach (var label in planningRealm.Labels.ToList())
+ foreach (var label in tournamentPlanner.Labels.ToList())
{
var shouldDelete = request.Labels.None(x => x.Id == label.Id);
if (shouldDelete)
{
- planningRealm.RemoveLabel(label);
+ tournamentPlanner.RemoveLabel(label);
}
}
@@ -153,13 +153,13 @@ private static bool TryDeleteNoLongerNeededLabels(PlanningRealm planningRealm, U
return true;
}
- private static bool TryCreateOrUpdateTournamentClasses(PlanningRealm planningRealm, UpdatePlanningRealmEndpointRequest request, [NotNullWhen(false)] out string? error)
+ private static bool TryCreateOrUpdateTournamentClasses(TournamentPlanner tournamentPlanner, UpdateTournamentPlannerEndpointRequest request, [NotNullWhen(false)] out string? error)
{
foreach (var requestTournamentClass in request.TournamentClasses)
{
if (requestTournamentClass.Id.HasValue)
{
- var result = planningRealm.TournamentClasses.FirstOrDefault(x => x.Id == requestTournamentClass.Id);
+ var result = tournamentPlanner.TournamentClasses.FirstOrDefault(x => x.Id == requestTournamentClass.Id);
if (result is null)
{
@@ -171,7 +171,7 @@ private static bool TryCreateOrUpdateTournamentClasses(PlanningRealm planningRea
}
else
{
- planningRealm.AddTournamentClass(requestTournamentClass.Name.Trim());
+ tournamentPlanner.AddTournamentClass(requestTournamentClass.Name.Trim());
}
}
@@ -179,7 +179,7 @@ private static bool TryCreateOrUpdateTournamentClasses(PlanningRealm planningRea
return true;
}
- private static bool TryCreateOrUpdateInvitationLinks(PlanningRealm planningRealm, UpdatePlanningRealmEndpointRequest request, [NotNullWhen(false)] out string? error)
+ private static bool TryCreateOrUpdateInvitationLinks(TournamentPlanner tournamentPlanner, UpdateTournamentPlannerEndpointRequest request, [NotNullWhen(false)] out string? error)
{
foreach (var requestInvitationLink in request.InvitationLinks)
{
@@ -187,7 +187,7 @@ private static bool TryCreateOrUpdateInvitationLinks(PlanningRealm planningRealm
if (requestInvitationLink.Id.HasValue)
{
- var result = planningRealm.InvitationLinks.FirstOrDefault(x => x.Id == requestInvitationLink.Id);
+ var result = tournamentPlanner.InvitationLinks.FirstOrDefault(x => x.Id == requestInvitationLink.Id);
if (result is null)
{
@@ -200,7 +200,7 @@ private static bool TryCreateOrUpdateInvitationLinks(PlanningRealm planningRealm
}
else
{
- invitationLink = planningRealm.AddInvitationLink(requestInvitationLink.Name.Trim());
+ invitationLink = tournamentPlanner.AddInvitationLink(requestInvitationLink.Name.Trim());
}
// This reference is required for the UpdateInvitationLinkImagesAsync() method so that it can
@@ -235,7 +235,7 @@ private static bool TryCreateOrUpdateInvitationLinks(PlanningRealm planningRealm
if (entry is null)
{
- var @class = planningRealm.TournamentClasses.FirstOrDefault(x => x.Id == requestEntry.TournamentClassId);
+ var @class = tournamentPlanner.TournamentClasses.FirstOrDefault(x => x.Id == requestEntry.TournamentClassId);
if (@class is null)
{
@@ -255,7 +255,7 @@ private static bool TryCreateOrUpdateInvitationLinks(PlanningRealm planningRealm
return true;
}
- private static bool TryCreateOrUpdateLabels(PlanningRealm planningRealm, UpdatePlanningRealmEndpointRequest request, [NotNullWhen(false)] out string? error)
+ private static bool TryCreateOrUpdateLabels(TournamentPlanner tournamentPlanner, UpdateTournamentPlannerEndpointRequest request, [NotNullWhen(false)] out string? error)
{
foreach (var requestLabel in request.Labels)
{
@@ -263,7 +263,7 @@ private static bool TryCreateOrUpdateLabels(PlanningRealm planningRealm, UpdateP
if (requestLabel.Id.HasValue)
{
- var result = planningRealm.Labels.FirstOrDefault(x => x.Id == requestLabel.Id);
+ var result = tournamentPlanner.Labels.FirstOrDefault(x => x.Id == requestLabel.Id);
if (result is null)
{
@@ -276,7 +276,7 @@ private static bool TryCreateOrUpdateLabels(PlanningRealm planningRealm, UpdateP
}
else
{
- label = planningRealm.AddLabel(requestLabel.Name.Trim());
+ label = tournamentPlanner.AddLabel(requestLabel.Name.Trim());
}
label.ColorCode = requestLabel.ColorCode;
@@ -290,15 +290,15 @@ private static bool TryCreateOrUpdateLabels(PlanningRealm planningRealm, UpdateP
private static async Task UpdateInvitationLinkImagesAsync(
IImageRepository imageRepository,
IAccessValidator accessValidator,
- PlanningRealm planningRealm,
- UpdatePlanningRealmEndpointRequest request)
+ TournamentPlanner tournamentPlanner,
+ UpdateTournamentPlannerEndpointRequest request)
{
foreach (var requestInvitationLink in request.InvitationLinks)
{
var primaryImageResult = await UpdateInvitationLinkImageAsync(
imageRepository,
accessValidator,
- planningRealm,
+ tournamentPlanner,
requestInvitationLink._invitationLink!.PrimaryLogo,
requestInvitationLink.PrimaryLogoId,
x => requestInvitationLink._invitationLink.SetPrimaryLogo(x)
@@ -312,7 +312,7 @@ private static bool TryCreateOrUpdateLabels(PlanningRealm planningRealm, UpdateP
var secondaryImageResult = await UpdateInvitationLinkImageAsync(
imageRepository,
accessValidator,
- planningRealm,
+ tournamentPlanner,
requestInvitationLink._invitationLink!.SecondaryLogo,
requestInvitationLink.SecondaryLogoId,
x => requestInvitationLink._invitationLink.SetSecondaryLogo(x)
@@ -330,7 +330,7 @@ private static bool TryCreateOrUpdateLabels(PlanningRealm planningRealm, UpdateP
private static async Task UpdateInvitationLinkImageAsync(
IImageRepository imageRepository,
IAccessValidator accessValidator,
- PlanningRealm planningRealm,
+ TournamentPlanner tournamentPlanner,
Image? currentImage,
PublicId? requestImageId,
Action updateImage)
@@ -366,9 +366,9 @@ private static bool TryCreateOrUpdateLabels(PlanningRealm planningRealm, UpdateP
return Results.Forbid();
}
- if (planningRealm.Organization != requestImage.Organization)
+ if (tournamentPlanner.Organization != requestImage.Organization)
{
- return Results.BadRequest("Image must belong to the same organization as the planning realm.");
+ return Results.BadRequest("Image must belong to the same organization as the tournament planner.");
}
updateImage(requestImage);
@@ -376,25 +376,25 @@ private static bool TryCreateOrUpdateLabels(PlanningRealm planningRealm, UpdateP
return null; // means no error occurred
}
- public sealed record UpdatePlanningRealmEndpointRequest
+ public sealed record UpdateTournamentPlannerEndpointRequest
{
public required string Name { get; init; }
- public required UpdatePlanningRealmEndpointRequestTournamentClass[] TournamentClasses { get; init; }
+ public required UpdateTournamentPlannerEndpointRequestTournamentClass[] TournamentClasses { get; init; }
- public required UpdatePlanningRealmEndpointRequestInvitationLink[] InvitationLinks { get; init; }
+ public required UpdateTournamentPlannerEndpointRequestInvitationLink[] InvitationLinks { get; init; }
- public required UpdatePlanningRealmEndpointRequestLabel[] Labels { get; init; }
+ public required UpdateTournamentPlannerEndpointRequestLabel[] Labels { get; init; }
}
- public sealed record UpdatePlanningRealmEndpointRequestTournamentClass
+ public sealed record UpdateTournamentPlannerEndpointRequestTournamentClass
{
public long? Id { get; init; }
public required string Name { get; init; }
}
- public sealed record UpdatePlanningRealmEndpointRequestInvitationLink
+ public sealed record UpdateTournamentPlannerEndpointRequestInvitationLink
{
// The TryCreateOrUpdateInvitationLinks() method will save a reference to the InvitationLink entity
// so that the UpdateInvitationLinkImagesAsync() method can update the image afterward.
@@ -425,12 +425,12 @@ public sealed record UpdatePlanningRealmEndpointRequestInvitationLink
public PublicId? SecondaryLogoId { get; init; }
- public required UpdatePlanningRealmEndpointRequestInvitationLinkExternalLink[] ExternalLinks { get; init; }
+ public required UpdateTournamentPlannerEndpointRequestInvitationLinkExternalLink[] ExternalLinks { get; init; }
- public required UpdatePlanningRealmEndpointRequestInvitationLinkEntry[] Entries { get; init; }
+ public required UpdateTournamentPlannerEndpointRequestInvitationLinkEntry[] Entries { get; init; }
}
- public sealed record UpdatePlanningRealmEndpointRequestInvitationLinkEntry
+ public sealed record UpdateTournamentPlannerEndpointRequestInvitationLinkEntry
{
public required long TournamentClassId { get; init; }
@@ -439,14 +439,14 @@ public sealed record UpdatePlanningRealmEndpointRequestInvitationLinkEntry
public int? MaxTeamsPerRegistration { get; init; }
}
- public sealed record UpdatePlanningRealmEndpointRequestInvitationLinkExternalLink
+ public sealed record UpdateTournamentPlannerEndpointRequestInvitationLinkExternalLink
{
public required string Name { get; init; }
public required string Url { get; init; }
}
- public sealed record UpdatePlanningRealmEndpointRequestLabel
+ public sealed record UpdateTournamentPlannerEndpointRequestLabel
{
public long? Id { get; init; }
@@ -457,7 +457,7 @@ public sealed record UpdatePlanningRealmEndpointRequestLabel
public required string ColorCode { get; init; }
}
- internal sealed class Validator : AbstractValidator
+ internal sealed class Validator : AbstractValidator
{
public static readonly Validator Instance = new();
diff --git a/src/Turnierplan.App/Endpoints/Tournaments/ConfigureTournamentEndpoint.cs b/src/Turnierplan.App/Endpoints/Tournaments/ConfigureTournamentEndpoint.cs
index 58e04d33..e7df2c04 100644
--- a/src/Turnierplan.App/Endpoints/Tournaments/ConfigureTournamentEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Tournaments/ConfigureTournamentEndpoint.cs
@@ -3,10 +3,10 @@
using Turnierplan.App.Extensions;
using Turnierplan.App.Models;
using Turnierplan.App.Security;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
using Turnierplan.Core.Tournament;
using Turnierplan.Core.Tournament.Definitions;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Dal.Extensions;
using Turnierplan.Dal.Repositories;
@@ -24,7 +24,7 @@ private static async Task Handle(
[FromRoute] PublicId id,
[FromBody] ConfigureTournamentEndpointRequest request,
ITournamentRepository tournamentRepository,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IAccessValidator accessValidator,
CancellationToken cancellationToken)
{
@@ -45,40 +45,40 @@ private static async Task Handle(
return Results.Forbid();
}
- var planningRealms = new Dictionary();
+ var tournamentPlanners = new Dictionary();
- var planningRealmIds = request.Groups
+ var tournamentPlannerIds = request.Groups
.SelectMany(x => x.Teams)
.Where(x => x.TeamLink is not null)
- .Select(x => x.TeamLink!.PlanningRealmId)
+ .Select(x => x.TeamLink!.TournamentPlannerId)
.Distinct()
.ToList();
- if (planningRealmIds.Count > 3)
+ if (tournamentPlannerIds.Count > 3)
{
- return Results.BadRequest("Cannot use more than 3 distinct planning realms across all team links.");
+ return Results.BadRequest("Cannot use more than 3 distinct tournament planners across all team links.");
}
- foreach (var planningRealmId in planningRealmIds)
+ foreach (var tournamentPlannerId in tournamentPlannerIds)
{
- var planningRealm = await planningRealmRepository.GetByPublicIdAsync(planningRealmId, IPlanningRealmRepository.Includes.ApplicationsWithTeams);
+ var tournamentPlanner = await tournamentPlannerRepository.GetByPublicIdAsync(tournamentPlannerId, ITournamentPlannerRepository.Includes.ApplicationsWithTeams);
- if (planningRealm is null)
+ if (tournamentPlanner is null)
{
return Results.NotFound();
}
- if (planningRealm.Organization != tournament.Organization)
+ if (tournamentPlanner.Organization != tournament.Organization)
{
- return Results.BadRequest("Planning realm must belong to the same organization as the tournament.");
+ return Results.BadRequest("Tournament planner must belong to the same organization as the tournament.");
}
- if (!accessValidator.IsActionAllowed(planningRealm, Actions.ApplicationsWrite))
+ if (!accessValidator.IsActionAllowed(tournamentPlanner, Actions.ApplicationsWrite))
{
return Results.Forbid();
}
- planningRealms[planningRealmId] = planningRealm;
+ tournamentPlanners[tournamentPlannerId] = tournamentPlanner;
}
DeleteNoLongerNeededTeams(tournament, request);
@@ -149,15 +149,15 @@ private static async Task Handle(
}
else if (requestTeam.TeamLink is not null)
{
- var planningRealm = planningRealms[requestTeam.TeamLink.PlanningRealmId];
+ var tournamentPlanner = tournamentPlanners[requestTeam.TeamLink.TournamentPlannerId];
- var applicationTeam = planningRealm.Applications
+ var applicationTeam = tournamentPlanner.Applications
.SelectMany(x => x.Teams)
.FirstOrDefault(x => x.Id == requestTeam.TeamLink.ApplicationTeamId);
if (applicationTeam is null)
{
- return Results.BadRequest($"No application team with id {requestTeam.TeamLink.ApplicationTeamId} exists in planning realm '{planningRealm.PublicId}'.");
+ return Results.BadRequest($"No application team with id {requestTeam.TeamLink.ApplicationTeamId} exists in tournament planner '{tournamentPlanner.PublicId}'.");
}
team.LinkWithApplicationTeam(applicationTeam);
@@ -321,7 +321,7 @@ public sealed record ConfigureTournamentEndpointRequestTeamEntry
public sealed record ConfigureTournamentEndpointRequestTeamLink
{
- public required PublicId PlanningRealmId { get; init; }
+ public required PublicId TournamentPlannerId { get; init; }
public required int ApplicationTeamId { get; init; }
}
diff --git a/src/Turnierplan.App/Endpoints/Tournaments/GetTournamentEndpoint.cs b/src/Turnierplan.App/Endpoints/Tournaments/GetTournamentEndpoint.cs
index d1a7de4a..801abf8e 100644
--- a/src/Turnierplan.App/Endpoints/Tournaments/GetTournamentEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Tournaments/GetTournamentEndpoint.cs
@@ -40,14 +40,14 @@ private static async Task Handle(
accessValidator.AddRolesToResponseHeader(tournament);
- var planningRealms = tournament.Teams.Select(x => x.TeamLink)
+ var tournamentPlanners = tournament.Teams.Select(x => x.TeamLink)
.WhereNotNull()
- .Select(x => x.ApplicationTeam.Application.PlanningRealm)
+ .Select(x => x.ApplicationTeam.Application.TournamentPlanner)
.Distinct();
- foreach (var planningRealm in planningRealms)
+ foreach (var tournamentPlanner in tournamentPlanners)
{
- accessValidator.AddRolesToResponseHeader(planningRealm);
+ accessValidator.AddRolesToResponseHeader(tournamentPlanner);
}
return Results.Ok(mapper.Map(tournament));
diff --git a/src/Turnierplan.App/Helpers/DeletionHelper.cs b/src/Turnierplan.App/Helpers/DeletionHelper.cs
index e4b51301..178aa053 100644
--- a/src/Turnierplan.App/Helpers/DeletionHelper.cs
+++ b/src/Turnierplan.App/Helpers/DeletionHelper.cs
@@ -14,7 +14,7 @@ internal sealed class DeletionHelper : IDeletionHelper
private readonly IOrganizationRepository _organizationRepository;
private readonly ITournamentRepository _tournamentRepository;
private readonly IVenueRepository _venueRepository;
- private readonly IPlanningRealmRepository _planningRealmRepository;
+ private readonly ITournamentPlannerRepository _tournamentPlannerRepository;
private readonly IImageRepository _imageRepository;
private readonly IImageStorage _imageStorage;
private readonly ILogger _logger;
@@ -23,7 +23,7 @@ public DeletionHelper(
IOrganizationRepository organizationRepository,
ITournamentRepository tournamentRepository,
IVenueRepository venueRepository,
- IPlanningRealmRepository planningRealmRepository,
+ ITournamentPlannerRepository tournamentPlannerRepository,
IImageRepository imageRepository,
IImageStorage imageStorage,
ILogger logger)
@@ -31,7 +31,7 @@ public DeletionHelper(
_organizationRepository = organizationRepository;
_tournamentRepository = tournamentRepository;
_venueRepository = venueRepository;
- _planningRealmRepository = planningRealmRepository;
+ _tournamentPlannerRepository = tournamentPlannerRepository;
_imageRepository = imageRepository;
_imageStorage = imageStorage;
_logger = logger;
@@ -95,12 +95,12 @@ public async Task DeleteOrganizationAsync(Organization organization, Cance
cancellationToken.ThrowIfCancellationRequested();
- foreach (var planningRealm in organization.PlanningRealms.ToList()) // ToList() to avoid invalid operation exception
+ foreach (var tournamentPlanner in organization.TournamentPlanners.ToList()) // ToList() to avoid invalid operation exception
{
- _planningRealmRepository.Remove(planningRealm);
+ _tournamentPlannerRepository.Remove(tournamentPlanner);
}
- await _planningRealmRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
+ await _tournamentPlannerRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
// Note that ApiKeys and Folders need not be deleted explicitly, because the corresponding
// foreign keys in the database are configured with the 'Cascade' deletion behaviour.
diff --git a/src/Turnierplan.App/Helpers/RbacScopeHelper.cs b/src/Turnierplan.App/Helpers/RbacScopeHelper.cs
index 2aacb6e9..02b1f14b 100644
--- a/src/Turnierplan.App/Helpers/RbacScopeHelper.cs
+++ b/src/Turnierplan.App/Helpers/RbacScopeHelper.cs
@@ -30,6 +30,6 @@ public static bool TryParseScopeId(string scopeId, [NotNullWhen(true)] out strin
return true;
}
- [GeneratedRegex("^(?ApiKey|Folder|Image|Organization|PlanningRealm|Tournament|Venue):(?[A-Za-z0-9_-]{11})$")]
+ [GeneratedRegex("^(?ApiKey|Folder|Image|Organization|Tournament|TournamentPlanner|Venue):(?[A-Za-z0-9_-]{11})$")]
public static partial Regex ScopeIdRegex();
}
diff --git a/src/Turnierplan.App/Mapping/Rules/ApplicationChangeLogMappingRule.cs b/src/Turnierplan.App/Mapping/Rules/ApplicationChangeLogMappingRule.cs
index 8c21f1c6..6878a2d5 100644
--- a/src/Turnierplan.App/Mapping/Rules/ApplicationChangeLogMappingRule.cs
+++ b/src/Turnierplan.App/Mapping/Rules/ApplicationChangeLogMappingRule.cs
@@ -1,5 +1,5 @@
using Turnierplan.App.Models;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.App.Mapping.Rules;
diff --git a/src/Turnierplan.App/Mapping/Rules/ApplicationMappingRule.cs b/src/Turnierplan.App/Mapping/Rules/ApplicationMappingRule.cs
index 068da87f..b6dad65d 100644
--- a/src/Turnierplan.App/Mapping/Rules/ApplicationMappingRule.cs
+++ b/src/Turnierplan.App/Mapping/Rules/ApplicationMappingRule.cs
@@ -1,5 +1,5 @@
using Turnierplan.App.Models;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.App.Mapping.Rules;
diff --git a/src/Turnierplan.App/Mapping/Rules/PlanningRealmHeaderMappingRule.cs b/src/Turnierplan.App/Mapping/Rules/PlanningRealmHeaderMappingRule.cs
deleted file mode 100644
index 1d4cdb57..00000000
--- a/src/Turnierplan.App/Mapping/Rules/PlanningRealmHeaderMappingRule.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Turnierplan.App.Models;
-using Turnierplan.Core.PlanningRealm;
-
-namespace Turnierplan.App.Mapping.Rules;
-
-internal sealed class PlanningRealmHeaderMappingRule : MappingRuleBase
-{
- protected override PlanningRealmHeaderDto Map(IMapper mapper, MappingContext context, PlanningRealm source)
- {
- return new PlanningRealmHeaderDto
- {
- Id = source.PublicId,
- OrganizationId = source.Organization.PublicId,
- Name = source.Name
- };
- }
-}
diff --git a/src/Turnierplan.App/Mapping/Rules/RoleAssignmentMappingRule.cs b/src/Turnierplan.App/Mapping/Rules/RoleAssignmentMappingRule.cs
index ddc2a4fb..da5b7ce0 100644
--- a/src/Turnierplan.App/Mapping/Rules/RoleAssignmentMappingRule.cs
+++ b/src/Turnierplan.App/Mapping/Rules/RoleAssignmentMappingRule.cs
@@ -5,9 +5,9 @@
using Turnierplan.Core.Folder;
using Turnierplan.Core.Image;
using Turnierplan.Core.Organization;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.RoleAssignment;
using Turnierplan.Core.Tournament;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Core.Venue;
namespace Turnierplan.App.Mapping.Rules;
@@ -42,8 +42,8 @@ internal sealed class ImageRoleAssignmentMappingRule : RoleAssignmentMappingRule
internal sealed class OrganizationRoleAssignmentMappingRule : RoleAssignmentMappingRuleBase;
-internal sealed class PlanningRealmRoleAssignmentMappingRule : RoleAssignmentMappingRuleBase;
-
internal sealed class TournamentRoleAssignmentMappingRule : RoleAssignmentMappingRuleBase;
+internal sealed class TournamentPlannerRoleAssignmentMappingRule : RoleAssignmentMappingRuleBase;
+
internal sealed class VenueRoleAssignmentMappingRule : RoleAssignmentMappingRuleBase;
diff --git a/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs b/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs
index 8b30f96a..f9d14c65 100644
--- a/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs
+++ b/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs
@@ -44,8 +44,8 @@ protected override TournamentDto Map(IMapper mapper, MappingContext context, Tou
},
Link = team.TeamLink is null ? null : new TeamLinkDto
{
- PlanningRealmId = team.TeamLink.ApplicationTeam.Application.PlanningRealm.PublicId,
- PlanningRealmName = team.TeamLink.ApplicationTeam.Application.PlanningRealm.Name,
+ TournamentPlannerId = team.TeamLink.ApplicationTeam.Application.TournamentPlanner.PublicId,
+ TournamentPlannerName = team.TeamLink.ApplicationTeam.Application.TournamentPlanner.Name,
TournamentClassName = team.TeamLink.ApplicationTeam.Class.Name,
ApplicationTeamId = team.TeamLink.ApplicationTeam.Id
}
diff --git a/src/Turnierplan.App/Mapping/Rules/TournamentPlannerHeaderMappingRule.cs b/src/Turnierplan.App/Mapping/Rules/TournamentPlannerHeaderMappingRule.cs
new file mode 100644
index 00000000..fead2aaf
--- /dev/null
+++ b/src/Turnierplan.App/Mapping/Rules/TournamentPlannerHeaderMappingRule.cs
@@ -0,0 +1,17 @@
+using Turnierplan.App.Models;
+using Turnierplan.Core.TournamentPlanner;
+
+namespace Turnierplan.App.Mapping.Rules;
+
+internal sealed class TournamentPlannerHeaderMappingRule : MappingRuleBase
+{
+ protected override TournamentPlannerHeaderDto Map(IMapper mapper, MappingContext context, TournamentPlanner source)
+ {
+ return new TournamentPlannerHeaderDto
+ {
+ Id = source.PublicId,
+ OrganizationId = source.Organization.PublicId,
+ Name = source.Name
+ };
+ }
+}
diff --git a/src/Turnierplan.App/Mapping/Rules/PlanningRealmMappingRule.cs b/src/Turnierplan.App/Mapping/Rules/TournamentPlannerMappingRule.cs
similarity index 88%
rename from src/Turnierplan.App/Mapping/Rules/PlanningRealmMappingRule.cs
rename to src/Turnierplan.App/Mapping/Rules/TournamentPlannerMappingRule.cs
index 8b4600e5..fe6c637a 100644
--- a/src/Turnierplan.App/Mapping/Rules/PlanningRealmMappingRule.cs
+++ b/src/Turnierplan.App/Mapping/Rules/TournamentPlannerMappingRule.cs
@@ -1,14 +1,14 @@
using Turnierplan.App.Helpers;
using Turnierplan.App.Models;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.App.Mapping.Rules;
-internal sealed class PlanningRealmMappingRule : MappingRuleBase
+internal sealed class TournamentPlannerMappingRule : MappingRuleBase
{
- protected override PlanningRealmDto Map(IMapper mapper, MappingContext context, PlanningRealm source)
+ protected override TournamentPlannerDto Map(IMapper mapper, MappingContext context, TournamentPlanner source)
{
- return new PlanningRealmDto
+ return new TournamentPlannerDto
{
Id = source.PublicId,
OrganizationId = source.Organization.PublicId,
diff --git a/src/Turnierplan.App/Models/ApplicationChangeLogDto.cs b/src/Turnierplan.App/Models/ApplicationChangeLogDto.cs
index 1467f548..ed244a74 100644
--- a/src/Turnierplan.App/Models/ApplicationChangeLogDto.cs
+++ b/src/Turnierplan.App/Models/ApplicationChangeLogDto.cs
@@ -1,4 +1,4 @@
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.App.Models;
diff --git a/src/Turnierplan.App/Models/ApplicationChangeLogPropertyDto.cs b/src/Turnierplan.App/Models/ApplicationChangeLogPropertyDto.cs
index 9180df01..abe655c5 100644
--- a/src/Turnierplan.App/Models/ApplicationChangeLogPropertyDto.cs
+++ b/src/Turnierplan.App/Models/ApplicationChangeLogPropertyDto.cs
@@ -1,4 +1,4 @@
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.App.Models;
diff --git a/src/Turnierplan.App/Models/TeamLinkDto.cs b/src/Turnierplan.App/Models/TeamLinkDto.cs
index 42f80522..b379bf7b 100644
--- a/src/Turnierplan.App/Models/TeamLinkDto.cs
+++ b/src/Turnierplan.App/Models/TeamLinkDto.cs
@@ -4,9 +4,9 @@ namespace Turnierplan.App.Models;
public sealed record TeamLinkDto
{
- public required PublicId PlanningRealmId { get; init; }
+ public required PublicId TournamentPlannerId { get; init; }
- public required string PlanningRealmName { get; init; }
+ public required string TournamentPlannerName { get; init; }
public required string TournamentClassName { get; init; }
diff --git a/src/Turnierplan.App/Models/PlanningRealmDto.cs b/src/Turnierplan.App/Models/TournamentPlannerDto.cs
similarity index 92%
rename from src/Turnierplan.App/Models/PlanningRealmDto.cs
rename to src/Turnierplan.App/Models/TournamentPlannerDto.cs
index a83eaa8a..81da66c3 100644
--- a/src/Turnierplan.App/Models/PlanningRealmDto.cs
+++ b/src/Turnierplan.App/Models/TournamentPlannerDto.cs
@@ -2,7 +2,7 @@
namespace Turnierplan.App.Models;
-public sealed record PlanningRealmDto
+public sealed record TournamentPlannerDto
{
public required PublicId Id { get; init; }
diff --git a/src/Turnierplan.App/Models/PlanningRealmHeaderDto.cs b/src/Turnierplan.App/Models/TournamentPlannerHeaderDto.cs
similarity index 82%
rename from src/Turnierplan.App/Models/PlanningRealmHeaderDto.cs
rename to src/Turnierplan.App/Models/TournamentPlannerHeaderDto.cs
index 2c9c9b34..ef61f048 100644
--- a/src/Turnierplan.App/Models/PlanningRealmHeaderDto.cs
+++ b/src/Turnierplan.App/Models/TournamentPlannerHeaderDto.cs
@@ -2,7 +2,7 @@
namespace Turnierplan.App.Models;
-public sealed record PlanningRealmHeaderDto
+public sealed record TournamentPlannerHeaderDto
{
public required PublicId Id { get; init; }
diff --git a/src/Turnierplan.App/Pages/InvitationForm.cshtml.cs b/src/Turnierplan.App/Pages/InvitationForm.cshtml.cs
index 6f82a7c0..46eac0c1 100644
--- a/src/Turnierplan.App/Pages/InvitationForm.cshtml.cs
+++ b/src/Turnierplan.App/Pages/InvitationForm.cshtml.cs
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Dal.Repositories;
namespace Turnierplan.App.Pages;
@@ -93,7 +93,7 @@ public async Task OnPost()
return;
}
- var application = Data.PlanningRealm.AddApplication(Data, contactPerson);
+ var application = Data.TournamentPlanner.AddApplication(Data, contactPerson);
application.ContactEmail = contactEMail;
application.ContactTelephone = contactTelephoneNr;
diff --git a/src/Turnierplan.App/Security/AccessValidator.cs b/src/Turnierplan.App/Security/AccessValidator.cs
index e3077d84..b176106b 100644
--- a/src/Turnierplan.App/Security/AccessValidator.cs
+++ b/src/Turnierplan.App/Security/AccessValidator.cs
@@ -3,10 +3,10 @@
using Turnierplan.Core.Entity;
using Turnierplan.Core.Folder;
using Turnierplan.Core.Image;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.PublicId;
using Turnierplan.Core.RoleAssignment;
using Turnierplan.Core.Tournament;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Core.Venue;
namespace Turnierplan.App.Security;
@@ -103,7 +103,7 @@ internal static bool IsActionAllowed(IEntityWithRoleAssignments target, Ac
ApiKey apiKey => IsActionAllowed(apiKey.Organization, action, principal),
Image image => IsActionAllowed(image.Organization, action, principal),
Folder folder => IsActionAllowed(folder.Organization, action, principal),
- PlanningRealm planningRealm => IsActionAllowed(planningRealm.Organization, action, principal),
+ TournamentPlanner tournamentPlanner => IsActionAllowed(tournamentPlanner.Organization, action, principal),
Tournament tournament => (tournament.Folder is not null && IsActionAllowed(tournament.Folder, action, principal)) || IsActionAllowed(tournament.Organization, action, principal),
Venue venue => IsActionAllowed(venue.Organization, action, principal),
_ => false
@@ -126,8 +126,8 @@ internal static void AddAvailableRoles(IEntityWithRoleAssignments target,
case Folder folder:
AddAvailableRoles(folder.Organization, rolesList, principal);
break;
- case PlanningRealm planningRealm:
- AddAvailableRoles(planningRealm.Organization, rolesList, principal);
+ case TournamentPlanner tournamentPlanner:
+ AddAvailableRoles(tournamentPlanner.Organization, rolesList, principal);
break;
case Tournament tournament:
AddAvailableRoles(tournament.Organization, rolesList, principal);
diff --git a/src/Turnierplan.App/Security/Actions.cs b/src/Turnierplan.App/Security/Actions.cs
index 13b6b18b..99b85826 100644
--- a/src/Turnierplan.App/Security/Actions.cs
+++ b/src/Turnierplan.App/Security/Actions.cs
@@ -40,12 +40,12 @@ internal static class Actions
public static readonly Action TournamentConduct = new(Role.Owner, Role.Contributor, Role.Reporter);
///
- /// Any action that adds or modifies applications in a planning realm.
+ /// Any action that adds or modifies applications in a tournament planner.
///
public static readonly Action ApplicationsWrite = new(Role.Owner, Role.Contributor, Role.ApplicationOfficer);
///
- /// Any action that queries applications in a planning realm.
+ /// Any action that queries applications in a tournament planner.
///
public static readonly Action ApplicationsRead = new(Role.Owner, Role.Contributor, Role.ApplicationOfficer, Role.ApplicationReader);
diff --git a/src/Turnierplan.Core.Test.Unit/PlanningRealm/ApplicationTest.cs b/src/Turnierplan.Core.Test.Unit/TournamentPlanner/ApplicationTest.cs
similarity index 98%
rename from src/Turnierplan.Core.Test.Unit/PlanningRealm/ApplicationTest.cs
rename to src/Turnierplan.Core.Test.Unit/TournamentPlanner/ApplicationTest.cs
index 557ee904..1fcae923 100644
--- a/src/Turnierplan.Core.Test.Unit/PlanningRealm/ApplicationTest.cs
+++ b/src/Turnierplan.Core.Test.Unit/TournamentPlanner/ApplicationTest.cs
@@ -1,8 +1,8 @@
using FluentAssertions;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
using Xunit;
-namespace Turnierplan.Core.Test.Unit.PlanningRealm;
+namespace Turnierplan.Core.Test.Unit.TournamentPlanner;
public sealed class ApplicationTest
{
diff --git a/src/Turnierplan.Core/Organization/Organization.cs b/src/Turnierplan.Core/Organization/Organization.cs
index e699e24c..bf731f6a 100644
--- a/src/Turnierplan.Core/Organization/Organization.cs
+++ b/src/Turnierplan.Core/Organization/Organization.cs
@@ -9,7 +9,7 @@ public sealed class Organization : Entity, IEntityWithRoleAssignments _apiKeys = [];
internal readonly List _folders = [];
internal readonly List _images = [];
- internal readonly List _planningRealms = [];
+ internal readonly List _tournamentPlanners = [];
internal readonly List _tournaments = [];
internal readonly List _venues = [];
@@ -45,7 +45,7 @@ internal Organization(long id, PublicId.PublicId publicId, DateTime createdAt, s
public IReadOnlyList Images => _images.AsReadOnly();
- public IReadOnlyList PlanningRealms => _planningRealms.AsReadOnly();
+ public IReadOnlyList TournamentPlanners => _tournamentPlanners.AsReadOnly();
public IReadOnlyList Tournaments => _tournaments.AsReadOnly();
diff --git a/src/Turnierplan.Core/RoleAssignment/Role.cs b/src/Turnierplan.Core/RoleAssignment/Role.cs
index d43cddca..e4a6e3f0 100644
--- a/src/Turnierplan.Core/RoleAssignment/Role.cs
+++ b/src/Turnierplan.Core/RoleAssignment/Role.cs
@@ -35,16 +35,16 @@ public enum Role
#endregion
- #region Planning Realm Roles
+ #region Tournament Planner Roles
///
- /// This role grants the permission to view and modify applications in a planning realm. These actions
+ /// This role grants the permission to view and modify applications in a tournament planner. These actions
/// are not allowed by the standard role because applications may contain PII.
///
ApplicationOfficer = 3000,
///
- /// This role grants the permission to view applications in a planning realm. These actions
+ /// This role grants the permission to view applications in a tournament planner. These actions
/// are not allowed by the standard role because applications may contain PII.
///
ApplicationReader = 3001
diff --git a/src/Turnierplan.Core/Tournament/Team.cs b/src/Turnierplan.Core/Tournament/Team.cs
index daeb1069..2484ee2c 100644
--- a/src/Turnierplan.Core/Tournament/Team.cs
+++ b/src/Turnierplan.Core/Tournament/Team.cs
@@ -1,6 +1,6 @@
using Turnierplan.Core.Entity;
using Turnierplan.Core.Exceptions;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.Core.Tournament;
diff --git a/src/Turnierplan.Core/PlanningRealm/Application.cs b/src/Turnierplan.Core/TournamentPlanner/Application.cs
similarity index 95%
rename from src/Turnierplan.Core/PlanningRealm/Application.cs
rename to src/Turnierplan.Core/TournamentPlanner/Application.cs
index ad6338e4..4194e0b6 100644
--- a/src/Turnierplan.Core/PlanningRealm/Application.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/Application.cs
@@ -1,7 +1,7 @@
using Turnierplan.Core.Entity;
using Turnierplan.Core.Exceptions;
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public sealed class Application : Entity
{
@@ -28,10 +28,10 @@ internal Application(long id, int tag, DateTime createdAt, string notes, string
_comment = comment;
}
- internal Application(PlanningRealm planningRealm, InvitationLink? sourceLink, int tag, string contact)
+ internal Application(TournamentPlanner tournamentPlanner, InvitationLink? sourceLink, int tag, string contact)
{
Id = 0;
- PlanningRealm = planningRealm;
+ TournamentPlanner = tournamentPlanner;
SourceLink = sourceLink;
Tag = tag;
CreatedAt = DateTime.UtcNow;
@@ -42,7 +42,7 @@ internal Application(PlanningRealm planningRealm, InvitationLink? sourceLink, in
public override long Id { get; protected set; }
- public PlanningRealm PlanningRealm { get; internal set; } = null!;
+ public TournamentPlanner TournamentPlanner { get; internal set; } = null!;
public InvitationLink? SourceLink { get; internal set; }
diff --git a/src/Turnierplan.Core/PlanningRealm/ApplicationChangeLog.cs b/src/Turnierplan.Core/TournamentPlanner/ApplicationChangeLog.cs
similarity index 96%
rename from src/Turnierplan.Core/PlanningRealm/ApplicationChangeLog.cs
rename to src/Turnierplan.Core/TournamentPlanner/ApplicationChangeLog.cs
index 494b6bc8..51715d77 100644
--- a/src/Turnierplan.Core/PlanningRealm/ApplicationChangeLog.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/ApplicationChangeLog.cs
@@ -1,7 +1,7 @@
using System.Text.Json.Serialization;
using Turnierplan.Core.Entity;
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public sealed class ApplicationChangeLog : Entity
{
diff --git a/src/Turnierplan.Core/PlanningRealm/ApplicationChangeLogProperty.cs b/src/Turnierplan.Core/TournamentPlanner/ApplicationChangeLogProperty.cs
similarity index 85%
rename from src/Turnierplan.Core/PlanningRealm/ApplicationChangeLogProperty.cs
rename to src/Turnierplan.Core/TournamentPlanner/ApplicationChangeLogProperty.cs
index 3a0c7759..ec5f8472 100644
--- a/src/Turnierplan.Core/PlanningRealm/ApplicationChangeLogProperty.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/ApplicationChangeLogProperty.cs
@@ -1,4 +1,4 @@
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public enum ApplicationChangeLogProperty
{
diff --git a/src/Turnierplan.Core/PlanningRealm/ApplicationChangeLogType.cs b/src/Turnierplan.Core/TournamentPlanner/ApplicationChangeLogType.cs
similarity index 89%
rename from src/Turnierplan.Core/PlanningRealm/ApplicationChangeLogType.cs
rename to src/Turnierplan.Core/TournamentPlanner/ApplicationChangeLogType.cs
index 2049f96a..9ec781a4 100644
--- a/src/Turnierplan.Core/PlanningRealm/ApplicationChangeLogType.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/ApplicationChangeLogType.cs
@@ -1,4 +1,4 @@
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public enum ApplicationChangeLogType
{
diff --git a/src/Turnierplan.Core/PlanningRealm/ApplicationTeam.cs b/src/Turnierplan.Core/TournamentPlanner/ApplicationTeam.cs
similarity index 98%
rename from src/Turnierplan.Core/PlanningRealm/ApplicationTeam.cs
rename to src/Turnierplan.Core/TournamentPlanner/ApplicationTeam.cs
index 7a59a97f..d71cb9ad 100644
--- a/src/Turnierplan.Core/PlanningRealm/ApplicationTeam.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/ApplicationTeam.cs
@@ -1,7 +1,7 @@
using Turnierplan.Core.Entity;
using Turnierplan.Core.Exceptions;
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public sealed class ApplicationTeam : Entity
{
diff --git a/src/Turnierplan.Core/PlanningRealm/InvitationLink.cs b/src/Turnierplan.Core/TournamentPlanner/InvitationLink.cs
similarity index 90%
rename from src/Turnierplan.Core/PlanningRealm/InvitationLink.cs
rename to src/Turnierplan.Core/TournamentPlanner/InvitationLink.cs
index d31eb4e8..a5948767 100644
--- a/src/Turnierplan.Core/PlanningRealm/InvitationLink.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/InvitationLink.cs
@@ -2,7 +2,7 @@
using Turnierplan.Core.Entity;
using Turnierplan.Core.Exceptions;
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public sealed class InvitationLink : Entity, IEntityWithPublicId
{
@@ -36,7 +36,7 @@ internal InvitationLink(string name)
public PublicId.PublicId PublicId { get; }
- public PlanningRealm PlanningRealm { get; internal set; } = null!;
+ public TournamentPlanner TournamentPlanner { get; internal set; } = null!;
public string Name { get; set; }
@@ -66,9 +66,9 @@ internal InvitationLink(string name)
public InvitationLinkEntry AddEntry(TournamentClass tournamentClass)
{
- if (!PlanningRealm._tournamentClasses.Contains(tournamentClass))
+ if (!TournamentPlanner._tournamentClasses.Contains(tournamentClass))
{
- throw new TurnierplanException("Cannot add entry with a tournament class from another planning realm.");
+ throw new TurnierplanException("Cannot add entry with a tournament class from another tournament planner.");
}
var invitationLinkEntry = new InvitationLinkEntry(tournamentClass);
@@ -105,7 +105,7 @@ private void ValidateAndSetImage(Image.Image? provided, Action apply)
return;
}
- if (provided.Organization != PlanningRealm.Organization)
+ if (provided.Organization != TournamentPlanner.Organization)
{
throw new TurnierplanException("Cannot assign an image from another organization.");
}
diff --git a/src/Turnierplan.Core/PlanningRealm/InvitationLinkEntry.cs b/src/Turnierplan.Core/TournamentPlanner/InvitationLinkEntry.cs
similarity index 94%
rename from src/Turnierplan.Core/PlanningRealm/InvitationLinkEntry.cs
rename to src/Turnierplan.Core/TournamentPlanner/InvitationLinkEntry.cs
index 09225e42..e4181881 100644
--- a/src/Turnierplan.Core/PlanningRealm/InvitationLinkEntry.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/InvitationLinkEntry.cs
@@ -1,6 +1,6 @@
using Turnierplan.Core.Entity;
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public sealed class InvitationLinkEntry : Entity
{
diff --git a/src/Turnierplan.Core/PlanningRealm/Label.cs b/src/Turnierplan.Core/TournamentPlanner/Label.cs
similarity index 92%
rename from src/Turnierplan.Core/PlanningRealm/Label.cs
rename to src/Turnierplan.Core/TournamentPlanner/Label.cs
index 2c688c76..cdc3e45b 100644
--- a/src/Turnierplan.Core/PlanningRealm/Label.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/Label.cs
@@ -1,6 +1,6 @@
using Turnierplan.Core.Entity;
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public sealed class Label : Entity
{
diff --git a/src/Turnierplan.Core/PlanningRealm/TeamLink.cs b/src/Turnierplan.Core/TournamentPlanner/TeamLink.cs
similarity index 64%
rename from src/Turnierplan.Core/PlanningRealm/TeamLink.cs
rename to src/Turnierplan.Core/TournamentPlanner/TeamLink.cs
index 340cbefe..13945af2 100644
--- a/src/Turnierplan.Core/PlanningRealm/TeamLink.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/TeamLink.cs
@@ -1,18 +1,18 @@
using Turnierplan.Core.Entity;
using Turnierplan.Core.Tournament;
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public sealed class TeamLink : Entity
{
public TeamLink(ApplicationTeam applicationTeam, Team team)
{
- var planningRealm = applicationTeam.Application.PlanningRealm;
+ var tournamentPlanner = applicationTeam.Application.TournamentPlanner;
var tournament = team.Tournament;
- if (planningRealm.Organization is null || planningRealm.Organization != tournament.Organization)
+ if (tournamentPlanner.Organization is null || tournamentPlanner.Organization != tournament.Organization)
{
- throw new ArgumentException("Both the planning realm and the tournament must belong to the same organization which may not be null.");
+ throw new ArgumentException("Both the tournament planner and the tournament must belong to the same organization which may not be null.");
}
Id = 0;
diff --git a/src/Turnierplan.Core/PlanningRealm/TournamentClass.cs b/src/Turnierplan.Core/TournamentPlanner/TournamentClass.cs
similarity index 88%
rename from src/Turnierplan.Core/PlanningRealm/TournamentClass.cs
rename to src/Turnierplan.Core/TournamentPlanner/TournamentClass.cs
index 78cd46a0..93d9d6d4 100644
--- a/src/Turnierplan.Core/PlanningRealm/TournamentClass.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/TournamentClass.cs
@@ -1,6 +1,6 @@
using Turnierplan.Core.Entity;
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
public sealed class TournamentClass : Entity
{
diff --git a/src/Turnierplan.Core/PlanningRealm/PlanningRealm.cs b/src/Turnierplan.Core/TournamentPlanner/TournamentPlanner.cs
similarity index 77%
rename from src/Turnierplan.Core/PlanningRealm/PlanningRealm.cs
rename to src/Turnierplan.Core/TournamentPlanner/TournamentPlanner.cs
index 7acbd7ea..f45a45a6 100644
--- a/src/Turnierplan.Core/PlanningRealm/PlanningRealm.cs
+++ b/src/Turnierplan.Core/TournamentPlanner/TournamentPlanner.cs
@@ -1,19 +1,19 @@
using Turnierplan.Core.Entity;
using Turnierplan.Core.RoleAssignment;
-namespace Turnierplan.Core.PlanningRealm;
+namespace Turnierplan.Core.TournamentPlanner;
-public sealed class PlanningRealm : Entity, IEntityWithRoleAssignments, IEntityWithOrganization
+public sealed class TournamentPlanner : Entity, IEntityWithRoleAssignments, IEntityWithOrganization
{
- internal readonly List> _roleAssignments = [];
+ internal readonly List> _roleAssignments = [];
internal readonly List _tournamentClasses = [];
internal readonly List _invitationLinks = [];
internal readonly List _applications = [];
internal readonly List _labels = [];
- public PlanningRealm(Organization.Organization organization, string name)
+ public TournamentPlanner(Organization.Organization organization, string name)
{
- organization._planningRealms.Add(this);
+ organization._tournamentPlanners.Add(this);
Id = 0;
PublicId = new PublicId.PublicId();
@@ -22,7 +22,7 @@ public PlanningRealm(Organization.Organization organization, string name)
Name = name;
}
- internal PlanningRealm(long id, PublicId.PublicId publicId, DateTime createdAt, string name)
+ internal TournamentPlanner(long id, PublicId.PublicId publicId, DateTime createdAt, string name)
{
Id = id;
PublicId = publicId;
@@ -36,7 +36,7 @@ internal PlanningRealm(long id, PublicId.PublicId publicId, DateTime createdAt,
public Organization.Organization Organization { get; internal set; } = null!;
- public IReadOnlyList> RoleAssignments => _roleAssignments.AsReadOnly();
+ public IReadOnlyList> RoleAssignments => _roleAssignments.AsReadOnly();
public DateTime CreatedAt { get; }
@@ -50,15 +50,15 @@ internal PlanningRealm(long id, PublicId.PublicId publicId, DateTime createdAt,
public IReadOnlyList Labels => _labels.AsReadOnly();
- public RoleAssignment AddRoleAssignment(Role role, Principal principal)
+ public RoleAssignment AddRoleAssignment(Role role, Principal principal)
{
- var roleAssignment = new RoleAssignment(this, role, principal);
+ var roleAssignment = new RoleAssignment(this, role, principal);
_roleAssignments.Add(roleAssignment);
return roleAssignment;
}
- public void RemoveRoleAssignment(RoleAssignment roleAssignment)
+ public void RemoveRoleAssignment(RoleAssignment roleAssignment)
{
_roleAssignments.Remove(roleAssignment);
}
@@ -76,7 +76,7 @@ public InvitationLink AddInvitationLink(string name)
var invitationLink = new InvitationLink(name);
_invitationLinks.Add(invitationLink);
- invitationLink.PlanningRealm = this;
+ invitationLink.TournamentPlanner = this;
return invitationLink;
}
diff --git a/src/Turnierplan.Dal/EntityConfigurations/ApplicationChangeLogEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/ApplicationChangeLogEntityTypeConfiguration.cs
index 9aafc273..cbb12f81 100644
--- a/src/Turnierplan.Dal/EntityConfigurations/ApplicationChangeLogEntityTypeConfiguration.cs
+++ b/src/Turnierplan.Dal/EntityConfigurations/ApplicationChangeLogEntityTypeConfiguration.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.Dal.EntityConfigurations;
diff --git a/src/Turnierplan.Dal/EntityConfigurations/ApplicationEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/ApplicationEntityTypeConfiguration.cs
index 64224b95..5d26f29c 100644
--- a/src/Turnierplan.Dal/EntityConfigurations/ApplicationEntityTypeConfiguration.cs
+++ b/src/Turnierplan.Dal/EntityConfigurations/ApplicationEntityTypeConfiguration.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.Dal.EntityConfigurations;
diff --git a/src/Turnierplan.Dal/EntityConfigurations/ApplicationTeamEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/ApplicationTeamEntityTypeConfiguration.cs
index 34e9a1a8..d6f70633 100644
--- a/src/Turnierplan.Dal/EntityConfigurations/ApplicationTeamEntityTypeConfiguration.cs
+++ b/src/Turnierplan.Dal/EntityConfigurations/ApplicationTeamEntityTypeConfiguration.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.Dal.EntityConfigurations;
diff --git a/src/Turnierplan.Dal/EntityConfigurations/InvitationLinkEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/InvitationLinkEntityTypeConfiguration.cs
index 0897eb09..869f083a 100644
--- a/src/Turnierplan.Dal/EntityConfigurations/InvitationLinkEntityTypeConfiguration.cs
+++ b/src/Turnierplan.Dal/EntityConfigurations/InvitationLinkEntityTypeConfiguration.cs
@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Turnierplan.Core.Image;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Dal.Converters;
namespace Turnierplan.Dal.EntityConfigurations;
diff --git a/src/Turnierplan.Dal/EntityConfigurations/InvitationLinkEntryEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/InvitationLinkEntryEntityTypeConfiguration.cs
index 2b6b35bf..73b78ddc 100644
--- a/src/Turnierplan.Dal/EntityConfigurations/InvitationLinkEntryEntityTypeConfiguration.cs
+++ b/src/Turnierplan.Dal/EntityConfigurations/InvitationLinkEntryEntityTypeConfiguration.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.Dal.EntityConfigurations;
diff --git a/src/Turnierplan.Dal/EntityConfigurations/LabelEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/LabelEntityTypeConfiguration.cs
index 11bab6fb..cd6de3ef 100644
--- a/src/Turnierplan.Dal/EntityConfigurations/LabelEntityTypeConfiguration.cs
+++ b/src/Turnierplan.Dal/EntityConfigurations/LabelEntityTypeConfiguration.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.Dal.EntityConfigurations;
diff --git a/src/Turnierplan.Dal/EntityConfigurations/OrganizationEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/OrganizationEntityTypeConfiguration.cs
index 0cb91190..cf3cfd76 100644
--- a/src/Turnierplan.Dal/EntityConfigurations/OrganizationEntityTypeConfiguration.cs
+++ b/src/Turnierplan.Dal/EntityConfigurations/OrganizationEntityTypeConfiguration.cs
@@ -52,7 +52,7 @@ public void Configure(EntityTypeBuilder builder)
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
- builder.HasMany(x => x.PlanningRealms)
+ builder.HasMany(x => x.TournamentPlanners)
.WithOne(x => x.Organization)
.HasForeignKey("OrganizationId")
.OnDelete(DeleteBehavior.Restrict)
@@ -74,7 +74,7 @@ public void Configure(EntityTypeBuilder builder)
builder.Metadata.FindNavigation(nameof(Organization.ApiKeys))!.SetPropertyAccessMode(PropertyAccessMode.Field);
builder.Metadata.FindNavigation(nameof(Organization.Folders))!.SetPropertyAccessMode(PropertyAccessMode.Field);
builder.Metadata.FindNavigation(nameof(Organization.Images))!.SetPropertyAccessMode(PropertyAccessMode.Field);
- builder.Metadata.FindNavigation(nameof(Organization.PlanningRealms))!.SetPropertyAccessMode(PropertyAccessMode.Field);
+ builder.Metadata.FindNavigation(nameof(Organization.TournamentPlanners))!.SetPropertyAccessMode(PropertyAccessMode.Field);
builder.Metadata.FindNavigation(nameof(Organization.Tournaments))!.SetPropertyAccessMode(PropertyAccessMode.Field);
builder.Metadata.FindNavigation(nameof(Organization.Venues))!.SetPropertyAccessMode(PropertyAccessMode.Field);
}
diff --git a/src/Turnierplan.Dal/EntityConfigurations/PlanningRealmEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/PlanningRealmEntityTypeConfiguration.cs
deleted file mode 100644
index 1545e38c..00000000
--- a/src/Turnierplan.Dal/EntityConfigurations/PlanningRealmEntityTypeConfiguration.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using Turnierplan.Core.PlanningRealm;
-using Turnierplan.Dal.Converters;
-
-namespace Turnierplan.Dal.EntityConfigurations;
-
-public sealed class PlanningRealmEntityTypeConfiguration : IEntityTypeConfiguration
-{
- public void Configure(EntityTypeBuilder builder)
- {
- builder.ToTable("PlanningRealms", TurnierplanContext.Schema);
-
- builder.HasKey(x => x.Id);
-
- builder.Property(x => x.Id)
- .IsRequired();
-
- builder.Property(x => x.PublicId)
- .HasConversion();
-
- builder.HasIndex(x => x.PublicId)
- .IsUnique();
-
- builder.HasMany(x => x.RoleAssignments)
- .WithOne(x => x.Scope)
- .HasForeignKey("PlanningRealmId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- builder.Property(x => x.CreatedAt)
- .IsRequired();
-
- builder.Property(x => x.Name)
- .IsRequired();
-
- builder.HasMany(x => x.TournamentClasses)
- .WithOne()
- .HasForeignKey("PlanningRealmId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- builder.HasMany(x => x.InvitationLinks)
- .WithOne(x => x.PlanningRealm)
- .HasForeignKey("PlanningRealmId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- builder.HasMany(x => x.Applications)
- .WithOne(x => x.PlanningRealm)
- .HasForeignKey("PlanningRealmId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- builder.HasMany(x => x.Labels)
- .WithOne()
- .HasForeignKey("PlanningRealmId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- builder.Metadata.FindNavigation(nameof(PlanningRealm.RoleAssignments))!.SetPropertyAccessMode(PropertyAccessMode.Field);
- builder.Metadata.FindNavigation(nameof(PlanningRealm.TournamentClasses))!.SetPropertyAccessMode(PropertyAccessMode.Field);
- builder.Metadata.FindNavigation(nameof(PlanningRealm.InvitationLinks))!.SetPropertyAccessMode(PropertyAccessMode.Field);
- builder.Metadata.FindNavigation(nameof(PlanningRealm.Applications))!.SetPropertyAccessMode(PropertyAccessMode.Field);
- builder.Metadata.FindNavigation(nameof(PlanningRealm.Labels))!.SetPropertyAccessMode(PropertyAccessMode.Field);
- }
-}
diff --git a/src/Turnierplan.Dal/EntityConfigurations/TeamLinkEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/TeamLinkEntityTypeConfiguration.cs
index 5cd2321f..c0f306c0 100644
--- a/src/Turnierplan.Dal/EntityConfigurations/TeamLinkEntityTypeConfiguration.cs
+++ b/src/Turnierplan.Dal/EntityConfigurations/TeamLinkEntityTypeConfiguration.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.Dal.EntityConfigurations;
diff --git a/src/Turnierplan.Dal/EntityConfigurations/TournamentClassEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/TournamentClassEntityTypeConfiguration.cs
index 564dc9da..c1ea5217 100644
--- a/src/Turnierplan.Dal/EntityConfigurations/TournamentClassEntityTypeConfiguration.cs
+++ b/src/Turnierplan.Dal/EntityConfigurations/TournamentClassEntityTypeConfiguration.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using Turnierplan.Core.PlanningRealm;
+using Turnierplan.Core.TournamentPlanner;
namespace Turnierplan.Dal.EntityConfigurations;
diff --git a/src/Turnierplan.Dal/EntityConfigurations/TournamentPlannerEntityTypeConfiguration.cs b/src/Turnierplan.Dal/EntityConfigurations/TournamentPlannerEntityTypeConfiguration.cs
new file mode 100644
index 00000000..e1373ad1
--- /dev/null
+++ b/src/Turnierplan.Dal/EntityConfigurations/TournamentPlannerEntityTypeConfiguration.cs
@@ -0,0 +1,67 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+using Turnierplan.Core.TournamentPlanner;
+using Turnierplan.Dal.Converters;
+
+namespace Turnierplan.Dal.EntityConfigurations;
+
+public sealed class TournamentPlannerEntityTypeConfiguration : IEntityTypeConfiguration
+{
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.ToTable("TournamentPlanners", TurnierplanContext.Schema);
+
+ builder.HasKey(x => x.Id);
+
+ builder.Property(x => x.Id)
+ .IsRequired();
+
+ builder.Property(x => x.PublicId)
+ .HasConversion();
+
+ builder.HasIndex(x => x.PublicId)
+ .IsUnique();
+
+ builder.HasMany(x => x.RoleAssignments)
+ .WithOne(x => x.Scope)
+ .HasForeignKey("TournamentPlannerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ builder.Property(x => x.CreatedAt)
+ .IsRequired();
+
+ builder.Property(x => x.Name)
+ .IsRequired();
+
+ builder.HasMany(x => x.TournamentClasses)
+ .WithOne()
+ .HasForeignKey("TournamentPlannerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ builder.HasMany(x => x.InvitationLinks)
+ .WithOne(x => x.TournamentPlanner)
+ .HasForeignKey("TournamentPlannerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ builder.HasMany(x => x.Applications)
+ .WithOne(x => x.TournamentPlanner)
+ .HasForeignKey("TournamentPlannerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ builder.HasMany(x => x.Labels)
+ .WithOne()
+ .HasForeignKey("TournamentPlannerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ builder.Metadata.FindNavigation(nameof(TournamentPlanner.RoleAssignments))!.SetPropertyAccessMode(PropertyAccessMode.Field);
+ builder.Metadata.FindNavigation(nameof(TournamentPlanner.TournamentClasses))!.SetPropertyAccessMode(PropertyAccessMode.Field);
+ builder.Metadata.FindNavigation(nameof(TournamentPlanner.InvitationLinks))!.SetPropertyAccessMode(PropertyAccessMode.Field);
+ builder.Metadata.FindNavigation(nameof(TournamentPlanner.Applications))!.SetPropertyAccessMode(PropertyAccessMode.Field);
+ builder.Metadata.FindNavigation(nameof(TournamentPlanner.Labels))!.SetPropertyAccessMode(PropertyAccessMode.Field);
+ }
+}
diff --git a/src/Turnierplan.Dal/Extensions/ServiceCollectionExtensions.cs b/src/Turnierplan.Dal/Extensions/ServiceCollectionExtensions.cs
index 4c05efa8..9f0d3b7b 100644
--- a/src/Turnierplan.Dal/Extensions/ServiceCollectionExtensions.cs
+++ b/src/Turnierplan.Dal/Extensions/ServiceCollectionExtensions.cs
@@ -9,8 +9,8 @@
using Turnierplan.Core.Folder;
using Turnierplan.Core.Image;
using Turnierplan.Core.Organization;
-using Turnierplan.Core.PlanningRealm;
using Turnierplan.Core.Tournament;
+using Turnierplan.Core.TournamentPlanner;
using Turnierplan.Core.Venue;
using Turnierplan.Dal.Repositories;
@@ -55,8 +55,8 @@ public static void AddTurnierplanDataAccessLayer(this IServiceCollection service
services.AddScoped();
services.AddScoped();
services.AddScoped();
- services.AddScoped();
services.AddScoped();
+ services.AddScoped();
services.AddScoped();
services.AddScoped();
@@ -66,24 +66,24 @@ public static void AddTurnierplanDataAccessLayer(this IServiceCollection service
services.AddScoped>(sp => sp.GetRequiredService());
services.AddScoped>(sp => sp.GetRequiredService());
services.AddScoped>(sp => sp.GetRequiredService());
- services.AddScoped>(sp => sp.GetRequiredService());
services.AddScoped>(sp => sp.GetRequiredService());
+ services.AddScoped>(sp => sp.GetRequiredService());
services.AddScoped>(sp => sp.GetRequiredService());
services.AddScoped, ApiKeyRoleAssignmentRepository>();
services.AddScoped, FolderRoleAssignmentRepository>();
services.AddScoped, ImageRoleAssignmentRepository>();
services.AddScoped, OrganizationRoleAssignmentRepository>();
- services.AddScoped, PlanningRealmRoleAssignmentRepository>();
services.AddScoped, TournamentRoleAssignmentRepository>();
+ services.AddScoped, TournamentPlannerRoleAssignmentRepository>();
services.AddScoped, VenueRoleAssignmentRepository>();
services.AddScoped(sp => sp.GetRequiredService>());
services.AddScoped(sp => sp.GetRequiredService>());
services.AddScoped(sp => sp.GetRequiredService>());
services.AddScoped(sp => sp.GetRequiredService>());
- services.AddScoped(sp => sp.GetRequiredService>());
services.AddScoped(sp => sp.GetRequiredService>());
+ services.AddScoped(sp => sp.GetRequiredService>());
services.AddScoped(sp => sp.GetRequiredService>());
}
}
diff --git a/src/Turnierplan.Dal/Migrations/20260604100316_Rename_TournamentPlanner.Designer.cs b/src/Turnierplan.Dal/Migrations/20260604100316_Rename_TournamentPlanner.Designer.cs
new file mode 100644
index 00000000..40d41d4e
--- /dev/null
+++ b/src/Turnierplan.Dal/Migrations/20260604100316_Rename_TournamentPlanner.Designer.cs
@@ -0,0 +1,1884 @@
+//
+using System;
+using System.Collections.Generic;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using Turnierplan.Dal;
+
+#nullable disable
+
+namespace Turnierplan.Dal.Migrations
+{
+ [DbContext(typeof(TurnierplanContext))]
+ [Migration("20260604100316_Rename_TournamentPlanner")]
+ partial class Rename_TournamentPlanner
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "10.0.4")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("ApplicationTeamLabel", b =>
+ {
+ b.Property("ApplicationTeamId")
+ .HasColumnType("bigint");
+
+ b.Property("LabelsId")
+ .HasColumnType("bigint");
+
+ b.HasKey("ApplicationTeamId", "LabelsId");
+
+ b.HasIndex("LabelsId");
+
+ b.ToTable("ApplicationTeamLabel", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ExpiryDate")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("IsActive")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("OrganizationId")
+ .HasColumnType("bigint");
+
+ b.Property("PrincipalId")
+ .HasColumnType("uuid");
+
+ b.Property("PublicId")
+ .HasColumnType("bigint");
+
+ b.Property("SecretHash")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrganizationId");
+
+ b.HasIndex("PrincipalId")
+ .IsUnique();
+
+ b.HasIndex("PublicId")
+ .IsUnique();
+
+ b.ToTable("ApiKeys", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKeyRequest", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ApiKeyId")
+ .HasColumnType("bigint");
+
+ b.Property