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

View File

@@ -45,6 +45,11 @@ service ClubMembershipContract
get: "/ClubMembership/GetHistory"
};
};
rpc GetClubStatistics(GetClubStatisticsRequest) returns (GetClubStatisticsResponse){
option (google.api.http) = {
get: "/ClubMembership/GetStatistics"
};
};
}
// Activate Command
@@ -164,3 +169,39 @@ message ClubMembershipHistoryModel
string reason = 12;
google.protobuf.Timestamp created = 13;
}
// GetClubStatistics Query
message GetClubStatisticsRequest
{
// Empty - returns overall club statistics
}
message GetClubStatisticsResponse
{
int32 total_members = 1;
int32 active_members = 2;
int32 inactive_members = 3;
int32 expired_members = 4;
double active_percentage = 5;
repeated PackageLevelDistribution package_distribution = 6;
repeated MonthlyMembershipTrend monthly_trend = 7;
int64 total_revenue = 8;
double average_membership_duration_days = 9;
int32 expiring_soon_count = 10; // Expiring in next 30 days
}
message PackageLevelDistribution
{
int64 package_id = 1;
string package_name = 2;
int32 member_count = 3;
double percentage = 4;
}
message MonthlyMembershipTrend
{
string month = 1; // Format: "2025-11"
int32 activations = 2;
int32 expirations = 3;
int32 net_change = 4;
}