mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 09:02:48 -05:00
Added Several New Reference Events (#1500)
* added enum values for new events * hooked up directory sync event * upgraded the OrganizationUpgrade ReferenceEvent * Added metadata to the OrganizationUserInvited event noting if this is the first event sent from an organization * Added metadata to the AdjustedSeats event * Implemented vaultImported event * Implemented FirstGroupAdded event * Implemented FirstCollectionAdded event * Implemented FirstSecretAdded event type * Implemented SalesAssisted reference event * changed events to match updated requirements * renamed an event enum
This commit is contained in:
@ -5,6 +5,8 @@ using Bit.Core.Models.Table;
|
||||
using Bit.Core.Repositories;
|
||||
using System.Collections.Generic;
|
||||
using Bit.Core.Models.Data;
|
||||
using Bit.Core.Models.Business;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
@ -14,17 +16,20 @@ namespace Bit.Core.Services
|
||||
private readonly IOrganizationRepository _organizationRepository;
|
||||
private readonly IOrganizationUserRepository _organizationUserRepository;
|
||||
private readonly IGroupRepository _groupRepository;
|
||||
private readonly IReferenceEventService _referenceEventService;
|
||||
|
||||
public GroupService(
|
||||
IEventService eventService,
|
||||
IOrganizationRepository organizationRepository,
|
||||
IOrganizationUserRepository organizationUserRepository,
|
||||
IGroupRepository groupRepository)
|
||||
IGroupRepository groupRepository,
|
||||
IReferenceEventService referenceEventService)
|
||||
{
|
||||
_eventService = eventService;
|
||||
_organizationRepository = organizationRepository;
|
||||
_organizationUserRepository = organizationUserRepository;
|
||||
_groupRepository = groupRepository;
|
||||
_referenceEventService = referenceEventService;
|
||||
}
|
||||
|
||||
public async Task SaveAsync(Group group, IEnumerable<SelectionReadOnly> collections = null)
|
||||
@ -54,6 +59,7 @@ namespace Bit.Core.Services
|
||||
}
|
||||
|
||||
await _eventService.LogGroupEventAsync(group, Enums.EventType.Group_Created);
|
||||
await _referenceEventService.RaiseEventAsync(new ReferenceEvent(ReferenceEventType.GroupCreated, org));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user