|
|
@ -36,10 +36,101 @@ module.exports = function (fastify, opts, next) {
|
|
|
|
handler: departmentController.addDepartment,
|
|
|
|
handler: departmentController.addDepartment,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.get("/api/getSingledepartmentData/:departmentId", {
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
tags: ["Department"],
|
|
|
|
|
|
|
|
description: "This is for Get Single departmentId Data",
|
|
|
|
|
|
|
|
summary: "This is to Get Single departmentId Data",
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
departmentId: {
|
|
|
|
|
|
|
|
type: "string",
|
|
|
|
|
|
|
|
description: "departmentId",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
security: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handler: departmentController.getSinledepartmentData,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.get("/api/getalldepartments", {
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
tags: ["Department"],
|
|
|
|
|
|
|
|
description: "This is for Get all Department Data",
|
|
|
|
|
|
|
|
summary: "This is for to Get all Department Data",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
security: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//preHandler: fastify.auth([fastify.authenticate]),
|
|
|
|
|
|
|
|
handler: departmentController.getalldepartmants,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.delete("/api/deletedepartment/:departmentId", {
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
description: "Delete a Department by departmentId",
|
|
|
|
|
|
|
|
tags: ["Department"],
|
|
|
|
|
|
|
|
summary: "Delete a user by departmentId",
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
departmentId: { type: "string" }, // Customer ID
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
required: ["departmentId"],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
response: {
|
|
|
|
|
|
|
|
200: {
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
success: { type: "boolean" },
|
|
|
|
|
|
|
|
message: { type: "string" },
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handler: departmentController.deletedepartmentInfo,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.put('/api/editdepartment/:departmentId', {
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
description: "Edit Department details by departmentId",
|
|
|
|
|
|
|
|
tags: ["Department"],
|
|
|
|
|
|
|
|
summary: "Edit Department details.",
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
departmentId: { type: "string" },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
required: ["departmentId"],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
body: {
|
|
|
|
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
phone: { type: "string" },
|
|
|
|
|
|
|
|
city: { type: "string" },
|
|
|
|
|
|
|
|
state: { type: "string" },
|
|
|
|
|
|
|
|
country: { type: "string" },
|
|
|
|
|
|
|
|
address1: { type: "string" },
|
|
|
|
|
|
|
|
address2: { type: "string" },
|
|
|
|
|
|
|
|
zone: { type: "string" },
|
|
|
|
|
|
|
|
pincode: { type: "string" },
|
|
|
|
|
|
|
|
departmentName: { type: "string" },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handler: departmentController.editdepartment,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
next();
|
|
|
|
};
|
|
|
|
};
|