Skip to content

Views on going#26

Open
DDRMin wants to merge 5 commits into
mainfrom
Views_on-going
Open

Views on going#26
DDRMin wants to merge 5 commits into
mainfrom
Views_on-going

Conversation

@DDRMin

@DDRMin DDRMin commented May 10, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 10, 2025 18:23

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 adds new endpoints to fetch supplier product prices and retrieve suppliers for a given product, along with the corresponding URL updates.

  • Added an API view get_supplier_product_prices in warehouse/views.py that aggregates supplier pricing with warehouse details.
  • Added an API view get_suppliers_for_product in product/views.py to return supplier IDs by product.
  • Updated product/urls.py with the new endpoint for fetching suppliers of a product.

Reviewed Changes

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

File Description
warehouse_managment/warehouse/views.py New endpoint to retrieve supplier product prices with added warehouse details.
warehouse_managment/product/views.py New endpoint to retrieve supplier IDs by product.
warehouse_managment/product/urls.py Updated URL patterns to include the new supplier endpoint.

)

summary.append({
"product_name": sp.product.product_name,

Copilot AI May 10, 2025

Copy link

Choose a reason for hiding this comment

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

The code assumes sp is a model instance by using sp.product, but supplier_products is constructed with .values(...), resulting in dictionaries. To fix this, either remove the .values() call or access dictionary keys appropriately.

Copilot uses AI. Check for mistakes.
@DDRMin DDRMin requested a review from InduwaraRathnayake May 10, 2025 18:24
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