package com.devjob.application.client;

import com.devjob.application.dto.EmailRequest;
import com.devjob.application.dto.NotificationInfo;
import com.devjob.common.dto.ApiResponse;
import lombok.extern.slf4j.Slf4j;

/**
 * devjob-notification 폴백 — 평범한 public 클래스다(@Component·implements·@HttpServiceFallback 붙이지 않는다).
 * NotificationHttpClient.sendEmail과 같은 시그니처면 매칭된다. 회로 연결은 HttpClientConfig가 한다.
 */
@Slf4j
public class NotificationHttpClientFallback {

    public ApiResponse<NotificationInfo> sendEmail(EmailRequest request) {
        log.warn("[Fallback] devjob-notification 호출 실패 - userId={}, recipientEmail={}",
                request.userId(), request.recipientEmail());
        return ApiResponse.ok(new NotificationInfo(null, "FAILED"));
    }
}
