package model

import (
	"time"

	"github.com/denisovdennis/autohero/internal/tuning"
)

func BuffRefillPrice() int {
	return int(tuning.Get().BuffRefillPriceRUB)
}

func ResurrectionRefillPrice() int {
	return int(tuning.Get().ResurrectionRefillPriceRUB)
}

// PaymentType identifies the kind of purchase.
type PaymentType string

const (
	PaymentBuffReplenish         PaymentType = "buff_replenish"
	PaymentResurrectionReplenish PaymentType = "resurrection_replenish"
)

// PaymentStatus tracks the lifecycle of a payment.
type PaymentStatus string

const (
	PaymentPending   PaymentStatus = "pending"
	PaymentCompleted PaymentStatus = "completed"
	PaymentFailed    PaymentStatus = "failed"
)

// Payment records a purchase transaction.
type Payment struct {
	ID          int64         `json:"id"`
	HeroID      int64         `json:"heroId"`
	Type        PaymentType   `json:"type"`
	BuffType    string        `json:"buffType,omitempty"`
	AmountRUB   int           `json:"amountRub"`
	Status      PaymentStatus `json:"status"`
	CreatedAt   time.Time     `json:"createdAt"`
	CompletedAt *time.Time    `json:"completedAt,omitempty"`
}
