Files
finger_print_app/lib/data/dto/vacation_type_dto.dart
Mohammed Al-Samarraie 79b53b6303 1111
2026-01-18 19:40:54 +03:00

44 lines
1016 B
Dart

class VacationTypesResponseDto {
final int statusCode;
final bool isSuccess;
final String? message;
final List<VacationTypeDto> data;
VacationTypesResponseDto({
required this.statusCode,
required this.isSuccess,
this.message,
required this.data,
});
factory VacationTypesResponseDto.fromJson(Map<String, dynamic> json) {
return VacationTypesResponseDto(
statusCode: json['statusCode'] ?? 0,
isSuccess: json['isSuccess'] ?? false,
message: json['message'],
data: json['data'] != null
? (json['data'] as List)
.map((item) => VacationTypeDto.fromJson(item))
.toList()
: [],
);
}
}
class VacationTypeDto {
final int value;
final String name;
VacationTypeDto({
required this.value,
required this.name,
});
factory VacationTypeDto.fromJson(Map<String, dynamic> json) {
return VacationTypeDto(
value: json['value'] ?? 0,
name: json['name']?.toString() ?? '',
);
}
}