package com.gameplatform.server.model.dto.admin;

import com.gameplatform.server.model.entity.admin.SystemConfig;

public class SystemConfigConverter {
    
    public static SystemConfigResponse toResponse(SystemConfig entity) {
        if (entity == null) return null;
        
        SystemConfigResponse response = new SystemConfigResponse();
        response.setId(entity.getId());
        response.setConfigKey(entity.getConfigKey());
        response.setConfigValue(entity.getConfigValue());
        response.setConfigType(entity.getConfigType());
        response.setDescription(entity.getDescription());
        response.setIsSystem(entity.getIsSystem());
        response.setCreatedAt(entity.getCreatedAt());
        response.setUpdatedAt(entity.getUpdatedAt());
        
        return response;
    }
    
    public static SystemConfig toEntity(SystemConfigRequest request) {
        if (request == null) return null;
        
        SystemConfig entity = new SystemConfig();
        entity.setConfigKey(request.getConfigKey());
        entity.setConfigValue(request.getConfigValue());
        entity.setConfigType(request.getConfigType());
        entity.setDescription(request.getDescription());
        entity.setIsSystem(request.getIsSystem());
        
        return entity;
    }
}
