abhishek-akbari01
add new routes to private server and make that same route authorized
251d397
import { Request, Response, Router } from 'express';
import { multipleUpload } from '../middlewares/multer';
import { createInvoice } from '../controllers/invoice/invoice.controller';
import { fetchGLAccountsData } from '../controllers/propertyware/glAccounts.controller';
import { fetchVendorsData } from '../controllers/propertyware/vendors.controller';
import { LocationLookup } from '../controllers/propertyware/units.controller';
import { getAllVendorConfigs } from '../controllers/settings/vendorConfig.controller';
const privateRouter = Router();
/**
* @swagger
* /:
* Post:
* tags: ["Root"]
* summary: Create Invoice from Email Pdfs
* responses:
* 200:
* description: The health of the service
*/
privateRouter.post("/invoice", multipleUpload, createInvoice);
// Note: We have use private router here, because it needs to be listen internal request only and for email ingestion.
/**
* @swagger
* /private/glAccounts:
* get:
* summary: Fetch all GL accounts
* tags: [Root]
* responses:
* 200:
* description: List of GL accounts
* content:
* application/json:
* schema:
* type: array
* items:
* $ref: '#/components/schemas/GLAccount'
* 500:
* description: Error fetching GL accounts
*/
privateRouter.get("/glAccounts", fetchGLAccountsData);
/**
* @swagger
* /private/vendors:
* get:
* summary: Fetch all vendors
* tags: [Root]
* responses:
* 200:
* description: List of vendors
* content:
* application/json:
* schema:
* type: array
* items:
* $ref: '#/components/schemas/Vendor'
* 500:
* description: Error fetching vendors
*/
privateRouter.get("/vendors", fetchVendorsData);
/**
* @swagger
* /private/locationLookup:
* get:
* summary: Location lookup
* tags: [Root]
* responses:
* 200:
* description: Location lookup successful
* 500:
* description: Error performing location lookup
*/
privateRouter.get('/locationLookup', LocationLookup);
/**
* @swagger
* /private/vendor-config:
* get:
* summary: Get all vendor configurations
* tags: [Root]
* responses:
* 200:
* description: Successfully retrieved all vendor configurations.
* content:
* application/json:
* schema:
* type: array
* items:
* type: object
* properties:
* id:
* type: integer
* vendor_ID:
* type: integer
* single_line_item:
* type: boolean
* 500:
* description: Internal server error.
*/
privateRouter.get('/vendor-config', getAllVendorConfigs);
export default privateRouter;