feat(commission): add per-package filtering to commission & balance queries

- Proto: add package_id filter to 4 request messages, package_id/package_title to 4 response models
- Queries: add PackageId filter to GetUserWeeklyBalances, GetUserCommissionPayouts, GetMyCommissionPayouts, GetMyWeeklyBalances
- Handlers: include Package navigation, filter by PackageId, map PackageId/PackageTitle
- DTOs: add PackageId + PackageTitle to all response models
- Mappings: update CommissionProfile with PackageId/PackageTitle for all admin+customer mappings
- NuGet: bump proto version to 0.0.187
This commit is contained in:
masoodafar-web
2026-02-26 21:07:59 +03:30
parent 7554d7054a
commit aaaf7fc1ca
14 changed files with 89 additions and 8 deletions
@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.186</Version>
<Version>0.0.187</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -217,6 +217,7 @@ message GetUserCommissionPayoutsRequest
google.protobuf.Int64Value user_id = 1;
google.protobuf.Int32Value status = 2; // CommissionPayoutStatus enum
google.protobuf.Int64Value week_definition_id = 3; // Preferred filter
google.protobuf.Int64Value package_id = 4; // فیلتر بر اساس پکیج
int32 page_index = 5;
int32 page_size = 6;
}
@@ -244,6 +245,8 @@ message UserCommissionPayoutModel
string iban_number = 13;
google.protobuf.Timestamp withdrawn_at = 14;
google.protobuf.Timestamp created = 15;
int64 package_id = 16; // شناسه پکیج
string package_title = 17; // نام پکیج
}
// GetCommissionPayoutHistory Query
@@ -314,6 +317,7 @@ message GetUserWeeklyBalancesRequest
{
google.protobuf.Int64Value user_id = 1;
google.protobuf.Int64Value week_definition_id = 2; // Preferred filter
google.protobuf.Int64Value package_id = 3; // فیلتر بر اساس پکیج
bool only_active = 4; // Only non-expired balances
int32 page_index = 5;
int32 page_size = 6;
@@ -343,6 +347,8 @@ message UserWeeklyBalanceModel
google.protobuf.Timestamp calculated_at = 14;
bool is_expired = 15;
google.protobuf.Timestamp created = 16;
int64 package_id = 17; // شناسه پکیج
string package_title = 18; // نام پکیج
}
// GetAllWeeklyPools Query
@@ -598,6 +604,7 @@ message GetMyCommissionPayoutsRequest
int32 page_size = 2;
google.protobuf.Int64Value week_definition_id = 3;
google.protobuf.Int32Value status = 4; // 0=Pending, 1=Calculated, 2=Paid, 3=Withdrawn
google.protobuf.Int64Value package_id = 5; // فیلتر بر اساس پکیج
}
message GetMyCommissionPayoutsResponse
@@ -622,6 +629,8 @@ message CustomerCommissionPayoutModel
int32 status = 7; // 0=Pending, 1=Paid, 2=WithdrawRequested, 3=Withdrawn, 4=PaymentFailed, 5=Cancelled
google.protobuf.Timestamp calculated_date = 8;
string date_persian = 9;
int64 package_id = 10; // شناسه پکیج
string package_title = 11; // نام پکیج
}
// GetMyWeeklyBalances - for frontend customer display
@@ -631,6 +640,7 @@ message GetMyWeeklyBalancesRequest
int32 page_size = 2;
google.protobuf.Int64Value week_definition_id = 3;
bool only_active = 4;
google.protobuf.Int64Value package_id = 5; // فیلتر بر اساس پکیج
}
message GetMyWeeklyBalancesResponse
@@ -658,4 +668,6 @@ message CustomerWeeklyBalanceModel
int32 right_leg_carryover = 12;
int32 left_leg_new_members = 13;
int32 right_leg_new_members = 14;
int64 package_id = 15; // شناسه پکیج
string package_title = 16; // نام پکیج
}