package com.sckw.payment.controller.operate;

import com.sckw.core.web.response.HttpResult;
import com.sckw.payment.model.constant.SettlementOrderTypeEnum;
import com.sckw.payment.model.vo.req.SettlementOfflineReq;
import com.sckw.payment.service.operateService.SettlementOfflineService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 结算-线下记录（交易订单结算/物流订单结算）
 *
 * @author xucaiqin
 * @date 2023-07-20 11:42
 */
@Tag(name = "运营线下结算管理", description = "提供运营端线下结算记录相关操作接口")
@RestController
@RequestMapping("/settlementOffline")
public class SettlementOfflineController {

    @Resource
    private SettlementOfflineService settlementOfflineService;

    /**
     * 贸易-线下付款记录
     *
     * @param settlementOfflineReq 查询参数
     * @return 付款记录列表
     */
    @Operation(summary = "贸易线下付款记录", description = "查询贸易订单线下付款记录")
    @GetMapping("tradeList")
    public HttpResult list(@Valid SettlementOfflineReq settlementOfflineReq) {
        settlementOfflineReq.setOrderType(SettlementOrderTypeEnum.TRADE.getStatus());
        return HttpResult.ok(settlementOfflineService.list(settlementOfflineReq));
    }

    /**
     * 物流线下结算记录
     *
     * @param settlementOfflineReq 查询参数
     * @return 结算记录列表
     */
    @Operation(summary = "物流线下结算记录", description = "查询物流订单线下结算记录")
    @GetMapping("logisticsList")
    public HttpResult logisticsList(@Valid SettlementOfflineReq settlementOfflineReq) {
        settlementOfflineReq.setOrderType(SettlementOrderTypeEnum.LOGISTICS.getStatus());
        return HttpResult.ok(settlementOfflineService.list(settlementOfflineReq));
    }

}