syntax = "proto3";

package payments.quotation.v2;

option go_package = "github.com/tech/sendico/pkg/proto/payments/quotation/v2;quotationv2";

import "api/proto/payments/shared/v1/shared.proto";
import "api/proto/common/money/v1/money.proto";
import "api/proto/common/payment/v1/settlement.proto";
import "api/proto/payments/endpoint/v1/endpoint.proto";
import "api/proto/payments/quotation/v2/interface.proto";

// QuoteIntent describes the intent behind a v2 quote request.
message QuoteIntent {
  payments.endpoint.v1.PaymentEndpoint source = 1;
  payments.endpoint.v1.PaymentEndpoint destination = 2;
  common.money.v1.Money amount = 3;
  common.payment.v1.SettlementMode settlement_mode = 4;
  payments.quotation.v2.FeeTreatment fee_treatment = 5;
  string settlement_currency = 6;
  string comment = 7;
  payments.shared.v1.FXIntent fx = 8;
}

// QuotePaymentRequest is the request to quote a single v2 payment.
message QuotePaymentRequest {
  payments.shared.v1.RequestMeta meta = 1;
  string idempotency_key = 2;
  payments.quotation.v2.QuoteIntent intent = 3;
  bool preview_only = 4;
  string initiator_ref = 5;
}

// QuotePaymentResponse is the response for QuotePayment.
message QuotePaymentResponse {
  payments.quotation.v2.PaymentQuote quote = 1;
  string idempotency_key = 2;
}

// QuotePaymentsRequest is the request to quote multiple v2 payments in a batch.
message QuotePaymentsRequest {
  payments.shared.v1.RequestMeta meta = 1;
  string idempotency_key = 2;
  repeated payments.quotation.v2.QuoteIntent intents = 3;
  bool preview_only = 4;
  string initiator_ref = 5;
}

// QuotePaymentsResponse is the response for QuotePayments.
message QuotePaymentsResponse {
  string quote_ref = 1;
  repeated payments.quotation.v2.PaymentQuote quotes = 3;
  string idempotency_key = 4;
}

// QuotationService provides v2 payment quoting capabilities.
service QuotationService {
  // QuotePayment returns a quote for a single payment request.
  rpc QuotePayment(QuotePaymentRequest) returns (QuotePaymentResponse);
  // QuotePayments returns quotes for multiple payment requests.
  rpc QuotePayments(QuotePaymentsRequest) returns (QuotePaymentsResponse);
}
