const fastify = require("fastify"); const supplierOrderController = require("../controllers/supplierOrderController"); const validationHandler = require("../handlers/supplierHandler"); module.exports = function (fastify, opts, next) { fastify.route({ method: "POST", url: "/api/ordernow/:bookingId", schema: { tags: ["Supplier-Order"], description:"This is for giving booking data to supplier", summary: "This is for giving booking data to supplier", params: { required: ["bookingId"], type: "object", properties: { bookingId: { type: "string", description: "bookingId", }, }, }, body: { type: "object", properties: { supplierName: {type: 'string'}, supplierId: { type: "string" }, customerId:{type:"string"}, capacity: { type: "string" }, customer_address: { type: "string" }, dateOfOrder: { type: "string"}, action:{type:"string"}, }, }, security: [ { basicAuth: [], }, ], }, // preHandler: fastify.auth([fastify.authenticate]), handler:supplierOrderController.orderNow, // onResponse: (request, reply) => { // validationHandler.sendPhoneVerificationCode(request, reply); // }, //onResponse: validationHandler.sendPhoneVerificationCode, }); next(); }