package com.ikon.projectmanagement.controller;

import java.util.List;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;

import com.ikon.projectmanagement.api.ImportFxRateApi;
import com.ikon.projectmanagement.dto.response.FxRateDto;
import com.ikon.projectmanagement.service.ImportFxRateService;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequiredArgsConstructor
@Slf4j
public class ImportFxRateController implements ImportFxRateApi {

    private final ImportFxRateService importFxRateService;

    @Override
    public ResponseEntity<List<FxRateDto>> fetchAllFxRates(String accessToken) {
        return ResponseEntity.ok(importFxRateService.importFxRates(accessToken));
    }
}
