<?php

namespace App\Game\BetBy;

class BetSlipItem
{
    public $id;
    public $timestamp;
    public $player_id;
    public $operator_id;
    public $operator_brand_id;
    public $ext_player_id;
    public $currency;
    public $type;
    public $sum;
    public $k;
    public $is_quick_bet;
    public $bets;

    public function __construct(array $data)
    {
        $this->id = $data['id'];
        $this->timestamp = $data['timestamp'];
        $this->player_id = $data['player_id'];
        $this->operator_id = $data['operator_id'];
        $this->operator_brand_id = $data['operator_brand_id'];
        $this->ext_player_id = $data['ext_player_id'];
        $this->currency = $data['currency'];
        $this->type = $data['type'];
        $this->sum = $data['sum'];
        $this->k = $data['k'];
        $this->is_quick_bet = $data['is_quick_bet'];
        $this->bets = array_map(function ($bet) {
            return new BetItem($bet);
        }, $data['bets']);
    }
}
