-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Kasulejoseph/doc
Merge documentation to develop
- Loading branch information
Showing
18 changed files
with
459 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
from flask import Flask | ||
from flasgger import Swagger | ||
from app.views.orders import main | ||
from app.auth.views import auth | ||
from app.auth import views | ||
from instance.config import app_config | ||
|
||
app = Flask(__name__, instance_relative_config=True) | ||
app.config.from_object(app_config["development"]) | ||
Swagger(app) | ||
app.register_blueprint(main) | ||
app.register_blueprint(auth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Menu | ||
--- | ||
tags: | ||
- add item | ||
parameters: | ||
- name: body | ||
description: Add a food item to menu | ||
in: body | ||
required: true | ||
schema: | ||
type: object | ||
required: | ||
- "meal" | ||
- "description" | ||
- "price" | ||
properties: | ||
meal: | ||
type: "string" | ||
example: "pizza" | ||
description: | ||
type: "string" | ||
example: "good one" | ||
price: | ||
type: integer | ||
format: | ||
example: 90000 | ||
|
||
responses: | ||
201: | ||
description: successfully Added | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "successfully added to menu" | ||
401: | ||
description: Failed to add a menu | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "Error adding a menu" | ||
- "No field should be left empty" | ||
- 'price must be integer' | ||
- 'Description and Dish must be string format' | ||
- 'order request contains spaces only' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Orders | ||
--- | ||
tags: | ||
- Create Order | ||
parameters: | ||
- name: body | ||
description: User request for an order | ||
in: body | ||
required: true | ||
schema: | ||
type: object | ||
required: | ||
- "meal_id" | ||
properties: | ||
meal_id: | ||
type: integer | ||
example: 1 | ||
|
||
responses: | ||
201: | ||
description: successfully submitted | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "Order successfully submited" | ||
401: | ||
description: invalid inputs | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- 'menu ids should be of integer data types only' | ||
- 'Zero is not a menu id' | ||
404: | ||
description: Not found | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "No item for that id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Orders | ||
--- | ||
tags: | ||
- Get all orders requests from users | ||
responses: | ||
200: | ||
description: order list | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "success" | ||
|
||
409: | ||
description: Not permitted | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "You dont have permission to access this route" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Orders | ||
--- | ||
tags: | ||
- fetch user previous order history | ||
responses: | ||
200: | ||
description: previous history | ||
|
||
404: | ||
description: Not found | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- 'You have not ordered from the site yet' | ||
security: | ||
- JWT: | ||
description: Pass in jwt token. i.e Bearer <jwt> | ||
type: apiKey | ||
scheme: bearer | ||
name: token | ||
in: header | ||
bearerFormat: JWT | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Menu | ||
--- | ||
tags: | ||
- Get food items on menu | ||
responses: | ||
200: | ||
description: menu today | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "On menu today" | ||
|
||
404: | ||
description: Empty menu | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "nothing on menu today" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Orders | ||
--- | ||
tags: | ||
- Get One | ||
responses: | ||
200: | ||
description: Admin gets an order by order id | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "Order by:user" | ||
|
||
404: | ||
description: Not found | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "No order by that Id" | ||
409: | ||
description: Not permited | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- 'You dont have permission to access this route' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
User log in | ||
--- | ||
tags: | ||
- User login | ||
parameters: | ||
- name: body | ||
description: Post request for user log in | ||
in: body | ||
required: true | ||
schema: | ||
type: object | ||
required: | ||
- "username" | ||
- "password" | ||
properties: | ||
username: | ||
type: "string" | ||
example: "kasule@gmail.com" | ||
password: | ||
type: "string" | ||
format: password | ||
example: "********" | ||
responses: | ||
200: | ||
description: You have succesfully logged in | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "You have succesfully logged in" | ||
400: | ||
description: Failed to login | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "wrong username or password credentials" | ||
401: | ||
description: incorrect credentials | ||
schema: | ||
type: string | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "incorect username" | ||
202: | ||
description: Invalid credentials | ||
schema: | ||
type: string | ||
properties: | ||
message: | ||
type: string | ||
enum: | ||
- "username must all be string or ivalid email" |
Oops, something went wrong.