<?php

namespace Models;

class OrderbookSearchModel
{
    private OrderbookModel $orderbookModel;

    public function __construct()
    {
        $this->orderbookModel = new OrderbookModel();
    }

    public function searchOpenOrders(string $state, string $commodityType): array
    {
        return $this->orderbookModel->findByStateAndCommodity(
            $state,
            $commodityType,
            OrderbookModel::STATUS_OPEN
        );
    }
}
