Audit Service

This commit is contained in:
Andre Beging
2022-05-23 10:29:10 +02:00
parent 5961c06004
commit 5d713db83f
14 changed files with 552 additions and 49 deletions

View File

@@ -0,0 +1,49 @@
using System.ComponentModel.DataAnnotations;
namespace FoodsharingSiegen.Contracts.Entity
{
/// <summary>
/// The audit class (a. beging, 23.05.2022)
/// </summary>
public class Audit
{
#region Public Properties
/// <summary>
/// Gets or sets the value of the created (ab)
/// </summary>
public DateTime? Created { get; set; }
/// <summary>
/// Gets or sets the value of the data 1 (ab)
/// </summary>
public string? Data1 { get; set; }
/// <summary>
/// Gets or sets the value of the data 2 (ab)
/// </summary>
public string? Data2 { get; set; }
/// <summary>
/// Gets or sets the value of the id (ab)
/// </summary>
[Key] public Guid Id { get; set; }
/// <summary>
/// Gets or sets the value of the type (ab)
/// </summary>
public AuditType Type { get; set; }
/// <summary>
/// Gets or sets the value of the user (ab)
/// </summary>
public User? User { get; set; }
/// <summary>
/// Gets or sets the value of the user id (ab)
/// </summary>
public Guid? UserID { get; set; }
#endregion
}
}

View File

@@ -0,0 +1,23 @@
namespace FoodsharingSiegen.Contracts.Entity
{
public enum AuditType : int
{
None = 0,
// Profile
SaveProfile = 10,
SetOwnPassword = 20,
// Usermanagement
CreateUser = 30,
UpdateUser = 40,
RemoveUser = 50,
SetUserPassword = 60,
// Prospect
CreateProspect = 70,
EditProspect = 80,
AddInteraction = 90,
RemoveInteraction = 100
}
}