syntax = "proto3";

package harbor.ledger.v1;

// Public interface of the ledger service. Client stubs are generated from this file.
service Ledger {
  rpc PostEntry(PostEntryRequest) returns (PostEntryResponse);
  rpc GetBalance(GetBalanceRequest) returns (Balance);
}

message PostEntryRequest {
  string idempotency_key = 1;
  string account_id = 2;
  int64 amount_minor = 3;
  string currency = 4;
}

message PostEntryResponse {
  string entry_id = 1;
}

message GetBalanceRequest {
  string account_id = 1;
}

message Balance {
  string account_id = 1;
  int64 balance_minor = 2;
  string currency = 3;
}
