Feature: Existing accounts join another company with consent 

Description 

When HR invites a person who already has an account, for example at another company, the company's new setting Existing accounts (existingAccountLinking) decides:

  • Ask the person first (default): the holder is informed in the app and by e-mail (account.companyInvitation) and accepts or declines on Company invitations (listMyCompanyInvitations, acceptMyCompanyInvitation, declineMyCompanyInvitation). Only an accepted request links the account.
  • Link at once and tell the person: the account is linked and its holder informed (account.companyAdded).

HR may name the e-mail the person already logs in with (loginEmail of sendEmployeeInvitation) when it differs from the work e-mail. The answer to an invitation does not tell whether an account exists.

Impact 

Before, an existing account was linked silently. Now nobody is added to a company without being asked or told; the default asks first. FunctionalTestCase::consumeAllAsynchronousMessages() handles queued messages until none are left, as a worker does.