Skip to content

Commit

Permalink
chore: added logging of cell range
Browse files Browse the repository at this point in the history
  • Loading branch information
extern-maksim-kuzmin1 committed Feb 25, 2024
1 parent ac83d0e commit 8224c29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.whiskels.notifier.reporting.service.audit.AuditDataFetchResult;
import com.whiskels.notifier.reporting.service.customer.birthday.domain.CustomerBirthdayInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Nonnull;
import java.time.Clock;
Expand All @@ -20,6 +21,7 @@
import static java.util.Objects.nonNull;

@RequiredArgsConstructor
@Slf4j
public class CustomerBirthdayInfoFetchService implements DataFetchService<CustomerBirthdayInfo> {
private final Clock clock;
private final GoogleSheetsReader spreadsheetLoader;
Expand All @@ -34,6 +36,7 @@ public ReportData<CustomerBirthdayInfo> fetch() {
}

private List<CustomerBirthdayInfo> load() {
log.info("Reading {}", cellRange);
return spreadsheetLoader.read(spreadSheet, cellRange).stream()
.map(CustomerBirthdayInfoFetchService::mapFromExcelData)
.filter(customerBirthdayInfo -> nonNull(customerBirthdayInfo) && isSameMonth(customerBirthdayInfo.birthday(), now(clock)))
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ report:
parameters:
customer-birthday:
spreadsheet: ${CUSTOMER_BIRTHDAY_SPREADSHEET}
cell-range: ${CUSTOMER_BIRTHDAY_CELL_RANGE}
cell-range: Контакты!A2:L
customer-debt:
url: ${CUSTOMER_DEBT_JSON_URL}
customer-payment:
Expand Down

0 comments on commit 8224c29

Please sign in to comment.