<?php

namespace KupShop\GraphQLBundle\ApiPos\Types\Stats;

use TheCodingMachine\GraphQLite\Annotations\Field;
use TheCodingMachine\GraphQLite\Annotations\Type;

/**
 * @Type()
 */
class PosStats
{
    private $paidByCash;
    private $paidByCard;
    private $paidByInvoice;
    private $summary;
    private \Decimal $paidOfTheInvoiceCash;
    private \Decimal $paidOfTheInvoiceCard;

    public function __construct(
        PosPaymentStats $paidByCash,
        PosPaymentStats $paidByCard,
        PosPaymentStats $paidByInvoice,
        \Decimal $paidOfTheInvoiceCash,
        \Decimal $paidOfTheInvoiceCard,
        PosSummaryStats $summary,
    ) {
        $this->paidByCard = $paidByCard;
        $this->paidByCash = $paidByCash;
        $this->paidByInvoice = $paidByInvoice;
        $this->paidOfTheInvoiceCash = $paidOfTheInvoiceCash;
        $this->paidOfTheInvoiceCard = $paidOfTheInvoiceCard;
        $this->summary = $summary;
    }

    /**
     * Nákup přes kartu.
     *
     * @Field()
     */
    public function getCard(): PosPaymentStats
    {
        return $this->paidByCard;
    }

    /**
     * Nákup pomocí hotovosti.
     *
     * @Field()
     */
    public function getCash(): PosPaymentStats
    {
        return $this->paidByCash;
    }

    /**
     * Nákup na fakturu.
     *
     * @Field()
     */
    public function getInvoice(): PosPaymentStats
    {
        return $this->paidByInvoice;
    }

    /**
     * Celkové vyhodnocení.
     *
     * @Field()
     */
    public function getSummary(): PosSummaryStats
    {
        return $this->summary;
    }

    /**
     * Uhrazeno na fakturu - hotově.
     *
     * @Field()
     */
    public function getPaidOfTheInvoiceCash(): string
    {
        return $this->paidOfTheInvoiceCash->asString();
    }

    /**
     * Uhrazeno na fakturu - kartou.
     *
     * @Field()
     */
    public function getPaidOfTheInvoiceCard(): string
    {
        return $this->paidOfTheInvoiceCard->asString();
    }
}
