package cn.newfeifan.mall.module.trade.controller.app.order.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.AssertTrue;
import java.util.Map;

@Schema(description = "用户 App - 交易订单创建 Request VO")
@Data
public class AppTradeOrderCreateReqVO extends AppTradeOrderSettlementReqVO {

    //add by Ben
    @Schema(description = "为键值对，键为店铺ID，值为备注文本", example = "{1:'包装好点，送人的！',2:''}")
    private Map<Long,String> shopRemarks;

    //add by Ben
    @Schema(description = "本订单使用积分，为一整数", example = "36")
    private Double payIntegral;

    @Schema(description = "【本属性已不作页面与后台传值使用，被shopRemarks替代。本属性只作java内部使用】备注", example = "这个是我的订单哟")
    private String remark;

    @AssertTrue(message = "配送方式不能为空")
    @JsonIgnore
    public boolean isDeliveryTypeNotNull() {
        return getDeliveryType() != null;
    }

}
