package org.dromara.mall.trade.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.mall.trade.domain.MallAddress;

/**
 * 收货地址业务对象 mall_address
 *
 * @author pengles
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = MallAddress.class, reverseConvertGenerate = false)
public class MallAddressBo extends BaseEntity {

    /**
     * 地址ID
     */
    private Long id;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 收货人姓名
     */
    @NotBlank(message = "收货人姓名不能为空")
    @Size(max = 64, message = "收货人姓名长度不能超过64个字符")
    private String receiverName;

    /**
     * 收货人电话
     */
    @NotBlank(message = "收货人电话不能为空")
    @Size(max = 32, message = "收货人电话长度不能超过32个字符")
    private String receiverPhone;

    /**
     * 省份
     */
    @Size(max = 64, message = "省份长度不能超过64个字符")
    private String province;

    /**
     * 城市
     */
    @Size(max = 64, message = "城市长度不能超过64个字符")
    private String city;

    /**
     * 区/县
     */
    @Size(max = 64, message = "区/县长度不能超过64个字符")
    private String district;

    /**
     * 详细地址
     */
    @NotBlank(message = "详细地址不能为空")
    @Size(max = 512, message = "详细地址长度不能超过512个字符")
    private String address;

    /**
     * 是否默认地址(0否 1是)
     */
    private Integer isDefault;

}
