<?php
/**
 * @author  Magediary
 * @package Magediary_ProductQuestion
 */

namespace Magediary\ProductQuestion\Api;

use Magediary\ProductQuestion\Api\Data\AnswerInterface;

interface AnswerRepositoryInterface
{
    /**
     * Save Answer
     *
     * @param AnswerInterface $answer
     * @return AnswerInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function save(
        AnswerInterface $answer
    );

    /**
     * Retrieve Answer
     *
     * @param string $answerId
     * @return AnswerInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function getById($answerId);

    /**
     * Retrieve Answer matching the specified criteria.
     *
     * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
     * @return \Magediary\ProductQuestion\Api\Data\AnswerSearchResultsInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function getList(
        \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
    );

    /**
     * Delete Answer
     *
     * @param AnswerInterface $answer
     * @return bool true on success
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function delete(
        AnswerInterface $answer
    );

    /**
     * Delete Answer by ID
     *
     * @param string $answerId
     * @return bool true on success
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function deleteById($answerId);
}
