Skip to content

[report]: add daily report#2

Open
vkopitsa wants to merge 1 commit into
masterfrom
schedule-report
Open

[report]: add daily report#2
vkopitsa wants to merge 1 commit into
masterfrom
schedule-report

Conversation

@vkopitsa
Copy link
Copy Markdown
Owner

No description provided.

@vkopitsa vkopitsa force-pushed the schedule-report branch 6 times, most recently from 287accd to 5226297 Compare August 13, 2023 18:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a daily report feature to the Monobank Telegram bot that automatically generates and sends daily transaction statistics at scheduled times.

  • Refactoring Monobank API client code with shared rate limiter and extracted common functionality
  • Implementing scheduled daily reports with transaction filtering and summarization
  • Adding new file serialization utilities for data persistence

Reviewed Changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
schedule_report_data.go Implements daily report data structure and transaction processing logic
schedule_report.go Provides cron-based scheduling functionality for automated reports
mono.go Extracts Monobank API operations with centralized rate limiting
template.go Adds template for daily report messages
tools.go Adds file serialization utilities and removes timezone dependency
client.go Refactors to use shared Mono API client and removes rate limiting
bot.go Integrates daily report functionality and extracts message sending utility
app.go Initializes and starts scheduled reporting feature
Comments suppressed due to low confidence (1)

schedule_report_data.go:1

  • The expected timestamp 1703462400 for 'This week' test case appears incorrect. Based on the mocked time (Unix 1672531300 = Jan 1, 2023), the start of that week should be around 1672185600 (Dec 26, 2022), not 1703462400 (Dec 25, 2023).
package main

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread schedule_report_data.go
return citem.CurrencyCodeA == item.CurrencyCode && citem.CurrencyCodeB == 980
})
if ok {
return -item.Amount * (currency.CurrencyCodeA * 100)
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

The calculation appears incorrect. currency.CurrencyCodeA represents a currency code (like 840 for USD), not an exchange rate. This should likely use currency.RateCross or another rate field.

Suggested change
return -item.Amount * (currency.CurrencyCodeA * 100)
return int(float64(-item.Amount) * currency.RateCross)

Copilot uses AI. Check for mistakes.
Comment thread schedule_report.go

taskr := tasker.New(tasker.Option{
Verbose: true,
Tz: "Europe/Kyiv",
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

The timezone should be 'Europe/Kiev' to match the IANA timezone database format, not 'Europe/Kyiv'.

Suggested change
Tz: "Europe/Kyiv",
Tz: "Europe/Kiev",

Copilot uses AI. Check for mistakes.
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.

2 participants