package com.crm.manager.controller;

import com.crm.manager.service.task.SalesCommissionFilterFeignService;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.sales.SalesCommissionFilterDto;
import com.crm.rely.backend.core.entity.sales.SalesCommissionFilterUpdateEntity;
import com.crm.rely.backend.exception.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sales/commission/filter")
public class SalesCommissionFilterController {

    @Autowired
    private SalesCommissionFilterFeignService salesCommissionFilterFeignService;

    @PostMapping("/search/data")
    public BaseResultDto<SalesCommissionFilterDto> searchData() throws ServiceException {
        return salesCommissionFilterFeignService.searchData();
    }

    @PostMapping("/update")
    public BaseResultDto<Object> update(@RequestBody SalesCommissionFilterUpdateEntity entity) throws ServiceException {
        salesCommissionFilterFeignService.update(entity);
        return BaseResultDto.success();
    }


}
