Files
sendico/api/proto/payments/quotation/v2/interface.proto
2026-02-18 20:38:08 +01:00

115 lines
3.1 KiB
Protocol Buffer

syntax = "proto3";
package payments.quotation.v2;
option go_package = "github.com/tech/sendico/pkg/proto/payments/quotation/v2;quotationv2";
import "google/protobuf/timestamp.proto";
import "api/proto/common/storable/v1/storable.proto";
import "api/proto/common/money/v1/money.proto";
import "api/proto/common/payment/v1/asset.proto";
import "api/proto/billing/fees/v1/fees.proto";
import "api/proto/oracle/v1/oracle.proto";
enum QuoteState {
QUOTE_STATE_UNSPECIFIED = 0;
QUOTE_STATE_INDICATIVE = 1;
QUOTE_STATE_EXECUTABLE = 2;
QUOTE_STATE_BLOCKED = 3;
QUOTE_STATE_EXPIRED = 4;
}
enum QuoteBlockReason {
QUOTE_BLOCK_REASON_UNSPECIFIED = 0;
QUOTE_BLOCK_REASON_ROUTE_UNAVAILABLE = 1;
QUOTE_BLOCK_REASON_LIMIT_BLOCKED = 2;
QUOTE_BLOCK_REASON_RISK_BLOCKED = 3;
QUOTE_BLOCK_REASON_INSUFFICIENT_LIQUIDITY = 4;
QUOTE_BLOCK_REASON_PRICE_STALE = 5;
QUOTE_BLOCK_REASON_AMOUNT_TOO_SMALL = 6;
QUOTE_BLOCK_REASON_AMOUNT_TOO_LARGE = 7;
}
enum QuoteExecutionReadiness {
QUOTE_EXECUTION_READINESS_UNSPECIFIED = 0;
QUOTE_EXECUTION_READINESS_LIQUIDITY_READY = 1;
QUOTE_EXECUTION_READINESS_LIQUIDITY_OBTAINABLE = 2;
QUOTE_EXECUTION_READINESS_INDICATIVE = 3;
}
enum RouteHopRole {
ROUTE_HOP_ROLE_UNSPECIFIED = 0;
ROUTE_HOP_ROLE_SOURCE = 1;
ROUTE_HOP_ROLE_TRANSIT = 2;
ROUTE_HOP_ROLE_DESTINATION = 3;
}
message RouteHop {
uint32 index = 1;
string rail = 2;
string gateway = 3;
string instance_id = 4;
string network = 5;
RouteHopRole role = 6;
}
message RouteSettlement {
common.payment.v1.ChainAsset asset = 1;
string model = 2;
}
// Abstract execution route selected during quotation.
// This is not an execution plan and must not contain operational steps.
message RouteSpecification {
// Optional summary fields. Topology is represented by hops + route_ref.
string rail = 1;
string provider = 2;
string payout_method = 3;
reserved 4, 5;
reserved "settlement_asset", "settlement_model";
string network = 6;
string route_ref = 7;
string pricing_profile_ref = 8;
repeated RouteHop hops = 9;
RouteSettlement settlement = 10;
}
// Execution assumptions and constraints evaluated at quotation time.
// Operational planning is performed by the execution layer later.
message ExecutionConditions {
QuoteExecutionReadiness readiness = 1;
bool batching_eligible = 2;
bool prefunding_required = 3;
bool prefunding_cost_included = 4;
bool liquidity_check_required_at_execution = 5;
string latency_hint = 6;
repeated string assumptions = 7;
}
message PaymentQuote {
common.storable.v1.Storable storable = 1;
QuoteState state = 2;
QuoteBlockReason block_reason = 4;
reserved 3, 13;
reserved "kind", "lifecycle", "executable";
common.money.v1.Money debit_amount = 5;
common.money.v1.Money credit_amount = 6;
repeated fees.v1.DerivedPostingLine fee_lines = 7;
repeated fees.v1.AppliedRule fee_rules = 8;
oracle.v1.Quote fx_quote = 9;
string quote_ref = 10;
google.protobuf.Timestamp expires_at = 11;
google.protobuf.Timestamp priced_at = 12;
RouteSpecification route = 14;
ExecutionConditions execution_conditions = 15;
common.money.v1.Money total_cost = 16;
}