<?php

namespace CouponsPlus\App\Coupon\Tree\Data;

use CouponsPlus\Original\Collections\Collection;
use CouponsPlus\Original\Collections\Mapper\Types;

class AppData
{
    /**
     * @var DataWithSource<Collection>
     */
    public DataWithSource $grove;
    /**
     * @var DataWithSource<Collection>
     */
    public DataWithSource $partialRelations;
    /**
     * @var DataWithSource<Collection>
     */
    public DataWithSource $preloadedData;
    /**
     * @var DataWithSource<object|null>
     */
    public DataWithSource $preconditions;
    /**
     * @var DataWithSource<object|null>
     */
    public DataWithSource $predates;
    public bool $autoApply;

    public $version = 1;
    public string $model;

    /**
     * @param DataWithSource<Collection> $grove
     * @param DataWithSource<Collection> $partialRelations
     * @param DataWithSource<Collection> $preloadedData
     * @param DataWithSource<object|null> $preconditions
     * @param DataWithSource<object|null> $predates
     * @param bool $autoApply
     */
    public function __construct(
        DataWithSource $grove,
        DataWithSource $partialRelations,
        DataWithSource $preloadedData,
        DataWithSource $preconditions,
        DataWithSource $predates,
        bool $autoApply = false,
        string $model = 'tree'
    )
    {
        $this->grove = $grove;
        $this->partialRelations = $partialRelations;
        $this->preloadedData = $preloadedData;
        $this->preconditions = $preconditions;
        $this->predates = $predates;
        $this->autoApply = $autoApply;
        $this->model = $model;
    }
}