|
|
|
const fastify = require("fastify");
|
|
|
|
const storeController = require('../controllers/storeController')
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function (fastify, opts, next) {
|
|
|
|
fastify.route({
|
|
|
|
method: 'POST',
|
|
|
|
url: '/api/installSignup',
|
|
|
|
schema: {
|
|
|
|
tags: ['Install'],
|
|
|
|
description: 'This is for creating a New Install Account',
|
|
|
|
summary: 'This is for creating a New Install Account',
|
|
|
|
body: {
|
|
|
|
type: 'object',
|
|
|
|
properties: {
|
|
|
|
phone: { type: 'string' },
|
|
|
|
password: { type: 'string' },
|
|
|
|
emails: {
|
|
|
|
type: 'array',
|
|
|
|
maxItems: 2,
|
|
|
|
items: {
|
|
|
|
type: 'object',
|
|
|
|
properties: {
|
|
|
|
email: { type: 'string', default: null },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//name: { type: 'string' },
|
|
|
|
|
|
|
|
team: { type: 'string', default: null },
|
|
|
|
manager: { type: 'string', default: null },
|
|
|
|
address: { type: 'string', default: null },
|
|
|
|
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 },
|
|
|
|
fcmId: { type: 'string', default: null },
|
|
|
|
alternativeNumber : { type: 'string', default: null },
|
|
|
|
firstName :{ type: 'string', default: null },
|
|
|
|
lastName : { type: 'string', default: null },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
security: [
|
|
|
|
{
|
|
|
|
basicAuth: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
handler: storeController.installSignUp,
|
|
|
|
});
|
|
|
|
// fastify.post("/api/insatllLogin", {
|
|
|
|
// schema: {
|
|
|
|
// description: "This is for Login Install",
|
|
|
|
// tags: ["Install"],
|
|
|
|
// summary: "This is for Login Install",
|
|
|
|
// body: {
|
|
|
|
// type: "object",
|
|
|
|
// required: ["phone", "password"],
|
|
|
|
// properties: {
|
|
|
|
// phone: { type: "string" },
|
|
|
|
// password: { type: "string" },
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// handler: storeController.installLogin,
|
|
|
|
// });
|
|
|
|
|
|
|
|
// fastify.post("/api/installotplogin", {
|
|
|
|
// schema: {
|
|
|
|
// description: "This is for Login Otp Boy",
|
|
|
|
// tags: ["Install"],
|
|
|
|
// summary: "This is for Login Otp Boy",
|
|
|
|
// body: {
|
|
|
|
// type: "object",
|
|
|
|
// required: ["phone"],
|
|
|
|
// properties: {
|
|
|
|
// phoneVerificationCode: { type: "string" },
|
|
|
|
// phone: { type: "string" },
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// handler: storeController.installationVerifyPhone,
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
};
|