optimization on the client steel scripts3 - removing datafusion from the steel dependencies
This commit is contained in:
53
common/proto/currency_conversion.proto
Normal file
53
common/proto/currency_conversion.proto
Normal file
@@ -0,0 +1,53 @@
|
||||
syntax = "proto3";
|
||||
package komp_ac.currency_conversion;
|
||||
|
||||
service CurrencyConversion {
|
||||
rpc ConvertCurrency(ConvertCurrencyRequest) returns (ConvertCurrencyResponse);
|
||||
rpc ResolveRate(ResolveRateRequest) returns (ResolvedFxRate);
|
||||
rpc ListRequiredCurrencies(ListRequiredCurrenciesRequest)
|
||||
returns (ListRequiredCurrenciesResponse);
|
||||
}
|
||||
|
||||
message ConvertCurrencyRequest {
|
||||
string amount = 1;
|
||||
string source_currency = 2;
|
||||
string target_currency = 3;
|
||||
string source = 4;
|
||||
string as_of_date = 5;
|
||||
}
|
||||
|
||||
message ResolveRateRequest {
|
||||
string source_currency = 1;
|
||||
string target_currency = 2;
|
||||
string source = 3;
|
||||
string as_of_date = 4;
|
||||
}
|
||||
|
||||
message FxRateComponent {
|
||||
string currency = 1;
|
||||
string units_per_base = 2;
|
||||
}
|
||||
|
||||
message ResolvedFxRate {
|
||||
string source_currency = 1;
|
||||
string target_currency = 2;
|
||||
string rate = 3;
|
||||
string effective_date = 4;
|
||||
string source = 5;
|
||||
int64 rate_set_id = 6;
|
||||
int32 revision = 7;
|
||||
string base_currency = 8;
|
||||
repeated FxRateComponent components = 9;
|
||||
}
|
||||
|
||||
message ConvertCurrencyResponse {
|
||||
string amount = 1;
|
||||
string currency = 2;
|
||||
ResolvedFxRate resolved_rate = 3;
|
||||
}
|
||||
|
||||
message ListRequiredCurrenciesRequest {}
|
||||
|
||||
message ListRequiredCurrenciesResponse {
|
||||
repeated string currencies = 1;
|
||||
}
|
||||
@@ -63,9 +63,9 @@ service TableScript {
|
||||
//
|
||||
// The server derives the required inputs from stored script_dependencies;
|
||||
// callers do not choose arbitrary tables or columns. Direct related-column
|
||||
// reads are grouped by related row, while related aggregates are evaluated
|
||||
// through the analytics runtime. Returned values include logical type and
|
||||
// currency metadata so the client can create correctly typed ScriptValues.
|
||||
// reads and related aggregates are evaluated through SQLx in one read-only
|
||||
// PostgreSQL snapshot. Returned values include logical type and currency
|
||||
// metadata so the client can create correctly typed ScriptValues.
|
||||
//
|
||||
// Current-table column values are intentionally not returned. The client
|
||||
// supplies those directly from row_data so unsaved edits participate in
|
||||
@@ -185,6 +185,14 @@ message ScriptDependency {
|
||||
string operation = 5;
|
||||
// Relationship table used to match the owner row to the related collection.
|
||||
string via_table = 6;
|
||||
// Source currency for an fx_conversion dependency.
|
||||
string from_currency = 7;
|
||||
// Target currency for an fx_conversion dependency.
|
||||
string to_currency = 8;
|
||||
// Persisted exchange-rate provider/source identifier.
|
||||
string source = 9;
|
||||
// Requested YYYY-MM-DD date, or empty for the latest stored snapshot.
|
||||
string as_of_date = 10;
|
||||
}
|
||||
|
||||
// Identifies the active form row whose external Steel inputs must be hydrated.
|
||||
@@ -243,4 +251,18 @@ message HydrateScriptDependenciesResponse {
|
||||
repeated HydratedColumnValue columns = 1;
|
||||
// Exact related aggregate inputs declared by stored scripts.
|
||||
repeated HydratedAggregateValue aggregates = 2;
|
||||
// Exact resolved rates declared by the table's stored scripts.
|
||||
repeated HydratedFxRate fx_rates = 3;
|
||||
}
|
||||
|
||||
message HydratedFxRate {
|
||||
string from_currency = 1;
|
||||
string to_currency = 2;
|
||||
string source = 3;
|
||||
string requested_as_of_date = 4;
|
||||
string rate = 5;
|
||||
string effective_date = 6;
|
||||
int64 rate_set_id = 7;
|
||||
int32 revision = 8;
|
||||
string base_currency = 9;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user