{"id":24509456,"url":"https://github.com/makampos/developer-store","last_synced_at":"2026-05-11T02:50:24.805Z","repository":{"id":273617330,"uuid":"891056343","full_name":"makampos/developer-store","owner":"makampos","description":"Sales Management API","archived":false,"fork":false,"pushed_at":"2024-11-26T14:43:51.000Z","size":26621,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T09:28:13.772Z","etag":null,"topics":["docker","masstransit","postgresql","rabbitmq"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makampos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-11-19T16:44:13.000Z","updated_at":"2024-11-26T14:05:13.000Z","dependencies_parsed_at":"2025-01-22T00:38:42.663Z","dependency_job_id":null,"html_url":"https://github.com/makampos/developer-store","commit_stats":null,"previous_names":["makampos/developer-store"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/makampos/developer-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makampos%2Fdeveloper-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makampos%2Fdeveloper-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makampos%2Fdeveloper-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makampos%2Fdeveloper-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makampos","download_url":"https://codeload.github.com/makampos/developer-store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makampos%2Fdeveloper-store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32879551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker","masstransit","postgresql","rabbitmq"],"created_at":"2025-01-22T00:21:10.372Z","updated_at":"2026-05-11T02:50:24.755Z","avatar_url":"https://github.com/makampos.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Developer Store Project\n\n## Use Case\n**You are a developer on the DeveloperStore team. Now we need to implement the API prototypes.**\n\nAs we work with `DDD`, to reference entities from other domains, we use the `External Identities` pattern with denormalization of entity descriptions.\n\nTherefore, you will write an API (complete CRUD) that handles sales records. The API needs to be able to inform:\n\n* Sale number\n* Date when the sale was made\n* Customer\n* Total sale amount\n* Branch where the sale was made\n* Products\n* Quantities\n* Unit prices\n* Discounts\n* Total amount for each item\n* Cancelled/Not Cancelled\n\nIt's not mandatory, but it would be a differential to build code for publishing events of:\n* SaleCreated\n* SaleModified\n* SaleCancelled\n* ItemCancelled\n\nIf you write the code, **it's not required** to actually publish to any Message Broker. You can log a message in the application log or however you find most convenient.\n\n### Business Rules\n\n* Purchases above 4 identical items have a 10% discount\n* Purchases between 10 and 20 identical items have a 20% discount\n* It's not possible to sell above 20 identical items\n* Purchases below 4 items cannot have a discount\n\nThese business rules define quantity-based discounting tiers and limitations:\n\n1. Discount Tiers:\n   - 4+ items: 10% discount\n   - 10-20 items: 20% discount\n\n2. Restrictions:\n   - Maximum limit: 20 items per product\n   - No discounts allowed for quantities below 4 items\n\n---\n\n## Instructions to Prepare and Run the Project\nTo set up and run the project, follow these steps:\n\n#### Prerequisites\nEnsure you have Docker installed on your machine.\n\n\n#### Step 1: Raise Containers\nYou need to start the containers for the database and RabbitMQ. Execute the following commands in the root folder of your project:\n\n```\ndocker-compose --project-name ambev-db up -d ambev.developerevaluation.database\ndocker-compose --project-name ambev-bus up -d ambev.developerevaluation.rabbitmq\n```\n\n#### Step 2: Update the Database\nAfter raising the containers, update the database using Entity Framework Core. You can do this in one of two ways:\nUsing Rider IDE:\nNavigate to Tools \u003e Entity Framework Core \u003e Update Database.\nUsing Command Line:\nRun the following command in the root folder:\n\n```\n/usr/local/share/dotnet/dotnet ef database update --project src/Ambev.DeveloperEvaluation.ORM/Ambev.DeveloperEvaluation.ORM.csproj --startup-project src/Ambev.DeveloperEvaluation.WebApi/Ambev.DeveloperEvaluation.WebApi.csproj --context Ambev.DeveloperEvaluation.ORM.DefaultContext\n```\n\n#### Step 3: Run the Web API Project \nSelect the project `Ambev.DeveloperEvaluation.WebApi` in your IDE and run it. This will start the Web API service.\n\n#### Step 4: Access Swagger UI\nOnce the Web API is running, navigate to `http://localhost:5119/swagger/index.html` in your web browser. This page will display all available routes through Swagger, allowing you to test and interact with your API endpoints.\n\n#### Step 5: Ready to Go\nYour environment is now set up, and you can start working with the project. You can use Swagger to explore different APIs and test their functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakampos%2Fdeveloper-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakampos%2Fdeveloper-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakampos%2Fdeveloper-store/lists"}