Skip to content

Views on going#21

Merged
InduwaraRathnayake merged 3 commits into
mainfrom
Views_on-going
May 8, 2025
Merged

Views on going#21
InduwaraRathnayake merged 3 commits into
mainfrom
Views_on-going

Conversation

@InduwaraRathnayake

Copy link
Copy Markdown
Contributor

This pull request introduces several enhancements and new features to the warehouse management system, including improvements to data population scripts, database schema updates, API functionality, and development environment configuration. Below is a summary of the most important changes grouped by theme.

Database and Schema Updates:

  • Added a product_SKU field to the Product model, ensuring each product has a unique SKU identifier. Corresponding migration 0002_product_product_sku.py was created. ([[1]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-e3126b89490ff95fab29bef220d891c5e08d044da990375f9f106e42769ef374R1-R18), [[2]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-0cc46d5940330f7605259aec8e81d57aa0d4ccde56d5dea8638e58ccbc9ffe03R10))
  • Introduced a capacity field to the Warehouse model to track the maximum storage capacity. Corresponding migration 0002_warehouse_capacity.py was created. ([[1]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-83711e32fd1d050ba9ed1c889bf7463e38584657e8df37494706199341656840R1-R18), [[2]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-2c2090344d8cad465e9a858e8383d7a506938c8f3a786afe568ddf7f4ce4c8b8R10))

Data Population Enhancements:

  • Updated the populate_all_data.py script to:
    • Add SKUs to products during data generation.
    • Dynamically create warehouses with capacities.
    • Generate inventory and simulate transactions (incoming and outgoing) for each product in each warehouse. ([[1]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-03a41d585e4f174dcb50486546917cd35cf23d52cd03c52547fdc300f2967516R5-R23), [[2]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-03a41d585e4f174dcb50486546917cd35cf23d52cd03c52547fdc300f2967516L31-R114))

API Improvements:

  • Enhanced the product_stock_summary API to use product_SKU for product lookup and include SKU in the response. ([warehouse_managment/product/views.pyL78-R95](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-e666d50864fb13751dbf7b4f6e89c0c2b92d9cdc3702b6f34a6096e0d59c4a22L78-R95))
  • Improved the warehouse_inventory_list API to:
    • Require warehouse_id as a parameter.
    • Return detailed inventory information, including supplier names, stock levels, and last restocked date. ([warehouse_managment/warehouse/views.pyL26-R61](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-671864e5ab4b2391fe05a8dc9ccf465183a73d48ddde61151f6e247ce13727f9L26-R61))

Development Environment Configuration:

  • Added a docker-compose.yml file to set up a development environment with pgadmin, a PostgreSQL client, and a custom network. ([database/docker-compose.ymlR1-R34](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-e0bbebfdf7f802db10750776ed72a77e6ec3e6049c211d039dda66b2bac04470R1-R34))
  • Enabled Cross-Origin Resource Sharing (CORS) by adding the corsheaders package and middleware, allowing all origins. ([[1]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-ec23290768da4a8b3ede4e6320a9d220db0548118f69f62e69d882f4dee0d81bR51), [[2]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-ec23290768da4a8b3ede4e6320a9d220db0548118f69f62e69d882f4dee0d81bR62-R66))

Utility Additions:

  • Introduced a supplier_names.py utility to map supplier IDs to human-readable names, improving code readability and API responses. ([[1]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-a84939202dc45597ccf0f61f6ade6d7c21a0b4b94c65256659c8b060bdee6c2eR1-R9), [[2]](https://github.com/IASSCMS/Warehouse-Management-Services/pull/21/files#diff-671864e5ab4b2391fe05a8dc9ccf465183a73d48ddde61151f6e247ce13727f9R10))

Copilot AI review requested due to automatic review settings May 8, 2025 14:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request enhances the warehouse management system by adding new fields and features such as a product SKU, warehouse capacity, improved API endpoints, data population scripts, and a development environment configuration.

  • Introduces a unique SKU field for products and updates related API logic.
  • Adds a capacity field to the Warehouse model and adjusts inventory handling including detailed API responses.
  • Updates the seeding script for products, warehouses, and inventory transactions and adds a new docker-compose configuration for development.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
warehouse_managment/warehouse_managment/settings.py Adds CORS headers and middleware configuration.
warehouse_managment/warehouse/views.py Updates inventory API to require warehouse_id and returns detailed info.
warehouse_managment/warehouse/supplier_names.py Introduces a supplier names mapping utility.
warehouse_managment/warehouse/models.py Adds a new capacity field to the Warehouse model.
warehouse_managment/product/views.py Enhances the product stock summary API using the new SKU field.
warehouse_managment/product/models.py Adds a new product_SKU field to enforce unique SKUs on products.
warehouse_managment/product/management/commands/populate_all_data.py Revises data population ensuring SKUs and capacities are set.
database/docker-compose.yml Provides development environment setup with pgadmin and a PostgreSQL client.

@InduwaraRathnayake InduwaraRathnayake merged commit 8effd9e into main May 8, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants