https://github.com/gustavofreze/cheap-delivery
POC for a logistics domain application.
https://github.com/gustavofreze/cheap-delivery
automated-testing brasil cqrs domain-driven-design flyway hexagonal-architecture outbox php poc proof-of-concept
Last synced: 7 months ago
JSON representation
POC for a logistics domain application.
- Host: GitHub
- URL: https://github.com/gustavofreze/cheap-delivery
- Owner: gustavofreze
- License: mit
- Created: 2021-12-10T20:37:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-30T13:51:19.000Z (10 months ago)
- Last Synced: 2025-03-24T15:41:51.830Z (7 months ago)
- Topics: automated-testing, brasil, cqrs, domain-driven-design, flyway, hexagonal-architecture, outbox, php, poc, proof-of-concept
- Language: PHP
- Homepage:
- Size: 140 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cheap Delivery
[](LICENSE)
* [Overview](#overview)
- [Use cases](#use_cases)
- [Queries](#queries)
* [Installation](#installation)
- [Repository](#repository)
- [Configuration](#configuration)
- [Tests](#tests)
- [Review](#review)
* [Environment setup](#environment_setup)
## Overview
Company XPTO held a drawing among players from all over Brazil. However, the prizes need to be delivered to the winners.
To achieve this, it is necessary to implement a system that calculates the lowest shipping cost for each award based on
the distance to the winner and the weight of the prize. When contacting carriers, we received the following
transportation conditions:
| Carrier | Fixed value | Value per km/kg |
|:-------------------|------------:|----------------:|
| DHL | R$ 10,00 | R$ 0,05 |
| FedEx | R$ 4,30 | R$ 0,12 |
| Loggi (up to 5kg) | R$ 2,10 | R$ 1,10 |
| Loggi (5kg and up) | R$ 10,00 | R$ 0,01 |
### Use cases
- [Dispatch with the lowest cost](docs/USE_CASES.md#dispatch-with-the-lowest-cost)
### Queries
- [Query dispatch with the lowest cost](docs/QUERIES.md#query-dispatches-with-lowest-cost)
## Installation
### Repository
To clone the repository using the command line, run:
```bash
git clone https://github.com/gustavofreze/cheap-delivery.git
```
### Configuration
To install project dependencies locally, run:
```bash
make configure
```
To start the application containers, run:
```bash
make start
```
### Tests
Run only unit tests:
```bash
make unit-test
```
Run only integration tests:
```bash
make integration-test
```
Run all tests:
```bash
make test
```
Displays coverage reports in the browser:
```bash
make show-reports
```
### Review
Run static code analysis:
```bash
make review
```
> You can check other available commands by running `make help`.
## Environment Setup
### Access URLs
| Environment | DNS |
|:------------|:--------------------------------|
| `Local` | http://cheap-delivery.localhost |
### Database
| Environment | URL | Port |
|:------------|:----------------------------|:----:|
| `Local` | jdbc:mysql://localhost:3307 | 3307 |