package com.backendsys.entity.B2c;

import com.backendsys.entity.validator.Phone;
import com.backendsys.entity.validator.RangeArray;

import java.awt.geom.Point2D;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class B2cMemberRecipientDTO {
    
    public static interface Detail{}
    public static interface Create{}
    public static interface Update{}
    public static interface Delete{}

    private Long id;

    @NotNull(message = "会员ID不能为空", groups = { B2cMemberRecipientDTO.Detail.class, B2cMemberRecipientDTO.Update.class, B2cMemberRecipientDTO.Delete.class })
    private Long member_id;

    @Size(min = 2, max = 50, message = "收货人姓名长度在 {min}-{mx} 字符", groups = { B2cMemberRecipientDTO.Create.class, B2cMemberRecipientDTO.Update.class })
    private String recipient_name;

    @Phone(message="手机号码格式不正确", groups = { B2cMemberRecipientDTO.Create.class, B2cMemberRecipientDTO.Update.class })
    private String recipient_phone;

    @Size(max = 500, message = "地址长度不超过 {max} 字符", groups = { B2cMemberRecipientDTO.Create.class, B2cMemberRecipientDTO.Update.class })
    private String recipient_address;

    private Point2D.Double recipient_point;

    @Size(max = 200, message = "标签长度不超过 {max} 字符", groups = { B2cMemberRecipientDTO.Create.class, B2cMemberRecipientDTO.Update.class })
    private String tag;

    @RangeArray(message="是否默认取值有误，范围应是(-1未阅, 1已阅)", value = {"-1", "1"}, groups = { B2cMemberRecipientDTO.Create.class, B2cMemberRecipientDTO.Update.class })
    private Integer is_default;

    @Size(max = 200, message = "备注长度不超过 {max} 字符", groups = { B2cMemberRecipientDTO.Create.class, B2cMemberRecipientDTO.Update.class })
    private String notes;

    private String create_time;
    private String update_time;
}
