133 lines
3.3 KiB
TypeScript
133 lines
3.3 KiB
TypeScript
|
|
|
||
|
|
export const orderSwaggerDocs = {
|
||
|
|
"/api/order": {
|
||
|
|
post: {
|
||
|
|
tags: ["order"],
|
||
|
|
summary: "Create new order",
|
||
|
|
description: "",
|
||
|
|
requestBody: {
|
||
|
|
required: true,
|
||
|
|
content: {
|
||
|
|
"application/json": {
|
||
|
|
example: JSON.stringify({
|
||
|
|
|
||
|
|
"productPrice": 1500,
|
||
|
|
"productQuantity": 2,
|
||
|
|
"productName": "Wireless Mouse",
|
||
|
|
"customerName": "Rahim Uddin",
|
||
|
|
"customerPhone": "+8801712345678",
|
||
|
|
"customerAddress": "Rangpur, Bangladesh",
|
||
|
|
"customerNote": "Please deliver between 3-5 PM",
|
||
|
|
"paymentType": "Cash on Delivery",
|
||
|
|
"status": "Pending"
|
||
|
|
|
||
|
|
}), // put your request body
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
responses: {
|
||
|
|
201: { description: "order created successfully" },
|
||
|
|
500: { description: "Validation error or internal server error" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
get: {
|
||
|
|
tags: ["order"],
|
||
|
|
summary: "Get all order",
|
||
|
|
description: "",
|
||
|
|
parameters: [
|
||
|
|
{
|
||
|
|
name: "page",
|
||
|
|
in: "query",
|
||
|
|
required: false,
|
||
|
|
schema: { type: "number" },
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "limit",
|
||
|
|
in: "query",
|
||
|
|
required: false,
|
||
|
|
schema: { type: "number" },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
responses: {
|
||
|
|
200: { description: "order fetched successfully" },
|
||
|
|
401: { description: "unauthorized" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
|
||
|
|
"/api/order/{id}": {
|
||
|
|
get: {
|
||
|
|
tags: ["order"],
|
||
|
|
summary: "Get single order",
|
||
|
|
description: "",
|
||
|
|
parameters: [
|
||
|
|
{
|
||
|
|
name: "id",
|
||
|
|
in: "path",
|
||
|
|
required: true,
|
||
|
|
schema: { type: "string" },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
responses: {
|
||
|
|
200: { description: "order fetched successfully" },
|
||
|
|
401: { description: "unauthorized" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
patch: {
|
||
|
|
tags: ["order"],
|
||
|
|
summary: "Update order",
|
||
|
|
description: "",
|
||
|
|
parameters: [
|
||
|
|
{
|
||
|
|
name: "id",
|
||
|
|
in: "path",
|
||
|
|
required: true,
|
||
|
|
schema: { type: "string" },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
requestBody: {
|
||
|
|
required: true,
|
||
|
|
content: {
|
||
|
|
"application/json": {
|
||
|
|
example: JSON.stringify({
|
||
|
|
"shopAccountId": "shop_12345",
|
||
|
|
"productPrice": 1500,
|
||
|
|
"productQuantity": 2,
|
||
|
|
"productName": "Wireless Mouse",
|
||
|
|
"customerName": "Rahim Uddin",
|
||
|
|
"customerPhone": "+8801712345678",
|
||
|
|
"customerAddress": "Rangpur, Bangladesh",
|
||
|
|
"customerNote": "Please deliver between 3-5 PM",
|
||
|
|
"paymentType": "Cash on Delivery",
|
||
|
|
"status": "Pending"
|
||
|
|
}), // put your request body
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
responses: {
|
||
|
|
200: { description: "order updated successfully" },
|
||
|
|
500: { description: "Validation error or internal server error" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
delete: {
|
||
|
|
tags: ["order"],
|
||
|
|
summary: "Delete order",
|
||
|
|
description: "",
|
||
|
|
parameters: [
|
||
|
|
{
|
||
|
|
name: "id",
|
||
|
|
in: "path",
|
||
|
|
required: true,
|
||
|
|
schema: { type: "string" },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
responses: {
|
||
|
|
200: { description: "order delete successfully" },
|
||
|
|
401: { description: "unauthorized" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
};
|
||
|
|
|
||
|
|
|