adresar and uctovnictvo are now wiped out of the existence

This commit is contained in:
filipriec
2025-06-25 16:14:43 +02:00
parent e20623ed53
commit 625c9b3e09
7 changed files with 4 additions and 62 deletions

View File

@@ -1,24 +0,0 @@
-- Add migration script here
CREATE TABLE adresar (
id BIGSERIAL PRIMARY KEY,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
firma TEXT NOT NULL,
kz TEXT,
drc TEXT,
ulica TEXT,
psc TEXT,
mesto TEXT,
stat TEXT,
banka TEXT,
ucet TEXT,
skladm TEXT,
ico TEXT,
kontakt TEXT,
telefon TEXT,
skladu TEXT,
fax TEXT,
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_adresar_firma ON adresar (firma);
CREATE INDEX idx_adresar_mesto ON adresar (mesto);

View File

@@ -1,22 +0,0 @@
-- Add migration script here
CREATE TABLE uctovnictvo (
id BIGSERIAL PRIMARY KEY,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
adresar_id BIGINT NOT NULL REFERENCES adresar(id), -- Link to adresar table
c_dokladu TEXT NOT NULL,
datum DATE NOT NULL,
c_faktury TEXT NOT NULL,
obsah TEXT,
stredisko TEXT,
c_uctu TEXT,
md TEXT,
identif TEXT,
poznanka TEXT,
firma TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_uctovnictvo_adresar_id ON uctovnictvo (adresar_id);
CREATE INDEX idx_uctovnictvo_firma ON uctovnictvo (firma);
CREATE INDEX idx_uctovnictvo_c_dokladu ON uctovnictvo (c_dokladu);
CREATE INDEX idx_uctovnictvo_poznanka ON uctovnictvo (poznanka);

View File

@@ -3,6 +3,8 @@
use tower::ServiceBuilder;
use crate::auth::logic::rbac;
// TODO redesign this, adresar and uctovnictvo are nonexistent, but we are keeping this code for
// the reference. Please adjust in the future rbac.
pub async fn run_server(db_pool: sqlx::PgPool) -> Result<(), Box<dyn std::error::Error>> {
// ... existing setup code ...

View File

@@ -8,8 +8,6 @@ use tracing::{error, info, warn};
use tantivy::schema::Schema;
use crate::search_schema;
const INDEX_DIR: &str = "./tantivy_indexes";
/// Defines the commands that can be sent to the indexer task.
#[derive(Debug)]
pub enum IndexCommand {

View File

@@ -1,4 +1,2 @@
// src/server/handlers.rs
pub use crate::server::services::adresar_service::AdresarService;
pub use crate::server::services::uctovnictvo_service::UctovnictvoService;
pub use crate::server::services::table_structure_service::TableStructureHandler;

View File

@@ -6,8 +6,6 @@ use crate::indexer::{indexer_task, IndexCommand};
use common::proto::multieko2::FILE_DESCRIPTOR_SET;
use crate::server::services::{
AdresarService,
UctovnictvoService,
TableStructureHandler,
TableDefinitionService,
TablesDataService,
@@ -15,8 +13,6 @@ use crate::server::services::{
AuthServiceImpl
};
use common::proto::multieko2::{
adresar::adresar_server::AdresarServer,
uctovnictvo::uctovnictvo_server::UctovnictvoServer,
table_structure::table_structure_service_server::TableStructureServiceServer,
table_definition::table_definition_server::TableDefinitionServer,
tables_data::tables_data_server::TablesDataServer,
@@ -47,7 +43,7 @@ pub async fn run_server(db_pool: sqlx::PgPool) -> Result<(), Box<dyn std::error:
let table_definition_service = TableDefinitionService { db_pool: db_pool.clone() };
let tables_data_service = TablesDataService {
db_pool: db_pool.clone(),
indexer_tx: indexer_tx.clone(), // Pass the sender
indexer_tx: indexer_tx.clone(),
};
let table_script_service = TableScriptService { db_pool: db_pool.clone() };
let auth_service = AuthServiceImpl { db_pool: db_pool.clone() };
@@ -56,14 +52,12 @@ pub async fn run_server(db_pool: sqlx::PgPool) -> Result<(), Box<dyn std::error:
let search_service = SearcherService { pool: db_pool.clone() };
Server::builder()
.add_service(AdresarServer::new(AdresarService { db_pool: db_pool.clone() }))
.add_service(UctovnictvoServer::new(UctovnictvoService { db_pool: db_pool.clone() }))
.add_service(TableStructureServiceServer::new(TableStructureHandler { db_pool: db_pool.clone() }))
.add_service(TableDefinitionServer::new(table_definition_service))
.add_service(TablesDataServer::new(tables_data_service))
.add_service(TableScriptServer::new(table_script_service))
.add_service(AuthServiceServer::new(auth_service))
.add_service(SearcherServer::new(search_service)) // This now works correctly
.add_service(SearcherServer::new(search_service))
.add_service(reflection_service)
.serve(addr)
.await?;

View File

@@ -1,16 +1,12 @@
// src/server/services/mod.rs
pub mod adresar_service;
pub mod table_structure_service;
pub mod uctovnictvo_service;
pub mod table_definition_service;
pub mod tables_data_service;
pub mod table_script_service;
pub mod auth_service;
pub use adresar_service::AdresarService;
pub use table_structure_service::TableStructureHandler;
pub use uctovnictvo_service::UctovnictvoService;
pub use table_definition_service::TableDefinitionService;
pub use tables_data_service::TablesDataService;
pub use table_script_service::TableScriptService;