Application responsible for send users notification.
- Docker and Docker-Compose
- PHP + Symfony
- MSQL
- Factory
- Adapter
- Create a docker network to works!
docker network create notification-network
- Up all containers
docker-compose up -d
- Enter to terminal on container
docker exec -it api.notification.dev sh
- Install dependencies
composer install
- Running migration
php bin/console doctrine:migrations:migrate
docker exec -it api.notification.dev php bin/phpunit
You can access OpenAPI through this link Swagger
curl --location 'http://localhost:8080/notification' \
--header 'Content-Type: application/json' \
--data '{
"userId": 1,
"context": "status",
"channel": "console",
"title": "Hello",
"message": "You are welcome!"
}'
field | Size | Description |
---|---|---|
userId | int | User identify |
context | string | Message context e.g. marketing notification. Possible values (status, news, marketing) |
channel | string | Channel that will used to send a message e.g. SMS, Whatsapp. Today is developed only channel console. Possible values (console) |
title | string | Message title |
message | string | Message content |
- status: not more than 2 per minute for each recipient
- news: not more than 1 per day for each recipient
- marketing: not more than 3 per hour for each recipient
Status | Description |
---|---|
200 | Message sent with success |
404 | Context or Channel not found |
429 | You have exceeded your rate limit |
500 | Internal Server Error |