Skip to content

transportation-on-vacation-solution #5086

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

Closed
wants to merge 3 commits into from
Closed

transportation-on-vacation-solution #5086

wants to merge 3 commits into from

Conversation

paolomariano
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 task! 😊 While your code is well-structured and meets many of the task requirements, there's a critical issue with the discount logic. Currently, the function only applies one discount, whereas it should apply both if the rental period qualifies. Please revise the logic to ensure both discounts are applied when applicable. Once this is addressed, your solution will be ready for approval. 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.

Comment on lines 10 to 15
if (days >= LONG_TERM) {
return basePrice - LONG_TERM_DISCOUNT;
}

if (days >= SHORT_TERM) {
return basePrice - SHORT_TERM_DISCOUNT;

Choose a reason for hiding this comment

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

The logic here only allows for one discount to be applied, either the long-term or the short-term discount, not both. According to the task description, if the rental period qualifies for both discounts, both should be applied. Consider revising the logic to ensure both discounts are applied when applicable.

Copy link
Author

Choose a reason for hiding this comment

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

Failed tasks have been resolved

@paolomariano
Copy link
Author

Failed tasks have been resolved

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