<?php
/**
 * @author Aitoc Team
 * @copyright Copyright (c) 2020 Aitoc (https://www.aitoc.com)
 * @package Aitoc_PreOrders
 */

/**
 * Copyright © 2018 Aitoc. All rights reserved.
 * Developed by Alex Yakimovich
 */

namespace Aitoc\PreOrders\Api;

use Aitoc\PreOrders\Api\Data\OrderItemPreOrderSettingsInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Api\SearchCriteriaInterface;
use Aitoc\PreOrders\Api\Data\OrderItemPreOrderSettingsSearchResultsInterface;

/**
 * Order Item Pre-Order Settings Repository interface.
 * @api
 */
interface OrderItemPreOrderSettingsRepositoryInterface
{
    /**
     * Save entity.
     *
     * @param OrderItemPreOrderSettingsInterface $settings
     * @return OrderItemPreOrderSettingsInterface
     * @throws LocalizedException
     */
    public function save(OrderItemPreOrderSettingsInterface $settings);

    /**
     * Retrieve entity.
     *
     * @param int $settingsId
     * @return OrderItemPreOrderSettingsInterface
     * @throws LocalizedException
     */
    public function get($settingsId);

    /**
     * Retrieve entity list by criteria.
     *
     * @param SearchCriteriaInterface $searchCriteria
     * @return OrderItemPreOrderSettingsSearchResultsInterface
     * @throws LocalizedException
     */
    public function getList(SearchCriteriaInterface $searchCriteria);

    /**
     * Delete entity.
     *
     * @param OrderItemPreOrderSettingsInterface $settings
     * @return bool true on success
     * @throws LocalizedException
     */
    public function delete(OrderItemPreOrderSettingsInterface $settings);

    /**
     * Delete entity by ID.
     *
     * @param int $settingsId
     * @return bool true on success
     * @throws NoSuchEntityException
     * @throws LocalizedException
     */
    public function deleteById($settingsId);
}
