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

TMI2-391 Spotlight submission endpoints for count and last submission date #71

Merged
merged 9 commits into from
Nov 22, 2023

Conversation

rachelswart
Copy link
Contributor

No description provided.

iaincooper-tco
iaincooper-tco previously approved these changes Nov 14, 2023
# Conflicts:
#	src/main/java/gov/cabinetoffice/gap/adminbackend/controllers/SpotlightSubmissionController.java
#	src/main/java/gov/cabinetoffice/gap/adminbackend/entities/SpotlightSubmission.java
#	src/main/java/gov/cabinetoffice/gap/adminbackend/repositories/SpotlightSubmissionRepository.java
#	src/main/java/gov/cabinetoffice/gap/adminbackend/services/SpotlightSubmissionService.java
#	src/test/java/gov/cabinetoffice/gap/adminbackend/controllers/SpotlightSubmissionControllerTest.java
#	src/test/java/gov/cabinetoffice/gap/adminbackend/services/SpotlightSubmissionServiceTest.java
# Conflicts:
#	src/main/java/gov/cabinetoffice/gap/adminbackend/controllers/SpotlightSubmissionController.java
#	src/main/java/gov/cabinetoffice/gap/adminbackend/services/SpotlightSubmissionService.java
#	src/test/java/gov/cabinetoffice/gap/adminbackend/controllers/SpotlightSubmissionControllerTest.java
#	src/test/java/gov/cabinetoffice/gap/adminbackend/services/SpotlightSubmissionServiceTest.java
final List<SpotlightSubmission> spotlightSubmissions = getSubmissionsByBySchemeIdAndStatus(schemeId, status);
return spotlightSubmissions.stream().map(SpotlightSubmission::getLastSendAttempt).max(Instant::compareTo)
.map(date -> date.atZone(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern("dd MMMM yyyy")))
.orElse(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this null handled/expected behaviour? if not it may be better to throw a custom exception here and handle appropriately. What do you think?

dylanwrightCO
dylanwrightCO previously approved these changes Nov 22, 2023
@rachelswart rachelswart merged commit 35c8f97 into develop Nov 22, 2023
1 check passed
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