|
|
|
@ -93,27 +93,39 @@ module.exports = function (fastify, opts, next) {
|
|
|
|
|
|
|
|
|
|
fastify.post('/api/stores', {
|
|
|
|
|
schema: {
|
|
|
|
|
description: "This is for Create New Store",
|
|
|
|
|
description: "Create a new store account",
|
|
|
|
|
tags: ["Store-Data"],
|
|
|
|
|
summary: "This is for Create New Store.",
|
|
|
|
|
summary: "create a new store account.",
|
|
|
|
|
body: {
|
|
|
|
|
type: "object",
|
|
|
|
|
required: ["storename", "phone", "password"],
|
|
|
|
|
// required: ["storename", "phone", "password"],
|
|
|
|
|
properties: {
|
|
|
|
|
storename: { type: "string" },
|
|
|
|
|
phone: { type: "string" },
|
|
|
|
|
alternativeContactNumber: { type: "string" },
|
|
|
|
|
password: {type: "string"},
|
|
|
|
|
phone: { type: "string", unique: true, trim: true },
|
|
|
|
|
contactPersonName: { type: "string" },
|
|
|
|
|
contactPersonPhone: { type: "string", unique: true, trim: true },
|
|
|
|
|
emails: { type: "string" },
|
|
|
|
|
office_address: { type: "string", default: null },
|
|
|
|
|
description: { type: "string", default: null },
|
|
|
|
|
startingPrice: { type: "string", default: 0.0 },
|
|
|
|
|
profile: {
|
|
|
|
|
type: "object",
|
|
|
|
|
properties: {
|
|
|
|
|
role: { type: "array", items: { type: "string" }, default: ["store"] },
|
|
|
|
|
firstName: { type: "string", default: null },
|
|
|
|
|
lastName: { type: "string", default: null },
|
|
|
|
|
contactNumber: { type: "string", default: null },
|
|
|
|
|
alternativeContactNumber: { type: "string", default: null },
|
|
|
|
|
store_address: { type: "string", default: null },
|
|
|
|
|
city: { type: "string", default: null },
|
|
|
|
|
state: { type: "string", default: null },
|
|
|
|
|
zip: { type: "string", default: null },
|
|
|
|
|
country: { type: "string", default: null },
|
|
|
|
|
latitude: { type: 'number', default: 0.0 },
|
|
|
|
|
longitude: { type: 'number', default: 0.0 },
|
|
|
|
|
zip: { type: "string", default: null },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
longitude: { type: "number", default: 0.0 },
|
|
|
|
|
latitude: { type: "number", default: 0.0 },
|
|
|
|
|
fcmId: { type: "string", default: null },
|
|
|
|
|
description: { type: "string", default: null },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
security: [{ basicAuth: [] }],
|
|
|
|
@ -121,6 +133,7 @@ fastify.post('/api/stores', {
|
|
|
|
|
handler: storeController.addStore,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.post('/api/salesSignUp', {
|
|
|
|
|
schema: {
|
|
|
|
|
description: "This is for Create New Sales",
|
|
|
|
@ -262,7 +275,7 @@ fastify.put('/api/editSalesUser/:salesId', {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//required: ["username", "phone", "emails", "profile"]
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handler: storeController.editSalesUser,
|
|
|
|
@ -270,19 +283,20 @@ fastify.put('/api/editSalesUser/:salesId', {
|
|
|
|
|
|
|
|
|
|
fastify.put('/api/editStore/:storeId', {
|
|
|
|
|
schema: {
|
|
|
|
|
description: "Edit store user details by Store ID",
|
|
|
|
|
tags: ["Sales-Data"],
|
|
|
|
|
summary: "Edit store user details.",
|
|
|
|
|
description: "Edit store details by Store ID",
|
|
|
|
|
tags: ["Store-Data"],
|
|
|
|
|
summary: "Edit store details.",
|
|
|
|
|
params: {
|
|
|
|
|
type: "object",
|
|
|
|
|
properties: {
|
|
|
|
|
storeId: { type: "string" }, // Store ID
|
|
|
|
|
storeId: { type: "string" },
|
|
|
|
|
},
|
|
|
|
|
required: ["storeId"],
|
|
|
|
|
},
|
|
|
|
|
body: {
|
|
|
|
|
type: "object",
|
|
|
|
|
properties: {
|
|
|
|
|
storename: { type: "string" },
|
|
|
|
|
phone: { type: "string" },
|
|
|
|
|
address: { type: "string" },
|
|
|
|
|
address1: { type: "string" },
|
|
|
|
@ -293,16 +307,24 @@ fastify.put('/api/editStore/:storeId', {
|
|
|
|
|
properties: {
|
|
|
|
|
firstName: { type: "string" },
|
|
|
|
|
lastName: { type: "string" },
|
|
|
|
|
contactNumber: { type: "string" },
|
|
|
|
|
alternativeContactNumber: { type: "string" },
|
|
|
|
|
store_address: { type: "string" },
|
|
|
|
|
city: { type: "string" },
|
|
|
|
|
state: { type: "string" },
|
|
|
|
|
country: { type: "string" },
|
|
|
|
|
zip: { type: "string" },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
alternativeNumber: { type: "string" },
|
|
|
|
|
longitude: { type: "number" },
|
|
|
|
|
latitude: { type: "number" },
|
|
|
|
|
fcmId: { type: "string" },
|
|
|
|
|
password: { type: "string" }, // Optional password update
|
|
|
|
|
description: { type: "string" },
|
|
|
|
|
startingPrice: { type: "string" },
|
|
|
|
|
password: { type: "string" },
|
|
|
|
|
},
|
|
|
|
|
// required: ["phone", "emails", "profile"]
|
|
|
|
|
required: ["phone"],
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handler: storeController.editStore,
|
|
|
|
@ -310,6 +332,7 @@ fastify.put('/api/editStore/:storeId', {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.get("/api/getAllInstallers", {
|
|
|
|
|
schema: {
|
|
|
|
|
description: "Retrieve all users",
|
|
|
|
|