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;
}
