mirror of
https://github.com/valitydev/anapi-v2.git
synced 2024-11-06 08:35:19 +00:00
Feedback edits
This commit is contained in:
parent
7d4e188a3c
commit
17c0be59d7
@ -57,11 +57,8 @@ public class ReportsApiDelegateService implements ReportsApiDelegate {
|
||||
String shopID, String paymentInstitutionRealm) {
|
||||
log.info("-> Req: xRequestID={}", xRequestID);
|
||||
checkDeadline(xRequestDeadline, xRequestID);
|
||||
if (shopID != null) {
|
||||
accessService.getAccessibleShops("CreateReport", partyID, List.of(shopID), paymentInstitutionRealm);
|
||||
} else {
|
||||
accessService.getAccessibleShops("CreateReport", partyID, paymentInstitutionRealm);
|
||||
}
|
||||
var shops = shopID != null ? List.of(shopID) : null;
|
||||
accessService.getAccessibleShops("CreateReport", partyID, shops, paymentInstitutionRealm);
|
||||
var request = getReportRequest(partyID, shopID, fromTime, toTime);
|
||||
var reportId = reporterService.createReport(request, reportType);
|
||||
var response = reporterService.getReport(reportId);
|
||||
@ -69,16 +66,6 @@ public class ReportsApiDelegateService implements ReportsApiDelegate {
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(response);
|
||||
}
|
||||
|
||||
private ReportRequest getReportRequest(String partyId, String shopId, OffsetDateTime fromTime,
|
||||
OffsetDateTime toTime) {
|
||||
return new ReportRequest()
|
||||
.setPartyId(partyId)
|
||||
.setShopId(shopId)
|
||||
.setTimeRange(new ReportTimeRange()
|
||||
.setFromTime(fromTime.toString())
|
||||
.setToTime(toTime.toString()));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('party:read')")
|
||||
@Override
|
||||
public ResponseEntity<ReportLink> downloadFile(String xRequestID, String partyID, Long reportID, String fileID,
|
||||
@ -130,6 +117,16 @@ public class ReportsApiDelegateService implements ReportsApiDelegate {
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
private ReportRequest getReportRequest(String partyId, String shopId, OffsetDateTime fromTime,
|
||||
OffsetDateTime toTime) {
|
||||
return new ReportRequest()
|
||||
.setPartyId(partyId)
|
||||
.setShopId(shopId)
|
||||
.setTimeRange(new ReportTimeRange()
|
||||
.setFromTime(fromTime.toString())
|
||||
.setToTime(toTime.toString()));
|
||||
}
|
||||
|
||||
private StatReportRequest getStatReportRequest(String partyId, String shopId, OffsetDateTime fromTime,
|
||||
OffsetDateTime toTime, Integer limit,
|
||||
List<String> reportTypes, String continuationToken) {
|
||||
|
Loading…
Reference in New Issue
Block a user