From 5f2069784d1f7705ec943af4e66d0586538ab069 Mon Sep 17 00:00:00 2001 From: Filipriec Date: Sun, 23 Aug 2026 00:05:31 +0200 Subject: [PATCH] conversions --- common/proto/ecb.proto | 25 +++++++++++++++++++++++-- common/src/proto/descriptor.bin | Bin 189628 -> 190995 bytes common/src/proto/komp_ac.ecb.rs | 25 +++++++++++++++++++++++-- server | 2 +- web/locales/cs/main.ftl | 2 +- web/locales/en/main.ftl | 2 +- web/locales/sk/main.ftl | 2 +- 7 files changed, 50 insertions(+), 8 deletions(-) diff --git a/common/proto/ecb.proto b/common/proto/ecb.proto index 4e3a2da9..6c679df2 100644 --- a/common/proto/ecb.proto +++ b/common/proto/ecb.proto @@ -148,7 +148,7 @@ message PreviewEcbConversionRequest { message PreviewEcbConversionResponse { string original_amount = 1; string original_currency = 2; - string eur_amount = 3; + string converted_amount = 3; string conversion_basis_date = 4; string determination_method = 5; string rounding_method = 6; @@ -174,6 +174,17 @@ message PreviewEcbConversionResponse { ExchangeRateDateRule applied_date_rule = 19; ExchangeRateSource applied_source = 20; string selection_reason = 21; + + // The currency converted_amount is stated in: the profile's accounting + // currency (EUR unless the profile keeps its books in something else). + string converted_currency = 22; + + // True when reaching converted_currency needed two hops (original currency + // to EUR, then EUR to converted_currency) because neither is EUR. The + // fields above then describe only the second, final hop; the full + // provenance of both hops is available from ListEcbConversionEvidence + // after posting. + bool via_two_hop_conversion = 23; } // Identify one logical money cell whose conversion history should be inspected. @@ -206,7 +217,7 @@ message EcbConversionEvidence { int64 row_revision = 2; string original_amount = 3; string original_currency = 4; - string eur_amount = 5; + string converted_amount = 5; string conversion_context = 6; string conversion_basis_date = 7; string determination_method = 8; @@ -232,6 +243,16 @@ message EcbConversionEvidence { // Immutable audit data for an accountant-controlled exception. string selection_reason = 23; optional string selected_by_user_id = 24; + + // The currency converted_amount is stated in. Always EUR for the + // original-currency-to-EUR leg; the profile's native currency for the + // EUR-to-native leg that follows it when that native currency is not EUR. + string converted_currency = 25; + + // Set only on the EUR-to-native-currency leg of a two-hop conversion. Names + // the original-currency-to-EUR leg's evidence_id, which produced this row's + // original_amount/original_currency (always EUR). + optional int64 derived_from_evidence_id = 26; } message ListEcbConversionEvidenceResponse { diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index b8a7c42a44a7fd011783fcd077a48fde21a00504..4e234c520a9cdbe679725c6fcafe1a3274117bf7 100644 GIT binary patch delta 3641 zcmaKv-EULL8OC|XCqDK#U!KIV9g;8!fh0>3U{@6jTPj%C3ek2|Wof$?ts=)cA=WxR z$aWHOWvvz|Qre4Fr`oLgA#t;Rz$#r;&}x+mDOHiEs00-(U*VgJCLobk;)eE_b7p+H z+uh#zotfu1?>zH*{Q8f7NqAQh5&q#XKZz{a>_Wo(jXm2x#9Q-jY0fEEoyqasj5}MZ zW+IXX<6|xL@#Ue|r;!OU!bN>(JU?45JEi>TOozWXS)VzgC&X*KW3G@Jug<&U)9$J9 zU_qtemNIEbVqlbKG4BFCD>QhLR=vEVH|zdR#Gsq@XP zJUjlC`sI(>79;#gp4*~f%a)(A<>B=84E&dmgu%CdFeYb9MW<3(TKS05wF%dKuL8BKxHC?58mpyKtT;oXTql@n@RNy| zkW?7oYC@#HOg)nSj`^8)2%d@l;2L6{dBqyAFZnolpS-{e=vInb2m5E$V6`bNE zY?*N9oPadxRDPH*7bYC(mWro+`zj8&lfzi7GC)Fa_`_4P#UfYU&N-zV3Pie7a>A`n z2PtEl++40u%uN&>sR~JYXWO#Jxy(&fk;N&uqHdw?Xa^jHNl|TK2OK?5cDD)P=y{TT z{3o1QQ4#%&w*1ZeVBe2hKBL$m-v^hYY>Ti~yp4VPUtJ*h9 z*4oe_G+G_X$;ak6gM8nAiWcM92eGF4X>`& z#$nu=DJq-Afm)+PQ0oYRS|brWg9w3IQ_o;NOwsD zcU!|WPBSoety>d8is z5E@b=NcSmGGv{jr>OKi`2aQ18ryT1 z8hk~QnuYa{*nlQA*MLH7P|ZL+3{lNMJtSdns2Qk-)W1`sT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Q_DTsY$)1#Hr zT0L5)5ZD;K2E9}0>NZ|q%V`&~PcNnQ`t(k_kbPRGUC4o!GZ5XTY{1+olUegbK++7d z$tyrf(hM~3-ry@tP1FoJyG$2K%UOs62BnCiv?xW?tV1cHW})rFRV2+~UymVWwVZ=E zWJp<(C@m>VQe)1(0iMVbHHT7-$lhLqQG0pf5>;{4@_qPD0!Q40>0Cu#xOhLI;~0ey!Is#VKHh+flFD@l}=)JoE# zBejyW2yLHGD@luJ^c*y(f|g4V2Mww~6s1KKh+1+<6^L3w$&Pk`s3q(_U`RzRmt9ju zk|-^yNYb)v>Z2l2%dV>;QOkJJR7uN6Zk9{*QrdYe(fSBMhiSP)>m%&#R)0s|RZnOw zS0J9*y&isf@>F>J<&g%ZZ9@~a;x43#T0!Y4gVIE;;OUd*LTy^ELL4!hZM+brCAE>X z>PT%Qt)gUeY$ItE{f8q`gH4sST!T1fP-UVhEvih^nnRU|T0^Pd9wurHM~<4NDq60) zd908`X-O55)?LaKlGf4jWFRXe_$Ic^o, + /// The currency converted_amount is stated in. Always EUR for the + /// original-currency-to-EUR leg; the profile's native currency for the + /// EUR-to-native leg that follows it when that native currency is not EUR. + #[prost(string, tag = "25")] + pub converted_currency: ::prost::alloc::string::String, + /// Set only on the EUR-to-native-currency leg of a two-hop conversion. Names + /// the original-currency-to-EUR leg's evidence_id, which produced this row's + /// original_amount/original_currency (always EUR). + #[prost(int64, optional, tag = "26")] + pub derived_from_evidence_id: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListEcbConversionEvidenceResponse { diff --git a/server b/server index 9a14bb11..0fc100a4 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 9a14bb116a0d281fe7965198cebf6e6689a53f0b +Subproject commit 0fc100a4342846eea066bd239d546f206568cd23 diff --git a/web/locales/cs/main.ftl b/web/locales/cs/main.ftl index 194e2676..ce656ed5 100644 --- a/web/locales/cs/main.ftl +++ b/web/locales/cs/main.ftl @@ -755,7 +755,7 @@ builder-choose-profile = Vyberte profil builder-new-profile = Nový profil… builder-new-profile-name = Název nového profilu builder-accounting-currency = Účetní měna -builder-accounting-currency-hint = Účetnictví se zatím vede v EUR — ostatní měny jsou v seznamu, ale server je zatím odmítá. +builder-accounting-currency-hint = Účetnictví může být vedeno v jakékoli měně, pro kterou ECB zveřejňuje referenční kurz. Jiná měna než EUR se v případě potřeby přepočítá přes EUR, protože kurzy ECB jsou vždy vyjádřeny vůči euru. builder-table-name = Název tabulky builder-add-column-heading = Přidat sloupec builder-add-column-button = Přidat sloupec diff --git a/web/locales/en/main.ftl b/web/locales/en/main.ftl index 8c9f8318..8ecf2d68 100644 --- a/web/locales/en/main.ftl +++ b/web/locales/en/main.ftl @@ -743,7 +743,7 @@ builder-choose-profile = Choose a profile builder-new-profile = New profile… builder-new-profile-name = New profile name builder-accounting-currency = Accounting currency -builder-accounting-currency-hint = Books are kept in EUR for now — other currencies are listed but the server still refuses them. +builder-accounting-currency-hint = Books can be kept in any currency ECB publishes a reference rate for. A currency other than EUR is converted through EUR when needed, since ECB rates are always quoted against the euro. builder-table-name = Table name builder-add-column-heading = Add a column builder-add-column-button = Add column diff --git a/web/locales/sk/main.ftl b/web/locales/sk/main.ftl index fc240161..5949c941 100644 --- a/web/locales/sk/main.ftl +++ b/web/locales/sk/main.ftl @@ -753,7 +753,7 @@ builder-choose-profile = Vyberte profil builder-new-profile = Nový profil… builder-new-profile-name = Názov nového profilu builder-accounting-currency = Účtovná mena -builder-accounting-currency-hint = Účtovníctvo sa zatiaľ vedie v EUR — ostatné meny sú v zozname, ale server ich ešte odmieta. +builder-accounting-currency-hint = Účtovníctvo môže byť vedené v akejkoľvek mene, pre ktorú ECB zverejňuje referenčný kurz. Iná mena ako EUR sa v prípade potreby prepočíta cez EUR, keďže kurzy ECB sú vždy vyjadrené voči euru. builder-table-name = Názov tabuľky builder-add-column-heading = Pridať stĺpec builder-add-column-button = Pridať stĺpec