package com.gcsc.connection.service.dto;

import com.gcsc.connection.service.entity.SnpServiceApiParam;

public record ApiParamResponse(
    Long paramId,
    Long apiId,
    String paramType,
    String paramName,
    String paramMeaning,
    String paramDescription,
    Boolean required,
    String defaultValue,
    String inputType,
    Integer sortOrder
) {

    public static ApiParamResponse from(SnpServiceApiParam p) {
        return new ApiParamResponse(
            p.getParamId(),
            p.getApi().getApiId(),
            p.getParamType(),
            p.getParamName(),
            p.getParamMeaning(),
            p.getParamDescription(),
            p.getRequired(),
            p.getDefaultValue(),
            p.getInputType(),
            p.getSortOrder()
        );
    }
}
