mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
event sql table and repo
This commit is contained in:
@ -3,7 +3,7 @@ using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public class Event : IEvent
|
||||
public class EventMessage : IEvent
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
public EventType Type { get; set; }
|
@ -5,7 +5,6 @@ namespace Bit.Core.Models.Data
|
||||
{
|
||||
public interface IEvent
|
||||
{
|
||||
DateTime Date { get; set; }
|
||||
EventType Type { get; set; }
|
||||
Guid? UserId { get; set; }
|
||||
Guid? OrganizationId { get; set; }
|
||||
@ -14,5 +13,6 @@ namespace Bit.Core.Models.Data
|
||||
Guid? GroupId { get; set; }
|
||||
Guid? OrganizationUserId { get; set; }
|
||||
Guid? ActingUserId { get; set; }
|
||||
DateTime Date { get; set; }
|
||||
}
|
||||
}
|
||||
|
41
src/Core/Models/Table/Event.cs
Normal file
41
src/Core/Models/Table/Event.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Data;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class Event : ITableObject<Guid>, IEvent
|
||||
{
|
||||
public Event() { }
|
||||
|
||||
public Event(IEvent e)
|
||||
{
|
||||
Date = e.Date;
|
||||
Type = e.Type;
|
||||
UserId = e.UserId;
|
||||
OrganizationId = e.OrganizationId;
|
||||
CipherId = e.CipherId;
|
||||
CollectionId = e.CollectionId;
|
||||
GroupId = e.GroupId;
|
||||
OrganizationUserId = e.OrganizationUserId;
|
||||
ActingUserId = e.ActingUserId;
|
||||
}
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public EventType Type { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public Guid? OrganizationId { get; set; }
|
||||
public Guid? CipherId { get; set; }
|
||||
public Guid? CollectionId { get; set; }
|
||||
public Guid? GroupId { get; set; }
|
||||
public Guid? OrganizationUserId { get; set; }
|
||||
public Guid? ActingUserId { get; set; }
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user