InfiniLore / infinilore.cs

GNU General Public License v3.0
2 stars 1 forks source link

make a better thing of this JSON of changed properties #21

Open github-actions[bot] opened 3 days ago

github-actions[bot] commented 3 days ago

πŸ“ Todo : make a better thing of this JSON of changed properties

Description:

Code Snippet:


// Imports
// ---------------------------------------------------------------------------------------------------------------------
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;

namespace InfiniLore.Server.Data.Models.Base;

// ---------------------------------------------------------------------------------------------------------------------
// Code
// ---------------------------------------------------------------------------------------------------------------------
[SuppressMessage("ReSharper", "EntityFramework.ModelValidation.UnlimitedStringLength")]
public class AuditLog<T> where T : BaseContent<T> {
    [Key] public Guid Id { get; set; }

    public required T Content { get; set; }
    public required Guid ContentId { get; set; }
    public required Guid UserId { get; set; }

    public DateTime ChangeDate { get; set; }
    public string ChangeType { get; set; } = string.Empty; // TODO add ChangeType predefined stuff : "Created", "Updated", "Deleted"
    public string ChangedProperties { get; set; } = string.Empty; // TODO make a better thing of this JSON of changed properties
}

File:
https://github.com/InfiniLore/infinilore.cs/blob/8230e188c77ec57fca07c8054bd9109aa37591e2/src/server/InfiniLore.Server.Data.Models/Base/AuditLog.cs#L22