|
|
|
@ -242,6 +242,86 @@ module.exports = function (fastify, opts, next) {
|
|
|
|
|
handler: validationHandler.deliveryBoyVerifyPhone,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
method: "PUT",
|
|
|
|
|
url: "/api/deletedeliveryboy/:supplierId",
|
|
|
|
|
schema: {
|
|
|
|
|
tags: ["Supplier-Data"],
|
|
|
|
|
summary: "This is for delete delivery boy",
|
|
|
|
|
description: "This is for delete delivery boy",
|
|
|
|
|
params: {
|
|
|
|
|
required: ["supplierId"],
|
|
|
|
|
type: "object",
|
|
|
|
|
properties: {
|
|
|
|
|
supplierId: {
|
|
|
|
|
type: "string",
|
|
|
|
|
description: "supplierId",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
querystring: {
|
|
|
|
|
phone: {type: 'string'}
|
|
|
|
|
},
|
|
|
|
|
security: [
|
|
|
|
|
{
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
preHandler: fastify.auth([fastify.authenticate]),
|
|
|
|
|
handler: validationHandler.deleteDeliveryBoy,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
method: "PUT",
|
|
|
|
|
url: "/api/updatedeliveryboy/:supplierId",
|
|
|
|
|
schema: {
|
|
|
|
|
tags: ["Supplier-Data"],
|
|
|
|
|
summary: "This is for update deliveryboy details",
|
|
|
|
|
params: {
|
|
|
|
|
required: ["supplierId"],
|
|
|
|
|
type: "object",
|
|
|
|
|
properties: {
|
|
|
|
|
supplierId: {
|
|
|
|
|
type: "string",
|
|
|
|
|
description: "supplierId",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
querystring: {
|
|
|
|
|
phone: {type: 'string'}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
body: {
|
|
|
|
|
type: "object",
|
|
|
|
|
// required: ['phone'],
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
|
|
name: { type: "string", default: null },
|
|
|
|
|
phone: { type: "string", default: null },
|
|
|
|
|
alternativeContactNumber: { type: "string" },
|
|
|
|
|
address: { type: "string", default: null },
|
|
|
|
|
city: { type: "string" , default: null},
|
|
|
|
|
state: { type: "string", default: null },
|
|
|
|
|
zip: { type: "string", default: null },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
security: [
|
|
|
|
|
{
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
// preHandler: [
|
|
|
|
|
// fastify.auth([fastify.operatorAuthenticate]),
|
|
|
|
|
// validationHandler.validatePhoneFormat,
|
|
|
|
|
// ],
|
|
|
|
|
preHandler: fastify.auth([fastify.authenticate]),
|
|
|
|
|
handler: validationHandler.updateDeliveryBoy,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
method: "POST",
|
|
|
|
|