exporting ECB

This commit is contained in:
Priec
2026-08-13 09:11:41 +02:00
parent f8e483efa8
commit fe8ea680e3
24 changed files with 895 additions and 1 deletions

View File

@@ -16,6 +16,70 @@ service EcbService {
// List immutable ECB conversion evidence for one money value.
rpc ListEcbConversionEvidence(ListEcbConversionEvidenceRequest)
returns (ListEcbConversionEvidenceResponse);
// 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.
rpc GetEcbPipelineStatus(GetEcbPipelineStatusRequest)
returns (GetEcbPipelineStatusResponse);
}
message GetEcbPipelineStatusRequest {
// Optional. How many recent import attempts to return. Zero uses 20; the
// maximum is 100.
int32 batch_limit = 1;
}
// One row of the append-only import audit log.
message EcbImportBatch {
int64 batch_id = 1;
// "running", "succeeded" or "failed".
string status = 2;
string requested_from = 3;
string requested_through = 4;
string endpoint = 5;
string started_at = 6;
optional string completed_at = 7;
// Present on a batch that advanced coverage.
optional string verified_through_date = 8;
optional int32 observation_count = 9;
// May be lower than observation_count: an observation already recorded by an
// earlier batch is kept rather than replaced.
optional int32 inserted_observation_count = 10;
optional string error_message = 11;
}
message GetEcbPipelineStatusResponse {
// Latest date a successful batch verified. Absent when nothing has ever
// succeeded, which is what a pipeline that has never run looks like.
optional string verified_through_date = 1;
// 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.
string latest_verifiable_date = 2;
// 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".
bool healthy = 3;
// Publication days between coverage and latest_verifiable_date. Zero when
// healthy.
int32 days_behind = 4;
// True while a batch holds the single-running lock.
bool import_running = 5;
// When the scheduler next wakes, from the same cutoff the importer uses.
string next_import_at = 6;
// Newest first, running and failed attempts included.
repeated EcbImportBatch batches = 7;
// Distinct currencies observed on verified_through_date, so a coverage gap
// for one currency is visible even when the date itself is covered.
repeated string covered_currencies = 8;
}
// Conversion basis rule used to select an ECB publication.