package com.its.op.dto.its.rse;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.its.op.entity.its.rse.TbRseObuNonCrpt;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * RSE OBU NON CRPT DTO Class
 */
@Data
@Builder
@ApiModel("TbRseObuNonCrptDto(RSE OBU NON CRPT)")
public class TbRseObuNonCrptDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("OBU 아이디")  // N VARCHAR2(200)
    @JsonProperty("obu_id")
    private String obuId;

    @ApiModelProperty("OBU 인식 번호")  // N VARCHAR2(200)
    @JsonProperty("obu_idnt_nmbr")
    private String obuIdntNmbr;

    // Code Description Field
    @ApiModel("TbRseObuNonCrptUpdReq(RSE OBU NON CRPT 정보변경)")
    @Getter
    @Setter
    @ToString
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class TbRseObuNonCrptUpdReq {

        @ApiModelProperty("OBU 아이디, Nullable = N, VARCHAR2(200)")  // N VARCHAR2(200)
        @JsonProperty("obu_id")
        @Size(min=1, max=200)
        private String obuId;

        @ApiModelProperty("OBU 인식 번호, Nullable = N, VARCHAR2(200)")  // N VARCHAR2(200)
        @JsonProperty("obu_idnt_nmbr")
        @Size(min=1, max=200)
        private String obuIdntNmbr;

        @Builder
        public TbRseObuNonCrptUpdReq(String obu_id, String obu_idnt_nmbr) {
            this.obuId = obu_id;
            this.obuIdntNmbr = obu_idnt_nmbr;
        }

        public TbRseObuNonCrpt toEntity() {
            return TbRseObuNonCrpt.builder()
                    .obuId(this.obuId)
                    .obuIdntNmbr(this.obuIdntNmbr)
                    .build();
        }

    }

}
