feat; change model names (Material -> WidgetFamily)

This commit is contained in:
Sathishkumar Krishnan
2022-01-06 00:15:05 +05:30
parent 32358ec68f
commit c459271a63
9 changed files with 100 additions and 100 deletions

View File

@@ -0,0 +1,27 @@
const mongoose = require("mongoose");
const schema = new mongoose.Schema(
{
name: {
type: String,
required: true,
trim: true,
},
parent: {
type: mongoose.Schema.Types.ObjectId,
ref: "WidgetFamily",
},
inventory: {
type: mongoose.Schema.Types.ObjectId,
ref: "Inventory",
required: true
},
},
{
timestamps: true,
}
);
const WidgetFamily = mongoose.model("WidgetFamily", schema);
module.exports = WidgetFamily;