South African mobile numbers validation.
Backend Engineer Assessment Exercise to perform validation of South African mobile numbers, provided through a CSV file.
Project API Swagger file can be found here.
This service requires access to a database. For that purpose, a docker-compose.yaml was included to allow for any
dependency to be started locally, mainly a Postgres DB available at port 5432. To get them up-and running just run the up command on the root of the repository:
docker-compose up
The build task will build the jar and run unit tests. To do so,
simply run:
./gradlew clean build
To run the application locally, default Spring profile can be used. Application properties sets the data source to
the local database started with docker-compose, running at port 5432.
./gradlew clean bootRun
For usage details, check API documentation.
Mainly due to time constrains which affected development of solution, mind the following implementation rationales and shortcomings/areas of improvement:
- Support libraries
- Spring Boot + Web/Data/Test starters to help accelerate development.
- Flyway DB migration tool to help define DDL/DB schemas.
- Number validation:
- SA mobile number format validation was based on work by Warwick Chapman (URL).
- Fixing of incorrect phone numbers was only based on quick analysis of provided dataset and assuming fixable values would be the ones with valid format plus a giving suffix (e.g. '27735405794_DELETED_1488987214').
- API implementation
- No security implemented to restrict access to endpoints.
- File validation issues (empty content, invalid mime type...) will abort upload process and return a BAD_REQUEST/400 HTTP error code.
- More consistent error handling, including more fine grained definition of different error situations, is needed.
- No listing/search functionality to get processed file results
- Logging is missing
- Testing
- Only a small number were tests were written, hence coverage is low. Main tests cover JPA repository functioning and phone number format validation (the core feature of the project).