<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Cart;

use CpCreation\VitiCore\Cart\Model\Promo;

final class PromoEligibilityResult
{
    public function __construct(
        public readonly ?Promo $promo,
        public readonly ?string $status = null,
        public readonly ?string $messageKey = null,
    ) {
    }

    public function isApplied(): bool
    {
        return null !== $this->promo && CartPromo::STATUS_APPLIED === $this->status;
    }
}
