49 lines
1.9 KiB
Go
49 lines
1.9 KiB
Go
package model
|
|
|
|
// QuoteRequestShape identifies the API surface that created the quote record.
|
|
type QuoteRequestShape string
|
|
|
|
const (
|
|
QuoteRequestShapeUnspecified QuoteRequestShape = "unspecified"
|
|
QuoteRequestShapeSingle QuoteRequestShape = "single"
|
|
QuoteRequestShapeBatch QuoteRequestShape = "batch"
|
|
)
|
|
|
|
// QuoteState captures v2 quote state metadata for persistence.
|
|
type QuoteState string
|
|
|
|
const (
|
|
QuoteStateUnspecified QuoteState = "unspecified"
|
|
QuoteStateIndicative QuoteState = "indicative"
|
|
QuoteStateExecutable QuoteState = "executable"
|
|
QuoteStateBlocked QuoteState = "blocked"
|
|
QuoteStateExpired QuoteState = "expired"
|
|
)
|
|
|
|
// QuoteBlockReason captures v2 non-executability reason for persistence.
|
|
type QuoteBlockReason string
|
|
|
|
const (
|
|
QuoteBlockReasonUnspecified QuoteBlockReason = "unspecified"
|
|
QuoteBlockReasonRouteUnavailable QuoteBlockReason = "route_unavailable"
|
|
QuoteBlockReasonLimitBlocked QuoteBlockReason = "limit_blocked"
|
|
QuoteBlockReasonRiskBlocked QuoteBlockReason = "risk_blocked"
|
|
QuoteBlockReasonInsufficientLiquidity QuoteBlockReason = "insufficient_liquidity"
|
|
QuoteBlockReasonPriceStale QuoteBlockReason = "price_stale"
|
|
QuoteBlockReasonAmountTooSmall QuoteBlockReason = "amount_too_small"
|
|
QuoteBlockReasonAmountTooLarge QuoteBlockReason = "amount_too_large"
|
|
)
|
|
|
|
// QuoteStatusV2 stores execution status metadata from quotation v2.
|
|
type QuoteStatusV2 struct {
|
|
State QuoteState `bson:"state,omitempty" json:"state,omitempty"`
|
|
BlockReason QuoteBlockReason `bson:"blockReason,omitempty" json:"blockReason,omitempty"`
|
|
}
|
|
|
|
// PaymentQuoteItemV2 keeps one intent/quote/status tuple in a stable shape.
|
|
type PaymentQuoteItemV2 struct {
|
|
Intent *PaymentIntent `bson:"intent,omitempty" json:"intent,omitempty"`
|
|
Quote *PaymentQuoteSnapshot `bson:"quote,omitempty" json:"quote,omitempty"`
|
|
Status *QuoteStatusV2 `bson:"status,omitempty" json:"status,omitempty"`
|
|
}
|