
package com.tmerclub.cloud.order.service;

import com.tmerclub.cloud.order.model.OrderInvoice;
import com.tmerclub.cloud.order.vo.OrderInvoiceVO;

import java.util.List;

/**
 * @author Pineapple
 * @date 2021/8/2 8:57
 */

public interface OrderInvoiceService {


    /**
     * 根据id获取
     *
     * @param orderInvoiceId id
     * @return
     */
    OrderInvoice getByOrderInvoiceId(Long orderInvoiceId);

    /**
     * 保存
     * @param orderInvoice
     * @param userId
     */
    void save(Long userId, OrderInvoice orderInvoice);

    /**
     * 批量保存
     * @param orderInvoices
     * @param userId
     */
    void saveBatch(List<OrderInvoice> orderInvoices);

    /**
     * 更新
     * @param orderInvoice
     */
    void update(OrderInvoice orderInvoice);

    /**
     * 根据id删除
     * @param orderInvoiceId id
     */
    void deleteById(Long orderInvoiceId);

    /**
     * 根据订单发票id获取，app端使用
     * @param orderInvoiceId 订单发票id
     * @return 信息
     */
    OrderInvoiceVO getById(Long orderInvoiceId);

    /**
     * 根据订单id获取发票id
     * @param orderId 订单id
     * @return
     */
    Long getByOrderId(Long orderId, Long shopId, Long supplierId);

    /**
     * 该订单是否已经开具发票
     * @param orderId
     * @return
     */
    boolean isUpload(Long orderId, Long shopId, Long supplierId);

    /**
     * 批量删除
     * @param orderIds 被取消的订单id
     */
    void deleteBatch(List<Long> orderIds);
}
