adding
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using LCU.Library.Internal.DocumentModels.Requests;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace LCU.API.Internal.DocumentLib.Containers;
|
||||
|
||||
[BsonKnownTypes(typeof(DocumentFieldAudit), typeof(DocumentActionAudit))]
|
||||
public abstract class DocumentAudit
|
||||
{
|
||||
protected DocumentAudit(Guid documentId, string source, DateTime date, string userId)
|
||||
{
|
||||
DocumentId = documentId;
|
||||
Source = source;
|
||||
Date = date;
|
||||
UserId = userId;
|
||||
}
|
||||
|
||||
public Guid DocumentId { get; set; }
|
||||
public string Source { get; set; }
|
||||
|
||||
[BsonDateTimeOptions(Kind = DateTimeKind.Utc)]
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public string UserId { get; set; }
|
||||
}
|
||||
|
||||
[BsonIgnoreExtraElements]
|
||||
public class DocumentFieldAudit : DocumentAudit
|
||||
{
|
||||
public DocumentFieldAudit(Guid documentId, string source, DateTime date, string userId, string field, object previousValue, object currentValue)
|
||||
: base(documentId, source, date, userId)
|
||||
{
|
||||
Field = field;
|
||||
PreviousValue = previousValue;
|
||||
CurrentValue = currentValue;
|
||||
}
|
||||
|
||||
public string Field { get; set; }
|
||||
public object PreviousValue { get; set; }
|
||||
public object CurrentValue { get; set; }
|
||||
}
|
||||
|
||||
[BsonIgnoreExtraElements]
|
||||
public class DocumentActionAudit : DocumentAudit
|
||||
{
|
||||
public DocumentActionAudit(Guid documentId, string source, DateTime date, string userId, DocumentAction action, string description)
|
||||
: base(documentId, source, date, userId)
|
||||
{
|
||||
Action = action;
|
||||
ActionDescription = description;
|
||||
}
|
||||
|
||||
public DocumentAction Action { get; set; }
|
||||
public string ActionDescription { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user