2026-04-12 22:47:56 +06:00
|
|
|
|
|
|
|
|
export const orderSwaggerDocs = {
|
|
|
|
|
"/api/order": {
|
|
|
|
|
post: {
|
|
|
|
|
tags: ["order"],
|
|
|
|
|
summary: "Create new order",
|
|
|
|
|
description: "",
|
|
|
|
|
requestBody: {
|
|
|
|
|
required: true,
|
|
|
|
|
content: {
|
|
|
|
|
"application/json": {
|
|
|
|
|
example: JSON.stringify({
|
2026-04-13 00:13:52 +06:00
|
|
|
"shopAccountId": "",
|
2026-04-12 22:47:56 +06:00
|
|
|
"productPrice": 1500,
|
|
|
|
|
"productQuantity": 2,
|
|
|
|
|
"productName": "Wireless Mouse",
|
|
|
|
|
"customerName": "Rahim Uddin",
|
|
|
|
|
"customerPhone": "+8801712345678",
|
2026-04-13 00:13:52 +06:00
|
|
|
"customerEmail": "softvence.abumahid@gmail.com",
|
2026-04-12 22:47:56 +06:00
|
|
|
"customerAddress": "Rangpur, Bangladesh",
|
2026-04-13 00:13:52 +06:00
|
|
|
"customerNote": "Please deliver between 3-5 PM"
|
|
|
|
|
})
|
2026-04-12 22:47:56 +06:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
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" },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|