outbox for gateways
This commit is contained in:
@@ -7,7 +7,6 @@ option go_package = "github.com/tech/sendico/pkg/proto/payments/quotation/v2;quo
|
||||
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/fx/v1/fx.proto";
|
||||
import "api/proto/billing/fees/v1/fees.proto";
|
||||
import "api/proto/oracle/v1/oracle.proto";
|
||||
|
||||
@@ -18,11 +17,11 @@ enum QuoteKind {
|
||||
QUOTE_KIND_INDICATIVE = 2; // informational only
|
||||
}
|
||||
|
||||
enum QuoteState {
|
||||
QUOTE_STATE_UNSPECIFIED = 0;
|
||||
enum QuoteLifecycle {
|
||||
QUOTE_LIFECYCLE_UNSPECIFIED = 0;
|
||||
|
||||
QUOTE_STATE_ACTIVE = 1;
|
||||
QUOTE_STATE_EXPIRED = 2;
|
||||
QUOTE_LIFECYCLE_ACTIVE = 1;
|
||||
QUOTE_LIFECYCLE_EXPIRED = 2;
|
||||
}
|
||||
|
||||
enum QuoteBlockReason {
|
||||
@@ -37,12 +36,68 @@ enum QuoteBlockReason {
|
||||
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;
|
||||
}
|
||||
|
||||
// Abstract execution route selected during quotation.
|
||||
// This is not an execution plan and must not contain operational steps.
|
||||
message RouteSpecification {
|
||||
string rail = 1;
|
||||
string provider = 2;
|
||||
string payout_method = 3;
|
||||
string settlement_asset = 4;
|
||||
string settlement_model = 5;
|
||||
string network = 6;
|
||||
string route_ref = 7;
|
||||
string pricing_profile_ref = 8;
|
||||
repeated RouteHop hops = 9;
|
||||
}
|
||||
|
||||
// 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;
|
||||
QuoteKind kind = 2;
|
||||
QuoteState state = 3;
|
||||
optional QuoteBlockReason block_reason = 4;
|
||||
QuoteLifecycle lifecycle = 3;
|
||||
|
||||
// Execution-status rules:
|
||||
// 1) kind=QUOTE_KIND_INDICATIVE => execution_status must be unset.
|
||||
// 2) lifecycle=QUOTE_LIFECYCLE_EXPIRED => execution_status must be unset.
|
||||
// 3) kind=QUOTE_KIND_EXECUTABLE and lifecycle=QUOTE_LIFECYCLE_ACTIVE => execution_status must be set.
|
||||
oneof execution_status {
|
||||
bool executable = 13; // must be true when set
|
||||
QuoteBlockReason block_reason = 4;
|
||||
}
|
||||
|
||||
common.money.v1.Money debit_amount = 5;
|
||||
common.money.v1.Money credit_amount = 6;
|
||||
@@ -56,4 +111,8 @@ message PaymentQuote {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user