// dashboard_teams_model.dart
class DashboardTeams {
  final bool success;
  final String message;
  final DashboardTeamsData? data;
  final dynamic errors;
  final int statusCode;
  final DateTime timestamp;

  DashboardTeams({
    required this.success,
    required this.message,
    required this.data,
    this.errors,
    required this.statusCode,
    required this.timestamp,
  });

  factory DashboardTeams.fromJson(Map<String, dynamic> json) {
    return DashboardTeams(
      success: json['success'] ?? false,
      message: json['message'] ?? '',
      data: json['data'] != null ? DashboardTeamsData.fromJson(json['data']) : null,
      errors: json['errors'],
      statusCode: json['statusCode'] ?? 0,
      timestamp: DateTime.parse(json['timestamp']),
    );
  }
}

class DashboardTeamsData {
  final int totalEmployees;
  final int inToday;

  DashboardTeamsData({
    required this.totalEmployees,
    required this.inToday,
  });

  factory DashboardTeamsData.fromJson(Map<String, dynamic> json) {
    return DashboardTeamsData(
      totalEmployees: json['totalEmployees'] ?? 0,
      inToday: json['inToday'] ?? 0,
    );
  }
}
