package quote_response_mapper_v2

import (
	"time"

	feesv1 "github.com/tech/sendico/pkg/proto/billing/fees/v1"
	moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
	paymentv1 "github.com/tech/sendico/pkg/proto/common/payment/v1"
	oraclev1 "github.com/tech/sendico/pkg/proto/oracle/v1"
	quotationv2 "github.com/tech/sendico/pkg/proto/payments/quotation/v2"
)

type QuoteMeta struct {
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type CanonicalQuote struct {
	QuoteRef                string
	TransferPrincipalAmount *moneyv1.Money
	DestinationAmount       *moneyv1.Money
	PayerTotalDebitAmount   *moneyv1.Money
	FeeLines                []*feesv1.DerivedPostingLine
	FeeRules                []*feesv1.AppliedRule
	FXQuote                 *oraclev1.Quote
	Route                   *quotationv2.RouteSpecification
	Conditions              *quotationv2.ExecutionConditions
	ResolvedSettlementMode  paymentv1.SettlementMode
	ResolvedFeeTreatment    quotationv2.FeeTreatment
	ExpiresAt               time.Time
	PricedAt                time.Time
}

type QuoteStatus struct {
	State       quotationv2.QuoteState
	BlockReason quotationv2.QuoteBlockReason
}

type MapInput struct {
	Meta   QuoteMeta
	Quote  CanonicalQuote
	Status QuoteStatus
}

type MapOutput struct {
	Quote       *quotationv2.PaymentQuote
	State       quotationv2.QuoteState
	BlockReason quotationv2.QuoteBlockReason
}
