140 lines
4.2 KiB
Protocol Buffer
140 lines
4.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package komp_ac.exchange_rates;
|
|
|
|
enum ExchangeRateDateRule {
|
|
EXCHANGE_RATE_DATE_RULE_UNSPECIFIED = 0;
|
|
EXCHANGE_RATE_DATE_RULE_PREVIOUS_PUBLICATION = 1;
|
|
EXCHANGE_RATE_DATE_RULE_ON_OR_BEFORE_DATE = 2;
|
|
EXCHANGE_RATE_DATE_RULE_SPECIFIC_PUBLICATION_DATE = 3;
|
|
}
|
|
|
|
enum ExchangeRateSource {
|
|
EXCHANGE_RATE_SOURCE_UNSPECIFIED = 0;
|
|
EXCHANGE_RATE_SOURCE_OFFICIAL = 1;
|
|
EXCHANGE_RATE_SOURCE_SAVED_CUSTOM = 2;
|
|
EXCHANGE_RATE_SOURCE_MANUAL = 3;
|
|
}
|
|
|
|
message ExchangeRateSelection {
|
|
ExchangeRateDateRule date_rule = 1;
|
|
ExchangeRateSource source = 2;
|
|
optional string specific_rate_date = 3;
|
|
optional string manual_foreign_units = 4;
|
|
string reason = 5;
|
|
}
|
|
|
|
service ExchangeRateService {
|
|
rpc PreviewDirectConversion(PreviewDirectConversionRequest)
|
|
returns (PreviewDirectConversionResponse);
|
|
rpc ListConversionEvidence(ListConversionEvidenceRequest)
|
|
returns (ListConversionEvidenceResponse);
|
|
rpc GetProfileExchangeRateSettings(GetProfileExchangeRateSettingsRequest)
|
|
returns (ProfileExchangeRateSettings);
|
|
rpc AddProfileForeignCurrency(AddProfileForeignCurrencyRequest)
|
|
returns (ProfileForeignCurrency);
|
|
}
|
|
|
|
message PreviewDirectConversionRequest {
|
|
string original_amount = 1;
|
|
string original_currency = 2;
|
|
string conversion_basis_date = 3;
|
|
string profile_name = 4;
|
|
optional ExchangeRateSelection exchange_rate_selection = 5;
|
|
}
|
|
|
|
message PreviewDirectConversionResponse {
|
|
string original_amount = 1;
|
|
string original_currency = 2;
|
|
string converted_amount = 3;
|
|
string accounting_currency = 4;
|
|
string conversion_basis_date = 5;
|
|
string determination_method = 6;
|
|
string rounding_method = 7;
|
|
optional string rate_date = 8;
|
|
optional string accounting_units = 9;
|
|
optional string foreign_currency = 10;
|
|
optional string foreign_units = 11;
|
|
string source_id = 12;
|
|
optional int64 rate_observation_id = 13;
|
|
optional string observation_hash = 14;
|
|
optional string source_payload_hash = 15;
|
|
optional string rate_fetched_at = 16;
|
|
optional int64 import_batch_id = 17;
|
|
optional string source_endpoint = 18;
|
|
optional int64 custom_rate_table_definition_id = 19;
|
|
optional int64 custom_rate_record_id = 20;
|
|
optional int64 custom_rate_row_revision = 21;
|
|
optional string custom_rate_note = 22;
|
|
ExchangeRateDateRule applied_date_rule = 23;
|
|
ExchangeRateSource applied_source = 24;
|
|
string selection_reason = 25;
|
|
}
|
|
|
|
message ListConversionEvidenceRequest {
|
|
string profile_name = 1;
|
|
string table_name = 2;
|
|
int64 record_id = 3;
|
|
string column_name = 4;
|
|
int32 limit = 5;
|
|
optional int64 before_evidence_id = 6;
|
|
}
|
|
|
|
message ConversionEvidence {
|
|
int64 evidence_id = 1;
|
|
int64 row_revision = 2;
|
|
string original_amount = 3;
|
|
string original_currency = 4;
|
|
string converted_amount = 5;
|
|
string accounting_currency = 6;
|
|
string accounting_units = 7;
|
|
string foreign_currency = 8;
|
|
string foreign_units = 9;
|
|
string conversion_context = 10;
|
|
string conversion_basis_date = 11;
|
|
string determination_method = 12;
|
|
string rounding_method = 13;
|
|
optional string rate_date = 14;
|
|
string source_id = 15;
|
|
optional int64 rate_observation_id = 16;
|
|
optional string observation_hash = 17;
|
|
optional string source_payload_hash = 18;
|
|
optional string rate_fetched_at = 19;
|
|
optional int64 import_batch_id = 20;
|
|
optional string source_endpoint = 21;
|
|
string evidence_created_at = 22;
|
|
optional int64 custom_rate_table_definition_id = 23;
|
|
optional int64 custom_rate_record_id = 24;
|
|
optional int64 custom_rate_row_revision = 25;
|
|
optional string custom_rate_note = 26;
|
|
string selection_reason = 27;
|
|
optional string selected_by_user_id = 28;
|
|
}
|
|
|
|
message ListConversionEvidenceResponse {
|
|
bool has_exchange = 1;
|
|
repeated ConversionEvidence evidence = 2;
|
|
bool has_more = 3;
|
|
}
|
|
|
|
message GetProfileExchangeRateSettingsRequest { string profile_name = 1; }
|
|
|
|
message ProfileForeignCurrency {
|
|
string currency = 1;
|
|
bool coverage_complete = 2;
|
|
optional string verified_from_date = 3;
|
|
optional string verified_through_date = 4;
|
|
}
|
|
|
|
message ProfileExchangeRateSettings {
|
|
string profile_name = 1;
|
|
string accounting_currency = 2;
|
|
string rate_source_id = 3;
|
|
repeated ProfileForeignCurrency foreign_currencies = 4;
|
|
}
|
|
|
|
message AddProfileForeignCurrencyRequest {
|
|
string profile_name = 1;
|
|
string currency = 2;
|
|
}
|