[CHANGE] Fixed auditing, storing images from account import

This commit is contained in:
max
2025-09-15 00:23:57 +02:00
parent e82736a45f
commit 0056a14f79
16 changed files with 201 additions and 47 deletions

View File

@@ -5,6 +5,7 @@ namespace Manager.Data.Entities.Audit;
public class EntityAudit
{
public required Guid Id { get; set; }
[MaxLength(200)]
public required string EntityName { get; set; }
[MaxLength(200)]

View File

@@ -5,6 +5,6 @@ namespace Manager.Data.Entities;
[NoAudit]
public abstract class DateTimeBase
{
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
public DateTime LastModifiedUtc { get; set; } = DateTime.UtcNow;
public DateTime CreatedAtUtc { get; set; }
public DateTime LastModifiedUtc { get; set; }
}

View File

@@ -0,0 +1,25 @@
using System.ComponentModel.DataAnnotations;
namespace Manager.Data.Entities.LibraryContext;
public class FileEntity : DateTimeBase
{
public required Guid Id { get; set; }
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
public required string ForeignKey { get; set; }
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
public required string FileType { get; set; }
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
public required string RelativePath { get; set; }
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
public string? MimeType { get; set; }
public long SizeBytes { get; set; }
[MaxLength(DataConstants.DbContext.DefaultDbUrlSize)]
public string? OriginalUrl { get; set; }
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
public string? OriginalFileName { get; set; }
public int? Width { get; set; }
public int? Height { get; set; }
public long? LenghtMilliseconds { get; set; }
}

View File

@@ -3,7 +3,7 @@ using Manager.Data.Entities.Audit;
namespace Manager.Data.Entities.LibraryContext;
[Auditable]
[NoAudit]
public class HttpCookieEntity : DateTimeBase
{
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]