refactor(UserRep): nullable related propoerties gemacht.

- RepUserId von UserRepCreateDto löschbar gemacht.
 - ChangedWho von UserRepReadDto löschbar gemacht.
 - RepUserId von UserRepUpdateDto löschbar gemacht.
This commit is contained in:
Developer 02 2024-11-06 10:03:10 +01:00
parent b3131637ab
commit 5df5cc555a
7 changed files with 7 additions and 39 deletions

View File

@ -89,7 +89,7 @@ export const env = {
field: "name"
}
],
complete: [
detailed: [
{
header: "Gruppe",
field: "name"
@ -97,34 +97,6 @@ export const env = {
{
header: "Kommentar",
field: "comment"
},
{
header: "Active",
field: (group: any) => group.active ? "✓" : ""
},
{
header: "AD Sync",
field: (group: any) => group.adSync ? "✓" : ""
},
{
header: "Internal",
field: (group: any) => group.internal ? "✓" : ""
},
{
header: 'Hinzugefügt<br>wer',
field: (g: any) => g.addedWho
},
{
header: 'Hinzugefügt<br>wann',
field: (g: any) => new Date(g.addedWhen).toLocaleString('de-DE', { day: '2-digit', month: '2-digit', year: '2-digit', hour: '2-digit', minute: '2-digit' }).replace(',', '')
},
{
header: 'Geändert<br>wer',
field: 'changedWho'
},
{
header: 'Geändert<br>wann',
field: (g: any) => new Date(g.changedWhen).toLocaleString('de-DE', { day: '2-digit', month: '2-digit', year: '2-digit', hour: '2-digit', minute: '2-digit' }).replace(',', '')
}
],
representative: [
@ -189,10 +161,6 @@ export const env = {
header: "Repr. Gruppen",
field: (ur: any) => ur.repGroup?.name
},
{
header: "Rechte Gruppen",
field: (ur: any) => ur.rightGroup?.name
},
{
header: "Repr. Benutzer",
field: (ur: any) => ur.repUser?.username

View File

@ -54,7 +54,7 @@ try {
// Once the app is built, the password will be decrypted with Encryptor. lazy loading also acts as a call back method.
Lazy<string>? cnn_str = null;
builder.Services.AddDbContext<UserManagerDbContext>(options => options.UseSqlServer(cnn_str!.Value).EnableDetailedErrors());
builder.Services.AddDbContext<UserManagerDbContext>(options => options.UseSqlServer(cnn_str!.Value).EnableSensitiveDataLogging());
var allowedOrigins = builder.Configuration.GetSection("AllowedOrigins").Get<string[]>() ?? throw new InvalidOperationException("In appsettings there is no allowed origin.");

View File

@ -6,6 +6,6 @@ namespace DigitalData.UserManager.Application.DTOs.UserRep
int? UserId,
int? RepGroupId,
int? GroupId,
int RepUserId
int? RepUserId
) : BaseCreateDto();
}

View File

@ -11,7 +11,7 @@ namespace DigitalData.UserManager.Application.DTOs.UserRep
int? RepUserId,
int? RepGroupId,
string AddedWho,
string ChangedWho,
string? ChangedWho,
UserReadDto? User,
GroupReadDto? RepGroup,
GroupReadDto? Group,

View File

@ -6,6 +6,6 @@ namespace DigitalData.UserManager.Application.DTOs.UserRep
int? UserId,
int? RepGroupId,
int? GroupId,
int RepUserId
int? RepUserId
) : BaseUpdateDto();
}

View File

@ -20,6 +20,7 @@ namespace DigitalData.UserManager.Domain.Entities
[Column("CHANGED_WHO")]
public string? ChangedWho { get; set; }
//TODO: assign it to default value in create dto, not here!
[Column("ADDED_WHEN", TypeName = "datetime")]
[DefaultValue("GETDATE()")]
public DateTime AddedWhen { get; set; } = DateTime.Now;

View File

@ -6,7 +6,6 @@ namespace DigitalData.UserManager.Domain.Entities
[Table("TBDD_USER_REPRESENTATION", Schema = "dbo")]
public class UserRep : BaseEntity
{
[Required]
[Column("USER_ID")]
public int? UserId { get; set; }