feat: add GetAvailableWeeks query and update protobuf imports
All checks were successful
Build and Deploy / build (push) Successful in 2m18s

This commit is contained in:
masoodafar-web
2025-12-12 05:57:32 +03:30
parent ce3b5db822
commit fe56b8f139
80 changed files with 308 additions and 238 deletions

View File

@@ -105,6 +105,11 @@ service CommissionContract
get: "/GetWorkerExecutionLogs"
};
};
rpc GetAvailableWeeks(GetAvailableWeeksRequest) returns (GetAvailableWeeksResponse){
option (google.api.http) = {
get: "/GetAvailableWeeks"
};
};
rpc GetWithdrawalReports(GetWithdrawalReportsRequest) returns (GetWithdrawalReportsResponse){
option (google.api.http) = {
get: "/GetWithdrawalReports"
@@ -457,3 +462,32 @@ message WithdrawalSummary
int32 unique_users = 7;
float success_rate = 8; // Percentage (0-100)
}
// ============ GetAvailableWeeks ============
message GetAvailableWeeksRequest
{
int32 future_weeks_count = 1; // تعداد هفته‌های آینده (پیش‌فرض: 4)
int32 past_weeks_count = 2; // تعداد هفته‌های گذشته (پیش‌فرض: 12)
}
message GetAvailableWeeksResponse
{
WeekInfo current_week = 1;
repeated WeekInfo calculated_weeks = 2;
repeated WeekInfo pending_weeks = 3;
repeated WeekInfo future_weeks = 4;
}
message WeekInfo
{
string week_number = 1; // YYYY-Www format
google.protobuf.Timestamp start_date = 2;
google.protobuf.Timestamp end_date = 3;
bool is_calculated = 4;
google.protobuf.Timestamp calculated_at = 5;
string last_execution_status = 6;
int64 total_pool_amount = 7;
int32 eligible_users_count = 8;
string display_text = 9; // نمایش فارسی برای UI
}