Skip to content

Commit 410faed

Browse files
add transaction report api to wallet server
1 parent 60e6d10 commit 410faed

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

protos/platform_management/wallet_server.proto

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ service Wallet {
2525
rpc SubscribeStoragePlan(SubscribeStoragePlanRequest) returns (SubscribeStoragePlanResponse);
2626
rpc UpgradeStoragePlan(UpgradeStoragePlanRequest) returns (UpgradeStoragePlanResponse);
2727
rpc RenewStoragePlan(RenewStoragePlanRequest) returns (RenewStoragePlanResponse);
28+
rpc GetTransactionCounts(GetTransactionCountsRequest) returns (GetTransactionCountsResponse);
2829
}
2930

3031

@@ -94,6 +95,13 @@ enum TransactionStatus {
9495
SUCCESSFUL = 2;
9596
FAILED = 3;
9697
}
98+
99+
enum GroupByPeriod {
100+
DAY = 0;
101+
WEEK = 1;
102+
MONTH = 2;
103+
}
104+
97105
message Transaction {
98106
uint64 amount = 1; // in Rials ﷼
99107
google.protobuf.Timestamp created_at = 2; // UTC
@@ -244,3 +252,20 @@ message RenewStoragePlanRequest {
244252
message RenewStoragePlanResponse {
245253
UserStoragePlan user_storage_plan = 1;
246254
}
255+
256+
message GetTransactionCountsRequest {
257+
google.protobuf.Timestamp start_date = 1;
258+
google.protobuf.Timestamp end_date = 2;
259+
GroupByPeriod group_by = 3;
260+
optional TransactionStatus status_filter = 4;
261+
optional TransactionKind kind_filter = 5;
262+
}
263+
264+
message TransactionCountData {
265+
string period = 1; // Date string representing the period (e.g., "2024-01-15", "2024-W03", "2024-01")
266+
uint64 count = 2;
267+
}
268+
269+
message GetTransactionCountsResponse {
270+
repeated TransactionCountData counts = 1;
271+
}

0 commit comments

Comments
 (0)