package mq

import "mengyastore-backend/internal/email"

// OrderEmailPayload is the JSON body published to RabbitMQ (no SMTP secrets).
type OrderEmailPayload struct {
	ToEmail     string   `json:"toEmail"`
	ToName      string   `json:"toName"`
	ProductName string   `json:"productName"`
	OrderID     string   `json:"orderId"`
	Quantity    int      `json:"quantity"`
	Codes       []string `json:"codes"`
	IsManual    bool     `json:"isManual"`
}

func (p OrderEmailPayload) ToNotifyData() email.OrderNotifyData {
	return email.OrderNotifyData{
		ToEmail:     p.ToEmail,
		ToName:      p.ToName,
		ProductName: p.ProductName,
		OrderID:     p.OrderID,
		Quantity:    p.Quantity,
		Codes:       p.Codes,
		IsManual:    p.IsManual,
	}
}
