package org.xyzh.api.workcase.service;

import org.xyzh.api.workcase.dto.TbWorkcaseDTO;
import org.xyzh.api.workcase.dto.TbWorkcaseDeviceDTO;
import org.xyzh.api.workcase.dto.TbWorkcaseProcessDTO;
import org.xyzh.common.core.domain.ResultDomain;
import org.xyzh.common.core.page.PageRequest;

import com.alibaba.fastjson2.JSONObject;

/**
 * 工单服务接口
 * 用于客服工单管理
 */
public interface WorkcaseService {
    
    // ====================== 工单管理 ======================
    /**
     * @description    创建工单
     * @param    workcase
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDTO> createWorkcase(TbWorkcaseDTO workcase);
    /**
     * @description    更新工单
     * @param    workcase
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDTO> updateWorkcase(TbWorkcaseDTO workcase);

    /**
     * @description    删除工单
     * @param    workcase
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDTO> deleteWorkcase(TbWorkcaseDTO workcase);

    /**
     * @description    获取工单列表
     * @param    filter
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDTO> getWorkcaseList(TbWorkcaseDTO filter);

    /**
     * @description    获取工单分页
     * @param    pageRequest
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDTO> getWorkcasePage(PageRequest<TbWorkcaseDTO> pageRequest);

    /**
     * @description    获取工单详情
     * @param    workcaseId
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDTO> getWorkcaseById(String workcaseId);
    
    // ====================== 同步到CRM和接收 ===================
    /**
     * @description    同步工单到CRM
     * @param    workcase
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<Void> syncWorkcaseToCrm(TbWorkcaseDTO workcase);

    /**
     * @description    接收CRM的工单处理结果
     * @param    json
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<Void> receiveWorkcaseFromCrm(JSONObject json);
    
    // ====================== 工单处理过程 ======================
    /**
     * @description    创建工单处理过程
     * @param    workcaseProcess
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseProcessDTO> createWorkcaseProcess(TbWorkcaseProcessDTO workcaseProcess);

    /**
     * @description    更新工单处理过程
     * @param    workcaseProcess
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseProcessDTO> updateWorkcaseProcess(TbWorkcaseProcessDTO workcaseProcess);
    
    /**
     * @description    删除工单处理过程
     * @param    workcaseProcess
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseProcessDTO> deleteWorkcaseProcess(TbWorkcaseProcessDTO workcaseProcess);
    
    /**
     * @description    获取工单处理过程列表
     * @param    filter
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseProcessDTO> getWorkcaseProcessList(TbWorkcaseProcessDTO filter);
    
    /**
     * @description    获取工单处理过程分页
     * @param    pageRequest
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseProcessDTO> getWorkcaseProcessPage(PageRequest<TbWorkcaseProcessDTO> pageRequest);

    // ====================== 工单设备管理 ======================
    /**
     * @description    创建工单设备
     * @param    workcaseDevice
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDeviceDTO> createWorkcaseDevice(TbWorkcaseDeviceDTO workcaseDevice);
    /**
     * @description    更新工单设备
     * @param    workcaseDevice
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDeviceDTO> updateWorkcaseDevice(TbWorkcaseDeviceDTO workcaseDevice);
    /**
     * @description    删除工单设备
     * @param    workcaseDevice
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDeviceDTO> deleteWorkcaseDevice(TbWorkcaseDeviceDTO workcaseDevice);
    /**
     * @description    获取工单设备列表
     * @param    filter
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDeviceDTO> getWorkcaseDeviceList(TbWorkcaseDeviceDTO filter);
    /**
     * @description    获取工单设备分页
     * @param    pageRequest
     * @author    yslg
     * @since 2025-12-19
     */
    ResultDomain<TbWorkcaseDeviceDTO> getWorkcaseDevicePage(PageRequest<TbWorkcaseDeviceDTO> pageRequest);
    

}
