RED-7854 - UI stuck when selecting a future license
- return 0 values in all invalid cases
This commit is contained in:
parent
1144221f97
commit
f4e1d6de0a
@ -37,12 +37,13 @@ public class LicenseReportService {
|
||||
|
||||
public LicenseReport getLicenseReport(LicenseReportRequest licenseReportRequest) {
|
||||
|
||||
if (licenseReportRequest.getStartDate() == null || licenseReportRequest.getStartDate().isAfter(Instant.now())) {
|
||||
throw new BadRequestException("Invalid start date.");
|
||||
}
|
||||
|
||||
if (licenseReportRequest.getStartDate().isAfter(licenseReportRequest.getEndDate())) {
|
||||
throw new BadRequestException("Invalid date period: End date is before start date.");
|
||||
if (licenseReportRequest.getStartDate() == null ||
|
||||
licenseReportRequest.getStartDate().isAfter(Instant.now()) ||
|
||||
licenseReportRequest.getStartDate().isAfter(licenseReportRequest.getEndDate())) {
|
||||
return LicenseReport.builder()
|
||||
.startDate(licenseReportRequest.getStartDate())
|
||||
.endDate(licenseReportRequest.getEndDate())
|
||||
.build();
|
||||
}
|
||||
|
||||
var files = fileStatusService.getStatusesAddedBefore(OffsetDateTime.ofInstant(licenseReportRequest.getEndDate(), UTC_ZONE_ID));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user