Skip to content

London | 26-Java-June | Andrei Filippov | Sprint 4 | Rental Summary Service - #67

Open
Droid-An wants to merge 5 commits into
CodeYourFuture:mainfrom
Droid-An:sprint-4/backlog
Open

Droid-An wants to merge 5 commits into
CodeYourFuture:mainfrom
Droid-An:sprint-4/backlog

Conversation

@Droid-An

@Droid-An Droid-An commented Aug 4, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Implement Rental Summary Service following the developer guidance

Questions

  • Do we need to have two almost identical contract generators for different contract lengths? The only difference is amount of months and interest. Why not extract it as a universal generator, and pass years and interest as parameters?
  • When error occurs, the error message is printed somewhere in the end of the summary, rather than in place where it occurred (not in the middle, if something went wrong halfway the process).
    Is it possible to log error exactly when it's occurred, so error message doesn't interfere with the next output?

@Droid-An Droid-An added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 4, 2026
@lukedsouza99 lukedsouza99 self-assigned this Sep 4, 2026
@lukedsouza99
lukedsouza99 self-requested a review September 4, 2026 15:12
@lukedsouza99

Copy link
Copy Markdown

This is really good @Droid-An, nice job!

@lukedsouza99 lukedsouza99 added the Reviewed Volunteer to add when completing a review with trainee action still to take. label Sep 4, 2026
public RentalSummary(Contract contract) {
this.endDate = contract.getStartDate().plusYears(contract.getContractLengthYears());
if (contract.getContractLengthYears() == 1) {
OneYearContractRentalGenerator oneYearContractRentalGenerator = new OneYearContractRentalGenerator();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As you said in your question, yep the three year and one year contract rental generator could be a single class which takes in the time period of the contract, meaning it could be used for any number of years.

@Droid-An Droid-An added the 📅 Sprint 4 Assigned during Sprint 4 of this module label Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 4 Assigned during Sprint 4 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants