feat: added models Inventory, Material, Item & User

This commit is contained in:
Sathishkumar Krishnan
2021-12-22 05:23:00 +05:30
parent 3a66670d5f
commit 291eea44f8
7 changed files with 299 additions and 2 deletions

39
src/models/Inventory.js Normal file
View File

@@ -0,0 +1,39 @@
const mongoose = require("mongoose");
const { InventoryTypes } = require("./../config/constants");
const schema = new mongoose.Schema(
{
name: {
type: String,
required: true,
trim: true,
},
type: {
type: String,
required: true,
trim: true,
enum: InventoryTypes,
},
policies: {
tracking: {
type: Object, // Create a different model and reference it here once more details available
required: true,
},
alerting: {
type: Object, // Create a different model and reference it here once more details available
required: true,
},
replenishment: {
type: Object, // Create a different model and reference it here once more details available
required: true,
},
},
},
{
timestamps: true,
}
);
const Inventory = mongoose.model("Inventory", schema);
module.exports = Inventory;