From dc4c343ecdbd98ae59335cb36932ac0cbb11dbec Mon Sep 17 00:00:00 2001 From: sriramv Date: Thu, 2 Sep 2021 13:45:46 +0530 Subject: [PATCH] swagger:GWM --- app/routes/routes.js | 156 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 140 insertions(+), 16 deletions(-) diff --git a/app/routes/routes.js b/app/routes/routes.js index 1c8fe10..3275d46 100644 --- a/app/routes/routes.js +++ b/app/routes/routes.js @@ -7,39 +7,163 @@ module.exports = app => { var router = require("express").Router(); - /** + + +/** + * @swagger + * /api/FinantialsSummary: + * get: + * summary: Financials Summary + * description: Get Financials Summary data by sending entityid + * parameters: + * - in: query + * name: entityid + * schema: + * type: integer + * required: true + * description: id of the Entity + * example: 7 + * responses: + * 200: + * description: success + */ + // get financials summary + router.get("/FinantialsSummary", financials.FinantialsSummary); + +/** + * @swagger + * /api/MenuList: + * get: + * summary: Menu List + * description: Get Menu List data by sending losid + * parameters: + * - in: query + * name: losid + * schema: + * type: string + * required: true + * description: Los id of entity + * example: MW112233 + * responses: + * 200: + * description: success + */ + // get menu list + router.get("/MenuList", financials.MenuList); + +/** + * @swagger + * /api/BrokenPeriodsList: + * get: + * summary: Broken Periods + * description: Get Broken Period data by sending entityid + * parameters: + * - in: query + * name: entityid + * schema: + * type: integer + * required: true + * description: id of the Entity + * example: 7 + * responses: + * 200: + * description: success + */ + // Retrieve all Broken periods + router.get("/BrokenPeriodsList", financials.BrokenPeriodsList); + +/** * @openapi - * /api/EntitiesList: + * /api/MasterDatas: * get: - * description: Welcome to swagger-jsdoc! + * description: This is List of all master data for new item master insert (dropdown) * responses: * 200: * description: Returns a mysterious string. */ - // insert or update broken periods - router.post("/BrokenPeriods", financials.BrokenPeriods); - - // get financials summary - router.get("/FinantialsSummary", financials.FinantialsSummary); - - // get menu list - router.get("/MenuList", financials.MenuList); - - // Retrieve all Broken periods - router.get("/BrokenPeriodsList", financials.BrokenPeriodsList); - // fetching all master data router.get("/MasterDatas", financials.MasterDatas); +/** + * @swagger + * definitions: + * BrokenPeriod: + * type: object + * properties: + * id: + * type: integer + * description: primary id of the broken period + * example: 1 + * entity_id: + * type: integer + * description: primary id of entity + * example: 1 + * from: + * type: date + * description: selected date + * example: '2020-01-01' + * to: + * type: date + * description: selected date + * example: '2020-01-01' + * months: + * type: integer + * description: month count between from and to date + * example: 3 + * cy: + * type: integer + * description: current year + * example: 1 + * py: + * type: integer + * description: previous year + * example: 1 + * variation: + * type: string + * description: calculated value + * example: '3%' + * createdby: + * type: integer + * description: The person who created + * example: 1 + * updatedby: + * type: integer + * description: The person who modified + * example: 1 + */ +/** + * @swagger + * /api/BrokenPeriods: + * post: + * summary: create or update Broken Periods + * description: create or update BrokenPeriods value with this single api by altering json object . If key 'id' exist in json object it will update the record otherwise it will create the record . + * requestBody: + * content: + * application/json: + * schema: + * $ref: '#/definitions/BrokenPeriod' + * responses: + * 200: + * description: BrokenPeriods created or updated succesfully + * 500: + * description: failure in creating statement + */ + // create broken periods + router.post("/BrokenPeriods", financials.BrokenPeriods); // create financials data router.post("/createFinancials", financials.createFinancials); - // update financials data router.post("/updateFinancials", financials.updateFinancials); + + + + + + /** * @swagger * definitions: