package com.jeesharp.business.modules.trade.application.api;

import com.jeesharp.business.modules.trade.api.TradeOrderMiniProgramApi;
import com.jeesharp.business.modules.trade.application.TradeOrderApplicationService;
import com.jeesharp.business.modules.trade.vo.TradeOrderQueryVO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import com.jeesharp.framework.pojo.query.PageRespVO;

import java.util.Map;

/**
 * {@link TradeOrderMiniProgramApi} 实现，委托 {@link TradeOrderApplicationService} 组装小程序统一订单视图。
 *
 * @author jeesharp
 * @since 2026-06-08
 */
@Service
@AllArgsConstructor
public class TradeOrderMiniProgramApiImpl implements TradeOrderMiniProgramApi {

    private final TradeOrderApplicationService tradeOrderApplicationService;

    @Override
    public PageRespVO<Map<String, Object>> listUnifiedOrdersForMiniProgram(String memberId, TradeOrderQueryVO query) {
        return tradeOrderApplicationService.listUnifiedOrdersForMiniProgram(memberId, query);
    }

    @Override
    public Map<String, Object> getUnifiedOrderDetailForMiniProgram(String memberId, String id) {
        return tradeOrderApplicationService.getUnifiedOrderDetailForMiniProgram(memberId, id);
    }
}
