Skip to content

New models#27

Closed
DDRMin wants to merge 7 commits into
IASSCMS:mainfrom
DDRMin:New_models
Closed

New models#27
DDRMin wants to merge 7 commits into
IASSCMS:mainfrom
DDRMin:New_models

Conversation

@DDRMin

@DDRMin DDRMin commented May 16, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 16, 2025 11:29

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 PR implements new models and updates related logic to replace the WarehouseSupplier model with a new SupplierProduct model. The key changes include:

  • Removal of WarehouseSupplier and migration of its logic/data into the SupplierProduct model.
  • Updates in views, serializers, admin, and URL configurations to reference the new model.
  • Adjustments in data population and migrations to support the new supplier-related functionality.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
warehouse_managment/warehouse/settings.py Updated commented and active database configuration.
warehouse_managment/warehouse/views.py Replaced WarehouseSupplier with SupplierProduct and updated business logic accordingly.
warehouse_managment/warehouse/urls.py Revised supplier product endpoint paths and inline comments.
warehouse_managment/warehouse/serializers.py Added SupplierProductSerializer.
warehouse_managment/warehouse/models.py Introduced the new SupplierProduct model with updated unique constraints.
warehouse_managment/warehouse/migrations/0004_supplierproduct_delete_warehousesupplier.py Migration creating SupplierProduct model and deleting WarehouseSupplier.
warehouse_managment/warehouse/admin.py Updated admin registration for the new SupplierProduct.
warehouse_managment/product/views.py Adjusted endpoints to use SupplierProduct with required parameter changes.
warehouse_managment/product/urls.py Added endpoints for supplier and product queries using the new model.
warehouse_managment/product/serializers.py Removed SupplierProductSerializer now handled in warehouse serializers.
warehouse_managment/product/models.py Removed the SupplierProduct model, as it is now maintained under warehouse.
warehouse_managment/product/migrations/0003_delete_supplierproduct.py Migration for deleting the old SupplierProduct model in product app.
warehouse_managment/product/management/commands/populate_all_data.py Updated data generation to accommodate SupplierProduct and updated WarehouseInventory usage.
warehouse_managment/product/admin.py Removed SupplierProduct admin registration.
Comments suppressed due to low confidence (1)

warehouse_managment/warehouse/urls.py:49

  • The URL pattern should not start with a leading slash; removing it will align with Django conventions.
path("/supplier-product/add_or_update/", add_supplier_product, name="update_supplier_product"),

path('order/handle/', handle_order_status, name='handle_order_status'),
# POST endpoint to add or update a supplier product

# POST endpoint to add a supplier product enrty or update an existing one with supplier_price, lead_time_days or maximum_stock

Copilot AI May 16, 2025

Copy link

Choose a reason for hiding this comment

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

Typo in the comment: 'enrty' should be corrected to 'entry'.

Suggested change
# POST endpoint to add a supplier product enrty or update an existing one with supplier_price, lead_time_days or maximum_stock
# POST endpoint to add a supplier product entry or update an existing one with supplier_price, lead_time_days or maximum_stock

Copilot uses AI. Check for mistakes.
@DDRMin DDRMin requested a review from InduwaraRathnayake May 16, 2025 11:30
@DDRMin DDRMin closed this May 16, 2025
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.

2 participants