package com.cf.imes.module.executor.api.funds;


import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.executor.dal.mysql.funds.invoice.InvoiceRecordsMapper;
import com.cf.imes.module.executor.enums.amount.InvoiceStatusEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import java.math.BigDecimal;

@RestController // 提供 RESTful API 接口，给 Feign 调用
@Validated
@Slf4j
public class ExecutorFundsApiImpl implements ExecutorFundsApi{



    @Resource
    private InvoiceRecordsMapper invoiceRecordsMapper;



    @Override
    public CommonResult<BigDecimal> getToExamineAmount() {

        BigDecimal examineAmount = invoiceRecordsMapper.selectToExamineAmount(InvoiceStatusEnum.PENDINGINVOICING.getStatus());

        return CommonResult.success(examineAmount);

    }


}
