{"id":20433796,"url":"https://github.com/raagh/orders-processing-service","last_synced_at":"2025-07-05T09:05:12.417Z","repository":{"id":87945176,"uuid":"286846738","full_name":"Raagh/orders-processing-service","owner":"Raagh","description":"C# CRUD API connected to Mongo DB requested as part of an interview process.","archived":false,"fork":false,"pushed_at":"2020-08-13T08:50:12.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T06:25:31.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Raagh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-11T20:59:38.000Z","updated_at":"2022-01-17T16:07:57.000Z","dependencies_parsed_at":"2023-05-22T01:15:07.898Z","dependency_job_id":null,"html_url":"https://github.com/Raagh/orders-processing-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Raagh/orders-processing-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raagh%2Forders-processing-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raagh%2Forders-processing-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raagh%2Forders-processing-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raagh%2Forders-processing-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Raagh","download_url":"https://codeload.github.com/Raagh/orders-processing-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raagh%2Forders-processing-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263715326,"owners_count":23500241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T08:21:16.759Z","updated_at":"2025-07-05T09:05:12.392Z","avatar_url":"https://github.com/Raagh.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Orders Processing Service\n\nThe `Orders Processing Service` is a basic CRUD ASP.net core application that connects with MongoDB that was requested as a coding task during an interview process.\nIt displays a simple scenario where you can add/update/delete/retrieve orders in a business application.\n\n`Order Model`\n\n```json\n{\n  \"id\": \"guid\",\n  \"userId\": \"guid\",\n  \"amount\": \"int\"\n}\n```\n\nAPI endpoints are versioned as `v1` \n\n`v1/orders/by-users` endpoint returns an aggregation of the orders grouped by userId with a sum of the total amount of the orders.\n\n```json\n{\n  \"userId\": \"guid\",\n  \"orders\": [\n  \"guid\"\n  ],\n  \"totalAmount\": \"int\"\n},\n```\n\n## Dependencies\n\n- Instead of running my own MongoDB instance I use a free tier on [MongoDB Cloud Atlas](https://www.mongodb.com/cloud/atlas).\n- I use [AutoMapper](https://automapper.org/) to map between domain models and API models.\n- I use [Moq](https://github.com/moq/moq) and [XUnit](https://xunit.github.io/) for unit testing the `OrdersService`.\n- I use [Swagger](https://swagger.io/) for API documentation.\n\n## Extra included features.\n\n- Deployable as a [Docker](https://www.docker.com/) container.\n- The default URL shows a [Swagger](https://swagger.io/) page with the API documentation.\n\n## Possible Improvements\n\nDue to time constraints there are some \"Missing\" features that I would normally implement in a \"Real World\" Project. Some of them are the following:\n\n- Authentication and Authorization using something like `Identity` and `JWT`.\n- Add pagination to the endpoints including limit and offset.\n- Complete separation between Domain Models and Database Models.\n- Generic implementation of the `Repository Pattern` when other repositories are introduced to the service.\n- In Memory DB or Mock to run integration tests.\n- Separate concerns between `Queries` and `Commands`.\n- HealthCheck endpoint that shows Database Integrity. For that, I like this [library](https://github.com/xabaril/AspNetCore.Diagnostics.HealthChecks).\n\n## Run on docker\n\nOn a terminal with OrdersProcessingService as root run the following commands:\n\n```bash\ndocker build -t orders-service .\ndocker run -p 8080:80 orders-service\n\nopen https://localhost:8080/index.html for the swagger page\n```\n\n## Run on dotnet\n\nOn a terminal with OrdersProcessingService.Api as root run the following commands:\n\n```bash\ndotnet restore\ndotnet build\ndotnet run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraagh%2Forders-processing-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraagh%2Forders-processing-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraagh%2Forders-processing-service/lists"}