refactor: Entfernen der right_group-Eigenschaft aus der Representation-Entität

- Die Spalte `right_group` aus der `Representation`-Entität entfernt, um die Zuordnung von Benutzern oder Gruppen zu spezifischen Gruppen zu entfernen.
- Stattdessen wurde die `group`-Eigenschaft hinzugefügt, um flexible Zuordnungen zu ermöglichen.
- Ermöglicht nun `user-user`, `user-group`, `group-user` und `group-group` Repräsentationen.
This commit is contained in:
Developer 02
2024-09-09 17:25:12 +02:00
parent 75e708d02d
commit 25a4b0752b
15 changed files with 86 additions and 85 deletions

View File

@@ -6,6 +6,6 @@ namespace DigitalData.UserManager.Application.Contracts
{
public interface IUserRepService : IBaseService<UserRepCreateDto, UserRepReadDto, UserRepUpdateDto, UserRep>
{
Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withRightGroup = false, bool withRepUser = false, int? userId = null);
Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null);
}
}

View File

@@ -5,8 +5,7 @@ namespace DigitalData.UserManager.Application.DTOs.UserRep
public record UserRepCreateDto(
int UserId,
int? RepGroupId,
int RightGroupId,
string AddedWho,
int? GroupId,
int RepUserId
) : BaseCreateDto();
}

View File

@@ -8,13 +8,13 @@ namespace DigitalData.UserManager.Application.DTOs.UserRep
int Id,
int UserId,
int? RepGroupId,
int RightGroupId,
int? GroupId,
string AddedWho,
string ChangedWho,
int? RepUserId,
UserReadDto? User,
GroupReadDto? RepGroup,
GroupReadDto? RightGroup,
GroupReadDto? Group,
UserReadDto? RepUser,
DateTime? AddedWhen,
DateTime? ChangedWhen

View File

@@ -5,7 +5,7 @@ namespace DigitalData.UserManager.Application.DTOs.UserRep
public record UserRepUpdateDto(
int UserId,
int? RepGroupId,
int RightGroupId,
int? GroupId,
int RepUserId
) : BaseUpdateDto();
}

View File

@@ -15,9 +15,9 @@ namespace DigitalData.UserManager.Application.Services
{
}
public async Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withRightGroup = false, bool withRepUser = false, int? userId = null)
public async Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null)
{
var urs = await _repository.ReadAllAsync(withUser, withRepGroup, withRightGroup, withRepUser, userId);
var urs = await _repository.ReadAllAsync(withUser, withRepGroup, withGroup, withRepUser, userId, groupId);
var urReadDTOs = _mapper.MapOrThrow<IEnumerable<UserRepReadDto>>(urs);
return Result.Success(urReadDTOs);
}