Kawhan Laurindo

WHOISKAWHAN / SOFTWARE ENGINEER / João Pessoa

Language

PROJECTS / 2026

Good Hamburger

An ordering API for a burger joint that figures out the combo on its own and applies the best discount. .NET 10, EF Core, PostgreSQL and tests covering the rules.

OVERVIEW

A REST API for a burger joint's orders. The menu has sandwiches and sides, and each order detects the combo on its own: sandwich, fries and soda get 20% off; sandwich and soda, 15%; sandwich and fries, 10%. Editing an order recalculates its total and discount.

CONCEPT

Business rules as data. Discounts are database entities created by seed data, not ifs scattered through the code — adding a new combo means inserting a row. Around that, a simple layered architecture (Controller, Service, Repository, Mapper) and typed domain exceptions that a middleware translates into the right HTTP status.

FEATURES

  • Menu with sandwiches and sides
  • Automatic combo detection with the best applicable discount
  • At most one sandwich and no duplicate items per order
  • Total and discount recalculated when an order is updated
  • Global middleware mapping exceptions to 400, 404, 409 and 500
  • Unit tests for the services plus integration tests
  • Interactive documentation with Scalar

HOW IT WORKS

The controller receives the order and hands it to the service, which validates the items, matches the combination against the stored discounts and computes the total; the repository persists to PostgreSQL through EF Core with migrations. Every dependency comes in through ASP.NET Core's built-in dependency injection, and the project runs with Docker Compose.

STACK

  • CSharp
  • DotNet
  • PostgreSQL
  • Docker
Back to portfolio