<?php

namespace App\Exceptions;

use RuntimeException;
use App\Lottery\ErrorCode;
use App\Support\ApiResponse;

/**
 * 玩家钱包划转等业务失败时抛出，由控制器捕获并转为 {@see ApiResponse} JSON。
 *
 * @property-read int $lotteryCode {@see ErrorCode}
 */
final class WalletOperationException extends RuntimeException
{
    public function __construct(
        string $message,
        public readonly int $lotteryCode,
        public readonly int $httpStatus = 400,
    ) {
        parent::__construct($message);
    }
}
