package dev.lions.unionflow.server.api.service.dashboard;

import static org.assertj.core.api.Assertions.assertThat;

import dev.lions.unionflow.server.api.dto.dashboard.DashboardDataResponse;
import dev.lions.unionflow.server.api.dto.dashboard.DashboardStatsResponse;
import dev.lions.unionflow.server.api.dto.dashboard.RecentActivityResponse;
import dev.lions.unionflow.server.api.dto.dashboard.UpcomingEventResponse;
import java.util.List;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

/**
 * Tests unitaires pour DashboardService.
 *
 * @author UnionFlow Team
 * @version 1.0
 * @since 2025-12-09
 */
@DisplayName("Tests DashboardService")
class DashboardServiceTest {

  /**
   * Implémentation de test pour DashboardService.
   */
  static class TestDashboardService implements DashboardService {

    @Override
    public DashboardDataResponse getDashboardData(String organizationId, String userId) {
      DashboardDataResponse data = new DashboardDataResponse();
      data.setStats(new DashboardStatsResponse());
      return data;
    }

    @Override
    public DashboardStatsResponse getDashboardStats(String organizationId, String userId) {
      return new DashboardStatsResponse();
    }

    @Override
    public List<RecentActivityResponse> getRecentActivities(
        String organizationId, String userId, int limit) {
      return List.of();
    }

    @Override
    public List<UpcomingEventResponse> getUpcomingEvents(String organizationId, String userId, int limit) {
      return List.of();
    }
  }

  @Test
  @DisplayName("L'interface peut être implémentée")
  void testInterfacePeutEtreImplementee() {
    DashboardService service = new TestDashboardService();
    assertThat(service).isNotNull();
  }

  @Test
  @DisplayName("getDashboardData retourne un DashboardDataResponse")
  void testGetDashboardData() {
    DashboardService service = new TestDashboardService();
    DashboardDataResponse result = service.getDashboardData("org1", "user1");
    assertThat(result).isNotNull();
  }

  @Test
  @DisplayName("getDashboardStats retourne un DashboardStatsResponse")
  void testGetDashboardStats() {
    DashboardService service = new TestDashboardService();
    DashboardStatsResponse result = service.getDashboardStats("org1", "user1");
    assertThat(result).isNotNull();
  }

  @Test
  @DisplayName("getRecentActivities retourne une liste")
  void testGetRecentActivities() {
    DashboardService service = new TestDashboardService();
    List<RecentActivityResponse> result = service.getRecentActivities("org1", "user1", 10);
    assertThat(result).isNotNull();
  }

  @Test
  @DisplayName("getUpcomingEvents retourne une liste")
  void testGetUpcomingEvents() {
    DashboardService service = new TestDashboardService();
    List<UpcomingEventResponse> result = service.getUpcomingEvents("org1", "user1", 10);
    assertThat(result).isNotNull();
  }
}

