You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
diplomatic-quarter/lib/core/service/parmacyModule/lacum-transfer-service.dart

57 lines
2.2 KiB
Dart

import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart';
import 'lacum-service.dart';
class LacumTransferService extends LacumService{
LacumAccountInformation lacumReceiverInformation;
Future getLacumGroupDataBuAccountId(String accountId) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['IdentificationNo'] = user.patientIdentificationNo;
body['AccountNumber'] = accountId;
try {
await baseAppClient.post(GET_LACUM_GROUP_INFORMATION,
onSuccess: (response, statusCode) async {
lacumReceiverInformation = LacumAccountInformation.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
return null;
}, body: body);
} catch (error) {
throw error;
}
}
Future transferYaHalaLoyaltyPoints(String points) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['MobileNo'] = lacumGroupInformation.lakumInquiryInformationObjVersion.mobileNumber;
body['UserName'] = lacumGroupInformation.lakumInquiryInformationObjVersion.memberName;
body['YaHalaSenderAccNumber'] = lacumGroupInformation.lakumInquiryInformationObjVersion.accountNumber;
body['Yahala_IdentificationNo'] = lacumGroupInformation.lakumInquiryInformationObjVersion.memberUniversalId;
body['YaHalaPointsToTransfer'] = points;
body['YaHalaReceiverAccNumber'] = lacumReceiverInformation.lakumInquiryInformationObjVersion.accountNumber;
body['YaHalaReceiverMobileNumber'] = lacumReceiverInformation.lakumInquiryInformationObjVersion.mobileNumber;
body['YaHalaReceiverName'] = lacumReceiverInformation.lakumInquiryInformationObjVersion.memberName;
try {
await baseAppClient.post(TRANSFER_YAHALA_LOYALITY_POINTS,
onSuccess: (response, statusCode) async {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
} catch (error) {
throw error;
}
}
}