44 lines
1016 B
Dart
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() ?? '',
|
|
);
|
|
}
|
|
}
|