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

View File

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