Added Warehouse Management Module with Controllers, Middleware, and Schema #930
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview:
This PR introduces a comprehensive set of controllers to handle warehouse management functionality. The module is designed to support key operations such as warehouse creation, updates, deletion, inventory management, and capacity checks. These controllers enable the system to manage warehouse data effectively.
Warehouse Controllers:
createWarehouse
warehouseId
andwarehouseName
are unique to ensure no duplicates exist.updateWarehouse
warehouseName
,address
,capacity
,currentOccupancy
, andcontactInfo
.getWarehouseInventory
warehouseId
. This controller ensures that the correct warehouse is fetched before returning the inventory details.checkWarehouseCapacity
currentOccupancy
of the warehouse with its totalcapacity
. If the current occupancy exceeds the capacity, it returns an error indicating that the warehouse is over capacity.deleteWarehouse
warehouseId
. If the warehouse exists, it is removed; otherwise, an error message is returned.getAllWarehouses
searchWarehouse
warehouseId
orwarehouseName
based on a query parameter.Key Features:
Unique Warehouse Validation: Ensures that the
warehouseId
andwarehouseName
are unique before creating or updating a warehouse.Capacity Management: Provides functionality to check if the warehouse exceeds its storage capacity based on current occupancy levels.
Search Functionality: Allows searching for warehouses by their name or ID using a flexible search mechanism.
CRUD Operations: Full CRUD (Create, Read, Update, Delete) operations for managing warehouses.
Closes Implement Warehouse Schema and Controllers for Warehouse Management #921