2025-11-30 23:39:31 +03:30
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
|
|
package clubmembership;
|
|
|
|
|
|
|
|
|
|
import "public_messages.proto";
|
|
|
|
|
import "google/protobuf/empty.proto";
|
|
|
|
|
import "google/protobuf/wrappers.proto";
|
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
|
|
|
|
|
|
option csharp_namespace = "BackOffice.BFF.ClubMembership.Protobuf";
|
|
|
|
|
|
|
|
|
|
service ClubMembershipContract
|
|
|
|
|
{
|
|
|
|
|
rpc ActivateClubMembership(ActivateClubMembershipRequest) returns (google.protobuf.Empty);
|
|
|
|
|
rpc DeactivateClubMembership(DeactivateClubMembershipRequest) returns (google.protobuf.Empty);
|
|
|
|
|
rpc AssignFeatureToMembership(AssignFeatureToMembershipRequest) returns (google.protobuf.Empty);
|
|
|
|
|
rpc GetClubMembership(GetClubMembershipRequest) returns (GetClubMembershipResponse);
|
|
|
|
|
rpc GetAllClubMemberships(GetAllClubMembershipsRequest) returns (GetAllClubMembershipsResponse);
|
|
|
|
|
rpc GetClubMembershipHistory(GetClubMembershipHistoryRequest) returns (GetClubMembershipHistoryResponse);
|
2025-12-02 03:32:26 +03:30
|
|
|
rpc GetClubStatistics(GetClubStatisticsRequest) returns (GetClubStatisticsResponse);
|
2025-11-30 23:39:31 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Activate Command
|
|
|
|
|
message ActivateClubMembershipRequest
|
|
|
|
|
{
|
|
|
|
|
int64 user_id = 1;
|
|
|
|
|
int64 package_id = 2;
|
|
|
|
|
google.protobuf.StringValue activation_code = 3;
|
|
|
|
|
int32 duration_months = 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Deactivate Command
|
|
|
|
|
message DeactivateClubMembershipRequest
|
|
|
|
|
{
|
|
|
|
|
int64 user_id = 1;
|
|
|
|
|
string reason = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// AssignFeature Command
|
|
|
|
|
message AssignFeatureToMembershipRequest
|
|
|
|
|
{
|
|
|
|
|
int64 user_id = 1;
|
|
|
|
|
int64 product_id = 2;
|
|
|
|
|
google.protobuf.Int32Value quantity = 3;
|
|
|
|
|
google.protobuf.Int32Value duration_days = 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get Query
|
|
|
|
|
message GetClubMembershipRequest
|
|
|
|
|
{
|
|
|
|
|
int64 user_id = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GetClubMembershipResponse
|
|
|
|
|
{
|
|
|
|
|
int64 id = 1;
|
|
|
|
|
int64 user_id = 2;
|
|
|
|
|
int64 package_id = 3;
|
|
|
|
|
string package_name = 4;
|
|
|
|
|
string activation_code = 5;
|
|
|
|
|
google.protobuf.Timestamp activated_at = 6;
|
|
|
|
|
google.protobuf.Timestamp expires_at = 7;
|
|
|
|
|
bool is_active = 8;
|
|
|
|
|
google.protobuf.Timestamp created = 9;
|
|
|
|
|
repeated MembershipFeatureModel features = 10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message MembershipFeatureModel
|
|
|
|
|
{
|
|
|
|
|
int64 product_id = 1;
|
|
|
|
|
string product_name = 2;
|
|
|
|
|
int32 quantity = 3;
|
|
|
|
|
google.protobuf.Timestamp expires_at = 4;
|
|
|
|
|
bool is_active = 5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetAll Query
|
|
|
|
|
message GetAllClubMembershipsRequest
|
|
|
|
|
{
|
|
|
|
|
google.protobuf.Int64Value user_id = 1;
|
|
|
|
|
google.protobuf.Int64Value package_id = 2;
|
|
|
|
|
google.protobuf.BoolValue is_active = 3;
|
|
|
|
|
google.protobuf.BoolValue is_expired = 4;
|
|
|
|
|
int32 page_index = 5;
|
|
|
|
|
int32 page_size = 6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GetAllClubMembershipsResponse
|
|
|
|
|
{
|
|
|
|
|
messages.MetaData meta_data = 1;
|
|
|
|
|
repeated ClubMembershipModel models = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ClubMembershipModel
|
|
|
|
|
{
|
|
|
|
|
int64 id = 1;
|
|
|
|
|
int64 user_id = 2;
|
|
|
|
|
string user_name = 3;
|
|
|
|
|
int64 package_id = 4;
|
|
|
|
|
string package_name = 5;
|
|
|
|
|
string activation_code = 6;
|
|
|
|
|
google.protobuf.Timestamp activated_at = 7;
|
|
|
|
|
google.protobuf.Timestamp expires_at = 8;
|
|
|
|
|
bool is_active = 9;
|
|
|
|
|
bool is_expired = 10;
|
|
|
|
|
google.protobuf.Timestamp created = 11;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetHistory Query
|
|
|
|
|
message GetClubMembershipHistoryRequest
|
|
|
|
|
{
|
|
|
|
|
google.protobuf.Int64Value user_id = 1;
|
|
|
|
|
google.protobuf.Int64Value package_id = 2;
|
|
|
|
|
int32 page_index = 3;
|
|
|
|
|
int32 page_size = 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GetClubMembershipHistoryResponse
|
|
|
|
|
{
|
|
|
|
|
messages.MetaData meta_data = 1;
|
|
|
|
|
repeated ClubMembershipHistoryModel models = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
2025-12-02 03:32:26 +03:30
|
|
|
|
|
|
|
|
// GetClubStatistics Query
|
|
|
|
|
message GetClubStatisticsRequest
|
|
|
|
|
{
|
|
|
|
|
// Empty - returns overall 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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message PackageLevelDistribution
|
|
|
|
|
{
|
|
|
|
|
int64 package_id = 1;
|
|
|
|
|
string package_name = 2;
|
|
|
|
|
int32 member_count = 3;
|
|
|
|
|
double percentage = 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message MonthlyMembershipTrend
|
|
|
|
|
{
|
|
|
|
|
string month = 1;
|
|
|
|
|
int32 activations = 2;
|
|
|
|
|
int32 expirations = 3;
|
|
|
|
|
int32 net_change = 4;
|
|
|
|
|
}
|
|
|
|
|
|