feat: add GetWeekDefinitions RPC and corresponding query handler for week retrieval

This commit is contained in:
masoodafar-web
2025-12-20 03:30:22 +03:30
parent 0cca79ebfe
commit 565a9605dc
37 changed files with 321 additions and 69 deletions
@@ -3,7 +3,7 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.13</Version>
<Version>0.0.14</Version>
<PackageId>Foursat.FrontOffice.BFF.Category.Protobuf</PackageId>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<DebugSymbols>False</DebugSymbols>
@@ -3,7 +3,7 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.1</Version>
<Version>0.0.2</Version>
<PackageId>Foursat.FrontOffice.BFF.City.Protobuf</PackageId>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<DebugSymbols>False</DebugSymbols>
@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.3</Version>
<Version>0.0.4</Version>
<PackageId>Foursat.FrontOffice.BFF.ClubMembership.Protobuf</PackageId>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<DebugSymbols>False</DebugSymbols>
@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.2</Version>
<Version>0.0.3</Version>
<PackageId>Foursat.FrontOffice.BFF.Commission.Protobuf</PackageId>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<DebugSymbols>False</DebugSymbols>
@@ -25,6 +25,13 @@ service CommissionContract
get: "/Commission/MyWeeklyBalances"
};
};
// دریافت لیست هفته‌ها برای dropdown
rpc GetWeekDefinitions(GetWeekDefinitionsRequest) returns (GetWeekDefinitionsResponse){
option (google.api.http) = {
get: "/Commission/WeekDefinitions"
};
};
}
// ============ MetaData ============
@@ -38,7 +45,7 @@ message GetMyCommissionPayoutsRequest
{
int32 page_number = 1;
int32 page_size = 2;
google.protobuf.StringValue week_number = 3;
google.protobuf.Int64Value week_definition_id = 3;
google.protobuf.Int32Value status = 4; // 0=Pending, 1=Calculated, 2=Paid, 3=Withdrawn
}
@@ -51,8 +58,8 @@ message GetMyCommissionPayoutsResponse
message CommissionPayoutModel
{
int64 id = 1;
string week_number = 2;
string week_label = 3;
int64 week_definition_id = 2;
string week_display_name = 3;
int32 balances_earned = 4;
int64 total_amount = 5;
string amount_formatted = 6;
@@ -67,7 +74,7 @@ message GetMyWeeklyBalancesRequest
{
int32 page_number = 1;
int32 page_size = 2;
google.protobuf.StringValue week_number = 3;
google.protobuf.Int64Value week_definition_id = 3;
bool only_active = 4;
}
@@ -83,12 +90,51 @@ message GetMyWeeklyBalancesResponse
message WeeklyBalanceModel
{
int64 id = 1;
string week_number = 2;
int32 left_leg_balances = 3;
int32 right_leg_balances = 4;
int32 total_balances = 5;
int64 weekly_pool_contribution = 6;
bool is_expired = 7;
google.protobuf.Timestamp calculated_at = 8;
string date_persian = 9;
int64 week_definition_id = 2;
string week_display_name = 3;
int32 left_leg_balances = 4;
int32 right_leg_balances = 5;
int32 total_balances = 6;
int64 weekly_pool_contribution = 7;
bool is_expired = 8;
google.protobuf.Timestamp calculated_at = 9;
string date_persian = 10;
}
// ============ GetWeekDefinitions ============
message GetWeekDefinitionsRequest
{
//جستجوی متنی روی DisplayName
google.protobuf.StringValue search_text = 1;
//شماره صفحه
int32 page_number = 2;
//تعداد در صفحه
int32 page_size = 3;
//سال میلادی
google.protobuf.Int32Value gregorian_year = 4;
//سال شمسی
google.protobuf.Int32Value persian_year = 5;
//فقط هفته‌های فعال
google.protobuf.BoolValue is_active = 6;
}
message GetWeekDefinitionsResponse
{
repeated WeekDefinitionModel data = 1;
int32 total_count = 2;
}
message WeekDefinitionModel
{
int64 id = 1;
int32 week_order = 2;
string display_name = 3;
google.protobuf.Timestamp start_date = 4;
google.protobuf.Timestamp end_date = 5;
int32 gregorian_year = 6;
int32 persian_year = 7;
bool is_active = 8;
bool is_current_week = 9;
string start_date_persian = 10;
string end_date_persian = 11;
}
@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.1</Version>
<Version>0.0.2</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.2</Version>
<Version>0.0.3</Version>
<PackageId>Foursat.FrontOffice.BFF.DiscountShop.Protobuf</PackageId>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<DebugSymbols>False</DebugSymbols>
@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.2</Version>
<Version>0.0.4</Version>
<PackageId>Foursat.FrontOffice.BFF.NetworkMembership.Protobuf</PackageId>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<DebugSymbols>False</DebugSymbols>
@@ -75,7 +75,7 @@ message NetworkNodeModel
bool is_active = 10;
google.protobuf.Timestamp joined_at = 11;
bool is_club_active = 12;
google.protobuf.StringValue activation_week_number = 13;
google.protobuf.Int64Value activation_week_definition_id = 13;
}
// ============ GetMyNetworkStatistics ============
@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.113</Version>
<Version>0.0.114</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -3,7 +3,7 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.17</Version>
<Version>0.0.18</Version>
<PackageId>Foursat.FrontOffice.BFF.Products.Protobuf</PackageId>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<DebugSymbols>False</DebugSymbols>
@@ -3,7 +3,7 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.16</Version>
<Version>0.0.17</Version>
<PackageId>Foursat.FrontOffice.BFF.ShopingCart.Protobuf</PackageId>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<DebugSymbols>False</DebugSymbols>
@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.112</Version>
<Version>0.0.113</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.117</Version>
<Version>0.0.118</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.115</Version>
<Version>0.0.116</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.115</Version>
<Version>0.0.116</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -3,7 +3,7 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.15</Version>
<Version>0.0.16</Version>
<PackageId>Foursat.FrontOffice.BFF.UserWallet.Protobuf</PackageId>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<DebugSymbols>False</DebugSymbols>
@@ -95,12 +95,13 @@ message GetUserWithdrawalsResponse
message UserWithdrawalModel
{
int64 id = 1;
string week_number = 2;
int64 total_amount = 3;
int32 status = 4;
google.protobuf.Int32Value withdrawal_method = 5;
string iban_number = 6;
google.protobuf.Timestamp created = 7;
int64 week_definition_id = 2;
string week_display_name = 3;
int64 total_amount = 4;
int32 status = 5;
google.protobuf.Int32Value withdrawal_method = 6;
string iban_number = 7;
google.protobuf.Timestamp created = 8;
}
message GetWithdrawalSettingsResponse