Sales Update
This commit is contained in:
parent
85c2c7ddaa
commit
20748ccd5d
@ -210,7 +210,6 @@ export const getTasksbytask = async (req, res) => {
|
|||||||
"Update Sales Data",
|
"Update Sales Data",
|
||||||
"Update Inventory Data",
|
"Update Inventory Data",
|
||||||
"Collect KYC",
|
"Collect KYC",
|
||||||
"Update Sales",
|
|
||||||
].includes(task)
|
].includes(task)
|
||||||
) {
|
) {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
|
@ -12,7 +12,7 @@ const TaskSchema = new mongoose.Schema(
|
|||||||
task: {
|
task: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
enum: ["Visit RD/PD", "Update Sales Data", "Update Inventory Data", "Collect KYC","Update Sales"],
|
enum: ["Visit RD/PD", "Update Sales Data", "Update Inventory Data", "Collect KYC"],
|
||||||
},
|
},
|
||||||
note: {
|
note: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -49,20 +49,20 @@ const TaskSchema = new mongoose.Schema(
|
|||||||
type: String,
|
type: String,
|
||||||
enum: ['PrincipalDistributor', 'RetailDistributor'],
|
enum: ['PrincipalDistributor', 'RetailDistributor'],
|
||||||
required: function () {
|
required: function () {
|
||||||
return this.task === "Update Inventory Data" || this.task === "Visit RD/PD" || this.task === "Update Sales";
|
return this.task === "Update Inventory Data" || this.task === "Visit RD/PD" || this.task === "Update Sales Data";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
addedForId: {
|
addedForId: {
|
||||||
type: mongoose.Schema.Types.ObjectId,
|
type: mongoose.Schema.Types.ObjectId,
|
||||||
refPath: 'addedFor',
|
refPath: 'addedFor',
|
||||||
required: function () {
|
required: function () {
|
||||||
return this.task === "Update Inventory Data" || this.task === "Visit RD/PD" || this.task === "Update Sales";
|
return this.task === "Update Inventory Data" || this.task === "Visit RD/PD" || this.task === "Update Sales Data";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tradename: {
|
tradename: {
|
||||||
type: String,
|
type: String,
|
||||||
required: function () {
|
required: function () {
|
||||||
return this.task === "Update Inventory Data" || this.task === "Visit RD/PD" || this.task === "Update Sales";
|
return this.task === "Update Inventory Data" || this.task === "Visit RD/PD" || this.task === "Update Sales Data";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user