feat(MED-97): make sure new company employee accounts get benefits balance
This commit is contained in:
@@ -18,6 +18,7 @@ import { RenewInvitationSchema } from '../../schema/renew-invitation.schema';
|
||||
import { UpdateInvitationSchema } from '../../schema/update-invitation.schema';
|
||||
import { createAccountInvitationsService } from '../services/account-invitations.service';
|
||||
import { createAccountPerSeatBillingService } from '../services/account-per-seat-billing.service';
|
||||
import { AccountBalanceService } from '@kit/accounts/services/account-balance.service';
|
||||
|
||||
/**
|
||||
* @name createInvitationsAction
|
||||
@@ -171,6 +172,9 @@ export const acceptInvitationAction = enhanceAction(
|
||||
throw new Error('Failed to accept invitation');
|
||||
}
|
||||
|
||||
// Make sure new account gets company benefits added to balance
|
||||
await new AccountBalanceService().processPeriodicBenefitDistributions();
|
||||
|
||||
// Increase the seats for the account
|
||||
await perSeatBillingService.increaseSeats(accountId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user