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" field: "name"
} }
], ],
complete: [ detailed: [
{ {
header: "Gruppe", header: "Gruppe",
field: "name" field: "name"
@ -97,34 +97,6 @@ export const env = {
{ {
header: "Kommentar", header: "Kommentar",
field: "comment" 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: [ representative: [
@ -189,10 +161,6 @@ export const env = {
header: "Repr. Gruppen", header: "Repr. Gruppen",
field: (ur: any) => ur.repGroup?.name field: (ur: any) => ur.repGroup?.name
}, },
{
header: "Rechte Gruppen",
field: (ur: any) => ur.rightGroup?.name
},
{ {
header: "Repr. Benutzer", header: "Repr. Benutzer",
field: (ur: any) => ur.repUser?.username field: (ur: any) => ur.repUser?.username
@ -220,4 +188,4 @@ export const env = {
{ value: "en-US", name: "en-US" } { value: "en-US", name: "en-US" }
] ]
} }
}; };

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. // 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; 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."); 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? UserId,
int? RepGroupId, int? RepGroupId,
int? GroupId, int? GroupId,
int RepUserId int? RepUserId
) : BaseCreateDto(); ) : BaseCreateDto();
} }

View File

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

View File

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

View File

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

View File

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