Added: sub/level position constants

Updated: Schemas
This commit is contained in:
Llewellyn D'souza
2021-12-28 16:43:16 +05:30
parent 2d08bca25d
commit 4cdc8f732e
3 changed files with 40 additions and 15 deletions

View File

@@ -12,6 +12,36 @@ const UserActions = [
"Receive",
];
const LevelPositions = [
"B",
"D",
"DB",
"DF",
"F",
"L",
"LB",
"LD",
"LDB",
"LDF",
"LF",
"LU",
"LUB",
"LUF",
"R",
"RB",
"RD",
"RDB",
"RDF",
"RF",
"RU",
"RUB",
"RUF",
"U",
"UB",
"UF",
"W",
];
const InventoryScopes = ["Inventory", "Material", "Item"];
const WarehouseScopes = [
@@ -53,6 +83,7 @@ module.exports = {
InventoryTypes,
CustomAttributeTypes,
SubLevelTypes,
LevelPositions,
SUPER_ADMIN_ROLE: "super-admin",
COMPANY_ADMIN_ROLE: "company-admin",
WAREHOUSE_ADMIN_ROLE: "warehouse-admin",

View File

@@ -1,5 +1,5 @@
const mongoose = require("mongoose");
const { SubLevelTypes } = require("../config/constants");
const { SubLevelTypes, LevelPositions } = require("../config/constants");
const schema = new mongoose.Schema(
{
@@ -29,15 +29,10 @@ const schema = new mongoose.Schema(
type: String,
enum: SubLevelTypes
},
depth: {
postition: {
required: true,
type: Number,
min: 1, // Level is at 0
max: 5,
},
bay_id: {
type: mongoose.Schema.Types.ObjectId,
ref: "Bay",
type: String,
enum: LevelPositions,
},
sub_level_id: {
required: true,

View File

@@ -1,5 +1,5 @@
const mongoose = require("mongoose");
const { SubLevelTypes } = require("../config/constants");
const { SubLevelTypes, LevelPositions } = require("../config/constants");
const schema = new mongoose.Schema(
{
@@ -11,7 +11,7 @@ const schema = new mongoose.Schema(
type: {
type: String,
required: true,
enum: SubLevelTypes
enum: SubLevelTypes,
},
specs: {
// TBD
@@ -39,11 +39,10 @@ const schema = new mongoose.Schema(
type: String,
enum: SubLevelTypes,
},
depth: {
postition: {
required: true,
type: Number,
min: 1, // Level is at 0
max: 5,
type: String,
enum: LevelPositions,
},
sub_level_id: {
required: true,