package com.repair.api;

import com.repair.model.pojo.RepairPayRecord;
import com.repair.model.request.RefundReviewRequest;
import com.repair.model.request.RefundableAmountRequest;
import com.repair.model.request.repairPayRequest;
import com.repair.model.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
@RequestMapping("/api/repairPayRecord")
@Api(tags = {"repairPayRecordController"}, value = "支付记录")
public interface RepairPayRecordControllerAPI {

    @PostMapping(value = "/insertRepairPayRecord")
    @ApiOperation(value = "添加支付记录", notes = "添加支付记录数据", httpMethod = "POST")
    CommonResult insertRepairPayRecord(@Validated @RequestBody RepairPayRecord rc, BindingResult bindingResult);

    @PostMapping(value = "/updateRepairPayRecordById")
    @ApiOperation(value = "编辑支付记录数据", notes = "编辑支付记录数据", httpMethod = "POST")
    CommonResult updateRepairPayRecordById(@Validated @RequestBody RepairPayRecord rc, BindingResult bindingResult);

    @GetMapping(value = "/deleterepairPayRecordById")
    @ApiOperation(value = "根据ID删除指定支付记录", notes = "根据ID删除指定支付记录", httpMethod = "GET")
    CommonResult deleteRepairPayRecordById(@RequestParam int id);

    @PostMapping(value = "/repairPayment")
    @ApiOperation(value = "支付接口", notes = "支付接口", httpMethod = "POST")
    CommonResult repairPayment(@Validated @RequestBody repairPayRequest rpr, BindingResult bindingResult);

    @GetMapping(value = "/queryProsperityRepairPayRecords")
    @ApiOperation(value = "支付成功记录分页数据", notes = "支付成功记录分页数据", httpMethod = "GET")
    CommonResult queryProsperityRepairPayRecords(@RequestHeader("user_head") String userhead, @RequestParam int currentPage, @RequestParam int pageCount, String keyWord,String startTime,String endTime);

    @PostMapping(value = "/RefundableAmount")
    @ApiOperation(value = "实退", notes = "实退", httpMethod = "POST")
    CommonResult refundableAmount(@RequestBody RefundableAmountRequest rar,@RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/refundReview")
    @ApiOperation(value = "退款审核", notes = "退款审核", httpMethod = "POST")
    CommonResult refundReview(@RequestBody RefundReviewRequest rar,@RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @GetMapping(value = "/statistics")
    @ApiOperation(value = "统计", notes = "统计", httpMethod = "GET")
    CommonResult statistics();

    @GetMapping(value = "/restrict")
    @ApiOperation(value = "限制实退金额", notes = "限制实退金额", httpMethod = "GET")
    CommonResult restrict(@RequestParam int payRecordId);

    @GetMapping(value = "/queryExport")
    @ApiOperation(value = "支付成功记录导出", notes = "支付成功记录导出", httpMethod = "GET")
    void queryExport(HttpServletResponse response, String keyWord, String startTime, String endTime);

}
