Compare commits
No commits in common. "8e2342fd7496376514053245714bc4912fb88745" and "1a7e596abdda169339a3bd20fe51fdff095c977a" have entirely different histories.
8e2342fd74
...
1a7e596abd
|
|
@ -1,12 +1,4 @@
|
||||||
|
## Erweiterte Registrierung & Club Mitgliedschaften
|
||||||
## Optimierung Spieltag-Details
|
|
||||||
Die Erfassung von Strafen muss möglichst schnell und komfortabel mögiich sein. Dafür muss die Seite DayDetails opimiert werden.
|
|
||||||
Es soll möglich sein eine Person in der Teilnehmerliste auszuwählen. Bei der Erfassung einer neuen Strafe kann diese Person direkt vorbelegt werden. Außerdem soll zusätzlich zum Button "Strafe hinzufügen" ein Menü-Button angezeigt werden, der eine Kurzwahl aller Strafen mit der Option "IsOneClick" ermöglicht.
|
|
||||||
Der Benutzer soll visuell leicht erkennen können, ob und welcher Teilnehmer aktuell markiert wurde.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Erweiterte Registrierung & Club Mitgliedschaften - done
|
|
||||||
Die REgistrierung funktioniert, entspricht aber noch nicht den Anforderungen. Ergänze nach der Phase
|
Die REgistrierung funktioniert, entspricht aber noch nicht den Anforderungen. Ergänze nach der Phase
|
||||||
F3 noch eine Phase "Erweiterte Registrierung". Dabei sollen neue User im Zuge der Registrierung erst mal
|
F3 noch eine Phase "Erweiterte Registrierung". Dabei sollen neue User im Zuge der Registrierung erst mal
|
||||||
nur "pending" sein, und auf Freischaltung durch die Club-Admins warten müssen. Das Login soll nach der
|
nur "pending" sein, und auf Freischaltung durch die Club-Admins warten müssen. Das Login soll nach der
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,6 @@ public class PersonService : IPersonService
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public async Task<PersonDto> CreateAsync(CreatePersonDto dto, CancellationToken ct = default)
|
public async Task<PersonDto> CreateAsync(CreatePersonDto dto, CancellationToken ct = default)
|
||||||
{
|
{
|
||||||
var existingPerson = await _personRepository.GetByNameAsync(_clubContext.ClubId, dto.Name, ct);
|
|
||||||
if (existingPerson != null)
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException($"Person with name '{dto.Name}' already exists");
|
|
||||||
}
|
|
||||||
|
|
||||||
var entity = new Person
|
var entity = new Person
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid(),
|
Id = Guid.NewGuid(),
|
||||||
|
|
@ -81,12 +75,6 @@ public class PersonService : IPersonService
|
||||||
if (existing.ClubId != _clubContext.ClubId)
|
if (existing.ClubId != _clubContext.ClubId)
|
||||||
throw new InvalidOperationException("Person does not belong to current club.");
|
throw new InvalidOperationException("Person does not belong to current club.");
|
||||||
|
|
||||||
var existingPerson = await _personRepository.GetByNameAsync(_clubContext.ClubId, dto.Name, ct);
|
|
||||||
if (existingPerson != null)
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException($"Person with name '{dto.Name}' already exists");
|
|
||||||
}
|
|
||||||
|
|
||||||
existing.Name = dto.Name;
|
existing.Name = dto.Name;
|
||||||
existing.PersonStatus = dto.PersonStatus;
|
existing.PersonStatus = dto.PersonStatus;
|
||||||
existing.ModifiedAt = DateTime.UtcNow;
|
existing.ModifiedAt = DateTime.UtcNow;
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,4 @@ public interface IPersonRepository
|
||||||
/// <param name="ct">Cancellation token.</param>
|
/// <param name="ct">Cancellation token.</param>
|
||||||
/// <returns>True if deleted successfully; otherwise, false.</returns>
|
/// <returns>True if deleted successfully; otherwise, false.</returns>
|
||||||
Task<bool> DeleteAsync(Guid id, CancellationToken ct = default);
|
Task<bool> DeleteAsync(Guid id, CancellationToken ct = default);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Read a person by its name within a specific club context.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="clubContextClubId"></param>
|
|
||||||
/// <param name="dtoName"></param>
|
|
||||||
/// <param name="ct"></param>
|
|
||||||
/// <returns>The person with the name or null</returns>
|
|
||||||
Task<Person?> GetByNameAsync(Guid clubContextClubId, string dtoName, CancellationToken ct);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,13 +63,4 @@ public class PersonRepository(IDbContextFactory<AppDbContext> contextFactory) :
|
||||||
await context.SaveChangesAsync(ct);
|
await context.SaveChangesAsync(ct);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public async Task<Person?> GetByNameAsync(Guid clubContextClubId, string dtoName, CancellationToken ct)
|
|
||||||
{
|
|
||||||
await using var context = await contextFactory.CreateDbContextAsync(ct);
|
|
||||||
var entity = await context.Persons
|
|
||||||
.FirstOrDefaultAsync(p => p.ClubId == clubContextClubId && p.Name == dtoName && !p.IsDeleted, ct);
|
|
||||||
return entity;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue