ppapou commented on a change in pull request #770:
URL: https://github.com/apache/incubator-dlab/pull/770#discussion_r438503923
##########
File path:
services/self-service/src/main/java/com/epam/dlab/backendapi/util/BillingUtils.java
##########
@@ -182,25 +183,39 @@ public static String
getComputationalShape(UserComputationalResource resource) {
return list.stream();
}
+ /**
+ *
+ * @param sbn Service Base Name
+ * @param from formatted date, like 2020-04-07
+ * @param to formatted date, like 2020-05-07
+ * @return line, like:
+ * "Service base name: SERVICE_BASE_NAME. Available reporting period from:
2020-04-07 to: 2020-04-07"
+ */
public static String getFirstLine(String sbn, LocalDate from, LocalDate
to) {
return
CSVFormatter.formatLine(Lists.newArrayList(String.format(REPORT_FIRST_LINE, sbn,
Optional.ofNullable(from).map(date ->
date.format(DateTimeFormatter.ISO_DATE)).orElse(StringUtils.EMPTY),
Optional.ofNullable(to).map(date ->
date.format(DateTimeFormatter.ISO_DATE)).orElse(StringUtils.EMPTY))),
CSVFormatter.SEPARATOR, '\"');
}
- public static String getHeader(boolean isFull) {
- List<String> headers = new
ArrayList<>(Arrays.asList(BillingUtils.REPORT_HEADERS));
- if (!isFull) {
- headers.remove(1);
+ /**
+ * headerType there are two types of header according user role
+ * @return line, like DLab ID,User,Project,DLab Resource
Type,Status,Shape,Product,Cost
+ * in case of additional header type, the ENUM object will be propagated
from the Service Impl Class
+ */
+ public static String getHeader(boolean isReportHeaderCompletable) {
+ if (!isReportHeaderCompletable){
+ return CSVFormatter.formatLine(
+
Arrays.asList(BillingUtils.BILLING_FILTERED_REPORT_HEADERS),
CSVFormatter.SEPARATOR);
Review comment:
line has been adjusted
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]