syntax = "proto3"; package corruption.v1; import "common.proto"; option go_package = "github.com/corruption/api/v1"; option java_multiple_files = true; option java_outer_classname = "PoliticianProto"; option java_package = "com.corruption.api.v1"; // Politician service definition service PoliticianService { // Get a list of politicians with pagination rpc ListPoliticians(ListPoliticiansRequest) returns (ListPoliticiansResponse) {} // Get a single politician by ID rpc GetPolitician(GetPoliticianRequest) returns (GetPoliticianResponse) {} } // Request message for ListPoliticians message ListPoliticiansRequest { // Pagination parameters PaginationRequest pagination = 1; // Optional filter by public institution ID optional int32 public_institution_id = 2; // Optional filter by party optional string party = 3; } // Response message for ListPoliticians message ListPoliticiansResponse { // List of politicians repeated Politician politicians = 1; // Pagination metadata PaginationResponse pagination = 2; } // Request message for GetPolitician message GetPoliticianRequest { // The ID of the politician to retrieve int32 id = 1; } // Response message for GetPolitician message GetPoliticianResponse { // The requested politician Politician politician = 1; } // Politician message message Politician { // The unique identifier for the politician int32 id = 1; // The full name of the politician string full_name = 2; // The current party of the politician string party = 3; // The position held by the politician string position = 4; // The URL to the politician's image string image_url = 5; // The ID of the associated public institution int32 public_institution_id = 6; // The name of the associated public institution string public_institution_name = 7; // The number of corruption cases associated with this politician int32 corruption_case_count = 8; // Creation timestamp Timestamp created_at = 9; // Last update timestamp Timestamp updated_at = 10; } // Party affiliation message message PartyAffiliation { // The unique identifier for the party affiliation int32 id = 1; // The politician ID int32 politician_id = 2; // The party name string party = 3; // The date when the politician joined the party Timestamp joined_at = 4; // The date when the politician left the party (if applicable) optional Timestamp left_at = 5; // Creation timestamp Timestamp created_at = 6; // Last update timestamp Timestamp updated_at = 7; }