You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB
Go

package model
import "time"
const (
// BuffRefillPriceRUB is the price in rubles to refill any regular buff's charges.
BuffRefillPriceRUB = 50
// ResurrectionRefillPriceRUB is the price in rubles to refill resurrection charges.
ResurrectionRefillPriceRUB = 150
)
// 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"`
}