Skip to content

runawaycoin/ordering_api_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Order API Test App

Task

Approach

I created a new Symfony 6 (framework) web app

Utilising Symfony Components: Validator, Form, Doctrine, Migrations, Serializer, Console

Using PHP8 attributes

No front end, all API back end, tested using swagger front end and unit tests

Database Design

API

Swagger API doc

Api is split for admins and users, using Symfony security firewall (/v1 and /v1/admin root paths)

Create new order example

example json request:

{"deliveryAddress" : 1,"billingAddress" : 1,"items":[{"id":1,"quantity":2}]}

Command

Process delayed orders command see: OrderControllerTest

Data Validation

Uses Validation component and forms to ensure valid input

Eg price is above 0, item name is not blank.

See entity attributes

See error response over api

Unit Tests

Full unit tested api

see: Controller tests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published