|
|
@ -326,6 +326,42 @@ module.exports = function (fastify, opts, next) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fastify.get("/api/userAccountsofparticularSupplier/:customerId", {
|
|
|
|
|
|
|
|
// schema: {
|
|
|
|
|
|
|
|
// tags: ["Supplier-Order"],
|
|
|
|
|
|
|
|
// description: "This is for Get accounts of user for particular supplier",
|
|
|
|
|
|
|
|
// summary: "This is for to Get accounts of user for particular supplier",
|
|
|
|
|
|
|
|
// params: {
|
|
|
|
|
|
|
|
// required: ["customerId"],
|
|
|
|
|
|
|
|
// type: "object",
|
|
|
|
|
|
|
|
// properties: {
|
|
|
|
|
|
|
|
// customerId: {
|
|
|
|
|
|
|
|
// type: "string",
|
|
|
|
|
|
|
|
// description: "customerId",
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// body: {
|
|
|
|
|
|
|
|
// type: "object",
|
|
|
|
|
|
|
|
// properties: {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// supplierId:{type:"string"}
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// security: [
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// basicAuth: [],
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// preHandler: fastify.auth([fastify.authenticate]),
|
|
|
|
|
|
|
|
// handler: supplierOrderController.userAccountsofparticularSupplier,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.get("/api/supplierAccounts/:supplierId", {
|
|
|
|
fastify.get("/api/supplierAccounts/:supplierId", {
|
|
|
|
schema: {
|
|
|
|
schema: {
|
|
|
|
tags: ["Supplier"],
|
|
|
|
tags: ["Supplier"],
|
|
|
@ -393,6 +429,217 @@ module.exports = function (fastify, opts, next) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
|
|
|
method: "GET",
|
|
|
|
|
|
|
|
url: "/api/accepted/:customerId",
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
tags: ["Supplier-Order"],
|
|
|
|
|
|
|
|
description:"This is for Get All order pending for delivery",
|
|
|
|
|
|
|
|
summary: "This is for Get All order pending for delivery",
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
required: ["customerId"],
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
customerId: {
|
|
|
|
|
|
|
|
type: "string",
|
|
|
|
|
|
|
|
description: "customerId",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
security: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handler:supplierOrderController.getAllOrderaccepted,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
|
|
|
method: "GET",
|
|
|
|
|
|
|
|
url: "/api/rejected/:customerId",
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
tags: ["Supplier-Order"],
|
|
|
|
|
|
|
|
description:"This is for Get All order cancelled",
|
|
|
|
|
|
|
|
summary: "This is for Get All order cancelled",
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
required: ["customerId"],
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
customerId: {
|
|
|
|
|
|
|
|
type: "string",
|
|
|
|
|
|
|
|
description: "customerId",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
security: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handler:supplierOrderController.getAllOrderreject,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
|
|
|
method: "GET",
|
|
|
|
|
|
|
|
url: "/api/delivered/:customerId",
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
tags: ["Supplier-Order"],
|
|
|
|
|
|
|
|
description:"This is for Get All order Delivered",
|
|
|
|
|
|
|
|
summary: "This is for Get All order Delivered",
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
required: ["customerId"],
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
customerId: {
|
|
|
|
|
|
|
|
type: "string",
|
|
|
|
|
|
|
|
description: "customerId",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
security: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handler:supplierOrderController.getAllOrderdelivered,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
|
|
|
method: "GET",
|
|
|
|
|
|
|
|
url: "/api/pendingconformation/:customerId",
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
tags: ["Supplier-Order"],
|
|
|
|
|
|
|
|
description:"This is for Get All order Pending for confirmation",
|
|
|
|
|
|
|
|
summary: "This is for Get All order pending for confirmation",
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
required: ["customerId"],
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
customerId: {
|
|
|
|
|
|
|
|
type: "string",
|
|
|
|
|
|
|
|
description: "customerId",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
security: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handler:supplierOrderController.getAllOrderpending,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fastify.route({
|
|
|
|
|
|
|
|
// method: "GET",
|
|
|
|
|
|
|
|
// url: "/api/billing/:bookingId",
|
|
|
|
|
|
|
|
// schema: {
|
|
|
|
|
|
|
|
// tags: ["Supplier-Order"],
|
|
|
|
|
|
|
|
// description:"This is for Get Billing Information",
|
|
|
|
|
|
|
|
// summary: "This is for Get Billing Information",
|
|
|
|
|
|
|
|
// params: {
|
|
|
|
|
|
|
|
// required: ["bookingId"],
|
|
|
|
|
|
|
|
// type: "object",
|
|
|
|
|
|
|
|
// properties: {
|
|
|
|
|
|
|
|
// bookingId: {
|
|
|
|
|
|
|
|
// type: "string",
|
|
|
|
|
|
|
|
// description: "bookingId",
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// security: [
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// basicAuth: [],
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// handler:supplierOrderController.getBillingInfo,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
|
|
|
method: "GET",
|
|
|
|
|
|
|
|
url: "/api/billinginfo/:bookingId",
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
tags: ["Supplier-Order"],
|
|
|
|
|
|
|
|
description:"This is for giving booking data billing information",
|
|
|
|
|
|
|
|
summary: "This is for giving booking data billing information",
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
required: ["bookingId"],
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
bookingId: {
|
|
|
|
|
|
|
|
type: "string",
|
|
|
|
|
|
|
|
description: "bookingId",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
security: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// preHandler: fastify.auth([fastify.authenticate]),
|
|
|
|
|
|
|
|
handler:supplierOrderController.getBillingInfo,
|
|
|
|
|
|
|
|
// onResponse: (request, reply) => {
|
|
|
|
|
|
|
|
// validationHandler.sendPhoneVerificationCode(request, reply);
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
//onResponse: validationHandler.sendPhoneVerificationCode,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
|
|
|
method: "GET",
|
|
|
|
|
|
|
|
url: "/api/userAccountsofparticularSupplier/:customerId",
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
tags: ["Supplier-Order"],
|
|
|
|
|
|
|
|
description: "This is for Get accounts of user for particular supplier",
|
|
|
|
|
|
|
|
summary: "This is for to Get accounts of user for particular supplier",
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
required: ["customerId"],
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
customerId: {
|
|
|
|
|
|
|
|
type: "string",
|
|
|
|
|
|
|
|
description: "customerId",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
body: {
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
//required: ["customerId"],
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
supplierId : { type : "string"}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
security: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handler:supplierOrderController.userAccountsofparticularSupplier,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|