<?php

declare(strict_types=1);

namespace BookiFlex\Extensions\NotificationPreview\Repository;

use BookiFlex\Core\Contract\RatePlan\RatePlanRepositoryInterface;
use BookiFlex\Core\Model\RatePlan\BoardType;
use BookiFlex\Core\Model\RatePlan\RatePlan;

defined( 'ABSPATH' ) || exit;

class FakeRatePlanRepository implements RatePlanRepositoryInterface
{
    public function findOne(array $scope = []): ?object
    {
        return $this->getRatePlan();
    }

    public function findByPK(mixed $id): ?object
    {
        return $this->getRatePlan();
    }

    public function findAll(array $scope = []): iterable
    {
        return [$this->getRatePlan()];
    }

    private function getRatePlan(): RatePlan
    {
        return new RatePlan(
            'Base',
            '',
            '',
            'BSD',
            true,
            [],
            [],
            BoardType::ALL_INCLUSIVE
        );
    }
}