refactor: update protobuf imports and add HTTP annotations

This commit is contained in:
masoodafar-web
2025-12-08 04:43:03 +03:30
parent fd3c17ac23
commit ca28678e8f
25 changed files with 207 additions and 53 deletions
@@ -20,10 +20,11 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.2" />
<PackageReference Include="Google.Api.CommonProtos" Version="2.10.0" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="Protos\clubmembership.proto" GrpcServices="Client" AdditionalImportDirs="..\BackOffice.BFF.Common.Protobuf\Protos"/>
<Protobuf Include="Protos\clubmembership.proto" ProtoRoot="Protos\" GrpcServices="Server" AdditionalImportDirs="..\BackOffice.BFF.Common.Protobuf\Protos"/>
</ItemGroup>
<ItemGroup>
@@ -6,18 +6,50 @@ import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Foursat.BackOffice.BFF.ClubMembership.Protobuf";
option csharp_namespace = "Foursat.BackOffice.BFF.ClubMembership.Protos";
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);
rpc GetClubStatistics(GetClubStatisticsRequest) returns (GetClubStatisticsResponse);
rpc ActivateClubMembership(ActivateClubMembershipRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/ActivateClubMembership"
body: "*"
};
};
rpc DeactivateClubMembership(DeactivateClubMembershipRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/DeactivateClubMembership"
body: "*"
};
};
rpc AssignFeatureToMembership(AssignFeatureToMembershipRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/AssignFeatureToMembership"
body: "*"
};
};
rpc GetClubMembership(GetClubMembershipRequest) returns (GetClubMembershipResponse){
option (google.api.http) = {
get: "/GetClubMembership"
};
};
rpc GetAllClubMemberships(GetAllClubMembershipsRequest) returns (GetAllClubMembershipsResponse){
option (google.api.http) = {
get: "/GetAllClubMemberships"
};
};
rpc GetClubMembershipHistory(GetClubMembershipHistoryRequest) returns (GetClubMembershipHistoryResponse){
option (google.api.http) = {
get: "/GetClubMembershipHistory"
};
};
rpc GetClubStatistics(GetClubStatisticsRequest) returns (GetClubStatisticsResponse){
option (google.api.http) = {
get: "/GetClubStatistics"
};
};
}
// Activate Command
@@ -24,7 +24,7 @@
</ItemGroup>
<ItemGroup>
<Protobuf Include="Protos\commission.proto" GrpcServices="Client" AdditionalImportDirs="..\BackOffice.BFF.Common.Protobuf\Protos"/>
<Protobuf Include="Protos\commission.proto" ProtoRoot="Protos\" GrpcServices="Server" AdditionalImportDirs="..\BackOffice.BFF.Common.Protobuf\Protos"/>
</ItemGroup>
<ItemGroup>
@@ -6,49 +6,109 @@ import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "BackOffice.BFF.Commission.Protobuf";
option csharp_namespace = "Foursat.BackOffice.BFF.Commission.Protos";
service CommissionContract
{
// Commands
rpc CalculateWeeklyBalances(CalculateWeeklyBalancesRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/CalculateWeeklyBalances"
body: "*"
};
};
rpc CalculateWeeklyCommissionPool(CalculateWeeklyCommissionPoolRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/CalculateWeeklyCommissionPool"
body: "*"
};
};
rpc ProcessUserPayouts(ProcessUserPayoutsRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/ProcessUserPayouts"
body: "*"
};
};
rpc RequestWithdrawal(RequestWithdrawalRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/RequestWithdrawal"
body: "*"
};
};
rpc ProcessWithdrawal(ProcessWithdrawalRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/ProcessWithdrawal"
body: "*"
};
};
// Queries
rpc GetWeeklyCommissionPool(GetWeeklyCommissionPoolRequest) returns (GetWeeklyCommissionPoolResponse){
option (google.api.http) = {
get: "/GetWeeklyCommissionPool"
};
};
rpc GetUserCommissionPayouts(GetUserCommissionPayoutsRequest) returns (GetUserCommissionPayoutsResponse){
option (google.api.http) = {
get: "/GetUserCommissionPayouts"
};
};
rpc GetCommissionPayoutHistory(GetCommissionPayoutHistoryRequest) returns (GetCommissionPayoutHistoryResponse){
option (google.api.http) = {
get: "/GetCommissionPayoutHistory"
};
};
rpc GetUserWeeklyBalances(GetUserWeeklyBalancesRequest) returns (GetUserWeeklyBalancesResponse){
option (google.api.http) = {
get: "/GetUserWeeklyBalances"
};
};
rpc GetAllWeeklyPools(GetAllWeeklyPoolsRequest) returns (GetAllWeeklyPoolsResponse){
option (google.api.http) = {
get: "/GetAllWeeklyPools"
};
};
rpc GetWithdrawalRequests(GetWithdrawalRequestsRequest) returns (GetWithdrawalRequestsResponse){
option (google.api.http) = {
get: "/GetWithdrawalRequests"
};
};
rpc ApproveWithdrawal(ApproveWithdrawalRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/ApproveWithdrawal"
body: "*"
};
};
rpc RejectWithdrawal(RejectWithdrawalRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/RejectWithdrawal"
body: "*"
};
};
// Worker Control APIs
rpc TriggerWeeklyCalculation(TriggerWeeklyCalculationRequest) returns (TriggerWeeklyCalculationResponse){
option (google.api.http) = {
post: "/TriggerWeeklyCalculation"
body: "*"
};
};
rpc GetWorkerStatus(GetWorkerStatusRequest) returns (GetWorkerStatusResponse){
option (google.api.http) = {
get: "/GetWorkerStatus"
};
};
rpc GetWorkerExecutionLogs(GetWorkerExecutionLogsRequest) returns (GetWorkerExecutionLogsResponse){
option (google.api.http) = {
get: "/GetWorkerExecutionLogs"
};
};
rpc GetWithdrawalReports(GetWithdrawalReportsRequest) returns (GetWithdrawalReportsResponse){
option (google.api.http) = {
get: "/GetWithdrawalReports"
};
};
}
@@ -20,10 +20,11 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.2" />
<PackageReference Include="Google.Api.CommonProtos" Version="2.10.0" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="Protos\configuration.proto" GrpcServices="Client" AdditionalImportDirs="..\BackOffice.BFF.Common.Protobuf\Protos"/>
<Protobuf Include="Protos\configuration.proto" ProtoRoot="Protos\" GrpcServices="Server" AdditionalImportDirs="..\BackOffice.BFF.Common.Protobuf\Protos"/>
</ItemGroup>
<ItemGroup>
@@ -6,16 +6,39 @@ import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Foursat.BackOffice.BFF.Configuration.Protobuf";
option csharp_namespace = "Foursat.BackOffice.BFF.Configuration.Protos";
service ConfigurationContract
{
rpc CreateOrUpdateConfiguration(CreateOrUpdateConfigurationRequest) returns (google.protobuf.Empty);
rpc DeactivateConfiguration(DeactivateConfigurationRequest) returns (google.protobuf.Empty);
rpc GetConfigurationByKey(GetConfigurationByKeyRequest) returns (GetConfigurationByKeyResponse);
rpc GetAllConfigurations(GetAllConfigurationsRequest) returns (GetAllConfigurationsResponse);
rpc GetConfigurationHistory(GetConfigurationHistoryRequest) returns (GetConfigurationHistoryResponse);
rpc CreateOrUpdateConfiguration(CreateOrUpdateConfigurationRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/CreateOrUpdateConfiguration"
body: "*"
};
};
rpc DeactivateConfiguration(DeactivateConfigurationRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/DeactivateConfiguration"
body: "*"
};
};
rpc GetConfigurationByKey(GetConfigurationByKeyRequest) returns (GetConfigurationByKeyResponse){
option (google.api.http) = {
get: "/GetConfigurationByKey"
};
};
rpc GetAllConfigurations(GetAllConfigurationsRequest) returns (GetAllConfigurationsResponse){
option (google.api.http) = {
get: "/GetAllConfigurations"
};
};
rpc GetConfigurationHistory(GetConfigurationHistoryRequest) returns (GetConfigurationHistoryResponse){
option (google.api.http) = {
get: "/GetConfigurationHistory"
};
};
}
// CreateOrUpdate Command
@@ -20,10 +20,11 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.2" />
<PackageReference Include="Google.Api.CommonProtos" Version="2.10.0" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="Protos\networkmembership.proto" GrpcServices="Client" AdditionalImportDirs="..\BackOffice.BFF.Common.Protobuf\Protos"/>
<Protobuf Include="Protos\networkmembership.proto" ProtoRoot="Protos\" GrpcServices="Server" AdditionalImportDirs="..\BackOffice.BFF.Common.Protobuf\Protos"/>
</ItemGroup>
<ItemGroup>
@@ -6,18 +6,50 @@ import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "BackOffice.BFF.NetworkMembership.Protobuf";
option csharp_namespace = "Foursat.BackOffice.BFF.NetworkMembership.Protos";
service NetworkMembershipContract
{
rpc JoinNetwork(JoinNetworkRequest) returns (google.protobuf.Empty);
rpc ChangeNetworkParent(ChangeNetworkParentRequest) returns (google.protobuf.Empty);
rpc RemoveFromNetwork(RemoveFromNetworkRequest) returns (google.protobuf.Empty);
rpc GetUserNetwork(GetUserNetworkRequest) returns (GetUserNetworkResponse);
rpc GetNetworkTree(GetNetworkTreeRequest) returns (GetNetworkTreeResponse);
rpc GetNetworkMembershipHistory(GetNetworkMembershipHistoryRequest) returns (GetNetworkMembershipHistoryResponse);
rpc GetNetworkStatistics(GetNetworkStatisticsRequest) returns (GetNetworkStatisticsResponse);
rpc JoinNetwork(JoinNetworkRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/JoinNetwork"
body: "*"
};
};
rpc ChangeNetworkParent(ChangeNetworkParentRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/ChangeNetworkParent"
body: "*"
};
};
rpc RemoveFromNetwork(RemoveFromNetworkRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
delete: "/RemoveFromNetwork"
body: "*"
};
};
rpc GetUserNetwork(GetUserNetworkRequest) returns (GetUserNetworkResponse){
option (google.api.http) = {
get: "/GetUserNetwork"
};
};
rpc GetNetworkTree(GetNetworkTreeRequest) returns (GetNetworkTreeResponse){
option (google.api.http) = {
get: "/GetNetworkTree"
};
};
rpc GetNetworkMembershipHistory(GetNetworkMembershipHistoryRequest) returns (GetNetworkMembershipHistoryResponse){
option (google.api.http) = {
get: "/GetNetworkMembershipHistory"
};
};
rpc GetNetworkStatistics(GetNetworkStatisticsRequest) returns (GetNetworkStatisticsResponse){
option (google.api.http) = {
get: "/GetNetworkStatistics"
};
};
}
// JoinNetwork Command
@@ -72,7 +104,7 @@ message GetUserNetworkResponse
// GetNetworkTree Query
message GetNetworkTreeRequest
{
int64 root_user_id = 1;
int64 user_id = 1;
google.protobuf.Int32Value max_depth = 2;
google.protobuf.BoolValue only_active = 3;
}
@@ -87,9 +119,9 @@ message NetworkTreeNodeModel
int64 user_id = 1;
string user_name = 2;
google.protobuf.Int64Value parent_id = 3;
int32 network_leg = 4;
int32 network_level = 5;
bool is_active = 6;
google.protobuf.Int32Value network_leg = 4;
google.protobuf.Int32Value network_level = 5;
google.protobuf.BoolValue is_active = 6;
google.protobuf.Timestamp joined_at = 7;
}