Create Audits on Actions
This commit is contained in:
40
FoodsharingSiegen.Server/Data/AuditHelper.cs
Normal file
40
FoodsharingSiegen.Server/Data/AuditHelper.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
|
||||
namespace FoodsharingSiegen.Server.Data
|
||||
{
|
||||
public static class AuditHelper
|
||||
{
|
||||
public static string CreateText(Audit audit)
|
||||
{
|
||||
switch (audit.Type)
|
||||
{
|
||||
case AuditType.SaveProfile:
|
||||
return "hat das eigene Profil gespeichert.";
|
||||
case AuditType.SetOwnPassword:
|
||||
return "hat das eigene Passwort geändert.";
|
||||
case AuditType.CreateUser:
|
||||
return $"hat den User {audit.Data1} erstellt.";
|
||||
case AuditType.UpdateUser:
|
||||
return $"hat den User {audit.Data1} gespeichert.";
|
||||
case AuditType.RemoveUser:
|
||||
return $"hat den User {audit.Data1} gelöscht.";
|
||||
case AuditType.SetUserPassword:
|
||||
return $"hat das Passwort von {audit.Data1} geändert.";
|
||||
case AuditType.CreateProspect:
|
||||
return $"hat den Neuling {audit.Data1} erstellt.";
|
||||
case AuditType.EditProspect:
|
||||
return $"hat den Neuling {audit.Data1} bearbeitet.";
|
||||
case AuditType.AddInteraction:
|
||||
return $"hat dem Neuling {audit.Data1} folgendes hinzugefügt: {audit.Data2}";
|
||||
case AuditType.RemoveInteraction:
|
||||
return $"hat eine Interaktion bei {audit.Data1} gelöscht.";
|
||||
break;
|
||||
case AuditType.None:
|
||||
default:
|
||||
return $"{audit.Data1}, {audit.Data2}";
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user