UBER-EATS-Wrapper/src/routes/connections.routes.js

51 lines
1.2 KiB
JavaScript

const express = require("express");
const asyncHandler = require("../middleware/asyncHandler");
const controller = require("../modules/connections/connections.controller");
const router = express.Router();
/**
* @openapi
* /api/v1/merchants:
* post:
* summary: Create or update merchant
* tags:
* - Merchants
* responses:
* 201:
* description: Merchant upserted
* get:
* summary: List merchants
* tags:
* - Merchants
* responses:
* 200:
* description: Merchant list
*/
router.post("/merchants", asyncHandler(controller.upsertMerchant));
router.get("/merchants", asyncHandler(controller.listMerchants));
/**
* @openapi
* /api/v1/connections/uber:
* post:
* summary: Save manual Uber tokens for merchant
* tags:
* - Connections
* responses:
* 201:
* description: Connection stored
* get:
* summary: List Uber connections
* tags:
* - Connections
* responses:
* 200:
* description: Connection list
*/
router.post("/connections/uber", asyncHandler(controller.upsertManualConnection));
router.get("/connections/uber", asyncHandler(controller.listConnections));
module.exports = router;