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

import com.jeesharp.business.modules.coupon.api.CouponCheckoutApi;
import com.jeesharp.business.modules.coupon.support.CouponOrderDisplayRowSupport;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 统一订单小程序视图：按垂直订单号补全优惠券抵扣展示字段（有使用才写入）。
 *
 * @author jeesharp
 * @since 2026-06-09
 */
@Component
@AllArgsConstructor
public class TradeOrderCouponDisplayEnricher {

    private final CouponCheckoutApi couponCheckoutApi;

    public void enrichRows(List<Map<String, Object>> rows) {
        CouponOrderDisplayRowSupport.enrichRows(rows, couponCheckoutApi);
    }

    public void enrichRow(Map<String, Object> row) {
        CouponOrderDisplayRowSupport.enrichRow(row, couponCheckoutApi);
    }
}
