35 lines
1.7 KiB
Go
35 lines
1.7 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/tech/sendico/pkg/db/storable"
|
|
"github.com/tech/sendico/pkg/model"
|
|
)
|
|
|
|
// PaymentQuoteRecord stores a quoted payment snapshot for later execution.
|
|
type PaymentQuoteRecord struct {
|
|
storable.Base `bson:",inline" json:",inline"`
|
|
model.OrganizationBoundBase `bson:",inline" json:",inline"`
|
|
|
|
QuoteRef string `bson:"quoteRef" json:"quoteRef"`
|
|
IdempotencyKey string `bson:"idempotencyKey" json:"idempotencyKey"`
|
|
Intent PaymentIntent `bson:"intent,omitempty" json:"intent,omitempty"`
|
|
Intents []PaymentIntent `bson:"intents,omitempty" json:"intents,omitempty"`
|
|
Quote *PaymentQuoteSnapshot `bson:"quote,omitempty" json:"quote,omitempty"`
|
|
Quotes []*PaymentQuoteSnapshot `bson:"quotes,omitempty" json:"quotes,omitempty"`
|
|
StatusV2 *QuoteStatusV2 `bson:"statusV2,omitempty" json:"statusV2,omitempty"`
|
|
StatusesV2 []*QuoteStatusV2 `bson:"statusesV2,omitempty" json:"statusesV2,omitempty"`
|
|
Plan *PaymentPlan `bson:"plan,omitempty" json:"plan,omitempty"`
|
|
Plans []*PaymentPlan `bson:"plans,omitempty" json:"plans,omitempty"`
|
|
ExecutionNote string `bson:"executionNote,omitempty" json:"executionNote,omitempty"`
|
|
ExpiresAt time.Time `bson:"expiresAt" json:"expiresAt"`
|
|
PurgeAt time.Time `bson:"purgeAt,omitempty" json:"purgeAt,omitempty"`
|
|
Hash string `bson:"hash" json:"hash"`
|
|
}
|
|
|
|
// Collection implements storable.Storable.
|
|
func (*PaymentQuoteRecord) Collection() string {
|
|
return "payment_quotes"
|
|
}
|