0f7af70b90
Updated Docker configuration, refactored middleware for improved error handling, and restructured account, order, plan, profile, and support modules, including their routes, services, and validations. Enhanced email processing queues and utilities for token generation, pagination, and response management to streamline the application architecture and enhance maintainability.
126 lines
4.0 KiB
JavaScript
126 lines
4.0 KiB
JavaScript
export const planSwaggerDocs = {
|
|
"/api/plan": {
|
|
post: {
|
|
tags: ["plan"],
|
|
summary: "Create new plan",
|
|
description: "",
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
"planName": "PRO Plan",
|
|
"price": 12,
|
|
"planType": "PRO",
|
|
"planDesc": "The plan is only for pro users",
|
|
"planFeatures": {
|
|
"storage": "10GB",
|
|
"projects": 5,
|
|
"support": "Email Support"
|
|
}
|
|
}), // put your request body
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
201: { description: "plan created successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
get: {
|
|
tags: ["plan"],
|
|
summary: "Get all plan",
|
|
description: "",
|
|
parameters: [
|
|
{
|
|
name: "page",
|
|
in: "query",
|
|
required: false,
|
|
schema: { type: "number" },
|
|
},
|
|
{
|
|
name: "limit",
|
|
in: "query",
|
|
required: false,
|
|
schema: { type: "number" },
|
|
},
|
|
],
|
|
responses: {
|
|
200: { description: "plan fetched successfully" },
|
|
401: { description: "unauthorized" },
|
|
},
|
|
},
|
|
},
|
|
"/api/plan/{id}": {
|
|
get: {
|
|
tags: ["plan"],
|
|
summary: "Get single plan",
|
|
description: "",
|
|
parameters: [
|
|
{
|
|
name: "id",
|
|
in: "path",
|
|
required: true,
|
|
schema: { type: "string" },
|
|
},
|
|
],
|
|
responses: {
|
|
200: { description: "plan fetched successfully" },
|
|
401: { description: "unauthorized" },
|
|
},
|
|
},
|
|
patch: {
|
|
tags: ["plan"],
|
|
summary: "Update plan",
|
|
description: "",
|
|
parameters: [
|
|
{
|
|
name: "id",
|
|
in: "path",
|
|
required: true,
|
|
schema: { type: "string" },
|
|
},
|
|
],
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
"planName": "PRO Plan",
|
|
"price": 12,
|
|
"planType": "PRO",
|
|
"planDesc": "The plan is only for pro users",
|
|
"planFeatures": {
|
|
"storage": "10GB",
|
|
"projects": 5,
|
|
"support": "Email Support"
|
|
}
|
|
}), // put your request body
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
200: { description: "plan updated successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
delete: {
|
|
tags: ["plan"],
|
|
summary: "Delete plan",
|
|
description: "",
|
|
parameters: [
|
|
{
|
|
name: "id",
|
|
in: "path",
|
|
required: true,
|
|
schema: { type: "string" },
|
|
},
|
|
],
|
|
responses: {
|
|
200: { description: "plan delete successfully" },
|
|
401: { description: "unauthorized" },
|
|
},
|
|
},
|
|
},
|
|
};
|