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.

1289 lines
32 KiB

3 years ago
const fastify = require("fastify");
const userController = require("../controllers/userController");
const validationHandler = require("../handlers/userHandler");
module.exports = function (fastify, opts, next) {
fastify.get("/api/users", {
schema: {
tags: ["User"],
description: "This is for Get All Users",
summary: "This is for to Get All Users",
security: [
{
basicAuth: [],
},
],
},
preHandler: fastify.auth([fastify.authenticate]),
handler: userController.getUsers,
});
3 years ago
fastify.route({
method: "POST",
url: "/api/users/:customerId",
3 years ago
schema: {
description: "To Get user by customerId",
3 years ago
tags: ["User"],
summary: "This is for Get a Single User by customerId",
3 years ago
params: {
type: "object",
properties: {
customerId: {
3 years ago
type: "string",
description: "customerId",
3 years ago
},
},
},
security: [
{
basicAuth: [],
},
],
},
preHandler: fastify.auth([fastify.authenticate]),
handler: userController.getSingleUser,
});
fastify.route({
method: "POST",
url: "/api/currentUser",
schema: {
tags: ["User"],
description: "This is for Get Current User by customerId by Post Body",
3 years ago
summary: "This is for Get a Current User.",
body: {
type: "object",
required: ["customerId"],
3 years ago
properties: {
customerId: { type: "string" },
3 years ago
},
},
security: [
{
basicAuth: [],
},
],
},
preHandler: fastify.auth([fastify.authenticate]),
handler: userController.getCurrentUser,
// onSend: (request, reply, done) => {
// // fire&forget
// request.log.info("#########################################");
// request.log.info(reply);
// done()
// },
});
fastify.route({
method: "PUT",
url: "/api/user/:userId",
schema: {
tags: ["User"],
summary: "This is for update user",
params: {
type: "object",
properties: {
userId: {
type: "string",
description: "userId",
3 years ago
},
},
},
body: {
type: "object",
// required: ['phone'],
properties: {
phone: { type: "string" },
firstName: { type: "string" },
lastName: { type: "string" },
3 years ago
address1: { type: "string" },
address2: { type: "string" },
city: { type: "string" },
state: { type: "string" },
country: { type: "string" },
zip: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
preHandler: [
fastify.auth([fastify.operatorAuthenticate]),
//validationHandler.validatePhoneFormat,
3 years ago
],
// preHandler: fastify.auth([fastify.authenticate]),
handler: userController.editUserInfo,
});
fastify.route({
method: "POST",
url: "/api/user/:installationId",
3 years ago
schema: {
tags: ["Install"],
3 years ago
description: "This is for cretae New user",
summary: "This is for Create New User.",
params: {
type: "object",
properties: {
installationId: {
type: "string",
description: "installationId",
},
},
},
3 years ago
body: {
type: "object",
properties: {
phone: { type: "string" },
3 years ago
password: { type: "string" },
emails: {
type: "array",
maxItems: 2,
items: {
type: "object",
properties: {
email: { type: "string", default: null },
},
},
},
firstName: { type: "string", default: null },
lastName: { type: "string", default: null },
username: { type: "string" },
buildingName: { type: "string", default: null },
inchargeName: { type: "string", default: null },
3 years ago
address1: { type: "string", default: null },
address2: { type: "string", default: null },
city: { type: "string", default: null },
state: { type: "string", default: null },
zip: { type: "string", default: null },
country: { type: "string", default: null },
notes: { type: "string", default: null },
latitude: { type: 'number', default: 0.0 },
longitude: { type: 'number', default: 0.0},
2 years ago
fcmId: { type: "string", default: null },
deviceId: { type: "string", default: null },
3 years ago
},
},
security: [
{
basicAuth: [],
},
],
},
preHandler: [
validationHandler.fieldCheck,
// validationHandler.verifyUser,
3 years ago
// validationHandler.validatePhoneFormat,
validationHandler.validateEmailFormat,
],
handler: userController.addUser,
// onResponse: (request, reply) => {
// validationHandler.sendPhoneVerificationCode(request, reply);
// },
//onResponse: validationHandler.sendPhoneVerificationCode,
});
fastify.route({
method: "POST",
url: "/api/phone",
schema: {
tags: ["User"],
description: "This is for verify User Phone",
summary: "This is to Verify User Phone.",
body: {
type: "object",
required: ["phone"],
properties: {
phoneVerificationCode: { type: "string" },
phone: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: fastify.auth([fastify.authenticate]),
handler: validationHandler.verifyPhone,
});
fastify.route({
method: "POST",
url: "/api/forgot-change-password",
schema: {
tags: ["User"],
description: "After OTP validation Change user password using mobile number and confirmation.",
summary: "After OTP validation Change user password using mobile number and confirmation.",
body: {
type: "object",
required: ["phone", "newPassword", "confirmPassword"],
properties: {
phone: { type: "string" },
newPassword: { type: "string" },
confirmPassword: { type: "string"},
},
},
security: [
{
basicAuth: [],
},
],
},
handler: validationHandler.changePassword,
});
8 months ago
// fastify.route({
// method: "POST",
// url: "/api/change-password",
// schema: {
// tags: ["User"],
// description: "Users to change their password using mobile number, old password, and new password.",
// summary: "Users to change their password using mobile number, old password, and new password.",
// body: {
// type: "object",
// required: ["phone", "oldPassword", "newPassword"],
// properties: {
// phone: { type: "string"},
// oldPassword: { type: "string"},
// newPassword: { type: "string" },
// //confirmPassword: { type: "string", minLength: 6 },
// },
// },
// },
// handler: validationHandler.verifyOldNewPassword, // Adjust the path to your handler
// });
// fastify.route({
// method: "POST",
// url: "/api/forgotpassword",
// schema: {
// tags: ["User"],
// description: "This is for forget password for the User.",
// summary: "This is for forget User Password.",
// body: {
// type: "object",
// required: ["phone"],
// properties: {
// phone: { type: "string" },
// },
// },
// security: [
// {
// basicAuth: [],
// },
// ],
// },
// // preHandler: [validationHandler.],
// handler: userController.forgotPassword,
// onResponse: (request, reply) => {
// validationHandler.sendPasswordResetCode(request, reply);
// },
// });
3 years ago
fastify.route({
method: "POST",
url: "/api/forgotpassword",
schema: {
tags: ["User"],
description: "This is for forget password for the User.",
summary: "This is for forget User Password.",
body: {
type: "object",
required: ["phone"],
properties: {
phone: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
handler: userController.forgotPassword,
});
fastify.route({
method: "POST",
url: "/api/forgotpasswordsupplier",
schema: {
tags: ["Supplier-Data"],
description: "This is for forgot password for the Supplier.",
summary: "This is for forgot password for the Supplier.",
body: {
type: "object",
required: ["phone"],
properties: {
phone: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: [validationHandler.],
handler: userController.forgotPasswordSupplier,
3 years ago
onResponse: (request, reply) => {
validationHandler.sendPasswordResetCode(request, reply);
},
});
8 months ago
fastify.route({
method: "POST",
url: "/api/changePassword",
schema: {
tags: ["User"],
description: "This is to change password of user",
summary: "This is to change password of user",
body: {
type: "object",
required: ["phone"],
properties: {
phone: { type: "string" },
oldPassword: { type: "string" },
newPassword: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: [validationHandler.],
handler: userController.changePassword,
});
3 years ago
fastify.route({
method: "POST",
url: "/api/resetpassword",
schema: {
tags: ["User"],
description: "This is for Reset User Password.",
summary: "This is for Reset User Password.",
body: {
type: "object",
//required: ["phone", "passwordResetCode", "newPassword"],
3 years ago
properties: {
phone: { type: "string" },
phoneVerificationCode: { type: "string" },
3 years ago
newPassword: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
//preHandler: [validationHandler],
3 years ago
handler: validationHandler.resetPassword,
// onResponse: (request,reply) => {validationHandler.resetPassword(request,reply)}
});
fastify.route({
method: "POST",
url: "/api/resetpasswordsupplier",
schema: {
tags: ["Supplier-Data"],
description: "This is for Supplier Reset Password.",
summary: "This is for Supplier Reset Password.",
body: {
type: "object",
required: ["phone", "resetPasswordCode", "newPassword"],
properties: {
phone: { type: "string" },
resetPasswordCode: { type: "string" },
newPassword: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
//preHandler: [validationHandler],
handler: validationHandler.resetPasswordSupplier,
// onResponse: (request,reply) => {validationHandler.resetPassword(request,reply)}
});
3 years ago
fastify.route({
method: "POST",
url: "/api/resetPasswordFromAdmin",
schema: {
tags: ["User"],
description: "This is for Reset Password for Admin.",
summary: "This is for Reset Password for Admin.",
body: {
type: "object",
properties: {
customerId: { type: "string" },
3 years ago
},
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: [validationHandler.],
handler: validationHandler.resetPasswordFromAdmin,
// onResponse: (request,reply) => {validationHandler.resetPassword(request,reply)}
});
fastify.route({
method: "POST",
url: "/api/resendphoneverificationcode",
schema: {
tags: ["User"],
description: "This is for Reset phone Verification Code.",
summary: "This is for Reset phone verification Code.",
body: {
type: "object",
required: ["phone"],
properties: {
phone: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: [validationHandler.],
handler: validationHandler.sendPhoneVerificationCode,
// onResponse: (request,reply) => {validationHandler.sendPhoneVerificationCode(request,reply)}
});
fastify.route({
method: "POST",
url: "/api/users/send_message",
schema: {
tags: ["User"],
description: "This is for Send Message.",
summary: "This is for Send Message.",
body: {
type: "object",
required: ["userId"],
properties: {
userId: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
handler: validationHandler.sendMessageNotification,
});
fastify.route({
method: "PUT",
url: "/api/update/currentUser/:customerId",
3 years ago
schema: {
tags: ["User"],
summary: "This is for update current user",
params: {
type: "object",
properties: {
customerId: {
3 years ago
type: "string",
description: "customerId",
3 years ago
},
},
},
body: {
type: "object",
properties: {
phone: { type: "string" },
firstName: { type: "string" },
buildingName: { type: "string" },
3 years ago
lastName: { type: "string" },
username: { type: "string" },
emails: {
type: "array",
maxItems: 2,
items: {
type: "object",
properties: {
email: { type: "string", default: null },
},
},
},
3 years ago
address1: { type: "string" },
address2: { type: "string" },
city: { type: "string" },
state: { type: "string" },
country: { type: "string" },
zip: { type: "string" },
},
},
security: [
{
3 years ago
basicAuth: [],
},
],
},
preHandler: [fastify.auth([fastify.authenticate])],
handler: userController.editCuurentUserInfo,
});
// Login for a user is in the main index.js file.
// fastify-jwt used to create the token was throwing exceptions and requierd
// it be called before the route is loaded.
2 years ago
const multer = require('multer');
const fs = require('fs');
const storage = multer.diskStorage({
destination: function (req, file, cb) {
if (!fs.existsSync(__dirname + '/temp')) {
fs.mkdirSync(__dirname + '/temp');
}
cb(null, './temp');
},
filename: function (req, file, cb) {
cb(null, file.originalname + '-' + Date.now() + '.' + file.mimetype.split('/')[1]);
},
});
const upload = multer({ storage: storage }).single('picture');
fastify.route({
2 years ago
method: 'POST',
url: '/api/users/profile-picture/:customerId',
schema: {
2 years ago
tags: ['User'],
description: 'Upload a profile picture',
summary: 'Upload a profile picture',
params: {
2 years ago
type: 'object',
properties: {
customerId: {
2 years ago
type: 'string',
description: 'Customer ID',
},
},
},
body: {
2 years ago
formData: {
picture: {
2 years ago
type: 'string',
format: 'binary',
description: 'Profile picture file',
},
},
},
2 years ago
response: {
200: {
description: 'Profile picture uploaded successfully',
type: 'object',
properties: {
message: { type: 'string' },
},
},
2 years ago
400: {
description: 'Failed to upload profile picture',
type: 'object',
properties: {
error: { type: 'string' },
},
},
500: {
description: 'Internal server error',
type: 'object',
properties: {
error: { type: 'string' },
},
},
},
},
handler: async (req, reply) => {
try {
upload(req, reply, async (err) => {
if (err) {
reply.status(400).send({ error: 'Failed to upload profile picture' });
return;
}
const customerId = req.params.customerId;
const picturePath = req.file.path;
let profilePicture = await ProfilePicture.findOne({ customerId });
if (!profilePicture) {
profilePicture = new ProfilePicture({
customerId,
picture: fs.readFileSync(picturePath),
});
} else {
profilePicture.picture = fs.readFileSync(picturePath);
}
await profilePicture.save();
// Delete the temporary uploaded file
fs.unlinkSync(picturePath);
reply.send({ message: 'Profile picture uploaded successfully' });
});
} catch (error) {
reply.status(500).send({ error: error.message });
}
},
});
fastify.route({
method: "POST",
url: "/api/sendSms",
schema: {
tags: ["User"],
description: "This is to send Sms.",
summary: "This is to send Sms.",
body: {
type: "object",
required: ["mobileNumbers"],
properties: {
mobileNumbers: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
//preHandler: [validationHandler],
handler: userController.sendSms,
// onResponse: (request,reply) => {validationHandler.resetPassword(request,reply)}
});
fastify.route({
method: "POST",
url: "/api/addTeammembers/:customerId",
schema: {
tags: ["User"],
description: "This is for adding Team members",
summary: "This is for adding Team members",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: {
type: "string",
description: "customerId",
},
},
},
body: {
type: "object",
properties: {
teamAdminName: { type: "string"},
Name: { type: "string" },
phone: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
preHandler: [
//validationHandler.fieldCheck,
//validationHandler.verifySupplier,
// validationHandler.validatePhoneFormat,
//validationHandler.validateEmailFormat,
],
handler: userController.addTeamMembers,
});
fastify.route({
method: "PUT",
url: "/api/deleteTeamMember/:customerId",
schema: {
tags: ["User"],
summary: "This is for delete Team Member",
description: "This is for delete Team Member",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: {
type: "string",
description: "customerId",
},
},
},
querystring: {
phone: { type: "string" },
},
security: [
{
basicAuth: [],
},
],
},
preHandler: fastify.auth([fastify.authenticate]),
handler: userController.deleteTeamMember, // Ensure this line points to the handler
});
fastify.route({
method: "PUT",
url: "/api/addingfavoratesupplier/:customerId",
schema: {
tags: ["User"],
summary: "This is for adding favorate supplier",
description: "This is for adding favorate supplier",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: {
type: "string",
description: "customerId",
},
},
},
querystring: {
supplierId: { type: "string" },
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: fastify.auth([fastify.authenticate]),
handler: userController.addingfavoratesupplier, // Ensure this line points to the handler
});
fastify.route({
method: "PUT",
url: "/api/editfavoratesupplier/:customerId",
schema: {
tags: ["User"],
summary: "Edit a favorite supplier",
description: "Replace an existing supplierId with a new one",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: { type: "string" },
},
},
querystring: {
oldSupplierId: { type: "string" },
newSupplierId: { type: "string" },
},
security: [{ basicAuth: [] }],
},
handler: userController.editFavoriteSupplier,
});
fastify.route({
method: "DELETE",
url: "/api/deletefavoratesupplier/:customerId",
schema: {
tags: ["User"],
summary: "Delete a favorite supplier",
description: "Remove a supplierId from favorite suppliers",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: { type: "string" },
},
},
querystring: {
supplierId: { type: "string" },
},
security: [{ basicAuth: [] }],
},
handler: userController.deleteFavoriteSupplier,
});
5 months ago
fastify.route({
method: "PUT",
url: "/api/updateTeamMeber/:customerId",
schema: {
tags: ["User"],
summary: "This is for update Team Member details",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: {
type: "string",
description: "customerId",
},
},
},
querystring: {
phone: {type: 'string'}
},
body: {
type: "object",
// required: ['phone'],
properties: {
name: { type: "string", default: null },
phone: { type: "string", default: null },
alternativeContactNumber: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: [
// fastify.auth([fastify.operatorAuthenticate]),
// validationHandler.validatePhoneFormat,
// ],
// preHandler: fastify.auth([fastify.authenticate]),
handler: userController.updateTeamMember,
});
3 years ago
fastify.route({
method: "DELETE",
url: "/api/logout",
schema: {
description: "This is for logout",
tags: ["Logout"],
summary: "This is for logout",
params: {
type: "object",
properties: {
customerId: {
type: "string",
description: "customerId",
},
},
},
},
// preHandler: fastify.auth([fastify.authenticate]),
handler: userController.logout,
});
fastify.route({
method: "POST",
url: "/api/createstaff/:customerId",
schema: {
tags: ["User"],
description: "This is for cretae New staff",
summary: "This is for cretae New staff",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: {
type: "string",
description: "customerId",
},
},
},
body: {
type: "object",
properties: {
staff: {
type: "array",
maxItems: 2500,
items: {
type: "object",
properties: {
name: { type: "string", default: null },
phone: { type: "string", default: null },
password:{ type: "string" ,default: null},
all_motor_access:{ type: "string" ,default: "read"},
},
},
},
},
},
security: [
{
basicAuth: [],
},
],
},
8 months ago
//preHandler: fastify.auth([fastify.authenticate]),
handler: userController.createstaff,
});
fastify.route({
method: "PUT",
url: "/api/editstaff/:customerId/:phone",
schema: {
tags: ["User"],
description: "Edit an existing staff member",
params: {
type: "object",
properties: {
customerId: { type: "string", description: "Customer ID" },
phone: { type: "string", description: "Staff phone number" }
},
required: ["customerId", "phone"]
},
body: {
type: "object",
properties: {
name: { type: "string" },
8 months ago
password: { type: "string" },
all_motor_access:{type:"string"}
},
required: ["name", "password"]
}
8 months ago
},
handler: userController.editStaff,
});
fastify.route({
method: "DELETE",
url: "/api/deletestaff/:customerId/:phone",
schema: {
tags: ["User"],
description: "Delete a staff member",
params: {
type: "object",
properties: {
customerId: { type: "string", description: "Customer ID" },
phone: { type: "string", description: "Staff phone number" }
},
required: ["customerId", "phone"]
}
},
handler: userController.deleteStaff,
});
fastify.route({
method: "PATCH",
url: "/api/blockstaff/:customerId/:phone",
schema: {
tags: ["User"],
description: "Block a staff member by phone",
params: {
type: "object",
properties: {
customerId: { type: "string", description: "Customer ID" },
phone: { type: "string", description: "Staff phone number" }
},
required: ["customerId", "phone"]
}
},
handler: userController.blockStaff,
});
5 months ago
fastify.route({
method: "GET",
url: "/api/favorites/:customerId",
schema: {
tags: ["User"],
description: "Get all favorite suppliers of a customer",
summary: "Get all favorite suppliers of a customer",
params: {
type: "object",
required: ["customerId"],
properties: {
customerId: { type: "string", description: "Customer ID" }
}
},
security: [{ basicAuth: [] }]
},
handler: userController.getFavoriteSuppliers
});
fastify.get("/api/cart/:customerId", {
schema: {
tags: ["User"],
description: "Fetch cart by userId",
summary: "Get cart",
params: {
type: "object",
properties: {
customerId: { type: "string" },
},
required: ["customerId"],
},
},
handler: userController.getCartByUserId,
});
fastify.post("/api/cart/:customerId/add", {
schema: {
tags: ["User"],
description: "Add item to cart",
summary: "Add item",
params: {
type: "object",
properties: {
customerId: { type: "string" },
},
required: ["customerId"],
},
body: {
type: "object",
properties: {
productId: { type: "string" },
name: { type: "string" },
quantity: { type: "number" },
price: { type: "number" },
},
required: ["productId", "quantity", "price"],
},
},
handler: userController.addItemToCart,
});
5 months ago
fastify.post("/api/cart/:customerId/remove", {
schema: {
tags: ["User"],
description: "Remove item from cart",
summary: "Remove item",
params: {
type: "object",
properties: {
customerId: { type: "string" },
},
required: ["customerId"],
},
body: {
type: "object",
properties: {
productId: { type: "string" },
},
required: ["productId"],
},
},
handler: userController.removeItemFromCart,
});
fastify.delete("/api/cart/:customerId/clear", {
schema: {
tags: ["User"],
description: "Clear entire cart",
summary: "Clear cart",
params: {
type: "object",
properties: {
customerId: { type: "string" },
},
required: ["customerId"],
},
},
handler: userController.clearCart,
});
5 months ago
3 months ago
fastify.route({
method: "GET",
url: "/api/getuserOrders/:customerId",
schema: {
description: "To Get orders of customer",
tags: ["User"],
summary: "This is for getting orders of a customer",
params: {
type: "object",
properties: {
customerId: {
type: "string",
description: "Customer ID",
},
},
3 months ago
required: ["customerId"]
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: fastify.auth([fastify.authenticate]),
handler: userController.getuserOrders,
});
fastify.route({
method: "GET",
url: "/api/getuserRequestbookings/:customerId",
schema: {
description: "To Get requestbookings of customer",
tags: ["User"],
summary: "This is for getting requestbookings of a customer",
params: {
type: "object",
properties: {
customerId: {
type: "string",
description: "Customer ID",
},
},
required: ["customerId"]
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: fastify.auth([fastify.authenticate]),
handler: userController.getuserRequestbookings,
});
fastify.route({
method: "GET",
url: "/api/getuserRequestbookingsforsupplier/:supplierId",
schema: {
description: "Get request bookings for a particular supplier",
tags: ["Supplier"],
summary: "Fetch bookings where the supplier is requested",
params: {
type: "object",
properties: {
supplierId: { type: "string", description: "Supplier ID" },
},
required: ["supplierId"],
},
security: [{ basicAuth: [] }],
},
// preHandler: fastify.auth([fastify.authenticate]),
handler: userController.getuserRequestbookingsForSupplier,
});
fastify.route({
method: "POST",
url: "/api/booking/accept/:supplierId",
schema: {
description: "Accept a requested booking by supplier",
tags: ["User"],
summary: "Accept booking and move to tanker bookings",
params: {
type: "object",
properties: {
supplierId: { type: "string", description: "Supplier ID" }
},
required: ["supplierId"]
},
body: {
type: "object",
properties: {
_id: { type: "string", description: "Requested booking ID" },
action: { type: "string", enum: ["accept","reject"], description: "Action to perform" }
},
required: ["_id", "action"]
},
security: [
{
basicAuth: [],
},
],
},
//preHandler: fastify.auth([fastify.authenticate]),
handler: userController.acceptRequestedBooking
});
fastify.route({
method: "GET",
url: "/api/getordersofcustomer/:customerId",
schema: {
tags: ["User"],
description: "Get tanker orders of customer",
summary: "Get tanker orders of customer",
params: {
type: "object",
properties: {
customerId: { type: "string" }
},
required: ["customerId"]
}
},
handler: userController.getordersofcustomer
});
3 months ago
fastify.route({
method: "GET",
url: "/api/getallsuppliers",
schema: {
tags: ["User"],
description: "Get all suppliers for showing",
summary: "Get all suppliers for showing",
},
handler: userController.getallsuppliers
});
fastify.route({
method: "GET",
url: "/api/estimationsget/:customerId",
schema: {
tags: ["User"],
description: "Get all estimations for particular customer",
summary: "Get all estimations for particular customer",
params: {
type: "object",
properties: {
customerId: { type: "string" }
},
required: ["customerId"]
}
},
handler: userController.estimationsget
});
3 years ago
next();
};