package com.ruoyi.dk.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.component.mybatis.core.page.PageQuery;
import com.ruoyi.dk.domain.Borrow;
import com.ruoyi.dk.dto.admin.req.BorrowUpdateStatusReq;
import com.ruoyi.dk.dto.admin.resp.BorrowResp;
import com.ruoyi.dk.dto.app.req.BorrowStartReq;
import com.ruoyi.dk.dto.app.resp.LoanProcessResp;

public interface BorrowService extends IService<Borrow> {
    Borrow borrow(BorrowStartReq req);

    Borrow getByTradeNo(String tradeNo);

    boolean updateLoan(Borrow bo);

    boolean updateStatus(BorrowUpdateStatusReq bo);

    boolean updateBank(Borrow bo);

    void withdraw(Double withdrawAmount, Long customerId);

    Borrow getByCustomerId(Long customerId);

    LoanProcessResp getStepBorrow(Long customerId);

    LoanProcessResp parseStepBorrow(Borrow one);

    IPage<BorrowResp> pageAdmin(PageQuery pageQuery, Borrow bo);

    String getContract(String tradeNo);
}
