1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

event sql table and repo

This commit is contained in:
Kyle Spearrin
2017-12-12 14:22:22 -05:00
parent 7b359053d6
commit ce1680a009
11 changed files with 225 additions and 19 deletions

View File

@ -33,7 +33,7 @@ namespace Bit.Core.Services
var now = DateTime.UtcNow;
var events = new List<IEvent>
{
new Event
new EventMessage
{
UserId = userId,
Type = type,
@ -44,7 +44,7 @@ namespace Bit.Core.Services
IEnumerable<IEvent> orgEvents;
if(_currentContext.UserId.HasValue)
{
orgEvents = _currentContext.Organizations.Select(o => new Event
orgEvents = _currentContext.Organizations.Select(o => new EventMessage
{
OrganizationId = o.Id,
UserId = userId,
@ -56,7 +56,7 @@ namespace Bit.Core.Services
{
var orgs = await _organizationUserRepository.GetManyByUserAsync(userId);
orgEvents = orgs.Where(o => o.Status == OrganizationUserStatusType.Confirmed)
.Select(o => new Event
.Select(o => new EventMessage
{
OrganizationId = o.Id,
UserId = userId,
@ -83,7 +83,7 @@ namespace Bit.Core.Services
return;
}
var e = new Event
var e = new EventMessage
{
OrganizationId = cipher.OrganizationId,
UserId = cipher.OrganizationId.HasValue ? null : cipher.UserId,
@ -97,7 +97,7 @@ namespace Bit.Core.Services
public async Task LogCollectionEventAsync(Collection collection, EventType type)
{
var e = new Event
var e = new EventMessage
{
OrganizationId = collection.OrganizationId,
CollectionId = collection.Id,
@ -110,7 +110,7 @@ namespace Bit.Core.Services
public async Task LogGroupEventAsync(Group group, EventType type)
{
var e = new Event
var e = new EventMessage
{
OrganizationId = group.OrganizationId,
GroupId = group.Id,
@ -123,7 +123,7 @@ namespace Bit.Core.Services
public async Task LogOrganizationUserEventAsync(OrganizationUser organizationUser, EventType type)
{
var e = new Event
var e = new EventMessage
{
OrganizationId = organizationUser.OrganizationId,
UserId = organizationUser.UserId,
@ -137,7 +137,7 @@ namespace Bit.Core.Services
public async Task LogOrganizationEventAsync(Organization organization, EventType type)
{
var e = new Event
var e = new EventMessage
{
OrganizationId = organization.Id,
Type = type,