Yimaru-BackEnd/internal/domain/atlas.go
2025-10-20 15:16:39 +03:00

152 lines
4.5 KiB
Go

package domain
import "errors"
type AtlasGameInitRequest struct {
Game string `json:"game"`
PlayerID string `json:"player_id"`
Language string `json:"language"`
Currency string `json:"currency"`
}
type AtlasGameInitResponse struct {
URL string `json:"url"`
}
type AtlasGetUserDataRequest struct {
Game string `json:"game"`
CasinoID string `json:"casino_id"`
PlayerID string `json:"player_id"`
SessionID string `json:"session_id"`
// timestamp and hash will also be included in the incoming JSON
}
type AtlasGetUserDataResponse struct {
PlayerID string `json:"player_id"`
Balance float64 `json:"balance"`
}
type AtlasBetRequest struct {
Game string `json:"game"`
CasinoID string `json:"casino_id"`
PlayerID string `json:"player_id"`
SessionID string `json:"session_id"`
Amount float64 `json:"amount"`
Currency string `json:"currency"`
RoundID int64 `json:"round_id"`
TransactionID string `json:"transaction_id"`
Details string `json:"details"`
}
type AtlasBetResponse struct {
PlayerID string `json:"player_id"`
Balance float64 `json:"balance"`
}
type AtlasBetWinRequest struct {
Game string `json:"game"`
CasinoID string `json:"casino_id"`
RoundID string `json:"round_id"`
PlayerID string `json:"player_id"`
SessionID string `json:"session_id"`
BetAmount float64 `json:"betAmount"`
WinAmount float64 `json:"winAmount"`
Currency string `json:"currency"`
TransactionID string `json:"transaction_id"`
Timestamp string `json:"timestamp"`
Hash string `json:"hash"`
}
type AtlasBetWinResponse struct {
PlayerID string `json:"player_id"`
Balance float64 `json:"balance"`
}
type RoundResultRequest struct {
Game string `json:"game"`
RoundID int64 `json:"round_id"`
CasinoID string `json:"casino_id"`
PlayerID string `json:"player_id"`
Amount float64 `json:"amount"` // win amount
Currency string `json:"currency"`
TransactionID string `json:"transaction_id"` // new transaction id
BetTransactionID string `json:"bet_transaction_id"` // from BET request
SessionID string `json:"session_id"`
Timestamp string `json:"timestamp"`
Hash string `json:"hash"`
}
type RoundResultResponse struct {
Success bool `json:"success"`
}
type RollbackRequest struct {
Game string `json:"game"`
RoundID int64 `json:"round_id"`
CasinoID string `json:"casino_id"`
PlayerID string `json:"player_id"`
BetTransactionID string `json:"bet_transaction_id"`
SessionID string `json:"session_id"`
Timestamp string `json:"timestamp"`
Hash string `json:"hash"`
}
type RollbackResponse struct {
Success bool `json:"success"`
}
type FreeSpinRequest struct {
CasinoID string `json:"casino_id"`
PlayerID string `json:"player_id"`
EndDate string `json:"end_date"` // "yyyy-mm-ddTHH:MM:SS+00:00"
FreeSpinsCount int `json:"freespins_count"` // count of free spins/bets
Timestamp string `json:"timestamp"`
Hash string `json:"hash"`
}
type FreeSpinResponse struct {
Success bool `json:"success"`
}
type FreeSpinResultRequest struct {
Game string `json:"game"`
RoundID int64 `json:"round_id"`
CasinoID string `json:"casino_id"`
PlayerID string `json:"player_id"`
Amount float64 `json:"amount"` // win amount
Currency string `json:"currency"`
TransactionID string `json:"transaction_id"`
SessionID string `json:"session_id"`
Timestamp string `json:"timestamp"`
Hash string `json:"hash"`
}
type FreeSpinResultResponse struct {
Success bool `json:"success"`
}
type JackpotRequest struct {
Game string `json:"game"`
CasinoID string `json:"casino_id"`
PlayerID string `json:"player_id"`
SessionID string `json:"session_id"`
Amount float64 `json:"amount"` // jackpot win
Currency string `json:"currency"`
RoundID int64 `json:"round_id"`
TransactionID string `json:"transaction_id"`
Details string `json:"details,omitempty"`
Timestamp string `json:"timestamp"`
Hash string `json:"hash"`
}
type JackpotResponse struct {
Success bool `json:"success"`
}
var (
ErrPlayerNotFound = errors.New("PLAYER_NOT_FOUND")
ErrSessionExpired = errors.New("SESSION_EXPIRED")
ErrWalletsNotFound = errors.New("WALLETS_NOT_FOUND")
ErrDuplicateTransaction = errors.New("DUPLICATE_TRANSACTION")
)