You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.5 KiB
66 lines
1.5 KiB
|
3 years ago
|
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();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|