added threshold API
parent
00869beb14
commit
10296efd12
@ -0,0 +1,50 @@
|
||||
class ThresholdAmountResponseModel {
|
||||
final List<ThresholdAmountItem>? thresholdAmountList;
|
||||
|
||||
ThresholdAmountResponseModel({this.thresholdAmountList});
|
||||
|
||||
factory ThresholdAmountResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
return ThresholdAmountResponseModel(
|
||||
thresholdAmountList: json['ThresholdAmountList'] != null
|
||||
? (json['ThresholdAmountList'] as List)
|
||||
.map((item) => ThresholdAmountItem.fromJson(item as Map<String, dynamic>))
|
||||
.toList()
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'ThresholdAmountList': thresholdAmountList?.map((item) => item.toJson()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class ThresholdAmountItem {
|
||||
final int? projectID;
|
||||
final double? thresholdAvailableAmountByProject;
|
||||
|
||||
ThresholdAmountItem({
|
||||
this.projectID,
|
||||
this.thresholdAvailableAmountByProject,
|
||||
});
|
||||
|
||||
factory ThresholdAmountItem.fromJson(Map<String, dynamic> json) {
|
||||
return ThresholdAmountItem(
|
||||
projectID: json['ProjectID'] as int?,
|
||||
thresholdAvailableAmountByProject: json['ThresholdAvailableAmountByProject'] != null
|
||||
? (json['ThresholdAvailableAmountByProject'] is int
|
||||
? (json['ThresholdAvailableAmountByProject'] as int).toDouble()
|
||||
: json['ThresholdAvailableAmountByProject'] as double)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'ProjectID': projectID,
|
||||
'ThresholdAvailableAmountByProject': thresholdAvailableAmountByProject,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue