|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
|
|
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/classes/consts.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/eit/get_eit_transaction_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/generic_response_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/member_login_list_model.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:mohem_flutter_app/api/api_client.dart';
|
|
|
|
|
|
|
|
|
|
class EITApiClient {
|
|
|
|
|
static final EITApiClient _instance = EITApiClient._internal();
|
|
|
|
|
|
|
|
|
|
EITApiClient._internal();
|
|
|
|
|
|
|
|
|
|
factory EITApiClient() => _instance;
|
|
|
|
|
|
|
|
|
|
Future<dynamic> getEITTransactions(String functionName, {bool isCompleteList = false}) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}GET_EIT_TRANSACTIONS";
|
|
|
|
|
Map<String, dynamic> postParams = {'P_FUNCTION_NAME': functionName, "P_MENU_TYPE": "E", "P_PAGE_LIMIT": 50, "P_PAGE_NUM": 1};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
|
(json) {
|
|
|
|
|
if (isCompleteList) {
|
|
|
|
|
List<List<CollectionTransaction>> responseData = [];
|
|
|
|
|
json['GetEITTransactionList'].forEach((element) {
|
|
|
|
|
var transactionList = GetEitTransactionsModel.fromJson(element).collectionTransaction;
|
|
|
|
|
if (transactionList != null) responseData.add(transactionList);
|
|
|
|
|
});
|
|
|
|
|
return responseData;
|
|
|
|
|
} else {
|
|
|
|
|
List<CollectionTransaction>? responseData = GetEitTransactionsModel.fromJson(json['GetEITTransactionList'][0]).collectionTransaction;
|
|
|
|
|
return responseData;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
url,
|
|
|
|
|
postParams,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|