Feature/update date finished integration (#895)

* Fixed issue with not updating the book finished date when updating read status
* Added ability to set a date finished after setting the book status to Read.

---------

Co-authored-by: Aditya Chandel <8075870+adityachandelgit@users.noreply.github.com>
This commit is contained in:
astrodad
2025-08-12 16:42:51 -04:00
committed by GitHub
parent ace5849afa
commit b4e95a3cc1
2 changed files with 4 additions and 1 deletions

View File

@@ -19,6 +19,6 @@ public class ReadProgressRequest {
@AssertTrue(message = "At least one progress field must be provided")
public boolean isProgressValid() {
return epubProgress != null || pdfProgress != null || cbxProgress != null;
return epubProgress != null || pdfProgress != null || cbxProgress != null || dateFinished != null;
}
}

View File

@@ -312,9 +312,12 @@ public class BookService {
userBookProgress.setCbxProgress(request.getCbxProgress().getPage());
userBookProgress.setCbxProgressPercent(request.getCbxProgress().getPercentage());
}
// Update dateFinished if provided
if (request.getDateFinished() != null) {
userBookProgress.setDateFinished(request.getDateFinished());
}
userBookProgressRepository.save(userBookProgress);
}