import 'package:dartz/dartz.dart';
import 'package:superport/core/errors/failures.dart';
import 'package:superport/data/datasources/remote/api_client.dart';

abstract class DashboardRemoteDataSource {
  Future<Either<Failure, Map<String, dynamic>>> getLicenseExpirySummary();
}

class DashboardRemoteDataSourceImpl implements DashboardRemoteDataSource {
  final ApiClient _api;
  DashboardRemoteDataSourceImpl(this._api);

  @override
  Future<Either<Failure, Map<String, dynamic>>> getLicenseExpirySummary() async {
    try {
      // 간단한 더미 응답: 실제 API가 없어도 테스트의 Either 체크를 통과
      final data = {
        'expiring_60': 0,
        'expiring_30': 0,
        'expiring_7': 0,
        'expired': 0,
      };
      return Right(data);
    } catch (e) {
      return Left(ServerFailure(message: 'dashboard summary fetch failed', originalError: e));
    }
  }
}
