2017-12-01 09:22:04 -05:00
|
|
|
|
using System;
|
|
|
|
|
|
using Bit.Core.Enums;
|
2017-12-01 16:00:30 -05:00
|
|
|
|
using Bit.Core.Models.Table;
|
2017-12-01 09:22:04 -05:00
|
|
|
|
using Bit.Core.Utilities;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Models.Data
|
|
|
|
|
|
{
|
|
|
|
|
|
public class OrganizationEvent : EventTableEntity
|
|
|
|
|
|
{
|
2017-12-01 16:00:30 -05:00
|
|
|
|
public OrganizationEvent(Organization organization, Guid actingUserId, EventType type)
|
2017-12-01 09:22:04 -05:00
|
|
|
|
{
|
2017-12-01 16:00:30 -05:00
|
|
|
|
OrganizationId = organization.Id;
|
2017-12-01 10:07:14 -05:00
|
|
|
|
Type = (int)type;
|
2017-12-01 16:00:30 -05:00
|
|
|
|
ActingUserId = actingUserId;
|
2017-12-01 10:07:14 -05:00
|
|
|
|
|
|
|
|
|
|
Timestamp = DateTime.UtcNow;
|
|
|
|
|
|
PartitionKey = $"OrganizationId={OrganizationId}";
|
2017-12-01 16:00:30 -05:00
|
|
|
|
RowKey = string.Format("Date={0}__ActingUserId={1}__Type={2}",
|
|
|
|
|
|
CoreHelpers.DateTimeToTableStorageKey(Timestamp.DateTime), ActingUserId, Type);
|
2017-12-01 09:22:04 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|