How to configure the service uniqueness checks to only apply within a uniqueness group, often a reseller.
Overview
This feature makes it possible to allow checks of uniqueness within e.g. customers of a reseller, while allowing identical values for customers of some other reseller.
Configuring service uniqueness checks for a limited group of services
- Configure the uniqueness check in the Provisioning Description by giving it a JSON argument containing two properties called uniqueness_per_account_group and uniqueness_per_account_group_property.
- As an example:
- Make sure that accounts have different values for this account_property (in the example AccountGroupUniqueness), if duplicates should be allowed for different subsets of the accounts.
- If accounts don’t have the property, the default behaviour is used. I.e. if a collision is detected, an error is thrown.
- If you have a reseller company A that has separate resources from a reseller company B, then make sure that accounts under company A have this value (“company A”) for the AccountGroupUniqueness attribute, and users under company B should instead have “company B” as the value.
- To get these properties set when creating new accounts you have to do the following:
- Add a reseller_configuration_custom_attribute row with name AccountGroupUniqueness and the corresponding value for the two resellers.
- Add the following item to <resellerAttributesToCopyToCustomer> in the Billing API web.config: <resellerAttribute name=”AccountGroupUniqueness “/>
<onBeforeAddService type="Atomia.Provisioning.ActionHooks.BeforeAddService.UniquenessCheck, Atomia.Provisioning.ActionHooks.BeforeAddService" argument="" />
becomes
<onBeforeAddService type="Atomia.Provisioning.ActionHooks.BeforeAddService.UniquenessCheck, Atomia.Provisioning.ActionHooks.BeforeAddService" argument="{ 'uniqueness_per_account_group': true, 'uniqueness_per_account_group_property': 'AccountGroupUniqueness' }" />
The new accounts get the new attributes by default, as these attributes are copied to account.custom_attribute, and all account.custom_attribute rows are copied to Automation Server as account_property rows. Therefore, they get distinct uniqueness groups.