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

solution #661

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

solution #661

wants to merge 3 commits into from

Conversation

FanniMalevych
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Thank you for your hard work on this project! 😊 There are a few critical issues that need to be addressed before we can approve the pull request. Firstly, there's a syntax error in the import statement for the dataclass, which needs to be corrected to ensure the code runs properly. Additionally, the customer's location should be updated to the shop's location when they make a purchase, as per the task requirements. Lastly, there's a typo in the variable name product_coast which should be corrected to product_cost. Please make these changes, and feel free to reach out if you need any help! Keep up the great work! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

@@ -0,0 +1,7 @@
from dataclasses import dataclass

Choose a reason for hiding this comment

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

There is a syntax error here. The import statement should be from dataclasses import dataclass without the slash (/).

app/customer.py Outdated

def calculate_products_cost(self, shop: Shop,
print_info: bool = False) -> float:
product_coast = sum([shop.products[key] * self.product_cart[key]

Choose a reason for hiding this comment

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

The variable product_coast seems to be a typo. It should be product_cost to reflect its purpose of storing the total cost of products.


selected_shop_name = min(shops_trip, key=shops_trip.get)
selected_shop_expenses = shops_trip[selected_shop_name]
if self.money >= shops_trip[selected_shop_name]:

Choose a reason for hiding this comment

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

Ensure that when the customer decides to make a purchase, their location is updated to the shop's location as required by the task description.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Great job on your submission! 🎉 Your code is well-structured and mostly aligns with the task requirements. However, there are a few critical areas that need your attention to ensure full functionality:

  1. Syntax Error in Import Statement: In app/car.py, there's a syntax error in the import statement for dataclass. Please correct it to from dataclasses import dataclass to ensure the code runs properly.

  2. Customer Location Update: It's crucial to update the customer's location to the shop's location after a purchase. This is a key requirement that hasn't been implemented yet. Consider adding self.location = selected_shop_instance.location after the purchase to meet this requirement.

  3. Variable Name Typo: In app/customer.py, there's a typo in the variable name product_cost. Make sure to correct this to avoid any potential issues.

  4. Configuration File: Ensure that the config.json file contains all necessary fields and data structures expected by app/main.py.

Your efforts are commendable, and addressing these points will enhance the functionality of your code. Remember, learning from these adjustments is a valuable part of your development journey. Keep up the great work, and don't hesitate to reach out if you need further assistance! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -0,0 +1,7 @@
from dataclasses import dataclass

Choose a reason for hiding this comment

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

There is a syntax error in the import statement. It should be from dataclasses import dataclass without the slash.

for shop in shops:
if shop.name == selected_shop_name:
selected_shop_instance = shop
self.calculate_products_cost(selected_shop_instance, print_info=True)

Choose a reason for hiding this comment

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

After the customer makes a purchase, their location should be updated to the shop's location as per the task requirements. Consider adding self.location = selected_shop_instance.location after the purchase.

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