conversions5

This commit is contained in:
Filipriec
2026-08-23 15:50:03 +02:00
parent af7016e4c7
commit 0c33d1fa5c
20 changed files with 1197 additions and 845 deletions

View File

@@ -1,36 +1,13 @@
// This file is @generated by prost-build.
/// Accountant-controlled conversion treatment. Exceptional choices remain
/// explicit and auditable rather than being inferred from a legal label.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExchangeRateSelection {
#[prost(enumeration = "ExchangeRateDateRule", tag = "1")]
pub date_rule: i32,
#[prost(enumeration = "ExchangeRateSource", tag = "2")]
pub source: i32,
/// Required for SPECIFIC_PUBLICATION_DATE and MANUAL; YYYY-MM-DD.
#[prost(string, optional, tag = "3")]
pub specific_rate_date: ::core::option::Option<::prost::alloc::string::String>,
/// Required only for MANUAL. Exact foreign-currency units per one unit of
/// the rate source's pivot currency (EUR for ECB).
#[prost(string, optional, tag = "4")]
pub manual_units_per_pivot: ::core::option::Option<::prost::alloc::string::String>,
/// Required for SPECIFIC_PUBLICATION_DATE and MANUAL.
#[prost(string, tag = "5")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetEcbPipelineStatusRequest {
/// Optional. How many recent import attempts to return. Zero uses 20; the
/// maximum is 100.
#[prost(int32, tag = "1")]
pub batch_limit: i32,
}
/// One row of the append-only import audit log.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EcbImportBatch {
#[prost(int64, tag = "1")]
pub batch_id: i64,
/// "running", "succeeded" or "failed".
#[prost(string, tag = "2")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
@@ -43,59 +20,44 @@ pub struct EcbImportBatch {
pub started_at: ::prost::alloc::string::String,
#[prost(string, optional, tag = "7")]
pub completed_at: ::core::option::Option<::prost::alloc::string::String>,
/// Present on a batch that advanced coverage.
#[prost(string, optional, tag = "8")]
pub verified_through_date: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, optional, tag = "9")]
pub observation_count: ::core::option::Option<i32>,
/// May be lower than observation_count: an observation already recorded by an
/// earlier batch is kept rather than replaced.
#[prost(int32, optional, tag = "10")]
pub inserted_observation_count: ::core::option::Option<i32>,
#[prost(string, optional, tag = "11")]
pub error_message: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EcbCurrencyCoverage {
#[prost(string, tag = "1")]
pub currency: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub status: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub verified_from_date: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub verified_through_date: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEcbPipelineStatusResponse {
/// Latest date a successful batch verified. Absent when nothing has ever
/// succeeded, which is what a pipeline that has never run looks like.
#[prost(string, optional, tag = "1")]
pub verified_through_date: ::core::option::Option<::prost::alloc::string::String>,
/// The date coverage should have reached by now, derived from the same
/// publication rule the importer schedules against. Comparing the two is what
/// "healthy" means.
#[prost(string, tag = "2")]
pub latest_verifiable_date: ::prost::alloc::string::String,
/// True when verified coverage has reached latest_verifiable_date. A
/// conversion whose publication date falls beyond coverage is refused, so
/// this answers "will posting work right now".
#[prost(bool, tag = "3")]
pub healthy: bool,
/// Publication days between coverage and latest_verifiable_date. Zero when
/// healthy.
#[prost(int32, tag = "4")]
pub days_behind: i32,
/// True while a batch holds the single-running lock.
#[prost(bool, tag = "5")]
pub import_running: bool,
/// When the scheduler next wakes, from the same cutoff the importer uses.
#[prost(string, tag = "6")]
pub next_import_at: ::prost::alloc::string::String,
/// Newest first, running and failed attempts included.
#[prost(message, repeated, tag = "7")]
pub batches: ::prost::alloc::vec::Vec<EcbImportBatch>,
/// Distinct currencies observed on verified_through_date, so a coverage gap
/// for one currency is visible even when the date itself is covered.
#[prost(string, repeated, tag = "8")]
pub covered_currencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Current coverage restated as the question a reader actually has: what may
/// be posted right now. Both are the latest basis date whose derived
/// publication date is still covered, under the two rules
/// required_publication_date applies -- transactions look strictly before the
/// basis date, statements and decisive dates look at it directly, so the
/// transaction bound is the later of the two. Derived here rather than by the
/// caller so it cannot disagree with the calendar the conversion path uses.
/// Absent when nothing has ever been verified and nothing can be posted.
#[prost(string, optional, tag = "9")]
pub transactions_postable_through: ::core::option::Option<
::prost::alloc::string::String,
@@ -104,292 +66,8 @@ pub struct GetEcbPipelineStatusResponse {
pub statements_postable_through: ::core::option::Option<
::prost::alloc::string::String,
>,
}
/// Exact inputs for a conversion preview. Decimal values are strings so the
/// client never loses precision through binary floating point.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PreviewEcbConversionRequest {
#[prost(string, tag = "1")]
pub original_amount: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub original_currency: ::prost::alloc::string::String,
/// ISO calendar date (YYYY-MM-DD) of the accounting case.
#[prost(string, tag = "3")]
pub conversion_basis_date: ::prost::alloc::string::String,
/// Required. Profile whose rates apply. Consulted when the selection requests
/// a saved custom rate, and always required so the preview names its books.
#[prost(string, tag = "4")]
pub profile_name: ::prost::alloc::string::String,
/// Empty uses previous publication and ECB.
#[prost(message, optional, tag = "5")]
pub exchange_rate_selection: ::core::option::Option<ExchangeRateSelection>,
}
/// The conversion and immutable local ECB observation that would be used now.
/// No rounding is performed and no conversion evidence is persisted.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PreviewEcbConversionResponse {
#[prost(string, tag = "1")]
pub original_amount: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub original_currency: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub converted_amount: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub conversion_basis_date: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub determination_method: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub rounding_method: ::prost::alloc::string::String,
#[prost(string, optional, tag = "7")]
pub rate_date: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "8")]
pub units_per_pivot: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int64, optional, tag = "9")]
pub rate_observation_id: ::core::option::Option<i64>,
#[prost(string, optional, tag = "10")]
pub observation_hash: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "11")]
pub source_payload_hash: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "12")]
pub rate_fetched_at: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int64, optional, tag = "13")]
pub import_batch_id: ::core::option::Option<i64>,
#[prost(string, optional, tag = "14")]
pub source_endpoint: ::core::option::Option<::prost::alloc::string::String>,
/// Present only when determination_method is custom_rate. rate_date and
/// units_per_pivot then describe the hand-entered row identified here, and
/// the ECB observation fields above are empty.
#[prost(int64, optional, tag = "15")]
pub custom_rate_table_definition_id: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "16")]
pub custom_rate_record_id: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "17")]
pub custom_rate_row_revision: ::core::option::Option<i64>,
#[prost(string, optional, tag = "18")]
pub custom_rate_note: ::core::option::Option<::prost::alloc::string::String>,
/// Accountant-supplied justification for an exceptional publication date or
/// one-off manual rate. Empty for the normal/default rule.
#[prost(enumeration = "ExchangeRateDateRule", tag = "19")]
pub applied_date_rule: i32,
#[prost(enumeration = "ExchangeRateSource", tag = "20")]
pub applied_source: i32,
#[prost(string, tag = "21")]
pub selection_reason: ::prost::alloc::string::String,
/// The currency converted_amount is stated in: the profile's accounting
/// currency (EUR unless the profile keeps its books in something else).
#[prost(string, tag = "22")]
pub converted_currency: ::prost::alloc::string::String,
/// 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.
#[prost(bool, tag = "23")]
pub via_two_hop_conversion: bool,
}
/// Identify one logical money cell whose conversion history should be inspected.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListEcbConversionEvidenceRequest {
/// Required. Profile containing the table.
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
/// Required. Logical table name within the profile.
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
/// Required. Dynamic table row id.
#[prost(int64, tag = "3")]
pub record_id: i64,
/// Required. Current display name of the money column. The server resolves it
/// to the stable physical column name used by immutable evidence.
#[prost(string, tag = "4")]
pub column_name: ::prost::alloc::string::String,
/// Optional. Maximum rows to return. Zero uses 100; maximum is 500.
#[prost(int32, tag = "5")]
pub limit: i32,
/// Optional cursor. Return evidence ids lower than this value.
#[prost(int64, optional, tag = "6")]
pub before_evidence_id: ::core::option::Option<i64>,
}
/// One immutable explanation of how a posted EUR value was determined.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EcbConversionEvidence {
#[prost(int64, tag = "1")]
pub evidence_id: i64,
/// Exact committed version of the target dynamic-table row.
#[prost(int64, tag = "2")]
pub row_revision: i64,
#[prost(string, tag = "3")]
pub original_amount: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub original_currency: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub converted_amount: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub conversion_context: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub conversion_basis_date: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub determination_method: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub rounding_method: ::prost::alloc::string::String,
#[prost(string, optional, tag = "10")]
pub rate_date: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "11")]
pub units_per_pivot: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int64, optional, tag = "12")]
pub rate_observation_id: ::core::option::Option<i64>,
#[prost(string, optional, tag = "13")]
pub observation_hash: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "14")]
pub source_payload_hash: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "15")]
pub rate_fetched_at: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int64, optional, tag = "16")]
pub import_batch_id: ::core::option::Option<i64>,
#[prost(string, optional, tag = "17")]
pub source_endpoint: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "18")]
pub evidence_created_at: ::prost::alloc::string::String,
/// Present only when determination_method is custom_rate. The hand-entered row
/// that supplied rate_date and units_per_pivot. The row itself stays editable, so
/// the figures above are the immutable record of what was actually applied.
#[prost(int64, optional, tag = "19")]
pub custom_rate_table_definition_id: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "20")]
pub custom_rate_record_id: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "21")]
pub custom_rate_row_revision: ::core::option::Option<i64>,
#[prost(string, optional, tag = "22")]
pub custom_rate_note: ::core::option::Option<::prost::alloc::string::String>,
/// Immutable audit data for an accountant-controlled exception.
#[prost(string, tag = "23")]
pub selection_reason: ::prost::alloc::string::String,
#[prost(string, optional, tag = "24")]
pub selected_by_user_id: ::core::option::Option<::prost::alloc::string::String>,
/// 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<i64>,
/// The pivot currency of the rate source that priced this hop (EUR for
/// every hop today). A rate-based hop always has this currency on exactly
/// one side of original_currency/converted_currency.
#[prost(string, tag = "27")]
pub pivot_currency: ::prost::alloc::string::String,
/// Which rate source's policy governs this hop's profile ("ecb" for every
/// hop today). Absent only for already_same_currency, where no policy
/// needed to be consulted. This is about which policy applies, not about
/// who actually supplied this specific rate -- see observation_source_id
/// for that.
#[prost(string, optional, tag = "28")]
pub policy_source_id: ::core::option::Option<::prost::alloc::string::String>,
/// Which rate source actually supplied this hop's rate as its own official
/// observation. Present only when determination_method is
/// official_reference_rate; absent for custom_rate, manual_rate, and
/// already_same_currency, since none of those were priced by the policy's
/// source itself -- a human entered them.
#[prost(string, optional, tag = "29")]
pub observation_source_id: ::core::option::Option<::prost::alloc::string::String>,
/// Exact immutable profile policy version selected for this conversion's
/// accounting date. Absent only when no conversion policy was needed because
/// determination_method is already_same_currency.
#[prost(int64, optional, tag = "30")]
pub rate_source_policy_id: ::core::option::Option<i64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEcbConversionEvidenceResponse {
/// True when at least one evidence row for this cell used an ECB, saved
/// custom, or one-off manual rate.
#[prost(bool, tag = "1")]
pub has_exchange: bool,
/// Newest-first immutable history for this page.
#[prost(message, repeated, tag = "2")]
pub evidence: ::prost::alloc::vec::Vec<EcbConversionEvidence>,
/// True when another page exists using the last evidence_id as the cursor.
#[prost(bool, tag = "3")]
pub has_more: bool,
}
/// How the publication date is selected from the accounting basis date.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExchangeRateDateRule {
Unspecified = 0,
/// Latest TARGET publication strictly before the basis date.
PreviousPublication = 1,
/// Latest TARGET publication on or before the basis date.
OnOrBeforeDate = 2,
/// The exact publication date supplied in specific_rate_date.
SpecificPublicationDate = 3,
}
impl ExchangeRateDateRule {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "EXCHANGE_RATE_DATE_RULE_UNSPECIFIED",
Self::PreviousPublication => "EXCHANGE_RATE_DATE_RULE_PREVIOUS_PUBLICATION",
Self::OnOrBeforeDate => "EXCHANGE_RATE_DATE_RULE_ON_OR_BEFORE_DATE",
Self::SpecificPublicationDate => {
"EXCHANGE_RATE_DATE_RULE_SPECIFIC_PUBLICATION_DATE"
}
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXCHANGE_RATE_DATE_RULE_UNSPECIFIED" => Some(Self::Unspecified),
"EXCHANGE_RATE_DATE_RULE_PREVIOUS_PUBLICATION" => {
Some(Self::PreviousPublication)
}
"EXCHANGE_RATE_DATE_RULE_ON_OR_BEFORE_DATE" => Some(Self::OnOrBeforeDate),
"EXCHANGE_RATE_DATE_RULE_SPECIFIC_PUBLICATION_DATE" => {
Some(Self::SpecificPublicationDate)
}
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExchangeRateSource {
Unspecified = 0,
/// The rate source's own published reference rate (ECB's, today).
Official = 1,
/// A reusable rate from the profile's custom_exchange_rates table.
SavedCustom = 2,
/// A one-off rate recorded only in this posting's immutable evidence.
Manual = 3,
}
impl ExchangeRateSource {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "EXCHANGE_RATE_SOURCE_UNSPECIFIED",
Self::Official => "EXCHANGE_RATE_SOURCE_OFFICIAL",
Self::SavedCustom => "EXCHANGE_RATE_SOURCE_SAVED_CUSTOM",
Self::Manual => "EXCHANGE_RATE_SOURCE_MANUAL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXCHANGE_RATE_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
"EXCHANGE_RATE_SOURCE_OFFICIAL" => Some(Self::Official),
"EXCHANGE_RATE_SOURCE_SAVED_CUSTOM" => Some(Self::SavedCustom),
"EXCHANGE_RATE_SOURCE_MANUAL" => Some(Self::Manual),
_ => None,
}
}
#[prost(message, repeated, tag = "11")]
pub currency_coverage: ::prost::alloc::vec::Vec<EcbCurrencyCoverage>,
}
/// Generated client implementations.
pub mod ecb_service_client {
@@ -402,11 +80,8 @@ pub mod ecb_service_client {
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Read-only access to ECB conversion previews and audit evidence.
///
/// This service exists for manual visual verification before and after posting.
/// Preview performs the authoritative unrounded backend calculation without
/// writing; evidence exposes conversions already recorded by posting workflows.
/// ECB-only operational details. Conversion selection and evidence live in the
/// provider-neutral exchange_rates contract.
#[derive(Debug, Clone)]
pub struct EcbServiceClient<T> {
inner: tonic::client::Grpc<T>,
@@ -487,67 +162,6 @@ pub mod ecb_service_client {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Preview the exact conversion the backend would currently perform.
/// This reads local verified ECB data and never persists conversion evidence.
pub async fn preview_ecb_conversion(
&mut self,
request: impl tonic::IntoRequest<super::PreviewEcbConversionRequest>,
) -> std::result::Result<
tonic::Response<super::PreviewEcbConversionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.ecb.EcbService/PreviewEcbConversion",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("komp_ac.ecb.EcbService", "PreviewEcbConversion"),
);
self.inner.unary(req, path, codec).await
}
/// List immutable ECB conversion evidence for one money value.
pub async fn list_ecb_conversion_evidence(
&mut self,
request: impl tonic::IntoRequest<super::ListEcbConversionEvidenceRequest>,
) -> std::result::Result<
tonic::Response<super::ListEcbConversionEvidenceResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.ecb.EcbService/ListEcbConversionEvidence",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.ecb.EcbService",
"ListEcbConversionEvidence",
),
);
self.inner.unary(req, path, codec).await
}
/// Health of the reference-rate import pipeline: how far verified coverage
/// reaches, how far it should reach by now, and how the recent import
/// attempts went. Not profile-scoped -- one pipeline feeds every profile.
pub async fn get_ecb_pipeline_status(
&mut self,
request: impl tonic::IntoRequest<super::GetEcbPipelineStatusRequest>,
@@ -589,26 +203,6 @@ pub mod ecb_service_server {
/// Generated trait containing gRPC methods that should be implemented for use with EcbServiceServer.
#[async_trait]
pub trait EcbService: std::marker::Send + std::marker::Sync + 'static {
/// Preview the exact conversion the backend would currently perform.
/// This reads local verified ECB data and never persists conversion evidence.
async fn preview_ecb_conversion(
&self,
request: tonic::Request<super::PreviewEcbConversionRequest>,
) -> std::result::Result<
tonic::Response<super::PreviewEcbConversionResponse>,
tonic::Status,
>;
/// List immutable ECB conversion evidence for one money value.
async fn list_ecb_conversion_evidence(
&self,
request: tonic::Request<super::ListEcbConversionEvidenceRequest>,
) -> std::result::Result<
tonic::Response<super::ListEcbConversionEvidenceResponse>,
tonic::Status,
>;
/// Health of the reference-rate import pipeline: how far verified coverage
/// reaches, how far it should reach by now, and how the recent import
/// attempts went. Not profile-scoped -- one pipeline feeds every profile.
async fn get_ecb_pipeline_status(
&self,
request: tonic::Request<super::GetEcbPipelineStatusRequest>,
@@ -617,11 +211,8 @@ pub mod ecb_service_server {
tonic::Status,
>;
}
/// Read-only access to ECB conversion previews and audit evidence.
///
/// This service exists for manual visual verification before and after posting.
/// Preview performs the authoritative unrounded backend calculation without
/// writing; evidence exposes conversions already recorded by posting workflows.
/// ECB-only operational details. Conversion selection and evidence live in the
/// provider-neutral exchange_rates contract.
#[derive(Debug)]
pub struct EcbServiceServer<T> {
inner: Arc<T>,
@@ -698,104 +289,6 @@ pub mod ecb_service_server {
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/komp_ac.ecb.EcbService/PreviewEcbConversion" => {
#[allow(non_camel_case_types)]
struct PreviewEcbConversionSvc<T: EcbService>(pub Arc<T>);
impl<
T: EcbService,
> tonic::server::UnaryService<super::PreviewEcbConversionRequest>
for PreviewEcbConversionSvc<T> {
type Response = super::PreviewEcbConversionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PreviewEcbConversionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as EcbService>::preview_ecb_conversion(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = PreviewEcbConversionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.ecb.EcbService/ListEcbConversionEvidence" => {
#[allow(non_camel_case_types)]
struct ListEcbConversionEvidenceSvc<T: EcbService>(pub Arc<T>);
impl<
T: EcbService,
> tonic::server::UnaryService<
super::ListEcbConversionEvidenceRequest,
> for ListEcbConversionEvidenceSvc<T> {
type Response = super::ListEcbConversionEvidenceResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::ListEcbConversionEvidenceRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as EcbService>::list_ecb_conversion_evidence(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListEcbConversionEvidenceSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.ecb.EcbService/GetEcbPipelineStatus" => {
#[allow(non_camel_case_types)]
struct GetEcbPipelineStatusSvc<T: EcbService>(pub Arc<T>);