package vn.azteam.tpf.service.mapper;

import vn.azteam.tpf.domain.*;
import vn.azteam.tpf.service.dto.TBActivityDTO;
import vn.azteam.tpf.service.dto.TBActivityExtendTypeDTO;

import org.mapstruct.*;

/**
 * Mapper for the entity TBActivityExtendType and its DTO TBActivityExtendTypeDTO.
 */
@Mapper(componentModel = "spring", uses = {TBActivityTypeMapper.class, TBDetailUserMapper.class})
public interface TBActivityExtendTypeMapper extends EntityMapper<TBActivityExtendTypeDTO, TBActivityExtendType> {

    @Mapping(source = "deletedBy.id", target = "deletedById")
    @Mapping(source = "createdBy.id", target = "createdById")
    @Mapping(source = "modifiedBy.id", target = "modifiedById")
    @Mapping(source = "tbActivityType.id", target = "activityTypeId")
    TBActivityExtendTypeDTO toDto(TBActivityExtendType TBActivityExtendType);

    @Mapping(source = "deletedById", target = "deletedBy")
    @Mapping(source = "createdById", target = "createdBy")
    @Mapping(source = "modifiedById", target = "modifiedBy")
    @Mapping(source = "activityTypeId", target = "tbActivityType")
    TBActivityExtendType toEntity(TBActivityExtendTypeDTO TBActivityExtendTypeDTO);

    default TBActivityExtendType fromId(Long id) {
        if (id == null) {
            return null;
        }
        TBActivityExtendType tBActivityExtendType = new TBActivityExtendType();
        tBActivityExtendType.setId(id);
        return tBActivityExtendType;
    }
}
