176 lines
4.0 KiB
JavaScript
176 lines
4.0 KiB
JavaScript
export default {
|
|
"/product": {
|
|
post: {
|
|
summary: "Create a New Product",
|
|
tags: ["Product"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": {
|
|
schema: {
|
|
type: "object",
|
|
properties: {
|
|
sku: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
name: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
stock: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
buyingPrice: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
sellingPrice: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
description: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
gst: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
hsn: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
stock: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
vendors: {
|
|
type: "array",
|
|
items: {
|
|
type: "string",
|
|
},
|
|
required: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
200: {
|
|
description: "OK",
|
|
content: {},
|
|
},
|
|
},
|
|
},
|
|
get: {
|
|
summary: "Get All Products",
|
|
tags: ["Product"],
|
|
responses: {
|
|
200: {
|
|
description: "OK",
|
|
content: {},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"/product/{id}": {
|
|
patch: {
|
|
summary: "Update a Product",
|
|
tags: ["Product"],
|
|
parameters: [
|
|
{
|
|
name: "id",
|
|
in: "path",
|
|
required: true,
|
|
description: "Product ID",
|
|
schema: {
|
|
type: "string",
|
|
},
|
|
},
|
|
],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": {
|
|
schema: {
|
|
type: "object",
|
|
properties: {
|
|
sku: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
name: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
stock: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
buyingPrice: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
sellingPrice: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
description: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
gst: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
hsn: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
stock: {
|
|
type: "number",
|
|
required: true,
|
|
},
|
|
vendors: {
|
|
type: "array",
|
|
items: {
|
|
type: "string",
|
|
},
|
|
required: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
200: {
|
|
description: "OK",
|
|
content: {},
|
|
},
|
|
},
|
|
},
|
|
delete: {
|
|
summary: "Delete a Product",
|
|
tags: ["Product"],
|
|
parameters: [
|
|
{
|
|
name: "id",
|
|
in: "path",
|
|
required: true,
|
|
description: "Product ID",
|
|
schema: {
|
|
type: "string",
|
|
},
|
|
},
|
|
],
|
|
responses: {
|
|
200: {
|
|
description: "OK",
|
|
content: {},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}; |