class WorkStatusResponseModel {
  final bool success;
  final String message;
  final List<WorkStatus> data;
  final dynamic errors;
  final int statusCode;
  final DateTime timestamp;

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

  factory WorkStatusResponseModel.fromJson(Map<String, dynamic> json) {
    return WorkStatusResponseModel(
      success: json['success'],
      message: json['message'],
      data: List<WorkStatus>.from(
        json['data'].map((item) => WorkStatus.fromJson(item)),
      ),
      errors: json['errors'],
      statusCode: json['statusCode'],
      timestamp: DateTime.parse(json['timestamp']),
    );
  }
}

class WorkStatus {
  final String id;
  final String name;
  final String description;
  final bool isSystem;

  WorkStatus({
    required this.id,
    required this.name,
    required this.description,
    required this.isSystem,
  });

  factory WorkStatus.fromJson(Map<String, dynamic> json) {
    return WorkStatus(
      id: json['id'],
      name: json['name'],
      description: json['description'],
      isSystem: json['isSystem'],
    );
  }
}
