mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Added initial structure for bot earn data.
This commit is contained in:
parent
71893f4ef7
commit
c5ba0fa705
4 changed files with 36 additions and 4 deletions
31
Telegram/SourceFiles/data/data_bot_earn.h
Normal file
31
Telegram/SourceFiles/data/data_bot_earn.h
Normal file
|
@ -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 <QtCore/QDateTime>
|
||||
|
||||
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
|
|
@ -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<PeerData*> _peer;
|
||||
std::shared_ptr<Ui::Show> _show;
|
||||
|
||||
Data::EarnStatistics _state;
|
||||
Data::BotEarnStatistics _state;
|
||||
|
||||
rpl::event_stream<Ui::ScrollToRequest> _scrollToRequests;
|
||||
rpl::event_stream<ShowRequest> _showRequests;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue