renamed again and fixed some minor stuff
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"username": "testuser2",
|
||||
"email": "test2@example.com"
|
||||
}' localhost:50051 KompAC.auth.AuthService/Register
|
||||
}' localhost:50051 komp_ac.auth.AuthService/Register
|
||||
{
|
||||
"id": "5fa9bbce-85e0-4b06-8364-b561770c2fdd",
|
||||
"username": "testuser2",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"email": "test3@example.com",
|
||||
"password": "your_password",
|
||||
"password_confirmation": "your_password"
|
||||
}' localhost:50051 KompAC.auth.AuthService/Register
|
||||
}' localhost:50051 komp_ac.auth.AuthService/Register
|
||||
{
|
||||
"id": "96d2fd35-b39d-4c05-916a-66134453d34c",
|
||||
"username": "testuser3",
|
||||
@@ -12,14 +12,14 @@
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"identifier": "testuser3"
|
||||
}' localhost:50051 KompAC.auth.AuthService/Login
|
||||
}' localhost:50051 komp_ac.auth.AuthService/Login
|
||||
ERROR:
|
||||
Code: Unauthenticated
|
||||
Message: Invalid credentials
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"identifier": "testuser3",
|
||||
"password": "your_password"
|
||||
}' localhost:50051 KompAC.auth.AuthService/Login
|
||||
}' localhost:50051 komp_ac.auth.AuthService/Login
|
||||
{
|
||||
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI5NmQyZmQzNS1iMzlkLTRjMDUtOTE2YS02NjEzNDQ1M2QzNGMiLCJleHAiOjE3NDI5ODE2MTAsInJvbGUiOiJhY2NvdW50YW50In0.78VIR3X4QZohzeI5x3xmkmqcICTusOC6PELPohMV-k8",
|
||||
"tokenType": "Bearer",
|
||||
@@ -30,7 +30,7 @@ ERROR:
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"username": "testuser4",
|
||||
"email": "test4@example.com"
|
||||
}' localhost:50051 KompAC.auth.AuthService/Register
|
||||
}' localhost:50051 komp_ac.auth.AuthService/Register
|
||||
{
|
||||
"id": "413d7ecc-f231-48af-8c5a-566b1dc2bf0b",
|
||||
"username": "testuser4",
|
||||
@@ -39,7 +39,7 @@ ERROR:
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"identifier": "test4@example.com"
|
||||
}' localhost:50051 KompAC.auth.AuthService/Login
|
||||
}' localhost:50051 komp_ac.auth.AuthService/Login
|
||||
{
|
||||
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0MTNkN2VjYy1mMjMxLTQ4YWYtOGM1YS01NjZiMWRjMmJmMGIiLCJleHAiOjE3NDI5ODE3MDEsInJvbGUiOiJhY2NvdW50YW50In0.4Hzu3tTZRNGHnBSgeCbGy2tFTl8EzpPdXBhcW8kuIc8",
|
||||
"tokenType": "Bearer",
|
||||
@@ -47,5 +47,5 @@ ERROR:
|
||||
"userId": "413d7ecc-f231-48af-8c5a-566b1dc2bf0b",
|
||||
"role": "accountant"
|
||||
}
|
||||
╭─ ~/Doc/pr/KompAC/server auth ······ ✔
|
||||
╭─ ~/Doc/pr/komp_ac/server auth ······ ✔
|
||||
╰─
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"email": "default@example.com",
|
||||
"password": "password",
|
||||
"password_confirmation": "password"
|
||||
}' localhost:50051 KompAC.auth.AuthService/Register
|
||||
}' localhost:50051 komp_ac.auth.AuthService/Register
|
||||
{
|
||||
"id": "73017288-af41-49d8-b4cb-2ac2109b38a1",
|
||||
"username": "testuser_default_role",
|
||||
@@ -16,7 +16,7 @@
|
||||
"password": "password",
|
||||
"password_confirmation": "password",
|
||||
"role": "admin"
|
||||
}' localhost:50051 KompAC.auth.AuthService/Register
|
||||
}' localhost:50051 komp_ac.auth.AuthService/Register
|
||||
{
|
||||
"id": "9437e318-818b-4c34-822d-c2d6601b835e",
|
||||
"username": "testuser_admin_role",
|
||||
@@ -29,9 +29,9 @@
|
||||
"password": "password",
|
||||
"password_confirmation": "password",
|
||||
"role": "invalid_role_name"
|
||||
}' localhost:50051 KompAC.auth.AuthService/Register
|
||||
}' localhost:50051 komp_ac.auth.AuthService/Register
|
||||
ERROR:
|
||||
Code: InvalidArgument
|
||||
Message: Invalid role specified: 'invalid_role_name'
|
||||
╭─ ~/Doc/pr/KompAC/server main +3 !1
|
||||
╭─ ~/Doc/pr/komp_ac/server main +3 !1
|
||||
╰─
|
||||
|
||||
@@ -3,7 +3,7 @@ use bcrypt::verify;
|
||||
use tonic::{Response, Status};
|
||||
use crate::db::PgPool;
|
||||
use crate::auth::logic::jwt; // Fixed import path
|
||||
use common::proto::KompAC::auth::{LoginRequest, LoginResponse};
|
||||
use common::proto::komp_ac::auth::{LoginRequest, LoginResponse};
|
||||
|
||||
pub async fn login(
|
||||
pool: &PgPool,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// src/auth/handlers/register.rs
|
||||
use bcrypt::{hash, DEFAULT_COST};
|
||||
use tonic::{Response, Status};
|
||||
use common::proto::KompAC::auth::{RegisterRequest, AuthResponse};
|
||||
use common::proto::komp_ac::auth::{RegisterRequest, AuthResponse};
|
||||
use crate::db::PgPool;
|
||||
use crate::auth::models::AuthError;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use tonic_reflection::server::Builder as ReflectionBuilder;
|
||||
use tokio::sync::mpsc;
|
||||
use crate::indexer::{indexer_task, IndexCommand};
|
||||
|
||||
use common::proto::KompAC::FILE_DESCRIPTOR_SET;
|
||||
use common::proto::komp_ac::FILE_DESCRIPTOR_SET;
|
||||
use crate::server::services::{
|
||||
TableStructureHandler,
|
||||
TableDefinitionService,
|
||||
@@ -12,7 +12,7 @@ use crate::server::services::{
|
||||
TableScriptService,
|
||||
AuthServiceImpl
|
||||
};
|
||||
use common::proto::KompAC::{
|
||||
use common::proto::komp_ac::{
|
||||
table_structure::table_structure_service_server::TableStructureServiceServer,
|
||||
table_definition::table_definition_server::TableDefinitionServer,
|
||||
tables_data::tables_data_server::TablesDataServer,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// src/server/services/auth_service.rs
|
||||
use tonic::{Request, Response, Status};
|
||||
use common::proto::KompAC::auth::{
|
||||
use common::proto::komp_ac::auth::{
|
||||
auth_service_server::AuthService,
|
||||
RegisterRequest, AuthResponse,
|
||||
LoginRequest, LoginResponse
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// src/server/services/table_definition_service.rs
|
||||
use tonic::{Request, Response, Status};
|
||||
use common::proto::KompAC::{
|
||||
use common::proto::komp_ac::{
|
||||
common::Empty,
|
||||
table_definition::{
|
||||
table_definition_server::TableDefinition,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// src/server/services/table_script_service.rs
|
||||
use tonic::{Request, Response, Status};
|
||||
use common::proto::KompAC::table_script::{
|
||||
use common::proto::komp_ac::table_script::{
|
||||
table_script_server::TableScript,
|
||||
PostTableScriptRequest, TableScriptResponse
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// src/server/services/table_structure_service.rs
|
||||
use tonic::{Request, Response, Status};
|
||||
// Correct the import path for the TableStructureService trait
|
||||
use common::proto::KompAC::table_structure::table_structure_service_server::TableStructureService;
|
||||
use common::proto::KompAC::table_structure::{
|
||||
use common::proto::komp_ac::table_structure::table_structure_service_server::TableStructureService;
|
||||
use common::proto::komp_ac::table_structure::{
|
||||
GetTableStructureRequest,
|
||||
TableStructureResponse,
|
||||
};
|
||||
|
||||
@@ -5,9 +5,9 @@ use tonic::{Request, Response, Status};
|
||||
use tokio::sync::mpsc;
|
||||
use crate::indexer::IndexCommand;
|
||||
|
||||
use common::proto::KompAC::tables_data::tables_data_server::TablesData;
|
||||
use common::proto::KompAC::common::CountResponse;
|
||||
use common::proto::KompAC::tables_data::{
|
||||
use common::proto::komp_ac::tables_data::tables_data_server::TablesData;
|
||||
use common::proto::komp_ac::common::CountResponse;
|
||||
use common::proto::komp_ac::tables_data::{
|
||||
PostTableDataRequest, PostTableDataResponse,
|
||||
PutTableDataRequest, PutTableDataResponse,
|
||||
DeleteTableDataRequest, DeleteTableDataResponse,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"target_column": "idea_name",
|
||||
"script": "(begin (define idea_name \"aaa\") idea_name)",
|
||||
"description": "Set idea_name to Awesome Idea"
|
||||
}' localhost:50051 KompAC.table_script.TableScript/PostTableScript
|
||||
}' localhost:50051 komp_ac.table_script.TableScript/PostTableScript
|
||||
{
|
||||
"id": "7"
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
"is_feasible": "true",
|
||||
"last_updated": "2025-03-11T12:34:56Z"
|
||||
}
|
||||
}' localhost:50051 KompAC.tables_data.TablesData/PostTableData
|
||||
}' localhost:50051 komp_ac.tables_data.TablesData/PostTableData
|
||||
ERROR:
|
||||
Code: InvalidArgument
|
||||
Message: Validation failed for 'idea_name'. Expected: 'aaa', Received: 'sdfsfs'
|
||||
@@ -31,7 +31,7 @@ ERROR:
|
||||
"is_feasible": "true",
|
||||
"last_updated": "2025-03-11T12:34:56Z"
|
||||
}
|
||||
}' localhost:50051 KompAC.tables_data.TablesData/PostTableData
|
||||
}' localhost:50051 komp_ac.tables_data.TablesData/PostTableData
|
||||
{
|
||||
"success": true,
|
||||
"message": "Data inserted successfully",
|
||||
|
||||
@@ -6,7 +6,7 @@ Creation of the tables:
|
||||
{"name": "yearly_goal", "field_type": "text"}
|
||||
],
|
||||
"profile_name": "finance"
|
||||
}' localhost:50051 KompAC.table_definition.TableDefinition/PostTableDefinition
|
||||
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
|
||||
{
|
||||
"success": true,
|
||||
"sql": "CREATE TABLE \"2025_department\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n \"yearly_goal\" TEXT,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\n"
|
||||
@@ -22,7 +22,7 @@ Creation of the tables:
|
||||
"links": [
|
||||
{"linked_table_name": "2025_department", "required": true}
|
||||
]
|
||||
}' localhost:50051 KompAC.table_definition.TableDefinition/PostTableDefinition
|
||||
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
|
||||
{
|
||||
"success": true,
|
||||
"sql": "CREATE TABLE \"2025_project\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n \"department_id\" BIGINT NOT NULL REFERENCES \"2025_department\"(id),\n \"name\" TEXT,\n \"budget_estimate\" TEXT,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\nCREATE INDEX idx_2025_project_department_fk ON \"2025_project\" (\"department_id\")\nCREATE INDEX idx_2025_project_name ON \"2025_project\" (\"name\")"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"indexes": ["company_name", "is_active"],
|
||||
"profile_name": "default",
|
||||
"linked_table_name": ""
|
||||
}' localhost:50051 KompAC.table_definition.TableDefinition/PostTableDefinition
|
||||
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
|
||||
ERROR:
|
||||
Code: NotFound
|
||||
Message: Linked table not found in profile
|
||||
@@ -35,12 +35,12 @@ ERROR:
|
||||
],
|
||||
"indexes": ["company_name", "is_active"],
|
||||
"profile_name": "default"
|
||||
}' localhost:50051 KompAC.table_definition.TableDefinition/PostTableDefinition
|
||||
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
|
||||
{
|
||||
"success": true,
|
||||
"sql": "CREATE TABLE \"2025_company_data1\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n firma TEXT NOT NULL,\n \"company_name\" TEXT,\n \"textfield\" TEXT,\n \"textfield2\" TEXT,\n \"textfield3\" TEXT,\n \"headquarters_psc\" TEXT,\n \"contact_phone\" VARCHAR(15),\n \"office_address\" TEXT,\n \"support_email\" VARCHAR(255),\n \"is_active\" BOOLEAN,\n \"last_updated\" TIMESTAMPTZ,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\nCREATE INDEX idx_2025_company_data1_firma ON \"2025_company_data1\" (firma)\nCREATE INDEX idx_2025_company_data1_company_name ON \"2025_company_data1\" (\"company_name\")\nCREATE INDEX idx_2025_company_data1_is_active ON \"2025_company_data1\" (\"is_active\")"
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 KompAC.table_definition.TableDefinition/GetProfileTree
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 komp_ac.table_definition.TableDefinition/GetProfileTree
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
@@ -56,12 +56,12 @@ ERROR:
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"profile_name": "default",
|
||||
"table_name": "2025_company_data1"
|
||||
}' localhost:50051 KompAC.table_definition.TableDefinition/DeleteTable
|
||||
}' localhost:50051 komp_ac.table_definition.TableDefinition/DeleteTable
|
||||
{
|
||||
"success": true,
|
||||
"message": "Table '2025_company_data1' and its definition were successfully removed"
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 KompAC.table_definition.TableDefinition/GetProfileTree
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 komp_ac.table_definition.TableDefinition/GetProfileTree
|
||||
{}
|
||||
╭─ ~/Doc/pr/KompAC/server main ⇡1 ········· ✔
|
||||
╭─ ~/Doc/pr/komp_ac/server main ⇡1 ········· ✔
|
||||
╰─
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 KompAC.table_definition.TableDefinition/GetProfileTree
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 komp_ac.table_definition.TableDefinition/GetProfileTree
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
@@ -80,12 +80,12 @@
|
||||
"indexes": ["column1", "columnd"],
|
||||
"profile_name": "new_profile",
|
||||
"linked_table_name": "2025_multi_dependent_table3"
|
||||
}' localhost:50051 KompAC.table_definition.TableDefinition/PostTableDefinition
|
||||
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
|
||||
{
|
||||
"success": true,
|
||||
"sql": "CREATE TABLE \"2025_multi_dependent_table5\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n firma TEXT NOT NULL,\n \"multi_dependent_table3_id\" BIGINT NOT NULL REFERENCES \"2025_multi_dependent_table3\"(id),\n \"2025_column1\" TEXT,\n \"2025_columnx\" TEXT,\n \"2025_columny\" TEXT,\n \"2025_columnz\" TEXT,\n \"2025_columna\" TEXT,\n \"2025_columnb\" TEXT,\n \"2025_columnc\" TEXT,\n \"2025_columnd\" TEXT,\n \"2025_column2\" INTEGER,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\nCREATE INDEX idx_2025_multi_dependent_table5_firma ON \"2025_multi_dependent_table5\" (firma)\nCREATE INDEX idx_2025_multi_dependent_table5_multi_dependent_table3_id ON \"2025_multi_dependent_table5\" (\"multi_dependent_table3_id\")\nCREATE INDEX idx_2025_multi_dependent_table5_2025_column1 ON \"2025_multi_dependent_table5\" (\"2025_column1\")\nCREATE INDEX idx_2025_multi_dependent_table5_2025_columnd ON \"2025_multi_dependent_table5\" (\"2025_columnd\")"
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 KompAC.table_definition.TableDefinition/GetProfileTree
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 komp_ac.table_definition.TableDefinition/GetProfileTree
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 KompAC.table_definition.TableDefinition/GetProfileTree
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 komp_ac.table_definition.TableDefinition/GetProfileTree
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
@@ -44,12 +44,12 @@
|
||||
],
|
||||
"indexes": ["firma", "mesto"],
|
||||
"profile_name": "default"
|
||||
}' localhost:50051 KompAC.table_definition.TableDefinition/PostTableDefinition
|
||||
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
|
||||
{
|
||||
"success": true,
|
||||
"sql": "CREATE TABLE \"2025_adresar6\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n \"firma\" TEXT,\n \"kz\" TEXT,\n \"drc\" TEXT,\n \"ulica\" TEXT,\n \"psc\" TEXT,\n \"mesto\" TEXT,\n \"stat\" TEXT,\n \"banka\" TEXT,\n \"ucet\" TEXT,\n \"skladm\" TEXT,\n \"ico\" TEXT,\n \"kontakt\" TEXT,\n \"telefon\" VARCHAR(15),\n \"skladu\" TEXT,\n \"fax\" TEXT,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\nCREATE INDEX idx_2025_adresar6_firma ON \"2025_adresar6\" (\"firma\")\nCREATE INDEX idx_2025_adresar6_mesto ON \"2025_adresar6\" (\"mesto\")"
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 KompAC.table_definition.TableDefinition/GetProfileTree
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 komp_ac.table_definition.TableDefinition/GetProfileTree
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
@@ -154,4 +154,4 @@ grpcurl -plaintext -d '{
|
||||
{"linked_table_name": "2025_shipping_provider", "required": false},
|
||||
{"linked_table_name": "2025_ecom_product", "required": false}
|
||||
]
|
||||
}' localhost:50051 KompAC.table_definition.TableDefinition/PostTableDefinition
|
||||
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// src/table_definition/handlers/delete_table.rs
|
||||
use tonic::Status;
|
||||
use sqlx::PgPool;
|
||||
use common::proto::KompAC::table_definition::{DeleteTableRequest, DeleteTableResponse};
|
||||
use common::proto::komp_ac::table_definition::{DeleteTableRequest, DeleteTableResponse};
|
||||
|
||||
pub async fn delete_table(
|
||||
db_pool: &PgPool,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// src/table_definition/handlers/get_profile_tree.rs
|
||||
use tonic::{Request, Response, Status};
|
||||
use sqlx::PgPool;
|
||||
use common::proto::KompAC::{
|
||||
use common::proto::komp_ac::{
|
||||
common::Empty,
|
||||
table_definition::{
|
||||
ProfileTreeResponse,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use tonic::Status;
|
||||
use sqlx::{PgPool, Transaction, Postgres};
|
||||
use serde_json::json;
|
||||
use common::proto::KompAC::table_definition::{PostTableDefinitionRequest, TableDefinitionResponse};
|
||||
use common::proto::komp_ac::table_definition::{PostTableDefinitionRequest, TableDefinitionResponse};
|
||||
|
||||
const PREDEFINED_FIELD_TYPES: &[(&str, &str)] = &[
|
||||
("text", "TEXT"),
|
||||
|
||||
@@ -4,7 +4,7 @@ This is how we can push script into the database, now its stored after a push in
|
||||
"target_column": "fax",
|
||||
"script": "(set! fax telefon)",
|
||||
"description": "Copy telefon value to fax column"
|
||||
}' localhost:50051 KompAC.table_script.TableScript/PostTableScript
|
||||
}' localhost:50051 komp_ac.table_script.TableScript/PostTableScript
|
||||
{
|
||||
"id": "2"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
use tonic::Status;
|
||||
use sqlx::{PgPool, Error as SqlxError};
|
||||
use common::proto::KompAC::table_script::{PostTableScriptRequest, TableScriptResponse};
|
||||
use common::proto::komp_ac::table_script::{PostTableScriptRequest, TableScriptResponse};
|
||||
use serde_json::Value;
|
||||
use steel_decimal::SteelDecimal;
|
||||
use regex::Regex;
|
||||
|
||||
@@ -4,7 +4,7 @@ grpcurl -plaintext \
|
||||
"table_name": "2025_customer"
|
||||
}' \
|
||||
localhost:50051 \
|
||||
KompAC.table_structure.TableStructureService/GetTableStructure
|
||||
komp_ac.table_structure.TableStructureService/GetTableStructure
|
||||
{
|
||||
"columns": [
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// src/table_structure/handlers/table_structure.rs
|
||||
use common::proto::KompAC::table_structure::{
|
||||
use common::proto::komp_ac::table_structure::{
|
||||
GetTableStructureRequest, TableColumn, TableStructureResponse,
|
||||
};
|
||||
use sqlx::PgPool;
|
||||
|
||||
@@ -2,7 +2,7 @@ grpcurl -plaintext -d '{
|
||||
"profile_name": "default",
|
||||
"table_name": "2025_adresar",
|
||||
"position": 1
|
||||
}' localhost:50051 KompAC.tables_data.TablesData/GetTableDataByPosition
|
||||
}' localhost:50051 komp_ac.tables_data.TablesData/GetTableDataByPosition
|
||||
{
|
||||
"data": {
|
||||
"banka": "New Banka",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Valid get request:
|
||||
|
||||
grpcurl -plaintext -d '{"profile_name": "default", "table_name": "2025_adresar", "id": 2}' localhost:50051 KompAC.tables_data.TablesData/GetTableData
|
||||
grpcurl -plaintext -d '{"profile_name": "default", "table_name": "2025_adresar", "id": 2}' localhost:50051 komp_ac.tables_data.TablesData/GetTableData
|
||||
|
||||
{
|
||||
"data": {
|
||||
@@ -26,7 +26,7 @@ grpcurl -plaintext -d '{"profile_name": "default", "table_name": "2025_adresar",
|
||||
|
||||
Request of a deleted data:
|
||||
|
||||
grpcurl -plaintext -d '{"profile_name": "default", "table_name": "2025_adresar", "id": 1}' localhost:50051 KompAC.tables_data.TablesData/GetTableData
|
||||
grpcurl -plaintext -d '{"profile_name": "default", "table_name": "2025_adresar", "id": 1}' localhost:50051 komp_ac.tables_data.TablesData/GetTableData
|
||||
|
||||
ERROR:
|
||||
Code: NotFound
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
grpcurl -plaintext -d '{"profile_name": "default", "table_name": "2025_adresar"}' localhost:50051 KompAC.tables_data.TablesData/GetTableDataCount
|
||||
grpcurl -plaintext -d '{"profile_name": "default", "table_name": "2025_adresar"}' localhost:50051 komp_ac.tables_data.TablesData/GetTableDataCount
|
||||
|
||||
{
|
||||
"count": "1"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 KompAC.table_definition.TableDefinition/GetProfileTree
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 komp_ac.table_definition.TableDefinition/GetProfileTree
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
@@ -26,7 +26,7 @@
|
||||
"support_email": "support@acmecorp.com",
|
||||
"is_active": "true"
|
||||
}
|
||||
}' localhost:50051 KompAC.tables_data.TablesData/PostTableData
|
||||
}' localhost:50051 komp_ac.tables_data.TablesData/PostTableData
|
||||
{
|
||||
"success": true,
|
||||
"message": "Data inserted successfully",
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"support_email": "updated-support@acmecorp.com",
|
||||
"is_active": "false"
|
||||
}
|
||||
}' localhost:50051 KompAC.tables_data.TablesData/PutTableData
|
||||
}' localhost:50051 komp_ac.tables_data.TablesData/PutTableData
|
||||
{
|
||||
"success": true,
|
||||
"message": "Data updated successfully",
|
||||
@@ -28,7 +28,7 @@
|
||||
"firma": "1",
|
||||
"is_active": "true"
|
||||
}
|
||||
}' localhost:50051 KompAC.tables_data.TablesData/PutTableData
|
||||
}' localhost:50051 komp_ac.tables_data.TablesData/PutTableData
|
||||
{
|
||||
"success": true,
|
||||
"message": "Data updated successfully",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// src/tables_data/handlers/delete_table_data.rs
|
||||
use tonic::Status;
|
||||
use sqlx::PgPool;
|
||||
use common::proto::KompAC::tables_data::{DeleteTableDataRequest, DeleteTableDataResponse};
|
||||
use common::proto::komp_ac::tables_data::{DeleteTableDataRequest, DeleteTableDataResponse};
|
||||
use crate::shared::schema_qualifier::qualify_table_name_for_data; // Import schema qualifier
|
||||
|
||||
pub async fn delete_table_data(
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use tonic::Status;
|
||||
use sqlx::{PgPool, Row};
|
||||
use std::collections::HashMap;
|
||||
use common::proto::KompAC::tables_data::{GetTableDataRequest, GetTableDataResponse};
|
||||
use common::proto::komp_ac::tables_data::{GetTableDataRequest, GetTableDataResponse};
|
||||
use crate::shared::schema_qualifier::qualify_table_name_for_data;
|
||||
|
||||
pub async fn get_table_data(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// src/tables_data/handlers/get_table_data_by_position.rs
|
||||
use tonic::Status;
|
||||
use sqlx::PgPool;
|
||||
use common::proto::KompAC::tables_data::{
|
||||
use common::proto::komp_ac::tables_data::{
|
||||
GetTableDataByPositionRequest, GetTableDataRequest, GetTableDataResponse
|
||||
};
|
||||
use super::get_table_data;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// src/tables_data/handlers/get_table_data_count.rs
|
||||
use tonic::Status;
|
||||
use sqlx::PgPool;
|
||||
use common::proto::KompAC::common::CountResponse;
|
||||
use common::proto::KompAC::tables_data::GetTableDataCountRequest;
|
||||
use common::proto::komp_ac::common::CountResponse;
|
||||
use common::proto::komp_ac::tables_data::GetTableDataCountRequest;
|
||||
use crate::shared::schema_qualifier::qualify_table_name_for_data; // 1. IMPORT THE FUNCTION
|
||||
|
||||
pub async fn get_table_data_count(
|
||||
|
||||
@@ -4,7 +4,7 @@ use tonic::Status;
|
||||
use sqlx::{PgPool, Arguments};
|
||||
use sqlx::postgres::PgArguments;
|
||||
use chrono::{DateTime, Utc};
|
||||
use common::proto::KompAC::tables_data::{PostTableDataRequest, PostTableDataResponse};
|
||||
use common::proto::komp_ac::tables_data::{PostTableDataRequest, PostTableDataResponse};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use prost_types::value::Kind;
|
||||
|
||||
@@ -4,12 +4,13 @@ use tonic::Status;
|
||||
use sqlx::{PgPool, Arguments, Row};
|
||||
use sqlx::postgres::PgArguments;
|
||||
use chrono::{DateTime, Utc};
|
||||
use common::proto::KompAC::tables_data::{PutTableDataRequest, PutTableDataResponse};
|
||||
use common::proto::komp_ac::tables_data::{PutTableDataRequest, PutTableDataResponse};
|
||||
|
||||
use std::sync::Arc;
|
||||
use prost_types::value::Kind;
|
||||
use rust_decimal::Decimal;
|
||||
use std::str::FromStr;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::steel::server::execution::{self, Value};
|
||||
use crate::indexer::{IndexCommand, IndexCommandData};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// tests/table_definition/post_table_definition_test.rs
|
||||
|
||||
// Keep all your normal use statements
|
||||
use common::proto::KompAC::table_definition::{
|
||||
use common::proto::komp_ac::table_definition::{
|
||||
ColumnDefinition, PostTableDefinitionRequest, TableLink,
|
||||
};
|
||||
use rstest::{fixture, rstest};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use crate::common::setup_isolated_db;
|
||||
use server::table_script::handlers::post_table_script::post_table_script; // Fixed import
|
||||
use common::proto::KompAC::table_script::PostTableScriptRequest;
|
||||
use common::proto::komp_ac::table_script::PostTableScriptRequest;
|
||||
use rstest::*;
|
||||
use serde_json::json;
|
||||
use sqlx::PgPool;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use crate::common::setup_isolated_db;
|
||||
use server::table_script::handlers::post_table_script::post_table_script; // Fixed import
|
||||
use common::proto::KompAC::table_script::PostTableScriptRequest;
|
||||
use common::proto::komp_ac::table_script::PostTableScriptRequest;
|
||||
use rstest::*;
|
||||
use serde_json::json;
|
||||
use sqlx::PgPool;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use crate::common::setup_isolated_db;
|
||||
use server::table_script::handlers::post_table_script::post_table_script;
|
||||
use common::proto::KompAC::table_script::{PostTableScriptRequest, TableScriptResponse};
|
||||
use common::proto::komp_ac::table_script::{PostTableScriptRequest, TableScriptResponse};
|
||||
use serde_json::json;
|
||||
use sqlx::PgPool;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use crate::common::setup_isolated_db;
|
||||
use server::table_script::handlers::post_table_script::post_table_script;
|
||||
use common::proto::KompAC::table_script::PostTableScriptRequest;
|
||||
use common::proto::komp_ac::table_script::PostTableScriptRequest;
|
||||
use serde_json::json;
|
||||
use sqlx::PgPool;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use crate::common::setup_isolated_db;
|
||||
use server::table_script::handlers::post_table_script::post_table_script;
|
||||
use common::proto::KompAC::table_script::PostTableScriptRequest;
|
||||
use common::proto::komp_ac::table_script::PostTableScriptRequest;
|
||||
use rstest::*;
|
||||
use serde_json::json;
|
||||
use sqlx::PgPool;
|
||||
|
||||
@@ -13,10 +13,10 @@ use rand::Rng;
|
||||
use rand::distr::Alphanumeric; // Corrected import
|
||||
|
||||
// Common imports from other modules
|
||||
use common::proto::KompAC::table_definition::{
|
||||
use common::proto::komp_ac::table_definition::{
|
||||
PostTableDefinitionRequest, ColumnDefinition as TableColumnDefinition, TableLink,
|
||||
};
|
||||
use common::proto::KompAC::tables_data::{
|
||||
use common::proto::komp_ac::tables_data::{
|
||||
DeleteTableDataRequest, DeleteTableDataResponse, PostTableDataRequest, PutTableDataRequest,
|
||||
};
|
||||
use server::indexer::IndexCommand;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
use rstest::{fixture, rstest};
|
||||
use tonic;
|
||||
use sqlx::PgPool;
|
||||
use common::proto::KompAC::tables_data::GetTableDataByPositionRequest;
|
||||
use common::proto::KompAC::table_definition::{PostTableDefinitionRequest, ColumnDefinition};
|
||||
use common::proto::komp_ac::tables_data::GetTableDataByPositionRequest;
|
||||
use common::proto::komp_ac::table_definition::{PostTableDefinitionRequest, ColumnDefinition};
|
||||
use server::table_definition::handlers::post_table_definition;
|
||||
use server::tables_data::handlers::get_table_data_by_position;
|
||||
use crate::common::setup_test_db;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
use rstest::{fixture, rstest};
|
||||
use tonic;
|
||||
use sqlx::PgPool;
|
||||
use common::proto::KompAC::tables_data::GetTableDataCountRequest;
|
||||
use common::proto::KompAC::table_definition::{PostTableDefinitionRequest, ColumnDefinition};
|
||||
use common::proto::KompAC::table_definition::TableLink;
|
||||
use common::proto::komp_ac::tables_data::GetTableDataCountRequest;
|
||||
use common::proto::komp_ac::table_definition::{PostTableDefinitionRequest, ColumnDefinition};
|
||||
use common::proto::komp_ac::table_definition::TableLink;
|
||||
use server::tables_data::handlers::get_table_data_count;
|
||||
use server::table_definition::handlers::post_table_definition;
|
||||
use crate::common::setup_test_db;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// tests/tables_data/handlers/get_table_data_test.rs
|
||||
use rstest::{fixture, rstest};
|
||||
use server::tables_data::handlers::get_table_data;
|
||||
use common::proto::KompAC::tables_data::GetTableDataRequest;
|
||||
use common::proto::komp_ac::tables_data::GetTableDataRequest;
|
||||
use crate::common::setup_test_db;
|
||||
use sqlx::{PgPool, Row};
|
||||
use tonic;
|
||||
@@ -15,10 +15,10 @@ use rust_decimal::Decimal;
|
||||
use rust_decimal_macros::dec;
|
||||
use server::table_definition::handlers::post_table_definition;
|
||||
use server::tables_data::handlers::post_table_data;
|
||||
use common::proto::KompAC::table_definition::{
|
||||
use common::proto::komp_ac::table_definition::{
|
||||
PostTableDefinitionRequest, ColumnDefinition as TableColumnDefinition, TableLink
|
||||
};
|
||||
use common::proto::KompAC::tables_data::PostTableDataRequest;
|
||||
use common::proto::komp_ac::tables_data::PostTableDataRequest;
|
||||
use prost_types::Value;
|
||||
use prost_types::value::Kind;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// tests/tables_data/post/post_table_data_steel_decimal_test.rs
|
||||
|
||||
use sqlx::PgPool;
|
||||
use common::proto::KompAC::{
|
||||
use common::proto::komp_ac::{
|
||||
table_definition::{PostTableDefinitionRequest, ColumnDefinition},
|
||||
table_script::PostTableScriptRequest,
|
||||
tables_data::PostTableDataRequest,
|
||||
|
||||
@@ -4,9 +4,9 @@ use sqlx::PgPool;
|
||||
use std::collections::HashMap;
|
||||
use prost_types::Value;
|
||||
use prost_types::value::Kind;
|
||||
use common::proto::KompAC::tables_data::{PostTableDataRequest, PostTableDataResponse};
|
||||
use common::proto::KompAC::table_definition::TableLink;
|
||||
use common::proto::KompAC::table_definition::{
|
||||
use common::proto::komp_ac::tables_data::{PostTableDataRequest, PostTableDataResponse};
|
||||
use common::proto::komp_ac::table_definition::TableLink;
|
||||
use common::proto::komp_ac::table_definition::{
|
||||
PostTableDefinitionRequest, ColumnDefinition as TableColumnDefinition
|
||||
};
|
||||
use server::tables_data::handlers::post_table_data;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// tests/tables_data/put/put_table_data_steel_decimal_test.rs
|
||||
|
||||
use sqlx::PgPool;
|
||||
use common::proto::KompAC::{
|
||||
use common::proto::komp_ac::{
|
||||
table_definition::{PostTableDefinitionRequest, ColumnDefinition},
|
||||
table_script::PostTableScriptRequest,
|
||||
tables_data::{PostTableDataRequest, PutTableDataRequest},
|
||||
|
||||
@@ -4,10 +4,10 @@ use rstest::{fixture, rstest};
|
||||
use sqlx::{PgPool, Row};
|
||||
use std::collections::HashMap;
|
||||
use prost_types::{value::Kind, Value};
|
||||
use common::proto::KompAC::table_definition::{
|
||||
use common::proto::komp_ac::table_definition::{
|
||||
PostTableDefinitionRequest, ColumnDefinition as TableColumnDefinition, TableLink,
|
||||
};
|
||||
use common::proto::KompAC::tables_data::{
|
||||
use common::proto::komp_ac::tables_data::{
|
||||
PostTableDataRequest, PutTableDataRequest,
|
||||
};
|
||||
use server::table_definition::handlers::post_table_definition;
|
||||
|
||||
Reference in New Issue
Block a user