diff --git a/Telegram/SourceFiles/data/data_bot_earn.h b/Telegram/SourceFiles/data/data_bot_earn.h new file mode 100644 index 000000000..e208ccf00 --- /dev/null +++ b/Telegram/SourceFiles/data/data_bot_earn.h @@ -0,0 +1,31 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +#include "data/data_statistics_chart.h" + +#include + +namespace Data { + +using BotEarnInt = uint64; + +struct BotEarnStatistics final { + explicit operator bool() const { + return !!usdRate; + } + Data::StatisticalGraph revenueGraph; + BotEarnInt currentBalance = 0; + BotEarnInt availableBalance = 0; + BotEarnInt overallRevenue = 0; + float64 usdRate = 0.; + bool isWithdrawalEnabled = false; + QDateTime nextWithdrawalAt; +}; + +} // namespace Data diff --git a/Telegram/SourceFiles/info/bot/earn/info_earn_inner_widget.h b/Telegram/SourceFiles/info/bot/earn/info_earn_inner_widget.h index b121b3dc0..f1d6d470c 100644 --- a/Telegram/SourceFiles/info/bot/earn/info_earn_inner_widget.h +++ b/Telegram/SourceFiles/info/bot/earn/info_earn_inner_widget.h @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include "data/data_channel_earn.h" +#include "data/data_bot_earn.h" #include "ui/widgets/scroll_area.h" #include "ui/wrap/vertical_layout.h" @@ -56,7 +56,7 @@ private: not_null _peer; std::shared_ptr _show; - Data::EarnStatistics _state; + Data::BotEarnStatistics _state; rpl::event_stream _scrollToRequests; rpl::event_stream _showRequests; diff --git a/Telegram/SourceFiles/info/bot/earn/info_earn_widget.h b/Telegram/SourceFiles/info/bot/earn/info_earn_widget.h index f66d8b39f..b201a32af 100644 --- a/Telegram/SourceFiles/info/bot/earn/info_earn_widget.h +++ b/Telegram/SourceFiles/info/bot/earn/info_earn_widget.h @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include "data/data_channel_earn.h" +#include "data/data_bot_earn.h" #include "info/info_content_widget.h" namespace Info::BotEarn { @@ -27,7 +27,7 @@ public: Section section() const override; - using SavedState = Data::EarnStatistics; + using SavedState = Data::BotEarnStatistics; void setState(SavedState states); [[nodiscard]] SavedState state(); diff --git a/Telegram/cmake/td_ui.cmake b/Telegram/cmake/td_ui.cmake index 2b69b2df7..ca5cb6003 100644 --- a/Telegram/cmake/td_ui.cmake +++ b/Telegram/cmake/td_ui.cmake @@ -80,6 +80,7 @@ PRIVATE data/data_birthday.cpp data/data_birthday.h + data/data_bot_earn.h data/data_channel_earn.h data/data_credits.h data/data_statistics_chart.cpp