package com.ga.core.mapstruct;

import com.ga.core.vo.user.UserSaveReq;
import com.ga.core.vo.user.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;

@Mapper(componentModel = "spring")
public interface UserMapStruct {

    @Mapping(target = "userId",       ignore = true)
    @Mapping(target = "password",     ignore = true)
    @Mapping(target = "failCount",    ignore = true)
    @Mapping(target = "lastLoginAt",  ignore = true)
    @Mapping(target = "pwdChangedAt", ignore = true)
    @Mapping(target = "createdAt",    ignore = true)
    @Mapping(target = "createdBy",    ignore = true)
    @Mapping(target = "updatedAt",    ignore = true)
    @Mapping(target = "updatedBy",    ignore = true)
    UserVO toVO(UserSaveReq req);

    @Mapping(target = "userId",       ignore = true)
    @Mapping(target = "loginId",      ignore = true)
    @Mapping(target = "password",     ignore = true)
    @Mapping(target = "failCount",    ignore = true)
    @Mapping(target = "lastLoginAt",  ignore = true)
    @Mapping(target = "pwdChangedAt", ignore = true)
    @Mapping(target = "createdAt",    ignore = true)
    @Mapping(target = "createdBy",    ignore = true)
    @Mapping(target = "updatedAt",    ignore = true)
    @Mapping(target = "updatedBy",    ignore = true)
    void updateVO(UserSaveReq req, @MappingTarget UserVO vo);
}
