npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@livup/wms_module

v1.2.14

Published

LivUp Warehouse management system core - this node_module contains the basic schemas and methods for a WMS implementation

Downloads

279

Readme

livup-wms-module

├── project_root

├ ├── model

├ ├── schema

├ ├── test

├ ├── utils

├ ├── wms_module.js

├ ├── wms_error.js

├ ├── errorCodes.js

├ ├── .eslintrc

├ ├── .gitignore

├ ├── package.json

  • Running tests: npm test

  • Usage:

map: [[[]]] (variable according with the number of coordinates of the storage)

position: Object { x: Number, y: Number, z: Number} (variable according with the number of coordinates of the storage)

item: Object { itemCode: String (required)- item unique identifier, info: Object - generic info about the item, quantity: Number (required) - quantity stored }

WMSModule

  • constructor
    • parameters

├ ├──── mongoose (required)

├ ├──── storageModelName - String (required)

├ ├──── containerModelName - String (required)

├ ├──── storedCollectionName - String (required)

  • createStorageModel()

  • createContainerModel({position})

├ ├──── position - Object (required)

  • createTransactionModel({transactionModelName})

├ ├──── position - Object (required)

Container

Container:

  • addItems(items, code): add items array inside container identified by the code provided. If container already exists update it or creates a new one in database using code

├ ├──── items - [items]

├ ├──── code - String: container unique code identifier

  • findOne({code}): returns a container matching code if exists

├ ├──── code - String: container unique code identifier

  • removeItem(item, code): remove item from container identified by code

├ ├──── item - Object

├ ├──── code - String: container unique code identifier

  • createInstance({ name, code, items, containerModelName })

├ ├──── name - String (required): unique name for container

├ ├──── code - String (required, unique): unique identifier for container

├ ├──── items - Object

├ ├──── containerModelName - Name of the model to be used to generate the instance.

Storage

  • createInstance({name, code, containerModelName, positionCapacity, mapNumberOfCoordinates ,map}: creates a new Storage in database

├ ├──── name - String (required): unique name for storage

├ ├──── code - String (required, unique): unique identifier for storage

├ ├──── positionCapacity - Number (required): how many containers can be stored in a same position

├ ├──── mapNumberOfCoordinates - Number (required): number of coordinates used in map

├ ├──── map - [[containerModelName]]: map of stored containers identified by position

  • findOne({code}): returns a storage matching code if exists

├ ├──── code - String: storage unique code identifier

  • findOneAndPopulateMap({code}): returns a storage matching code if exists and populate map

├ ├──── code - String: storage unique code identifier

  • checkIfPositionIsAvailable(containerId, position, storageCode) - check if a position is available inside storage

├ ├──── containerId - String : containerId you want to store

├ ├──── position - Object : position you want to check

├ ├──── storageCode - String: storage you want to check position

  • addContainerToStorage(container, storageCode, position) - adds a container into a position

├ ├──── container: Object - container to store

├ ├──── storageCode: - String: storage unique code identifier

├ ├──── position: Object - position to store

  • removeContainerFromStorage(container, storage)

├ ├──── container: Object - container you want to remove

├ ├──── storage: Object - storage that will have container removed

  • getPositions({ items, storageCode }) - finds items inside storage and returns an array of containers found for each item

├ ├──── items: Array of Items you want to look for

├ ├──── storageCode: String - code of storage you are searching

Transaction

  • createTransactionModel() - Generate the base schema and models based on the given model names. It should be called after the model names were given.

  • AddTransaction({container, storage, info, quantity, item, status, kind}) - Creates a transaction on the transaction database.

├ ├──── container - Container object which is suffering the transaction

├ ├──── storage - Storage object which is suffering the transaction

├ ├──── info - Object that can hold any additional infomation needed.

├ ├──── quantity - Total amount this transaction registers. It uses positive values to add and negative to remove

├ ├──── item - : {ObjectId, Quantity}Item related to the transaction. It should hold the initial intended value of the transaction

├ ├──── status - String for use of the application

├ ├──── kind - Definition of the kind of transaction (redundant with the quantity signal, but easier to use for query)

Step-by-Step Example of use

  • The very first step is setting the name of the 3 kinds of models to be used. (containerModelName, storageModelName , storedCollectionName) for the container, storage and items respectively. This is done through the use creation of a WMSModule object with those names and the mongoose reference as parameters.

  • After the names are set we can create the models. The WMSModule has 3 main functions to do that: createStorageModel, createContainerModel, createTransactionModel.

The storage and the container ones return the models that can be used to instantiate the objects through the function createInstance.

The Transaction module make use of static methods to work. At anytime one can call addTransaction(whateverArguments) and the module generate the necessary transaction.

  • The instantiated stores and container are able to do several operations related to themselves and each other, please refer to the list above for a detailed explanation of each.

  • Extension of the operations can be done through the use of them as father class to any other new classes that are needed.