package com.jeesharp.business.modules.mall.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;

import java.util.List;

/**
 * 小程序运费试算入参：与提交订单相同的商品行，按收货地址与 SPU 绑定的运费模板由服务端计算应付运费。
 *
 * @author jeesharp
 * @since 2026-05-16
 */
@Data
@Schema(description = "商城运费试算请求")
public class MallFreightPreviewDTO {

    @Schema(description = "配送方式：DELIVERY-快递 PICKUP-到店自提，缺省 DELIVERY")
    private String deliveryType;

    @Schema(description = "会员收货地址主键（mall_member_address.id）；快递配送时必填，自提时可不传")
    private String addressId;

    @Schema(description = "会员优惠券主键（试算抵扣，兼容单券），选填")
    private String memberCouponId;

    @Schema(description = "平台券 app_member_coupon.id")
    private String platformMemberCouponId;

    @Schema(description = "各商户券")
    private List<MallMerchantCouponDTO> merchantCoupons;

    @NotEmpty(message = "商品列表不能为空")
    @Valid
    @Schema(description = "试算商品行", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<MallOrderSubmitLineDTO> items;
}
