mirror of
https://github.com/bitwarden/server.git
synced 2025-07-12 05:13:58 -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:
@ -305,6 +305,8 @@ namespace Bit.Core.Services
|
||||
{
|
||||
PlanName = newPlan.Name,
|
||||
PlanType = newPlan.Type,
|
||||
OldPlanName = existingPlan.Name,
|
||||
OldPlanType = existingPlan.Type,
|
||||
Seats = organization.Seats,
|
||||
Storage = organization.MaxStorageGb,
|
||||
});
|
||||
@ -497,14 +499,15 @@ namespace Bit.Core.Services
|
||||
});
|
||||
}
|
||||
|
||||
organization.Seats = (short?)newSeatTotal;
|
||||
await _referenceEventService.RaiseEventAsync(
|
||||
new ReferenceEvent(ReferenceEventType.AdjustSeats, organization)
|
||||
{
|
||||
PlanName = plan.Name,
|
||||
PlanType = plan.Type,
|
||||
Seats = organization.Seats,
|
||||
Seats = newSeatTotal,
|
||||
PreviousSeats = organization.Seats
|
||||
});
|
||||
organization.Seats = (short?)newSeatTotal;
|
||||
await ReplaceAndUpdateCache(organization);
|
||||
return paymentIntentClientSecret;
|
||||
}
|
||||
@ -1977,6 +1980,12 @@ namespace Bit.Core.Services
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_currentContext.ClientId == BitwardenClient.DirectoryConnector)
|
||||
{
|
||||
await _referenceEventService.RaiseEventAsync(
|
||||
new ReferenceEvent(ReferenceEventType.DirectorySynced, organization));
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RotateApiKeyAsync(Organization organization)
|
||||
|
Reference in New Issue
Block a user