feat(club-membership): enhance club membership history queries and responses
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 17m54s

- Added filtering capabilities to GetClubMembershipHistoryQuery, allowing optional filters for UserId, ClubMembershipId, Action, and date range.
- Updated GetClubMembershipHistoryQueryHandler to utilize the new filter structure.
- Enhanced GetAllClubMembershipsQueryHandler to include LastPackage details in the response.
- Introduced new properties in GetAllClubMembershipsResponseModel for PackageId and PackageName.
- Updated Protobuf definitions to reflect changes in club membership history queries and responses.
- Refactored mapping configurations to accommodate new DTOs and filters.
This commit is contained in:
masoodafar-web
2026-06-22 22:19:44 +03:30
parent 6395f63ab5
commit f8794bbb63
41 changed files with 1590 additions and 74 deletions
@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.200</Version>
<Version>0.0.201</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -74,6 +74,11 @@
<Protobuf Include="Protos\sitepagesettings.proto" ProtoRoot="Protos\" GrpcServices="Both" />
<!-- Image Resolver Service -->
<Protobuf Include="Protos\imageresolver.proto" ProtoRoot="Protos\" GrpcServices="Both" />
<!-- Admin Report APIs -->
<Protobuf Include="Protos\paymenttransaction.proto" ProtoRoot="Protos\" GrpcServices="Both" />
<Protobuf Include="Protos\userpackagepurchase.proto" ProtoRoot="Protos\" GrpcServices="Both" />
<Protobuf Include="Protos\clubmembershipcycle.proto" ProtoRoot="Protos\" GrpcServices="Both" />
<Protobuf Include="Protos\clubmembershipcyclehistory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
</ItemGroup>
<Target Name="PushToFoursatNuget" AfterTargets="Pack" Condition="'$(CI)' != 'true'">
@@ -164,11 +164,19 @@ message ClubMembershipModel
// GetHistory Query
message GetClubMembershipHistoryRequest
{
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
GetClubMembershipHistoryFilter filter = 3;
}
message GetClubMembershipHistoryFilter
{
google.protobuf.Int64Value user_id = 1;
google.protobuf.Int64Value package_id = 2;
int32 page_index = 3;
int32 page_size = 4;
google.protobuf.Int64Value club_membership_id = 2;
google.protobuf.Int32Value action = 3;
google.protobuf.Timestamp created_from = 4;
google.protobuf.Timestamp created_to = 5;
}
message GetClubMembershipHistoryResponse
@@ -182,16 +190,15 @@ message ClubMembershipHistoryModel
int64 id = 1;
int64 club_membership_id = 2;
int64 user_id = 3;
google.protobuf.Int64Value old_package_id = 4;
google.protobuf.Int64Value new_package_id = 5;
google.protobuf.Timestamp old_activated_at = 6;
google.protobuf.Timestamp new_activated_at = 7;
google.protobuf.Timestamp old_expires_at = 8;
google.protobuf.Timestamp new_expires_at = 9;
int32 action = 10; // ClubMembershipAction enum
string performed_by = 11;
string reason = 12;
google.protobuf.Timestamp created = 13;
string user_name = 4;
bool old_is_active = 5;
bool new_is_active = 6;
google.protobuf.Int64Value old_initial_contribution = 7;
google.protobuf.Int64Value new_initial_contribution = 8;
int32 action = 9; // ClubMembershipAction enum
string performed_by = 10;
string reason = 11;
google.protobuf.Timestamp created_at = 12;
}
// GetClubStatistics Query
@@ -0,0 +1,79 @@
syntax = "proto3";
package clubmembershipcycle;
import "public_messages.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.ClubMembershipCycle";
service ClubMembershipCycleContract
{
rpc GetAllClubMembershipCycleByFilter(GetAllClubMembershipCycleByFilterRequest) returns (GetAllClubMembershipCycleByFilterResponse){
option (google.api.http) = {
get: "/ClubMembershipCycle/GetAllByFilter"
};
};
rpc GetClubMembershipCycleSummary(GetClubMembershipCycleSummaryRequest) returns (GetClubMembershipCycleSummaryResponse){
option (google.api.http) = {
get: "/ClubMembershipCycle/GetSummary"
};
};
}
message GetAllClubMembershipCycleByFilterRequest
{
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
GetAllClubMembershipCycleByFilterFilter filter = 3;
}
message GetAllClubMembershipCycleByFilterFilter
{
google.protobuf.Int64Value user_id = 1;
google.protobuf.BoolValue is_current_cycle = 2;
google.protobuf.Int64Value package_id = 3;
google.protobuf.Int32Value cycle_number = 4;
google.protobuf.Int32Value purchase_method = 5;
google.protobuf.Int32Value magic_state = 6; // 0=none, 1=active, 2=completed
google.protobuf.Timestamp package_purchased_from = 7;
google.protobuf.Timestamp package_purchased_to = 8;
}
message GetAllClubMembershipCycleByFilterResponse
{
messages.MetaData meta_data = 1;
repeated ClubMembershipCycleModel models = 2;
}
message ClubMembershipCycleModel
{
int64 id = 1;
int64 user_id = 2;
string user_name = 3;
int64 club_membership_id = 4;
int32 cycle_number = 5;
int64 package_id = 6;
string package_name = 7;
int64 package_amount = 8;
int32 purchase_method = 9;
google.protobuf.Timestamp package_purchased_at = 10;
google.protobuf.Timestamp magic_started_at = 11;
google.protobuf.Timestamp magic_completed_at = 12;
bool is_current_cycle = 13;
google.protobuf.Timestamp created_at = 14;
}
message GetClubMembershipCycleSummaryRequest
{
GetAllClubMembershipCycleByFilterFilter filter = 1;
}
message GetClubMembershipCycleSummaryResponse
{
int64 total_count = 1;
int64 current_cycle_count = 2;
int64 magic_active_count = 3;
}
@@ -0,0 +1,61 @@
syntax = "proto3";
package clubmembershipcyclehistory;
import "public_messages.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.ClubMembershipCycleHistory";
service ClubMembershipCycleHistoryContract
{
rpc GetAllClubMembershipCycleHistoryByFilter(GetAllClubMembershipCycleHistoryByFilterRequest) returns (GetAllClubMembershipCycleHistoryByFilterResponse){
option (google.api.http) = {
get: "/ClubMembershipCycleHistory/GetAllByFilter"
};
};
}
message GetAllClubMembershipCycleHistoryByFilterRequest
{
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
GetAllClubMembershipCycleHistoryByFilterFilter filter = 3;
}
message GetAllClubMembershipCycleHistoryByFilterFilter
{
google.protobuf.Int64Value user_id = 1;
google.protobuf.Int64Value club_membership_cycle_id = 2;
google.protobuf.Int32Value cycle_number = 3;
google.protobuf.Int32Value action = 4;
google.protobuf.Timestamp created_from = 5;
google.protobuf.Timestamp created_to = 6;
}
message GetAllClubMembershipCycleHistoryByFilterResponse
{
messages.MetaData meta_data = 1;
repeated ClubMembershipCycleHistoryModel models = 2;
}
message ClubMembershipCycleHistoryModel
{
int64 id = 1;
int64 club_membership_cycle_id = 2;
int64 user_id = 3;
string user_name = 4;
int32 cycle_number = 5;
bool old_is_current_cycle = 6;
bool new_is_current_cycle = 7;
google.protobuf.Timestamp old_magic_started_at = 8;
google.protobuf.Timestamp new_magic_started_at = 9;
google.protobuf.Timestamp old_magic_completed_at = 10;
google.protobuf.Timestamp new_magic_completed_at = 11;
int32 action = 12;
string performed_by = 13;
string reason = 14;
google.protobuf.Timestamp created_at = 15;
}
@@ -0,0 +1,82 @@
syntax = "proto3";
package paymenttransaction;
import "public_messages.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.PaymentTransaction";
service PaymentTransactionContract
{
rpc GetAllPaymentTransactionByFilter(GetAllPaymentTransactionByFilterRequest) returns (GetAllPaymentTransactionByFilterResponse){
option (google.api.http) = {
get: "/PaymentTransaction/GetAllByFilter"
};
};
rpc GetPaymentTransactionSummary(GetPaymentTransactionSummaryRequest) returns (GetPaymentTransactionSummaryResponse){
option (google.api.http) = {
get: "/PaymentTransaction/GetSummary"
};
};
}
message GetAllPaymentTransactionByFilterRequest
{
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
GetAllPaymentTransactionByFilterFilter filter = 3;
}
message GetAllPaymentTransactionByFilterFilter
{
google.protobuf.Int64Value user_id = 1;
google.protobuf.StringValue mobile = 2;
google.protobuf.StringValue gateway_provider = 3;
google.protobuf.BoolValue payment_status = 4;
google.protobuf.StringValue authority = 5;
google.protobuf.StringValue ref_id = 6;
google.protobuf.StringValue order_id = 7;
google.protobuf.Timestamp created_from = 8;
google.protobuf.Timestamp created_to = 9;
}
message GetAllPaymentTransactionByFilterResponse
{
messages.MetaData meta_data = 1;
repeated PaymentTransactionModel models = 2;
}
message PaymentTransactionModel
{
int64 id = 1;
int64 user_id = 2;
string mobile = 3;
string gateway_provider = 4;
int64 amount = 5;
string authority = 6;
bool payment_status = 7;
google.protobuf.Int32Value verification_status_code = 8;
string verification_status_message = 9;
string ref_id = 10;
string card_pan = 11;
string order_id = 12;
google.protobuf.Int64Value transaction_id = 13;
string description = 14;
google.protobuf.Timestamp created_at = 15;
}
message GetPaymentTransactionSummaryRequest
{
GetAllPaymentTransactionByFilterFilter filter = 1;
}
message GetPaymentTransactionSummaryResponse
{
int64 total_count = 1;
int64 total_amount = 2;
int64 successful_count = 3;
int64 pending_count = 4;
}
@@ -0,0 +1,75 @@
syntax = "proto3";
package userpackagepurchase;
import "public_messages.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.UserPackagePurchase";
service UserPackagePurchaseContract
{
rpc GetAllUserPackagePurchaseByFilter(GetAllUserPackagePurchaseByFilterRequest) returns (GetAllUserPackagePurchaseByFilterResponse){
option (google.api.http) = {
get: "/UserPackagePurchase/GetAllByFilter"
};
};
rpc GetUserPackagePurchaseSummary(GetUserPackagePurchaseSummaryRequest) returns (GetUserPackagePurchaseSummaryResponse){
option (google.api.http) = {
get: "/UserPackagePurchase/GetSummary"
};
};
}
message GetAllUserPackagePurchaseByFilterRequest
{
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
GetAllUserPackagePurchaseByFilterFilter filter = 3;
}
message GetAllUserPackagePurchaseByFilterFilter
{
google.protobuf.Int64Value user_id = 1;
google.protobuf.Int64Value package_id = 2;
google.protobuf.Int32Value purchase_method = 3;
google.protobuf.Timestamp purchased_from = 4;
google.protobuf.Timestamp purchased_to = 5;
google.protobuf.Int64Value min_amount = 6;
google.protobuf.Int64Value max_amount = 7;
}
message GetAllUserPackagePurchaseByFilterResponse
{
messages.MetaData meta_data = 1;
repeated UserPackagePurchaseModel models = 2;
}
message UserPackagePurchaseModel
{
int64 id = 1;
int64 user_id = 2;
string user_name = 3;
string user_mobile = 4;
int64 package_id = 5;
string package_name = 6;
int32 purchase_method = 7;
google.protobuf.Timestamp purchased_at = 8;
int64 amount = 9;
google.protobuf.Int64Value order_id = 10;
google.protobuf.Int64Value transaction_id = 11;
google.protobuf.Timestamp created_at = 12;
}
message GetUserPackagePurchaseSummaryRequest
{
GetAllUserPackagePurchaseByFilterFilter filter = 1;
}
message GetUserPackagePurchaseSummaryResponse
{
int64 total_count = 1;
int64 total_amount = 2;
}