I'm creating an app that lets companies view analytics about their employees. The manager of the company will upload all their employees' data and the app will run analytics on it.
The problem is that different companies use different ways to uniquely identify their employees. For example, one company can have an employeeId
number, while another company might use the email
to identify different employees.
Company 1:
[
{
"firstName": "John",
"lastName": "Doe",
"email": "johnDoe@company.com",
"employeeId": "1234"
},
{
"firstName": "Cat",
"lastName": "Dog",
"email": "catDog@company.com",
"employeeId": "5678"
}
]
Company 2:
[
{
"firstName": "John",
"lastName": "Doe",
"email": "johnDoe@company.com",
},
{
"firstName": "Cat",
"lastName": "Dog",
"email": "catDog@company.com",
}
]
My proposed solution is to make the managers select the field they use to uniquely identify their employees when they're uploading the data, then use that field as the unique ID in the database. However, I'm wondering if this is good practice. Should I also hash the value of the unique field they chose and use that instead of just the raw value?
Does anyone know if this is a common practice?