Added: sub/level position constants
Updated: Schemas
This commit is contained in:
@@ -12,6 +12,36 @@ const UserActions = [
|
|||||||
"Receive",
|
"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 InventoryScopes = ["Inventory", "Material", "Item"];
|
||||||
|
|
||||||
const WarehouseScopes = [
|
const WarehouseScopes = [
|
||||||
@@ -53,6 +83,7 @@ module.exports = {
|
|||||||
InventoryTypes,
|
InventoryTypes,
|
||||||
CustomAttributeTypes,
|
CustomAttributeTypes,
|
||||||
SubLevelTypes,
|
SubLevelTypes,
|
||||||
|
LevelPositions,
|
||||||
SUPER_ADMIN_ROLE: "super-admin",
|
SUPER_ADMIN_ROLE: "super-admin",
|
||||||
COMPANY_ADMIN_ROLE: "company-admin",
|
COMPANY_ADMIN_ROLE: "company-admin",
|
||||||
WAREHOUSE_ADMIN_ROLE: "warehouse-admin",
|
WAREHOUSE_ADMIN_ROLE: "warehouse-admin",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const mongoose = require("mongoose");
|
const mongoose = require("mongoose");
|
||||||
const { SubLevelTypes } = require("../config/constants");
|
const { SubLevelTypes, LevelPositions } = require("../config/constants");
|
||||||
|
|
||||||
const schema = new mongoose.Schema(
|
const schema = new mongoose.Schema(
|
||||||
{
|
{
|
||||||
@@ -29,15 +29,10 @@ const schema = new mongoose.Schema(
|
|||||||
type: String,
|
type: String,
|
||||||
enum: SubLevelTypes
|
enum: SubLevelTypes
|
||||||
},
|
},
|
||||||
depth: {
|
postition: {
|
||||||
required: true,
|
required: true,
|
||||||
type: Number,
|
type: String,
|
||||||
min: 1, // Level is at 0
|
enum: LevelPositions,
|
||||||
max: 5,
|
|
||||||
},
|
|
||||||
bay_id: {
|
|
||||||
type: mongoose.Schema.Types.ObjectId,
|
|
||||||
ref: "Bay",
|
|
||||||
},
|
},
|
||||||
sub_level_id: {
|
sub_level_id: {
|
||||||
required: true,
|
required: true,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const mongoose = require("mongoose");
|
const mongoose = require("mongoose");
|
||||||
const { SubLevelTypes } = require("../config/constants");
|
const { SubLevelTypes, LevelPositions } = require("../config/constants");
|
||||||
|
|
||||||
const schema = new mongoose.Schema(
|
const schema = new mongoose.Schema(
|
||||||
{
|
{
|
||||||
@@ -11,7 +11,7 @@ const schema = new mongoose.Schema(
|
|||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
enum: SubLevelTypes
|
enum: SubLevelTypes,
|
||||||
},
|
},
|
||||||
specs: {
|
specs: {
|
||||||
// TBD
|
// TBD
|
||||||
@@ -39,11 +39,10 @@ const schema = new mongoose.Schema(
|
|||||||
type: String,
|
type: String,
|
||||||
enum: SubLevelTypes,
|
enum: SubLevelTypes,
|
||||||
},
|
},
|
||||||
depth: {
|
postition: {
|
||||||
required: true,
|
required: true,
|
||||||
type: Number,
|
type: String,
|
||||||
min: 1, // Level is at 0
|
enum: LevelPositions,
|
||||||
max: 5,
|
|
||||||
},
|
},
|
||||||
sub_level_id: {
|
sub_level_id: {
|
||||||
required: true,
|
required: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user