IRECKONU Assignment
Developed with ♥ and ASP.NET Core by Arley Pádua 😎
Getting started
- run
docker pull mongo
to pull the latest mongo image - run
docker run -d -p 27017-27019:27017-27019 --name mongodb mongo
to run it locally - run the project, using Visual Studio and selecting
ImportFile.Api
as the debug option - send a request to
POST https://{localhost}:{port}/inventory/import/csv
with the following body:
{
"fileUrl": "https://goo.gl/tJWo1f",
"containsHeader": true
}
- the file will be generated on the application path
Running with docker
- Edit the file:
appsettings.Developtment.json
and put the connection string of the desired MongoDb instance - Run the docker file
- Submit the request described on the "Getting started" session
Observations
- The solution is fully synchronous, but can easily accept an implementation with RabbitMQ, Azure Service Bus or any other messaging mechanism. This way we could scale individual parts of the solution.
- I used a hexagonal architecture to organize the project, where the core implements all use cases and requires contracts (ports) to be implemented by adapters.
- The unit tests provided are testing the main functionality asked in the assignment.
- Some comments were provided giving clarity on the decisions taken
- There are a few things that I left aside to avoid bloating the scope: exception handling, concurrency management (optimistic concurrency when creating/updating), asynchronous through messaging.