assigned team member added in order schema

master^2
Bhaskar 7 months ago
parent 742445005e
commit db9db4b8b1

@ -252,7 +252,7 @@ exports.assignTeamMemberToQuotation = async (request, reply) => {
installationId, installationId,
quatationId: quotationId, quatationId: quotationId,
assignedTeamMembers: [], // Ensure assignedTeamMembers array is initialized assignedTeamMembers: [], // Ensure assignedTeamMembers array is initialized
status: "Pending", // Default status when created quatation_status: "Pending", // Default status when created
}); });
} }
@ -266,7 +266,7 @@ exports.assignTeamMemberToQuotation = async (request, reply) => {
} }
// 🔹 Update order status when a team member is assigned // 🔹 Update order status when a team member is assigned
quotation.status = "Assigned"; // Update status quotation.quatation_status = "Assigned"; // Update status
// 🔹 Save the updated quotation in the Order schema // 🔹 Save the updated quotation in the Order schema
await quotation.save(); await quotation.save();

@ -442,6 +442,7 @@ const orderSchema = new mongoose.Schema({
comments: { type: String, default: null }, comments: { type: String, default: null },
datetime: { type: String, default: null }, datetime: { type: String, default: null },
updated_at: { type: String, default: null }, updated_at: { type: String, default: null },
assignedTeamMembers: [{ type: String }],
electricals: [ electricals: [
{ {
type: { type: String, default: null }, type: { type: String, default: null },
@ -461,7 +462,9 @@ const orderSchema = new mongoose.Schema({
switch_type_quantity_price: { type: String, default: null }, switch_type_quantity_price: { type: String, default: null },
switch_type_total_price: { type: String, default: null }, switch_type_total_price: { type: String, default: null },
qutation_total_price: { type: String, default: null }, qutation_total_price: { type: String, default: null },
status: { type: String, default: "pending" }, // Status field added status: { type: String, default: "pending" },
quatation_status: { type: String, default: "pending" },
}); });
const SensorStockSchema = new mongoose.Schema({ const SensorStockSchema = new mongoose.Schema({

Loading…
Cancel
Save