package com.wyz.demo.dao;

import com.wyz.demo.po.OrderPO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderRepository {


    // 根据sender_id查订单
    public List<OrderPO> getOrdersBySenderId(int sender_id);

    // 根据receiver_id查订单
    public List<OrderPO> getOrdersByReceiverId(int receiver_id);

    // 提交订单
    public void addOrder(OrderPO orderPO);


    // 返回所有 未接单 的订单
    public List<OrderPO> getAllUnpickOrders();


    // 根据id查订单
    public OrderPO getOrderById(int id);


    // 接单
    public void pickOrder(@Param("order_id") int order_id, @Param("receiver_id")int receiver_id);

    // 取消接单
    public void cancelPickedOrder(int order_id);

    // 确认接单送达
    public void confirmPickedOrder(int order_id);

    /**
     * 下单者-取消订单
     */
    void cancelOrder(int order_id);


    /**
     * 下单者-确认完成
     */
    void confirmOrder(int order_id);
}
