|
|
|
|
@ -25,16 +25,23 @@ class EITApiClient {
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
|
(json) {
|
|
|
|
|
// Check if GetEITTransactionList exists and is not empty
|
|
|
|
|
if (json['GetEITTransactionList'] == null || (json['GetEITTransactionList'] is List && json['GetEITTransactionList'].isEmpty)) {
|
|
|
|
|
return isCompleteList ? <List<CollectionTransaction>>[] : <CollectionTransaction>[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isCompleteList) {
|
|
|
|
|
List<List<CollectionTransaction>> responseData = [];
|
|
|
|
|
json['GetEITTransactionList'].forEach((element) {
|
|
|
|
|
var transactionList = GetEitTransactionsModel.fromJson(element).collectionTransaction;
|
|
|
|
|
if (transactionList != null) responseData.add(transactionList);
|
|
|
|
|
if (transactionList != null && transactionList.isNotEmpty) {
|
|
|
|
|
responseData.add(transactionList);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return responseData;
|
|
|
|
|
} else {
|
|
|
|
|
List<CollectionTransaction>? responseData = GetEitTransactionsModel.fromJson(json['GetEITTransactionList'][0]).collectionTransaction;
|
|
|
|
|
return responseData;
|
|
|
|
|
return responseData ?? <CollectionTransaction>[];
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
url,
|
|
|
|
|
|