class SalaryResponseDto {
  final bool isSuccess;
  final String message;
  final SalaryDataDto? data;

  SalaryResponseDto({
    required this.isSuccess,
    required this.message,
    this.data,
  });

  factory SalaryResponseDto.fromJson(Map<String, dynamic> json) {
    return SalaryResponseDto(
      isSuccess: json['isSuccess'] ?? json['IsSuccess'] ?? false,
      message: json['message'] ?? json['Message'] ?? '',
      data:
          json['data'] != null
              ? SalaryDataDto.fromJson(json['data'])
              : json['Data'] != null
              ? SalaryDataDto.fromJson(json['Data'])
              : null,
    );
  }
}

class SalaryDataDto {
  final double netAmount;

  SalaryDataDto({required this.netAmount});

  factory SalaryDataDto.fromJson(Map<String, dynamic> json) {
    return SalaryDataDto(
      netAmount: (json['netAmount'] ?? json['NetAmount'] ?? 0.0).toDouble(),
    );
  }
}
