feat(MED-97): make sure new company employee accounts get benefits balance

This commit is contained in:
2025-09-26 13:50:33 +03:00
parent 1aeee0bc30
commit 0aa16c457a

View File

@@ -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);