feat: added inventory policies & modified APIs

This commit is contained in:
Sathishkumar Krishnan
2022-01-07 07:44:53 +05:30
parent a22b2adc5c
commit 046435c304
3 changed files with 103 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
const mongoose = require("mongoose");
const { InventoryTypes } = require("./../config/constants");
const { InventoryTypes, WarehouseScopes } = require("./../config/constants");
const schema = new mongoose.Schema(
{
@@ -15,15 +15,42 @@ const schema = new mongoose.Schema(
enum: InventoryTypes,
},
policies: {
tracking: {
orderTracking: {
type: Object, // Create a different model and reference it here once more details available
},
alerting: {
type: Object, // Create a different model and reference it here once more details available
lowestStockLevel: {
type: Boolean,
required: true,
},
highestStockLevel: {
type: Boolean,
required: true,
},
alertStockLevel: {
type: Boolean,
required: true,
},
reOrderLevel: {
type: Boolean,
required: true,
},
},
replenishment: {
type: Object, // Create a different model and reference it here once more details available
},
preferredLocations: [
{
id: {
type: mongoose.Schema.Types.ObjectId,
refPath: "type",
},
type: {
type: String,
enum: WarehouseScopes,
},
},
],
},
},
{