Skip to content

Conversation

@github-classroom
Copy link

@github-classroom github-classroom bot commented Oct 6, 2025

👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.
In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.
Click the Files changed or Commits tab to see all of the changes pushed to the default branch since the assignment started. Your teacher can see this too.

Notes for teachers

Use this PR to leave feedback. Here are some tips:

  • Click the Files changed tab to see all of the changes pushed to the default branch since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.
  • Click the Commits tab to see the commits pushed to the default branch. Click a commit to see specific changes.
  • If you turned on autograding, then click the Checks tab to see the results.
  • This page is an overview. It shows commits, line comments, and general comments. You can leave a general comment below.
    For more information about this pull request, read “Leaving assignment feedback in GitHub”.

Subscribed: @mattiasbarth

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

🤖 AI Feedback

🕒 Posted on 2025-10-20T12:16:03.603Z

Overall Feedback

Great job! The WarehouseAnalyzer implementation meets all test requirements and handles complex business logic correctly. The solution is comprehensive and well-structured for advanced features.

What's Working Well

  1. Precise Discount Calculations:
    Discount logic for perishables (calculateExpirationBasedDiscounts) exactly matches test expectations, using ChronoUnit.DAYS.between() and tiered percentages (50%/30%/15%).

  2. Optimal Shipping Grouping:
    optimizeShippingGroups implements first-fit-decreasing correctly, ensuring all items fit within weight constraints while minimizing groups.

  3. Statistical Methods:
    Outlier detection (findPriceOutliers) and weighted averages (calculateWeightedAveragePriceByCategory) use correct population statistics with RoundingMode.HALF_UP.

Areas for Improvement

  1. Shipping Group Weight Handling:
    In ShippingGroup, totalWeight uses reduce(0.0, Double::sum) directly. For safety, handle potential null weights explicitly:

    this.totalWeight = products.stream().mapToDouble(p -> p.weight() != null ? p.weight() : 0.0).sum();  
  2. Expire Date Check Edge Case:
    findProductsExpiringWithinDays checks exp.isBefore(today) && !exp.isAfter(end), but "today" should be included. Fix comparisons:

    exp.isAfter(today) && exp.compareTo(end) <= 0  
  3. Collections Immutability:
    getProducts() in Warehouse returns a modifiable list. Implement return Collections.unmodifiableList(products) to enforce immutability.

Summary

Your implementation excels in edge case handling and algorithm optimality. The single most important takeaway: always validate edge cases in date/time logic (e.g., include today's date in intervals).


Previous Feedback

🕒 Posted on 2025-10-06T13:19:12.805Z

Overall Feedback

Excellent work! Your WarehouseAnalyzer implementation is comprehensive and handles all the advanced requirements correctly. The code is well-structured, follows Java conventions, and demonstrates a solid understanding of the business logic and algorithmic requirements. All the methods are properly implemented with appropriate data structures, error handling, and mathematical calculations.

LGTM!


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