Introduction
This article describes a validation mechanism which prevents duplication of members in a system.
Before you start
In order to turn on this feature please contact PG support team.
Feature description
Member Duplicatation Policy works across all application (PGM, Client Portal, POS, Kiosk and API). It means that it doesn't matter how you try to add a new club member into the system. Validator will always work in a same way.
Validator can return two results:
- OK - Member doesn't exist in a system
- Error - Member exists in a system plus additional infromation.
Validation rules
Numbers behind are the points given.
>75 points results in an Error - means the member does exist:
- First name: 15
- Last name: 15
- Postal code: 15
- Email: 15
- Birth date: 15
- Bonus points if:
- First name + Phone: 50
- First name + Email: 50
- Birth date + Postcode: 30
- Birth date + Last name + Phone: 30
- Birth date + Last name + email: 30
- Name + Last name + postal code: 30
- Name + Last name + email: 30
- Name + Last name + Phone: 30
- Name + Last name + Birth date: 30
Errors
Validator not only returns information that the member exists in a system, but also some additional information.
Possible Error Codes:
public enum PersonalDataDuplicationValidatorErrorCode
{
DuplicationOnly,
Blacklisted,
Debtor,
HasCurrentContract,
IsOnFinancialBlacklist
}
- DuplicationOnly - Member exists in a system but doesn't have any contract.
- Blacklisted - Member exists in a system and has a tag "BLACKLIST".
- Debtor - Member exists in a system and has a debt.
- HasCurrentContract- Member exists in a system and has a contract.
- IsOnFinancialBlacklist - Member exists in a system and has a tag "FINANCIAL_BLACKLIST"
Please be aware, that validator can return more than one error. I.e. a member can have a contract, be a debtor and additionally be on a blacklist.
Possible contract statuses:
public enum ContractStatusTranslated
{
/// <summary>
/// Contract is Current, user is using it, Only one contract for user can be Current
/// </summary>
Current,
/// <summary>
/// Contract is ended, past due, overdue. User can have many ended contracts
/// </summary>
Ended,
/// <summary>
/// Contract is not started, future. User can have many not started contracts
/// </summary>
NotStarted,
/// <summary>
/// Contract is Frozen. Only one contract for user can be Frozen
/// </summary>
Frozen
}
All possible Massages:
Massage content will be displayed in each application (Client Portal, PGM, POSweb or Kiosk). Full error as described below will be available only in API.
{
"message": "Member with provided data already exists in the system. User number: {0}",
"property": DuplicationOnly,
"code": "PersonalDataDuplication",
"nestedBusinessErrors": [],
"data":
{
"memberId": 0
}
},
{
"message": "Member with provided data already exists and has a contract with status '{1}'. User number: {0}",
"property": HasCurrentContract,
"code": "PersonalDataDuplication",
"nestedBusinessErrors": [],
"data":
{
"memberId": 0,
"contractStatus": "Current"
}
},
{
"message": "Member with provided data already exists and has a debt. User number: {0}",
"property": Debtor,
"code": "PersonalDataDuplication",
"nestedBusinessErrors": [],
"data":
{
"memberId": 0
}
},
{
"message": "Member with provided data already exists and is on financial blacklist. User number: {0}",
"property": IsOnFinancialBlacklist,
"code": "PersonalDataDuplication",
"nestedBusinessErrors": [],
"data":
{
"memberId": 0
}
},
{
"message": "Member with provided data already exists in the system. User number: {0}",
"property": Blacklisted,
"code": "PersonalDataDuplication",
"nestedBusinessErrors": [],
"data":
{
"memberId": 0
}
}
API Usage
Personal Data Duplication Validator can be use together with those API endpoints:
- /v2/Members/AddContractMember
- /v2/Members/ValidateMember
For more information, check our API documentation.