We have two providers collect data from them in json files we need to read and make some filter operations on them to get the result
You can check the json files inside jsons folder
DataProviderX
data is stored in [DataProviderX.json]DataProviderY
data is stored in [DataProviderX.json]
`DataProviderX schema is
{
parentAmount:200,
Currency:'USD',
parentEmail:'[email protected]',
statusCode:1,
registerationDate: '2018-11-30',
parentIdentification: 'd3d29d70-1d25-11e3-8591-034165a3a613'
}
we have three status for DataProviderX
authorised
which will have statusCode1
decline
which will have statusCode2
refunded
which will have statusCode3
`DataProviderY schema is
{
balance:300,
currency:'AED',
email:'[email protected]',
status:100,
created_at: '22/12/2018',
id: '4fc2-a8d1'
}
we have three status for DataProviderY
authorised
which will have statusCode100
decline
which will have statusCode200
refunded
which will have statusCode300
Using PHP Laravel, implement this API endpoint /api/v1/users
- it should list all users which combine transactaions from all the available provider
DataProviderX
andDataProviderY
) - it should be able to filter resullt by payment providers for example
/api/v1/users?provider=DataProviderX
it should return users from DataProviderX - it should be able to filter result three statusCode (
authorised
,decline
,refunded
) for example /api/v1/users?statusCode=authorised it should return all users from all providers that have status code authorised - it should be able to filer by amount range for example
/api/v1/users?balanceMin=10&balanceMax=100
it should return result between 10 and 100 including 10 and 100 - it should be able to filer by
currency
- it should be able to combine all this filter together
Task will be evaluated based on
- Code quality
- Application performance in reading large files
- Code scalability : ability to add
DataProviderZ
by small changes - Unit tests coverage
- Docker