package com.oqpo.api.web.dto.response.rtnmng.rtnOrd;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.oqpo.api.entity.oper.UserMngEntity;
import com.oqpo.api.entity.pomng.PchOdrBaseInfoEntity;
import com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;


@Getter
@Setter
@Builder
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@JsonInclude(JsonInclude.Include.ALWAYS)
public class RtnOrdNInitInfoResponse {


    @ApiModelProperty(value = "브랜드아이디") private String brandId;
    @ApiModelProperty(value = "브랜드명") private String brandNm;
    @ApiModelProperty(value = "요청반품구분") private String rtnReqDvsn;  // RR02 요청반품
    @ApiModelProperty(value = "반품담당자명") private String rtnMgrNm;
    @ApiModelProperty(value = "반품담당자아이디") private String rtnMgrId;
    @ApiModelProperty(value = "반품담당자전화번호") private String rtnMgrTelNo;
    @ApiModelProperty(value = "수거구분") private String colDvsn;
    @ApiModelProperty(value = "수거구분명") private String colDvsnNm;

    public static RtnOrdNInitInfoResponse toDTO(UserMngEntity uEntity, RtnOdrBaseInfoEntity baseEntity ) {
        if (uEntity == null) return null;
        return RtnOrdNInitInfoResponse.builder()
                .brandId(baseEntity.getBrandId() == null ? "" : baseEntity.getBrandId())
                .brandNm(baseEntity.getBrandNm() == null ? "" : baseEntity.getBrandNm())
                .rtnReqDvsn("RR02")
                .rtnMgrNm(uEntity.getUserNm() == null ? "" : uEntity.getUserNm())
                .rtnMgrId(uEntity.getUserId() == null ? "" : uEntity.getUserId())
                .rtnMgrTelNo(uEntity.getTelNo() == null ? "" : uEntity.getTelNo())
                .colDvsn(baseEntity.getColDvsn() == null ? "" : baseEntity.getColDvsn())
                .colDvsnNm(baseEntity.getColDvsnNm() == null ? "" : baseEntity.getColDvsnNm())
                .build();
    }


}
