This API provides Ecommerce 'Order return' Functionality.
- Simple, fast routing and dependency injection with Laravel.
- Based on Rest API Guidelines
- Automatic Migrations for Models
-
clone project
-
install composer dependencies using
composer install(of course you need, php and composer -
create
.envfile by copying from.env.example -
run
php artisan key:generatecommand, this will get APP_KEY in.envfile -
create database and fill information in `.env' file
-
now run migrations for creating table
php artisan migrate -
you will need to seed your database , use following command steps
- run
php artisan tinkerto enter in to command line tinker - enter
factory(App\User::class,100)->create(), this will seed yourUsertable with 100 records - enter
factory(App\Order::class,100)->create(), this will seed yourOrdertable with 100 records - enter
factory(App\Agent::class,10)->create(), this will seed yourAgenttable with 10 records
- run
-
Now run
php artisan serve, which will run your app onlocalhost:8000. -
That's It, You can modify and create a pull request, Thanks.
Remember Initially, all agents are free and return Orders are zero.
GET /will take you to the Welcome Page. where you will get same documentation.
Every thing about Users
| API Route | Functionality |
|---|---|
| GET /users | All Registered Users |
| GET /user/{userId} | User Detail |
| GET /user/{userId}/orders | All Orders By User |
Every thing about Simple Orders (not return orders) as we are assuming some orders has been placed and delivered)
| API Route | Functionality |
|---|---|
| GET /orders | All Delivered Orders |
| GET /order/{orderId} | Order Details |
| GET /order/{orderId}/agent | Agent who has Delivered Order |
Here agent is person who has delivered order ( not the one who will be picking it for return)
Every thing about Return Orders ( which will be assigned to free or nearest Agent)
| API Route | Functionality |
|---|---|
| GET /returns | All Return Placed Orders |
| GET /return/{returnId} | Return Order Details |
| GET /return/place/{orderId} | Place Order with for return |
| GET /return/complete/{orderId} | Return has been SuccessFull |
Here agent is person who has delivered order ( not the one who will be picking it for return)
Every thing about Delivery Agent
| API Route | Functionality |
|---|---|
| GET /agents | All Registered Agents |
| GET /agent/{agentId} | Agent Detail |
| GET /agent/{agentId}/orders | All Orders Delivered By Agent |
| GET /agents/free | All Free Agents (with no assigned order) |
| GET /agents/busy | All Busy Agents (with assigned order/orders) |
Every thing anyone create has bugs and some of them can be fixed, If you find one, please mail me at [email protected]
This API is open-sourced software licensed under the MIT license.