feat: Add GetClubStatistics and GetNetworkStatistics APIs with corresponding request and response messages

This commit is contained in:
masoodafar-web
2025-12-01 16:43:53 +03:30
parent 199e7e99d1
commit 8d31a8c026
8 changed files with 533 additions and 9 deletions
@@ -45,6 +45,11 @@ service NetworkMembershipContract
get: "/NetworkMembership/GetHistory"
};
};
rpc GetNetworkStatistics(GetNetworkStatisticsRequest) returns (GetNetworkStatisticsResponse){
option (google.api.http) = {
get: "/NetworkMembership/GetStatistics"
};
};
}
// JoinNetwork Command
@@ -150,3 +155,46 @@ message NetworkMembershipHistoryModel
string reason = 11;
google.protobuf.Timestamp created = 12;
}
// GetNetworkStatistics Query
message GetNetworkStatisticsRequest
{
// Empty - returns overall network statistics
}
message GetNetworkStatisticsResponse
{
int32 total_members = 1;
int32 active_members = 2;
int32 left_leg_count = 3;
int32 right_leg_count = 4;
double left_percentage = 5;
double right_percentage = 6;
double average_depth = 7;
int32 max_depth = 8;
repeated LevelDistribution level_distribution = 9;
repeated MonthlyGrowth monthly_growth = 10;
repeated TopNetworkUser top_users = 11;
}
message LevelDistribution
{
int32 level = 1;
int32 count = 2;
}
message MonthlyGrowth
{
string month = 1; // Format: "2025-11" or Persian month name
int32 new_members = 2;
}
message TopNetworkUser
{
int32 rank = 1;
int64 user_id = 2;
string user_name = 3;
int32 total_children = 4;
int32 left_count = 5;
int32 right_count = 6;
}