package com.gcsc.connection.service.dto;

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

import java.time.LocalDateTime;

public record ServiceApiResponse(
    Long apiId,
    Long serviceId,
    String apiPath,
    String apiMethod,
    String apiName,
    String apiDomain,
    String apiSection,
    String description,
    Boolean isActive,
    LocalDateTime createdAt,
    LocalDateTime updatedAt
) {

    public static ServiceApiResponse from(SnpServiceApi a) {
        return new ServiceApiResponse(
            a.getApiId(),
            a.getService().getServiceId(),
            a.getApiPath(),
            a.getApiMethod(),
            a.getApiName(),
            a.getApiDomain(),
            a.getApiSection(),
            a.getDescription(),
            a.getIsActive(),
            a.getCreatedAt(),
            a.getUpdatedAt()
        );
    }
}
