From fbe05feed258deed3f3d65c29e7246f6249a8455 Mon Sep 17 00:00:00 2001 From: Filipriec Date: Mon, 24 Aug 2026 10:25:00 +0200 Subject: [PATCH] conversions web3 --- web/locales/cs/main.ftl | 40 +----- web/locales/en/main.ftl | 40 +----- web/locales/sk/main.ftl | 40 +----- web/src/pages/admin/ecb/mod.rs | 4 - web/src/pages/admin/ecb/workspace_loader.rs | 2 - web/src/pages/admin/ecb/workspace_logic.rs | 77 +---------- web/src/pages/admin/ecb/workspace_state.rs | 135 +------------------ web/src/pages/admin/ecb/workspace_ui.rs | 5 +- web/templates/pages/admin/ecb/workspace.html | 56 -------- 9 files changed, 9 insertions(+), 390 deletions(-) diff --git a/web/locales/cs/main.ftl b/web/locales/cs/main.ftl index ae1ae317..e25b06f1 100644 --- a/web/locales/cs/main.ftl +++ b/web/locales/cs/main.ftl @@ -298,6 +298,7 @@ td-root = kořen td-template-create-heading = Vytvořit tabulky z fakturové šablony td-template-hint = Načte kontrakt #let komp_ac_fields = (…) z Typst šablony. Cesta, která odpovídá existující tabulce a sloupci, se stane odkazem na ni; vše ostatní se stane sloupcem TEXT, který později upravíte, a každé [] se stane podřízenou tabulkou. td-table-name = Název tabulky +td-table-name-hint = Zde přejmenujte tabulku. Odkazy a její definice budou nadále odkazovat na stejnou tabulku. td-row-display-columns = Sloupce identifikující řádek td-row-display-hint = Oddělte čárkami, platí jen pro kořenovou tabulku. td-template-source = Zdroj šablony @@ -925,14 +926,12 @@ validation-err-permission = Vyžaduje se oprávnění ke správě validací. # Pracoviště správy konverzních kurzů rates-title = Konverzní kurzy rates-eyebrow = Pracoviště správce -rates-description = Nastavte měny profilů, ověřte konverze, zkontrolujte auditní důkazy a sledujte poskytovatele. +rates-description = Nastavte měny profilů, zkontrolujte auditní důkazy a sledujte poskytovatele. rates-updated = Konverzní kurzy byly aktualizovány rates-could-not-continue = Operaci se nepodařilo dokončit rates-sections = Části pracoviště konverzních kurzů rates-tab-configuration = Konfigurace rates-tab-configuration-sub = Měny a poskytovatelé -rates-tab-preview = Náhled -rates-tab-preview-sub = Zkouška konverze rates-tab-evidence = Důkazy rates-tab-evidence-sub = Kontrola uloženého výsledku rates-tab-providers = Poskytovatelé @@ -957,35 +956,8 @@ rates-append-only-hint = Konfigurace se pouze rozšiřuje: přidejte dalšího p rates-provider = Poskytovatel rates-choose-provider = Vyberte poskytovatele rates-make-default-now = Použít jako výchozího poskytovatele této měny -rates-conversion-preview = Náhled konverze -rates-preview-hint = Ověří stejná pravidla výběru jako účtování bez zápisu účetních údajů. -rates-amount = Původní částka -rates-currency = Původní měna -rates-basis-date = Rozhodné datum konverze -rates-rate-method = Metoda kurzu -rates-method-automatic = Automatický oficiální kurz -rates-method-specific = Oficiální kurz z konkrétního dne zveřejnění -rates-method-saved = Uložený vlastní kurz -rates-method-manual = Jednorázový ruční kurz -rates-date-context = Kontext data -rates-context-ordinary = Běžná transakce — předchozí zveřejnění -rates-context-statement = Výpis — v den nebo před datem -rates-specific-date = Datum zveřejnění -rates-manual-foreign-units = Jednotky cizí měny na účetní jednotku -rates-provider-override = Jiný poskytovatel -rates-use-default-provider = Použít nastaveného výchozího rates-reason = Důvod -rates-reason-hint = Backend jej vyžaduje, když výjimečný výběr potřebuje odůvodnění. -rates-preview-action = Zobrazit náhled konverze -rates-preview-result = Výsledek náhledu -rates-date-rule = Pravidlo data rates-rate-date = Použité datum kurzu -rates-audit-details = Auditní podrobnosti -rates-exact-quote = Přesná kotace -rates-determination = Způsob určení -rates-rounding = Způsob zaokrouhlení -rates-observation = ID oficiálního pozorování -rates-import-batch = ID dávky importu rates-evidence-lookup = Vyhledání důkazů rates-evidence-hint = Vyhledejte přesnou historii konverzí jedné buňky tabulky a jejích revizí. rates-table = Tabulka @@ -1003,13 +975,5 @@ rates-provider-health = Stav poskytovatele rates-provider-health-hint = Ověřené pokrytí, hranice účtování a nedávné pokusy o import oficiálního poskytovatele. rates-unavailable-title = Konverzní kurzy nejsou dostupné rates-err-profile-missing = Vybraný profil již neexistuje. Zobrazuje se první dostupný profil. -rates-err-preview-method = Vyberte podporovanou metodu kurzu. rates-err-record-id = ID záznamu musí být kladné celé číslo. rates-configuration-added = Poskytovatel { $source } byl přidán pro měnu { $currency }. -rates-source-official = Oficiální -rates-source-saved = Uložený vlastní -rates-source-manual = Jednorázový ruční -rates-rule-previous = Předchozí zveřejnění -rates-rule-on-or-before = V den nebo před datem -rates-rule-specific = Konkrétní datum zveřejnění -rates-unknown = Neznámé diff --git a/web/locales/en/main.ftl b/web/locales/en/main.ftl index cf387873..5a9976a6 100644 --- a/web/locales/en/main.ftl +++ b/web/locales/en/main.ftl @@ -299,7 +299,6 @@ td-col-parent = Parent td-root = root td-template-create-heading = Create tables from an invoice template td-template-hint = Reads the #let komp_ac_fields = (…) contract out of a Typst template. A path that matches an existing table and column becomes a reference to it; anything else becomes a TEXT column to refine later, and every [] becomes a child table. -td-table-name = Table name td-row-display-columns = Row display columns td-row-display-hint = Comma-separated, and only for the root table. td-template-source = Template source @@ -911,14 +910,12 @@ validation-err-permission = Validation-management permission is required. # Exchange-rate administration workspace rates-title = Conversion rates rates-eyebrow = Admin workspace -rates-description = Configure profile currencies, verify conversions, inspect audit evidence, and monitor providers. +rates-description = Configure profile currencies, inspect audit evidence, and monitor providers. rates-updated = Conversion rates updated rates-could-not-continue = The operation could not be completed rates-sections = Conversion-rate workspace sections rates-tab-configuration = Configuration rates-tab-configuration-sub = Currencies and providers -rates-tab-preview = Preview -rates-tab-preview-sub = Test a conversion rates-tab-evidence = Evidence rates-tab-evidence-sub = Inspect a stored result rates-tab-providers = Providers @@ -943,35 +940,8 @@ rates-append-only-hint = Configuration is append-only: add another provider or m rates-provider = Provider rates-choose-provider = Choose a provider rates-make-default-now = Use as the default provider for this currency -rates-conversion-preview = Conversion preview -rates-preview-hint = Exercise the same selection rules as posting without writing accounting data. -rates-amount = Original amount -rates-currency = Original currency -rates-basis-date = Conversion basis date -rates-rate-method = Rate method -rates-method-automatic = Automatic official rate -rates-method-specific = Official rate from a specific publication date -rates-method-saved = Saved custom rate -rates-method-manual = One-off manual rate -rates-date-context = Date context -rates-context-ordinary = Ordinary transaction — previous publication -rates-context-statement = Statement — on or before date -rates-specific-date = Publication date -rates-manual-foreign-units = Foreign units per accounting unit -rates-provider-override = Provider override -rates-use-default-provider = Use the configured default rates-reason = Reason -rates-reason-hint = Required by the backend when an exceptional selection needs justification. -rates-preview-action = Preview conversion -rates-preview-result = Preview result -rates-date-rule = Date rule rates-rate-date = Applied rate date -rates-audit-details = Audit details -rates-exact-quote = Exact quote -rates-determination = Determination method -rates-rounding = Rounding method -rates-observation = Official observation ID -rates-import-batch = Import batch ID rates-evidence-lookup = Evidence lookup rates-evidence-hint = Look up the exact conversion history for one table cell and its revisions. rates-table = Table @@ -989,13 +959,5 @@ rates-provider-health = Provider health rates-provider-health-hint = Verified coverage, posting horizons, and recent import attempts for the official provider. rates-unavailable-title = Conversion rates are unavailable rates-err-profile-missing = The selected profile no longer exists. The first available profile is shown instead. -rates-err-preview-method = Choose a supported rate method. rates-err-record-id = Record ID must be a positive whole number. rates-configuration-added = Added provider { $source } for { $currency }. -rates-source-official = Official -rates-source-saved = Saved custom -rates-source-manual = One-off manual -rates-rule-previous = Previous publication -rates-rule-on-or-before = On or before date -rates-rule-specific = Specific publication date -rates-unknown = Unknown diff --git a/web/locales/sk/main.ftl b/web/locales/sk/main.ftl index f95ef795..efd8d7e4 100644 --- a/web/locales/sk/main.ftl +++ b/web/locales/sk/main.ftl @@ -298,6 +298,7 @@ td-root = koreň td-template-create-heading = Vytvoriť tabuľky z faktúrovej šablóny td-template-hint = Načíta kontrakt #let komp_ac_fields = (…) z Typst šablóny. Cesta, ktorá zodpovedá existujúcej tabuľke a stĺpcu, sa stane odkazom na ňu; všetko ostatné sa stane stĺpcom TEXT, ktorý neskôr upravíte, a každé [] sa stane podradenou tabuľkou. td-table-name = Názov tabuľky +td-table-name-hint = Tu premenujte tabuľku. Odkazy a jej definícia budú naďalej odkazovať na tú istú tabuľku. td-row-display-columns = Stĺpce identifikujúce riadok td-row-display-hint = Oddeľte čiarkami, platí len pre koreňovú tabuľku. td-template-source = Zdroj šablóny @@ -923,14 +924,12 @@ validation-err-permission = Vyžaduje sa oprávnenie na správu validácií. # Pracovisko správy konverzných kurzov rates-title = Konverzné kurzy rates-eyebrow = Pracovisko správcu -rates-description = Nastavte meny profilov, overte konverzie, skontrolujte auditné dôkazy a sledujte poskytovateľov. +rates-description = Nastavte meny profilov, skontrolujte auditné dôkazy a sledujte poskytovateľov. rates-updated = Konverzné kurzy boli aktualizované rates-could-not-continue = Operáciu sa nepodarilo dokončiť rates-sections = Časti pracoviska konverzných kurzov rates-tab-configuration = Konfigurácia rates-tab-configuration-sub = Meny a poskytovatelia -rates-tab-preview = Náhľad -rates-tab-preview-sub = Skúška konverzie rates-tab-evidence = Dôkazy rates-tab-evidence-sub = Kontrola uloženého výsledku rates-tab-providers = Poskytovatelia @@ -955,35 +954,8 @@ rates-append-only-hint = Konfigurácia sa iba rozširuje: pridajte ďalšieho po rates-provider = Poskytovateľ rates-choose-provider = Vyberte poskytovateľa rates-make-default-now = Použiť ako predvoleného poskytovateľa tejto meny -rates-conversion-preview = Náhľad konverzie -rates-preview-hint = Overí rovnaké pravidlá výberu ako účtovanie bez zápisu účtovných údajov. -rates-amount = Pôvodná suma -rates-currency = Pôvodná mena -rates-basis-date = Rozhodujúci dátum konverzie -rates-rate-method = Metóda kurzu -rates-method-automatic = Automatický oficiálny kurz -rates-method-specific = Oficiálny kurz z konkrétneho dňa zverejnenia -rates-method-saved = Uložený vlastný kurz -rates-method-manual = Jednorazový manuálny kurz -rates-date-context = Kontext dátumu -rates-context-ordinary = Bežná transakcia — predchádzajúce zverejnenie -rates-context-statement = Výpis — v deň alebo pred dátumom -rates-specific-date = Dátum zverejnenia -rates-manual-foreign-units = Jednotky cudzej meny na účtovnú jednotku -rates-provider-override = Iný poskytovateľ -rates-use-default-provider = Použiť nastaveného predvoleného rates-reason = Dôvod -rates-reason-hint = Backend ho vyžaduje, keď výnimočný výber potrebuje odôvodnenie. -rates-preview-action = Zobraziť náhľad konverzie -rates-preview-result = Výsledok náhľadu -rates-date-rule = Pravidlo dátumu rates-rate-date = Použitý dátum kurzu -rates-audit-details = Auditné podrobnosti -rates-exact-quote = Presná kotácia -rates-determination = Spôsob určenia -rates-rounding = Spôsob zaokrúhlenia -rates-observation = ID oficiálneho pozorovania -rates-import-batch = ID dávky importu rates-evidence-lookup = Vyhľadanie dôkazov rates-evidence-hint = Vyhľadajte presnú históriu konverzií jednej bunky tabuľky a jej revízií. rates-table = Tabuľka @@ -1001,13 +973,5 @@ rates-provider-health = Stav poskytovateľa rates-provider-health-hint = Overené pokrytie, hranice účtovania a nedávne pokusy o import oficiálneho poskytovateľa. rates-unavailable-title = Konverzné kurzy nie sú dostupné rates-err-profile-missing = Vybraný profil už neexistuje. Zobrazuje sa prvý dostupný profil. -rates-err-preview-method = Vyberte podporovanú metódu kurzu. rates-err-record-id = ID záznamu musí byť kladné celé číslo. rates-configuration-added = Poskytovateľ { $source } bol pridaný pre menu { $currency }. -rates-source-official = Oficiálny -rates-source-saved = Uložený vlastný -rates-source-manual = Jednorazový manuálny -rates-rule-previous = Predchádzajúce zverejnenie -rates-rule-on-or-before = V deň alebo pred dátumom -rates-rule-specific = Konkrétny dátum zverejnenia -rates-unknown = Neznáme diff --git a/web/src/pages/admin/ecb/mod.rs b/web/src/pages/admin/ecb/mod.rs index c2eb048e..b691d2bb 100644 --- a/web/src/pages/admin/ecb/mod.rs +++ b/web/src/pages/admin/ecb/mod.rs @@ -24,10 +24,6 @@ pub(crate) fn router() -> Router { "/admin/exchange-rates/configuration", post(workspace_logic::add_configuration), ) - .route( - "/admin/exchange-rates/preview", - post(workspace_logic::preview), - ) .route( "/admin/exchange-rates/evidence", post(workspace_logic::evidence), diff --git a/web/src/pages/admin/ecb/workspace_loader.rs b/web/src/pages/admin/ecb/workspace_loader.rs index cccb5b6f..589e7c0a 100644 --- a/web/src/pages/admin/ecb/workspace_loader.rs +++ b/web/src/pages/admin/ecb/workspace_loader.rs @@ -128,8 +128,6 @@ pub(crate) async fn load_workspace( settings, can_configure: crate::authz::can_manage(&authorization, crate::authz::STRUCT_TABLE), configuration: inputs.configuration, - preview_form: inputs.preview_form, - preview: inputs.preview, evidence_form: inputs.evidence_form, evidence: inputs.evidence, evidence_has_exchange: inputs.evidence_has_exchange, diff --git a/web/src/pages/admin/ecb/workspace_logic.rs b/web/src/pages/admin/ecb/workspace_logic.rs index 1d021cba..55d71ede 100644 --- a/web/src/pages/admin/ecb/workspace_logic.rs +++ b/web/src/pages/admin/ecb/workspace_logic.rs @@ -9,10 +9,7 @@ use axum_extra::extract::Form; use crate::{ AppState, - definitions::exchange_rates::{ - AddProfileCurrencySourceRequest, ExchangeRateDateRule, ExchangeRateSource, - ListConversionEvidenceRequest, - }, + definitions::exchange_rates::{AddProfileCurrencySourceRequest, ListConversionEvidenceRequest}, services::{authenticated_request, reject_cross_site}, }; @@ -20,8 +17,7 @@ use super::{ state::LoadError, workspace_loader::load_workspace, workspace_state::{ - ConfigurationForm, EvidenceForm, EvidenceView, PreviewForm, PreviewView, WorkspaceInputs, - WorkspaceQuery, + ConfigurationForm, EvidenceForm, EvidenceView, WorkspaceInputs, WorkspaceQuery, }, workspace_ui, }; @@ -90,57 +86,6 @@ pub(crate) async fn add_configuration( } } -pub(crate) async fn preview( - State(state): State, - headers: HeaderMap, - Form(form): Form, -) -> Response { - if let Some(rejection) = reject_cross_site(&headers) { - return rejection; - } - let mut inputs = WorkspaceInputs::for_profile(form.profile.clone()); - inputs.preview_form = form.clone(); - let request = match form.request() { - Ok(request) => request, - Err(key) => { - inputs.error = Some(crate::tr!(crate::i18n::Locale::from_headers(&headers), key)); - return render_loaded( - &headers, - load_workspace(state, &headers, inputs).await, - StatusCode::UNPROCESSABLE_ENTITY, - ); - } - }; - let Ok(request) = authenticated_request(&headers, request) else { - return Redirect::to("/login").into_response(); - }; - let mut exchange_rates = state.exchange_rates.clone(); - match exchange_rates.preview_direct_conversion(request).await { - Ok(response) => { - let response = response.into_inner(); - let locale = crate::i18n::Locale::from_headers(&headers); - inputs.preview = Some(PreviewView { - applied_method: crate::tr!(locale, rate_method_key(response.applied_source)), - applied_date_rule: crate::tr!(locale, date_rule_key(response.applied_date_rule)), - response, - }); - render_loaded( - &headers, - load_workspace(state, &headers, inputs).await, - StatusCode::OK, - ) - } - Err(error) => { - inputs.error = Some(error.message().to_string()); - render_loaded( - &headers, - load_workspace(state, &headers, inputs).await, - StatusCode::UNPROCESSABLE_ENTITY, - ) - } - } -} - pub(crate) async fn evidence( State(state): State, headers: HeaderMap, @@ -204,24 +149,6 @@ pub(crate) async fn evidence( } } -fn rate_method_key(value: i32) -> &'static str { - match ExchangeRateSource::try_from(value).ok() { - Some(ExchangeRateSource::Official) => "rates-source-official", - Some(ExchangeRateSource::SavedCustom) => "rates-source-saved", - Some(ExchangeRateSource::Manual) => "rates-source-manual", - _ => "rates-unknown", - } -} - -fn date_rule_key(value: i32) -> &'static str { - match ExchangeRateDateRule::try_from(value).ok() { - Some(ExchangeRateDateRule::PreviousPublication) => "rates-rule-previous", - Some(ExchangeRateDateRule::OnOrBeforeDate) => "rates-rule-on-or-before", - Some(ExchangeRateDateRule::SpecificPublicationDate) => "rates-rule-specific", - _ => "rates-unknown", - } -} - fn render_loaded( headers: &HeaderMap, result: Result, diff --git a/web/src/pages/admin/ecb/workspace_state.rs b/web/src/pages/admin/ecb/workspace_state.rs index 61d5772c..8c469dab 100644 --- a/web/src/pages/admin/ecb/workspace_state.rs +++ b/web/src/pages/admin/ecb/workspace_state.rs @@ -1,9 +1,6 @@ //! State and form wire formats for the provider-neutral exchange-rate workspace. -use crate::definitions::exchange_rates::{ - ConversionEvidence, ExchangeRateDateRule, ExchangeRateSelection, ExchangeRateSource, - PreviewDirectConversionRequest, PreviewDirectConversionResponse, -}; +use crate::definitions::exchange_rates::ConversionEvidence; use super::state::EcbPageState; @@ -25,92 +22,6 @@ pub(crate) struct ConfigurationForm { pub make_default: bool, } -#[derive(Clone, Debug, serde::Deserialize)] -pub(crate) struct PreviewForm { - #[serde(default)] - pub profile: String, - #[serde(default)] - pub original_amount: String, - #[serde(default)] - pub original_currency: String, - #[serde(default)] - pub conversion_basis_date: String, - #[serde(default = "automatic_official")] - pub method: String, - #[serde(default = "ordinary_context")] - pub context: String, - #[serde(default)] - pub specific_rate_date: String, - #[serde(default)] - pub manual_foreign_units: String, - #[serde(default)] - pub rate_source_id: String, - #[serde(default)] - pub reason: String, -} - -fn automatic_official() -> String { - "automatic-official".to_string() -} - -fn ordinary_context() -> String { - "ordinary".to_string() -} - -impl Default for PreviewForm { - fn default() -> Self { - Self { - profile: String::new(), - original_amount: String::new(), - original_currency: String::new(), - conversion_basis_date: String::new(), - method: automatic_official(), - context: ordinary_context(), - specific_rate_date: String::new(), - manual_foreign_units: String::new(), - rate_source_id: String::new(), - reason: String::new(), - } - } -} - -impl PreviewForm { - pub(crate) fn request(&self) -> Result { - let date_rule = match self.method.as_str() { - "official-specific" | "manual" => ExchangeRateDateRule::SpecificPublicationDate, - _ if self.context == "statement" => ExchangeRateDateRule::OnOrBeforeDate, - _ => ExchangeRateDateRule::PreviousPublication, - }; - let source = match self.method.as_str() { - "automatic-official" | "official-specific" => ExchangeRateSource::Official, - "saved-custom" => ExchangeRateSource::SavedCustom, - "manual" => ExchangeRateSource::Manual, - _ => return Err("rates-err-preview-method"), - }; - let use_default_selection = self.method == "automatic-official" - && self.context != "statement" - && self.rate_source_id.trim().is_empty(); - let selection = (!use_default_selection).then(|| ExchangeRateSelection { - date_rule: date_rule as i32, - source: source as i32, - specific_rate_date: (!self.specific_rate_date.trim().is_empty()) - .then(|| self.specific_rate_date.trim().to_string()), - manual_foreign_units: (!self.manual_foreign_units.trim().is_empty()) - .then(|| self.manual_foreign_units.trim().to_string()), - reason: self.reason.trim().to_string(), - rate_source_id: (!self.rate_source_id.trim().is_empty()) - .then(|| self.rate_source_id.trim().to_string()), - }); - Ok(PreviewDirectConversionRequest { - original_amount: self.original_amount.trim().to_string(), - original_currency: self.original_currency.trim().to_ascii_uppercase(), - conversion_basis_date: self.conversion_basis_date.trim().to_string(), - profile_name: self.profile.clone(), - exchange_rate_selection: selection, - }) - } -} - #[derive(Clone, Debug, Default, serde::Deserialize)] pub(crate) struct EvidenceForm { #[serde(default)] @@ -154,44 +65,6 @@ pub(crate) struct ProfileSettingsView { pub foreign_currencies: Vec, } -#[derive(Clone, Debug)] -pub(crate) struct PreviewView { - pub response: PreviewDirectConversionResponse, - pub applied_method: String, - pub applied_date_rule: String, -} - -impl PreviewView { - pub(crate) fn quote(&self) -> String { - match ( - self.response.accounting_units.as_deref(), - self.response.foreign_units.as_deref(), - self.response.foreign_currency.as_deref(), - ) { - (Some(accounting_units), Some(foreign_units), Some(foreign_currency)) => format!( - "{} {} = {} {}", - accounting_units, - self.response.accounting_currency, - foreign_units, - foreign_currency, - ), - _ => "—".to_string(), - } - } - - pub(crate) fn observation_id(&self) -> String { - self.response - .official_observation_id - .map_or_else(|| "—".to_string(), |id| id.to_string()) - } - - pub(crate) fn import_batch_id(&self) -> String { - self.response - .import_batch_id - .map_or_else(|| "—".to_string(), |id| id.to_string()) - } -} - #[derive(Clone, Debug)] pub(crate) struct EvidenceView { pub evidence: ConversionEvidence, @@ -200,8 +73,6 @@ pub(crate) struct EvidenceView { pub(crate) struct WorkspaceInputs { pub selected_profile: String, pub configuration: ConfigurationForm, - pub preview_form: PreviewForm, - pub preview: Option, pub evidence_form: EvidenceForm, pub evidence: Vec, pub evidence_has_exchange: Option, @@ -215,8 +86,6 @@ impl WorkspaceInputs { Self { selected_profile: profile, configuration: ConfigurationForm::default(), - preview_form: PreviewForm::default(), - preview: None, evidence_form: EvidenceForm::default(), evidence: Vec::new(), evidence_has_exchange: None, @@ -235,8 +104,6 @@ pub(crate) struct ExchangeRateWorkspaceState { pub settings: Option, pub can_configure: bool, pub configuration: ConfigurationForm, - pub preview_form: PreviewForm, - pub preview: Option, pub evidence_form: EvidenceForm, pub evidence: Vec, pub evidence_has_exchange: Option, diff --git a/web/src/pages/admin/ecb/workspace_ui.rs b/web/src/pages/admin/ecb/workspace_ui.rs index ac03ddc5..85121cd9 100644 --- a/web/src/pages/admin/ecb/workspace_ui.rs +++ b/web/src/pages/admin/ecb/workspace_ui.rs @@ -45,7 +45,7 @@ mod tests { state::{EcbPageState, ImportBatchView}, workspace_state::{ ConfigurationForm, CurrencySettingsView, CurrencySourceView, EvidenceForm, - ExchangeRateWorkspaceState, PreviewForm, ProfileSettingsView, + ExchangeRateWorkspaceState, ProfileSettingsView, }, }; @@ -98,8 +98,6 @@ mod tests { }), can_configure: true, configuration: ConfigurationForm::default(), - preview_form: PreviewForm::default(), - preview: None, evidence_form: EvidenceForm::default(), evidence: Vec::new(), evidence_has_exchange: None, @@ -116,7 +114,6 @@ mod tests { assert!(!html.contains("Template error"), "{html}"); assert!(html.contains("Profile configuration"), "{html}"); - assert!(html.contains("Conversion preview"), "{html}"); assert!(html.contains("Evidence lookup"), "{html}"); assert!(html.contains("Provider health"), "{html}"); assert!(html.contains("CZK"), "{html}"); diff --git a/web/templates/pages/admin/ecb/workspace.html b/web/templates/pages/admin/ecb/workspace.html index 05379b3c..8898d871 100644 --- a/web/templates/pages/admin/ecb/workspace.html +++ b/web/templates/pages/admin/ecb/workspace.html @@ -20,7 +20,6 @@ @@ -113,61 +112,6 @@ {% endif %} -
-

{{ nav.tr("rates-conversion-preview") }}

-

{{ nav.tr("rates-preview-hint") }}

-
- -
- - - - - - - - - -
-
-
- - {% if let Some(preview) = page.preview %} -

{{ nav.tr("rates-preview-result") }}

-

{{ preview.response.original_amount }} {{ preview.response.original_currency }} = {{ preview.response.converted_amount }} {{ preview.response.accounting_currency }}

-
-
{{ nav.tr("rates-provider") }}
{{ preview.response.source_id }}
-
{{ nav.tr("rates-rate-method") }}
{{ preview.applied_method }}
-
{{ nav.tr("rates-date-rule") }}
{{ preview.applied_date_rule }}
-
{{ nav.tr("rates-rate-date") }}
{{ preview.response.rate_date.as_deref().unwrap_or("—") }}
-
-
{{ nav.tr("rates-audit-details") }} -
-
{{ nav.tr("rates-exact-quote") }}
{{ preview.quote() }}
-
{{ nav.tr("rates-determination") }}
{{ preview.response.determination_method }}
-
{{ nav.tr("rates-rounding") }}
{{ preview.response.rounding_method }}
-
{{ nav.tr("rates-reason") }}
{{ preview.response.selection_reason }}
-
{{ nav.tr("rates-observation") }}
{{ preview.observation_id() }}
-
{{ nav.tr("rates-import-batch") }}
{{ preview.import_batch_id() }}
-
-
- {% endif %} -
-

{{ nav.tr("rates-evidence-lookup") }}

{{ nav.tr("rates-evidence-hint") }}