<?php


namespace Meibuyu\Rpc\Service\Interfaces\PurchaseNew;


interface PurchaseStockServiceInterface
{

    /**
     * 收货记录rpc
    {

    "batch_no": "batch_no",
    "purchase_no": "1634197133",
    "product": [{
    "id": 24,
    "received_num":22 //收货数量
    }]
    }
     *
     *
     * response
     * {
    "flag"=>true|false
     *  "error_msg"=>''
     *  }
     * @param $post
     * @return array
     */
    public function receiptOperation($post) :array ;


    /**
     * 入库记录rpc
    {
    "batch_no": "batch_no",
    "purchase_no": "1634197133",
    "stored_person":"入库操作人"
    "product": [{
    "id": 24,
    "stored_num":22 //入库数量
    }]
    }
     * @param $post
     * @return array
     */
    public function warehousingOperation($post):array;



    /**
     * 退款记录rpc
    {
    "id": 28,
    "purchase_id": 26,
    "purchase_no": "1634197133",
    "product": [{
    "id": 24,
    "return_num":22 //已退货数量
    }]
    }
     * @param $post
     * @return array
     */
    public function refundOperation($post):array;


    /**
     * 获取采购在途的数量总和
     * @return mixed
     */
    public function getShippingCount();



    /**
     * 发货产品处理
     * @param $post
     {
        "logistics_no": "物流单号",
        "source_type":"product-dev",
        "operate_user":"操作人名",
        "type": "Return(退货)| Exchange (换货) | Receipt(签收)",
        "detail": [{
            "source_no": "来源单号",
            "child_sku": "仓库子产品sku",
            "num": "退换货数量"
        }]
      }
     * @return  true | string (error_msg)
     */
    public function  deliveryProductsDeal($post);


    /**
     * 更新新品开发采购单的sku码
     * $data = [
     *   'sub_order_no' => 1,
     *   'product_main_sku' => 1,
     *   'product_sku' => 1,
     * ]
     * @param $data
     * @return int
     * @author chentianyu
     */
    public function updateDevelopPurchaseSkuCode($data);


    /**
     * 采购单仓库入库虚拟发票匹配推送,便于发票登记
     * @example
     * {
        "warehousing_no":"仓库入库单号",
        "virtual_invoice_details":[
            {
                "virtual_invoice_no":"虚拟发票号",
                "invoice_serial_no":"发票流水号",
                "sub_order_no":"采购子订单号",
                "batch_no":"采购批次号"
            }
        ]
    }
     * @param $post
     * @author Liu lu
     * date 2023-10-20
     */
    public function warehousingVirtualInvoicePush($post);


    /**
     * 同步仓库缺票管理的采购开票(采购补票开票) 针对确认-不开票的子订单号标记
     * @LogTrace()
     * @param $post ['sub_order_no'] 子订单号数组
     * @author Liu lu
     * date 2023-10-24
     */
    public function  syncSupplementInvoicingSubOrderNos($post);


    /**
     * 补票开票退税单删除推送
     * @author Liu lu
     * date 2023-10-25
     */
    public function supplementInvoiceCancelPush($post);


}