@ -147,7 +147,7 @@ public class OrganizationService : IOrganizationService
@@ -147,7 +147,7 @@ public class OrganizationService : IOrganizationService
await _ paymentService . CancelSubscriptionAsync ( organization , eop ) ;
await _ referenceEventService . RaiseEventAsync (
new ReferenceEvent ( ReferenceEventType . CancelSubscription , organization )
new ReferenceEvent ( ReferenceEventType . CancelSubscription , organization , _ currentContext )
{
EndOfPeriod = endOfPeriod ,
} ) ;
@ -163,7 +163,7 @@ public class OrganizationService : IOrganizationService
@@ -163,7 +163,7 @@ public class OrganizationService : IOrganizationService
await _ paymentService . ReinstateSubscriptionAsync ( organization ) ;
await _ referenceEventService . RaiseEventAsync (
new ReferenceEvent ( ReferenceEventType . ReinstateSubscription , organization ) ) ;
new ReferenceEvent ( ReferenceEventType . ReinstateSubscription , organization , _ currentContext ) ) ;
}
public async Task < Tuple < bool , string > > UpgradePlanAsync ( Guid organizationId , OrganizationUpgrade upgrade )
@ -357,7 +357,7 @@ public class OrganizationService : IOrganizationService
@@ -357,7 +357,7 @@ public class OrganizationService : IOrganizationService
if ( success )
{
await _ referenceEventService . RaiseEventAsync (
new ReferenceEvent ( ReferenceEventType . UpgradePlan , organization )
new ReferenceEvent ( ReferenceEventType . UpgradePlan , organization , _ currentContext )
{
PlanName = newPlan . Name ,
PlanType = newPlan . Type ,
@ -393,7 +393,7 @@ public class OrganizationService : IOrganizationService
@@ -393,7 +393,7 @@ public class OrganizationService : IOrganizationService
var secret = await BillingHelpers . AdjustStorageAsync ( _ paymentService , organization , storageAdjustmentGb ,
plan . StripeStoragePlanId ) ;
await _ referenceEventService . RaiseEventAsync (
new ReferenceEvent ( ReferenceEventType . AdjustStorage , organization )
new ReferenceEvent ( ReferenceEventType . AdjustStorage , organization , _ currentContext )
{
PlanName = plan . Name ,
PlanType = plan . Type ,
@ -530,7 +530,7 @@ public class OrganizationService : IOrganizationService
@@ -530,7 +530,7 @@ public class OrganizationService : IOrganizationService
var paymentIntentClientSecret = await _ paymentService . AdjustSeatsAsync ( organization , plan , additionalSeats , prorationDate ) ;
await _ referenceEventService . RaiseEventAsync (
new ReferenceEvent ( ReferenceEventType . AdjustSeats , organization )
new ReferenceEvent ( ReferenceEventType . AdjustSeats , organization , _ currentContext )
{
PlanName = plan . Name ,
PlanType = plan . Type ,
@ -681,7 +681,7 @@ public class OrganizationService : IOrganizationService
@@ -681,7 +681,7 @@ public class OrganizationService : IOrganizationService
var ownerId = provider ? default : signup . Owner . Id ;
var returnValue = await SignUpAsync ( organization , ownerId , signup . OwnerKey , signup . CollectionName , true ) ;
await _ referenceEventService . RaiseEventAsync (
new ReferenceEvent ( ReferenceEventType . Signup , organization )
new ReferenceEvent ( ReferenceEventType . Signup , organization , _ currentContext )
{
PlanName = plan . Name ,
PlanType = plan . Type ,
@ -853,7 +853,7 @@ public class OrganizationService : IOrganizationService
@@ -853,7 +853,7 @@ public class OrganizationService : IOrganizationService
organization . ExpirationDate . Value > = DateTime . UtcNow ;
await _ paymentService . CancelSubscriptionAsync ( organization , eop ) ;
await _ referenceEventService . RaiseEventAsync (
new ReferenceEvent ( ReferenceEventType . DeleteAccount , organization ) ) ;
new ReferenceEvent ( ReferenceEventType . DeleteAccount , organization , _ currentContext ) ) ;
}
catch ( GatewayException ) { }
}
@ -1136,7 +1136,7 @@ public class OrganizationService : IOrganizationService
@@ -1136,7 +1136,7 @@ public class OrganizationService : IOrganizationService
await SendInvitesAsync ( orgUsers . Concat ( limitedCollectionOrgUsers . Select ( u = > u . Item1 ) ) , organization ) ;
await _ referenceEventService . RaiseEventAsync (
new ReferenceEvent ( ReferenceEventType . InvitedUsers , organization )
new ReferenceEvent ( ReferenceEventType . InvitedUsers , organization , _ currentContext )
{
Users = orgUserInvitedCount
} ) ;
@ -1971,7 +1971,7 @@ public class OrganizationService : IOrganizationService
@@ -1971,7 +1971,7 @@ public class OrganizationService : IOrganizationService
}
await _ referenceEventService . RaiseEventAsync (
new ReferenceEvent ( ReferenceEventType . DirectorySynced , organization ) ) ;
new ReferenceEvent ( ReferenceEventType . DirectorySynced , organization , _ currentContext ) ) ;
}
public async Task DeleteSsoUserAsync ( Guid userId , Guid ? organizationId )
@ -2472,7 +2472,7 @@ public class OrganizationService : IOrganizationService
@@ -2472,7 +2472,7 @@ public class OrganizationService : IOrganizationService
await SendInviteAsync ( ownerOrganizationUser , organization , true ) ;
await _ eventService . LogOrganizationUserEventAsync ( ownerOrganizationUser , EventType . OrganizationUser_Invited ) ;
await _ referenceEventService . RaiseEventAsync ( new ReferenceEvent ( ReferenceEventType . OrganizationCreatedByAdmin , organization )
await _ referenceEventService . RaiseEventAsync ( new ReferenceEvent ( ReferenceEventType . OrganizationCreatedByAdmin , organization , _ currentContext )
{
EventRaisedByUser = userService . GetUserName ( user ) ,
SalesAssistedTrialStarted = salesAssistedTrialStarted ,