<?php
/**
 * Copyright ©  All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Leadlion\SmartBill\Api;

use Magento\Framework\Api\SearchCriteriaInterface;

interface InvoiceRepositoryInterface
{

    /**
     * Save Invoice
     * @param \Leadlion\SmartBill\Api\Data\InvoiceInterface $invoice
     * @return \Leadlion\SmartBill\Api\Data\InvoiceInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function save(
        \Leadlion\SmartBill\Api\Data\InvoiceInterface $invoice
    );

    /**
     * Retrieve Invoice
     * @param string $invoiceId
     * @return \Leadlion\SmartBill\Api\Data\InvoiceInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function get($invoiceId);

    /**
     * Retrieve Invoice matching the specified criteria.
     * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
     * @return \Leadlion\SmartBill\Api\Data\InvoiceSearchResultsInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function getList(
        \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
    );

    /**
     * Delete Invoice
     * @param \Leadlion\SmartBill\Api\Data\InvoiceInterface $invoice
     * @return bool true on success
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function delete(
        \Leadlion\SmartBill\Api\Data\InvoiceInterface $invoice
    );

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

