Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Warehouse Management Module with Controllers, Middleware, and Schema #930

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

IkkiOcean
Copy link
Contributor

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:

  1. createWarehouse

    • This controller is responsible for creating a new warehouse. It validates that the warehouseId and warehouseName are unique to ensure no duplicates exist.
    • Upon successful validation, a new warehouse is created with the given details and saved to the database.
  2. updateWarehouse

    • Allows the updating of an existing warehouse by modifying its attributes such as warehouseName, address, capacity, currentOccupancy, and contactInfo.
    • It checks if the warehouse exists before applying the update and saves the updated data.
  3. getWarehouseInventory

    • Retrieves the inventory items of a specific warehouse based on the warehouseId. This controller ensures that the correct warehouse is fetched before returning the inventory details.
  4. checkWarehouseCapacity

    • This controller checks if a warehouse has exceeded its capacity. It compares the currentOccupancy of the warehouse with its total capacity. If the current occupancy exceeds the capacity, it returns an error indicating that the warehouse is over capacity.
  5. deleteWarehouse

    • Handles the deletion of a warehouse from the database using its warehouseId. If the warehouse exists, it is removed; otherwise, an error message is returned.
  6. getAllWarehouses

    • Retrieves all warehouse records stored in the database. This controller does not require any parameters and returns all warehouse details.
  7. searchWarehouse

    • Searches for warehouses by name or ID. It uses a case-insensitive regular expression search to match the warehouseId or warehouseName based on a query parameter.

Key Features:

  • Unique Warehouse Validation: Ensures that the warehouseId and warehouseName 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

Copy link

vercel bot commented Nov 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agro-tech-ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 2:13pm

Copy link
Contributor

github-actions bot commented Nov 9, 2024

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@manikumarreddyu manikumarreddyu merged commit be6f209 into manikumarreddyu:main Nov 9, 2024
4 checks passed
Copy link
Contributor

github-actions bot commented Nov 9, 2024

🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Warehouse Schema and Controllers for Warehouse Management
2 participants