mirror of
https://github.com/bitwarden/server
synced 2025-12-15 15:53:59 +00:00
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using System;
|
|
using Bit.Core.Enums;
|
|
using Bit.Core.Utilities;
|
|
|
|
namespace Bit.Core.Models.Data
|
|
{
|
|
public class OrganizationEvent : EventTableEntity
|
|
{
|
|
public OrganizationEvent(Guid organizationId, EventType type)
|
|
{
|
|
OrganizationId = organizationId;
|
|
Type = (int)type;
|
|
|
|
Timestamp = DateTime.UtcNow;
|
|
PartitionKey = $"OrganizationId={OrganizationId}";
|
|
RowKey = string.Format("Date={0}__Type={1}",
|
|
CoreHelpers.DateTimeToTableStorageKey(Timestamp.DateTime), Type);
|
|
}
|
|
|
|
public OrganizationEvent(Guid organizationId, Guid userId, EventType type)
|
|
{
|
|
OrganizationId = organizationId;
|
|
UserId = userId;
|
|
Type = (int)type;
|
|
|
|
Timestamp = DateTime.UtcNow;
|
|
PartitionKey = $"OrganizationId={OrganizationId}";
|
|
RowKey = string.Format("Date={0}__UserId={1}__Type={2}",
|
|
CoreHelpers.DateTimeToTableStorageKey(Timestamp.DateTime), UserId, Type);
|
|
}
|
|
}
|
|
}
|