linted protobufs via buf

This commit is contained in:
Priec
2025-12-20 20:57:11 +01:00
parent 1cedd58708
commit a506cd8f08
13 changed files with 185 additions and 206 deletions

View File

@@ -6,78 +6,78 @@ import "common.proto";
// import "table_structure.proto";
service Adresar {
rpc PostAdresar (PostAdresarRequest) returns (AdresarResponse);
rpc GetAdresar (GetAdresarRequest) returns (AdresarResponse);
rpc PutAdresar (PutAdresarRequest) returns (AdresarResponse);
rpc DeleteAdresar (DeleteAdresarRequest) returns (DeleteAdresarResponse);
rpc GetAdresarCount (common.Empty) returns (common.CountResponse);
rpc GetAdresarByPosition (common.PositionRequest) returns (AdresarResponse);
rpc PostAdresar(PostAdresarRequest) returns (AdresarResponse);
rpc GetAdresar(GetAdresarRequest) returns (AdresarResponse);
rpc PutAdresar(PutAdresarRequest) returns (AdresarResponse);
rpc DeleteAdresar(DeleteAdresarRequest) returns (DeleteAdresarResponse);
rpc GetAdresarCount(common.Empty) returns (common.CountResponse);
rpc GetAdresarByPosition(common.PositionRequest) returns (AdresarResponse);
}
message GetAdresarRequest {
int64 id = 1;
int64 id = 1;
}
message DeleteAdresarRequest {
int64 id = 1;
int64 id = 1;
}
message PostAdresarRequest {
string firma = 1;
string kz = 2;
string drc = 3;
string ulica = 4;
string psc = 5;
string mesto = 6;
string stat = 7;
string banka = 8;
string ucet = 9;
string skladm = 10;
string ico = 11;
string kontakt = 12;
string telefon = 13;
string skladu = 14;
string fax = 15;
string firma = 1;
string kz = 2;
string drc = 3;
string ulica = 4;
string psc = 5;
string mesto = 6;
string stat = 7;
string banka = 8;
string ucet = 9;
string skladm = 10;
string ico = 11;
string kontakt = 12;
string telefon = 13;
string skladu = 14;
string fax = 15;
}
message AdresarResponse {
int64 id = 1;
string firma = 2;
string kz = 3;
string drc = 4;
string ulica = 5;
string psc = 6;
string mesto = 7;
string stat = 8;
string banka = 9;
string ucet = 10;
string skladm = 11;
string ico = 12;
string kontakt = 13;
string telefon = 14;
string skladu = 15;
string fax = 16;
int64 id = 1;
string firma = 2;
string kz = 3;
string drc = 4;
string ulica = 5;
string psc = 6;
string mesto = 7;
string stat = 8;
string banka = 9;
string ucet = 10;
string skladm = 11;
string ico = 12;
string kontakt = 13;
string telefon = 14;
string skladu = 15;
string fax = 16;
}
message PutAdresarRequest {
int64 id = 1;
string firma = 2;
string kz = 3;
string drc = 4;
string ulica = 5;
string psc = 6;
string mesto = 7;
string stat = 8;
string banka = 9;
string ucet = 10;
string skladm = 11;
string ico = 12;
string kontakt = 13;
string telefon = 14;
string skladu = 15;
string fax = 16;
int64 id = 1;
string firma = 2;
string kz = 3;
string drc = 4;
string ulica = 5;
string psc = 6;
string mesto = 7;
string stat = 8;
string banka = 9;
string ucet = 10;
string skladm = 11;
string ico = 12;
string kontakt = 13;
string telefon = 14;
string skladu = 15;
string fax = 16;
}
message DeleteAdresarResponse {
bool success = 1;
bool success = 1;
}

View File

@@ -5,35 +5,35 @@ package komp_ac.auth;
import "common.proto";
service AuthService {
rpc Register(RegisterRequest) returns (AuthResponse);
rpc Login(LoginRequest) returns (LoginResponse);
rpc Register(RegisterRequest) returns (AuthResponse);
rpc Login(LoginRequest) returns (LoginResponse);
}
message RegisterRequest {
string username = 1;
string email = 2;
string password = 3;
string password_confirmation = 4;
string role = 5;
string username = 1;
string email = 2;
string password = 3;
string password_confirmation = 4;
string role = 5;
}
message AuthResponse {
string id = 1; // UUID in string format
string username = 2; // Registered username
string email = 3; // Registered email (if provided)
string role = 4; // Default role: 'accountant'
string id = 1; // UUID in string format
string username = 2; // Registered username
string email = 3; // Registered email (if provided)
string role = 4; // Default role: 'accountant'
}
message LoginRequest {
string identifier = 1; // Can be username or email
string password = 2;
string identifier = 1; // Can be username or email
string password = 2;
}
message LoginResponse {
string access_token = 1; // JWT token
string token_type = 2; // Usually "Bearer"
int32 expires_in = 3; // Expiration in seconds (86400 for 24 hours)
string user_id = 4; // User's UUID in string format
string role = 5; // User's role
string username = 6;
string access_token = 1; // JWT token
string token_type = 2; // Usually "Bearer"
int32 expires_in = 3; // Expiration in seconds (86400 for 24 hours)
string user_id = 4; // User's UUID in string format
string role = 5; // User's role
string username = 6;
}

View File

@@ -3,5 +3,9 @@ syntax = "proto3";
package komp_ac.common;
message Empty {}
message CountResponse { int64 count = 1; }
message PositionRequest { int64 position = 1; }
message CountResponse {
int64 count = 1;
}
message PositionRequest {
int64 position = 1;
}

View File

@@ -3,18 +3,18 @@ syntax = "proto3";
package komp_ac.search;
service Searcher {
rpc SearchTable(SearchRequest) returns (SearchResponse);
rpc SearchTable(SearchRequest) returns (SearchResponse);
}
message SearchRequest {
string table_name = 1;
string query = 2;
string table_name = 1;
string query = 2;
}
message SearchResponse {
message Hit {
int64 id = 1; // PostgreSQL row ID
float score = 2;
string content_json = 3;
}
repeated Hit hits = 1;
message Hit {
int64 id = 1; // PostgreSQL row ID
float score = 2;
string content_json = 3;
}
repeated Hit hits = 1;
}

View File

@@ -3,44 +3,44 @@ syntax = "proto3";
package komp_ac.search2;
service Search2 {
rpc SearchTable(Search2Request) returns (Search2Response);
rpc SearchTable(Search2Request) returns (Search2Response);
}
message Search2Request {
string profile_name = 1;
string table_name = 2;
repeated ColumnFilter column_filters = 3;
optional string text_query = 4; // Optional fallback text search
optional string text_query = 4; // Optional fallback text search
optional int32 limit = 5;
optional string order_by = 6;
optional bool order_desc = 7;
}
message ColumnFilter {
string column_name = 1;
FilterType filter_type = 2;
string value = 3;
optional string value2 = 4; // For range queries
string column_name = 1;
FilterType filter_type = 2;
string value = 3;
optional string value2 = 4; // For range queries
}
enum FilterType {
EQUALS = 0;
CONTAINS = 1;
STARTS_WITH = 2;
ENDS_WITH = 3;
RANGE = 4;
GREATER_THAN = 5;
LESS_THAN = 6;
IS_NULL = 7;
IS_NOT_NULL = 8;
EQUALS = 0;
CONTAINS = 1;
STARTS_WITH = 2;
ENDS_WITH = 3;
RANGE = 4;
GREATER_THAN = 5;
LESS_THAN = 6;
IS_NULL = 7;
IS_NOT_NULL = 8;
}
message Search2Response {
message Hit {
int64 id = 1;
string content_json = 2; // No score - this is SQL-based
optional string match_info = 3; // Info about which columns matched
}
repeated Hit hits = 1;
int32 total_count = 2; // Total matching records (for pagination)
message Hit {
int64 id = 1;
string content_json = 2; // No score - this is SQL-based
optional string match_info = 3; // Info about which columns matched
}
repeated Hit hits = 1;
int32 total_count = 2; // Total matching records (for pagination)
}

View File

@@ -12,17 +12,14 @@ service TableDefinition {
// Creates a new table (and schema if missing) with system columns,
// linked-table foreign keys, user-defined columns, and optional indexes.
// Also inserts metadata and default validation rules. Entirely transactional.
rpc PostTableDefinition(PostTableDefinitionRequest)
returns (TableDefinitionResponse);
rpc PostTableDefinition(PostTableDefinitionRequest) returns (TableDefinitionResponse);
// Lists all profiles (schemas) and their tables with declared dependencies.
// This provides a tree-like overview of table relationships.
rpc GetProfileTree(komp_ac.common.Empty)
returns (ProfileTreeResponse);
rpc GetProfileTree(komp_ac.common.Empty) returns (ProfileTreeResponse);
// Drops a table and its metadata, then deletes the profile if it becomes empty.
rpc DeleteTable(DeleteTableRequest)
returns (DeleteTableResponse);
rpc DeleteTable(DeleteTableRequest) returns (DeleteTableResponse);
}
// A single link to another table within the same profile (schema).

View File

@@ -23,8 +23,7 @@ service TableStructureService {
// - Normalizes data_type text (details under TableColumn.data_type)
// - Returns an empty list if the table is validated but has no visible
// columns in information_schema (e.g., physical table missing)
rpc GetTableStructure(GetTableStructureRequest)
returns (TableStructureResponse);
rpc GetTableStructure(GetTableStructureRequest) returns (TableStructureResponse);
}
// Request identifying the profile (schema) and table to inspect.

View File

@@ -53,8 +53,8 @@ message CharacterLimits {
// Mask for pretty display
message DisplayMask {
string pattern = 1; // e.g., "(###) ###-####" or "####-##-##"
string input_char = 2; // e.g., "#"
string pattern = 1; // e.g., "(###) ###-####" or "####-##-##"
string input_char = 2; // e.g., "#"
optional string template_char = 3; // e.g., "_"
}
@@ -94,11 +94,9 @@ message PatternRules {
// Service to fetch validations for a table
service TableValidationService {
rpc GetTableValidation(GetTableValidationRequest)
returns (TableValidationResponse);
rpc GetTableValidation(GetTableValidationRequest) returns (TableValidationResponse);
rpc UpdateFieldValidation(UpdateFieldValidationRequest)
returns (UpdateFieldValidationResponse);
rpc UpdateFieldValidation(UpdateFieldValidationRequest) returns (UpdateFieldValidationResponse);
}
message UpdateFieldValidationRequest {

View File

@@ -5,57 +5,57 @@ package komp_ac.uctovnictvo;
import "common.proto";
service Uctovnictvo {
rpc PostUctovnictvo (PostUctovnictvoRequest) returns (UctovnictvoResponse);
rpc GetUctovnictvo (GetUctovnictvoRequest) returns (UctovnictvoResponse);
rpc GetUctovnictvoCount (common.Empty) returns (common.CountResponse);
rpc GetUctovnictvoByPosition (common.PositionRequest) returns (UctovnictvoResponse);
rpc PutUctovnictvo (PutUctovnictvoRequest) returns (UctovnictvoResponse);
rpc PostUctovnictvo(PostUctovnictvoRequest) returns (UctovnictvoResponse);
rpc GetUctovnictvo(GetUctovnictvoRequest) returns (UctovnictvoResponse);
rpc GetUctovnictvoCount(common.Empty) returns (common.CountResponse);
rpc GetUctovnictvoByPosition(common.PositionRequest) returns (UctovnictvoResponse);
rpc PutUctovnictvo(PutUctovnictvoRequest) returns (UctovnictvoResponse);
}
message PostUctovnictvoRequest {
int64 adresar_id = 1;
string c_dokladu = 2;
string datum = 3; // Use string for simplicity, or use google.protobuf.Timestamp for better date handling
string c_faktury = 4;
string obsah = 5;
string stredisko = 6;
string c_uctu = 7;
string md = 8;
string identif = 9;
string poznanka = 10;
string firma = 11;
int64 adresar_id = 1;
string c_dokladu = 2;
string datum = 3; // Use string for simplicity, or use google.protobuf.Timestamp for better date handling
string c_faktury = 4;
string obsah = 5;
string stredisko = 6;
string c_uctu = 7;
string md = 8;
string identif = 9;
string poznanka = 10;
string firma = 11;
}
message UctovnictvoResponse {
int64 id = 1;
int64 adresar_id = 2;
string c_dokladu = 3;
string datum = 4;
string c_faktury = 5;
string obsah = 6;
string stredisko = 7;
string c_uctu = 8;
string md = 9;
string identif = 10;
string poznanka = 11;
string firma = 12;
int64 id = 1;
int64 adresar_id = 2;
string c_dokladu = 3;
string datum = 4;
string c_faktury = 5;
string obsah = 6;
string stredisko = 7;
string c_uctu = 8;
string md = 9;
string identif = 10;
string poznanka = 11;
string firma = 12;
}
message PutUctovnictvoRequest {
int64 id = 1;
int64 adresar_id = 2;
string c_dokladu = 3;
string datum = 4;
string c_faktury = 5;
string obsah = 6;
string stredisko = 7;
string c_uctu = 8;
string md = 9;
string identif = 10;
string poznanka = 11;
string firma = 12;
int64 id = 1;
int64 adresar_id = 2;
string c_dokladu = 3;
string datum = 4;
string c_faktury = 5;
string obsah = 6;
string stredisko = 7;
string c_uctu = 8;
string md = 9;
string identif = 10;
string poznanka = 11;
string firma = 12;
}
message GetUctovnictvoRequest {
int64 id = 1;
int64 id = 1;
}