package com.erp.approval.service;

import com.erp.approval.dto.*;
import com.erp.approval.entity.AuditRule;

import java.util.List;
import com.erp.common.core.model.PageResponse;
import java.util.Map;
import java.util.Optional;

/**
 * 审核规则服务接口
 */
public interface AuditRuleService {
    
    /**
     * 分页查询规则
     */
    PageResponse<AuditRuleResponse> listRules(Long tenantId, AuditRuleQueryRequest request);
    
    /**
     * 获取规则详情
     */
    Optional<AuditRuleResponse> getRuleById(Long tenantId, Long id);
    
    /**
     * 创建规则
     */
    AuditRuleResponse createRule(Long tenantId, Long userId, AuditRuleCreateRequest request);
    
    /**
     * 更新规则
     */
    Optional<AuditRuleResponse> updateRule(Long tenantId, Long userId, Long id, AuditRuleUpdateRequest request);
    
    /**
     * 删除规则
     */
    boolean deleteRule(Long tenantId, Long id);
    
    /**
     * 批量删除规则
     */
    int batchDeleteRules(Long tenantId, List<Long> ids);
    
    /**
     * 批量启用/禁用规则
     */
    int batchToggleActive(Long tenantId, Long userId, List<Long> ids, Boolean isActive);
    
    /**
     * 调整优先级顺序
     */
    void reorderRules(Long tenantId, Long userId, AuditRuleReorderRequest request);
    
    /**
     * 克隆规则
     */
    Optional<AuditRuleResponse> duplicateRule(Long tenantId, Long userId, Long id);
    
    /**
     * 测试规则
     */
    Map<String, Object> testRule(Long tenantId, Long id, AuditRuleTestRequest request);
    
    /**
     * 模拟执行规则
     */
    Map<String, Object> simulateRules(Long tenantId, AuditRuleSimulateRequest request);
    
    /**
     * 获取支持的字段列表
     */
    Map<String, Object> getFields(String type);
    
    /**
     * 获取规则类型列表
     */
    Map<String, String> getTypes();
}
