package cn.iocoder.yudao.module.order.listener;

import cn.iocoder.yudao.framework.apollo.core.event.AssignConfirmedCustomerEvent;
import cn.iocoder.yudao.module.order.service.orderException.OrderExceptionService;
import lombok.AllArgsConstructor;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 订单相关操作日志监听
 *
 * @author zhengYi
 */
@Component("AssignConfirmedCustomerListener")
@AllArgsConstructor
public class AssignConfirmedCustomerListener {

    private final OrderExceptionService orderExceptionService;

    /**
     * 添加客户分配确认监听
     *
     * @param event 客户id
     */
    @EventListener(AssignConfirmedCustomerEvent.class)
    public void assignedCustomerCallback(AssignConfirmedCustomerEvent event) {
        orderExceptionService.assignedCustomerCallback(event.getCustomerId(),event.getCustomerService());
    }
}
