Merge branch 'development_v2.5' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into fatima_v2

# Conflicts:
#	lib/services/pharmacy_services/product_detail_service.dart
merge-requests/576/head
Fatimah Alshammari 3 years ago
commit e5f0f5777b

@ -31,7 +31,7 @@ const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// RC API URL
const RC_BASE_URL = 'https://livecare.hmg.com/';
const RC_BASE_URL = 'https://rc.hmg.com/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
@ -146,18 +146,18 @@ const INSERT_ER_INERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
/// ER RRT
const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation';
const GET_ALL_RC_TRANSPORTATION = 'api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_RC = 'api/Transportation/getalltransportation';
const GET_ALL_RRT_QUESTIONS =
'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions';
const GET_RRT_SERVICE_PRICE =
'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice';
const GET_ALL_TRANSPORTATIONS_ORDERS = 'rc/api/Transportation/get';
const GET_ALL_TRANSPORTATIONS_ORDERS = 'api/Transportation/get';
const CANCEL_AMBULANCE_REQUEST = "rc/api/Transportation/update";
const CANCEL_AMBULANCE_REQUEST = "api/Transportation/update";
const INSERT_TRANSPORTATION_ORDER_RC = "rc/api/Transportation/add";
const INSERT_TRANSPORTATION_ORDER_RC = "api/Transportation/add";
///FindUs
const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
@ -606,27 +606,27 @@ const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
// HHC RC SERVICES
const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc";
const ADD_HHC_ORDER_RC = "rc/api/HHC/add";
const GET_ALL_HHC_ORDERS_RC = 'rc/api/hhc/list';
const UPDATE_HHC_ORDER_RC = 'rc/api/hhc/update';
const HHC_GET_ALL_SERVICES_RC = "api/HHC/getallhhc";
const ADD_HHC_ORDER_RC = "api/HHC/add";
const GET_ALL_HHC_ORDERS_RC = 'api/hhc/list';
const UPDATE_HHC_ORDER_RC = 'api/hhc/update';
// CMC RC SERVICES
const GET_ALL_CMC_SERVICES_RC = 'rc/api/cmc/getallcmc';
const ADD_CMC_ORDER_RC = 'rc/api/cmc/add';
const GET_ALL_CMC_ORDERS_RC = 'rc/api/cmc/list';
const UPDATE_CMC_ORDER_RC = 'rc/api/cmc/update';
const GET_ALL_CMC_SERVICES_RC = 'api/cmc/getallcmc';
const ADD_CMC_ORDER_RC = 'api/cmc/add';
const GET_ALL_CMC_ORDERS_RC = 'api/cmc/list';
const UPDATE_CMC_ORDER_RC = 'api/cmc/update';
// RRT RC SERVICES
const ADD_RRT_ORDER_RC = "rc/api/rrt/add";
const GET_ALL_RRT_ORDERS_RC = "rc/api/rrt/list";
const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update';
const ADD_RRT_ORDER_RC = "api/rrt/add";
const GET_ALL_RRT_ORDERS_RC = "api/rrt/list";
const UPDATE_RRT_ORDER_RC = 'api/rrt/update';
// PRESCRIPTION RC SERVICES
const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list";
const GET_ALL_PRESCRIPTION_INFO_RC = "rc/api/Prescription/info";
const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update';
const ADD_PRESCRIPTION_ORDER_RC = "api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "api/prescription/list";
const GET_ALL_PRESCRIPTION_INFO_RC = "api/Prescription/info";
const UPDATE_PRESCRIPTION_ORDER_RC = 'api/prescription/update';
//Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/";

@ -20,7 +20,7 @@ class PrescriptionDeliveryService extends BaseService {
}, body: body);
}
Future insertDeliveryOrderRC({double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async {
Future insertDeliveryOrderRC({double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID, int projectID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['latitude'] = latitude;
@ -28,8 +28,8 @@ class PrescriptionDeliveryService extends BaseService {
body['AppointmentNo'] = appointmentNo.toString();
// body['CreatedBy'] = createdBy;
body['DischargeID'] = dischargeID.toString();
body['ProjectID'] = projectID;
await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
var asd = "";
}, onFailure: (String error, int statusCode) {
hasError = true;
print(error);

@ -27,12 +27,12 @@ class PrescriptionDeliveryViewModel extends BaseViewModel {
await getCustomerAddresses();
}
Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async {
Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID, int projectID}) async {
setState(ViewState.BusyLocal);
// await _prescriptionDeliveryService.insertDeliveryOrder(
// lineItemNo: lineItemNo, latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID);
await _prescriptionDeliveryService.insertDeliveryOrderRC(
latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID);
latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID, projectID: projectID);
if (_prescriptionDeliveryService.hasError) {
error = _prescriptionDeliveryService.error;
setState(ViewState.ErrorLocal);

@ -82,6 +82,8 @@ class PharmacyAddressesViewModel extends BaseViewModel {
if (_pharmacyAddressService.hasError) {
setState(ViewState.Idle);
await Future.delayed(Duration(milliseconds: 800));
getAddressesList();
} else {
setState(ViewState.Idle);
await Future.delayed(Duration(milliseconds: 800));

@ -280,7 +280,8 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
child: InkWell(
onTap: () {
AuthenticatedUser user = projectViewModel.user;
if (projectViewModel.havePrivilege(82)) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user)));
// if (projectViewModel.havePrivilege(82))
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user)));
},
child: Stack(
children: [
@ -427,18 +428,18 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
],
),
),
projectViewModel.havePrivilege(82)
? Container()
: Container(
width: double.infinity,
height: double.infinity,
clipBehavior: Clip.antiAlias,
decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor.withOpacity(0.7), darkColor: CustomColors.lightGreyColor.withOpacity(0.7)),
child: Icon(
Icons.lock_outline,
size: 40,
),
)
// projectViewModel.havePrivilege(82)
// ? Container()
// : Container(
// width: double.infinity,
// height: double.infinity,
// clipBehavior: Clip.antiAlias,
// decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor.withOpacity(0.7), darkColor: CustomColors.lightGreyColor.withOpacity(0.7)),
// child: Icon(
// Icons.lock_outline,
// size: 40,
// ),
// )
],
),
),

@ -196,6 +196,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
latitude: latitude,
appointmentNo: prescriptions.appointmentNo,
dischargeID: prescriptions.dischargeNo,
projectID: prescriptions.projectID,
createdBy: model.user.patientID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);

@ -45,7 +45,7 @@ class PaymentBottomWidget extends StatelessWidget {
child: Row(
children: [
isChecked ? Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount - model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
"${TranslationBase.of(context).sar} ${model.cartResponse.totalAmount}",
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color(0xff929295),

@ -34,11 +34,16 @@ class PharmacyAddressesPage extends StatefulWidget {
class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
void navigateToAddressPage(BuildContext ctx, PharmacyAddressesViewModel model, AddressInfo address) {
Navigator.push(
ctx,
FadePage(
page: AddAddressPage(address, (pickResult) async {
await model.addEditAddress(pickResult, address);
}))).then((value) async {
ctx,
FadePage(
page: AddAddressPage(
address,
(pickResult) async {
await model.addEditAddress(pickResult, address);
},
),
),
).then((value) async {
// await model.getAddressesList();
});
}
@ -320,7 +325,7 @@ class _AddressItemWidgetState extends State<AddressItemWidget> {
okText: TranslationBase.of(context).delete,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
ConfirmDialog.closeAlertDialog(context),
setState(() {
widget.model.deleteAddresses(widget.address).then((_) {
AppToast.showSuccessToast(

@ -162,12 +162,15 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
SizedBox(
width: 30,
),
Text(projectViewModel.isArabic ? "2833400 " + " -11- 966+": "+966 " + " -11- 2833400",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
Directionality(
textDirection: TextDirection.ltr,
child: Text("+966" +"-11-2833400",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
),
],
),
SizedBox(

@ -74,7 +74,7 @@ class PharmacyAddressService extends BaseService {
Future addCustomerAddress(AddressInfo address) async {
await makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS);
// if(!hasError) {
selectedAddressIndex = addresses.length +1;
// selectedAddressIndex = addresses.length + 1;
// }
}
@ -100,14 +100,14 @@ class PharmacyAddressService extends BaseService {
body["customer"] = customerObject;
await baseAppClient.postPharmacy("$url", onSuccess: (response, statusCode) async {
addresses.clear();
response['customers'][0]['addresses'].forEach((item) {
addresses.add(AddressInfo.fromJson(item));
});
// addresses.clear();
// response['customers'][0]['addresses'].forEach((item) {
// addresses.add(AddressInfo.fromJson(item));
// });
// getAddresses();
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
},isAllowAny: true, body: body);
}
}

@ -48,7 +48,11 @@ class ProductDetailService extends BaseService {
Future getProductReviews(productID) async {
hasError = false;
await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL + productID + "?fields=reviews,stock_quantity,stock_availability,stock_availabilityn,IsStockAvailable", onSuccess: (dynamic response, int statusCode) {
await baseAppClient.getPharmacy(
GET_PRODUCT_DETAIL +
productID +
"?fields=reviews,stock_quantity,stock_availability,stock_availabilityn,IsStockAvailable",
onSuccess: (dynamic response, int statusCode) {
_productDetailList.clear();
response['products'].forEach((item) {
_productDetailList.add(ProductDetail.fromJson(item));
@ -82,7 +86,8 @@ class ProductDetailService extends BaseService {
// "generalid": "Cs2020@2016\$2958",
// "isDentalAllowedBackend": false
};
await baseAppClient.post(GET_LOCATION, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_LOCATION,
onSuccess: (dynamic response, int statusCode) {
_productLocationList.clear();
response['PharmList'].forEach((item) {
_productLocationList.add(LocationModel.fromJson(item));
@ -101,23 +106,32 @@ class ProductDetailService extends BaseService {
Map<String, dynamic> request;
request = {
"shopping_cart_item": {"quantity": quantity, "shopping_cart_type": "1", "product_id": itemID, "customer_id": customerId, "language_id": 1}
"shopping_cart_item": {
"quantity": quantity,
"shopping_cart_type": "1",
"product_id": itemID,
"customer_id": customerId,
"language_id": 1
}
};
dynamic localRes;
await baseAppClient.pharmacyPost(GET_SHOPPING_CART, isExternal: false, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.pharmacyPost(GET_SHOPPING_CART, isExternal: false,
onSuccess: (dynamic response, int statusCode) {
_addToCartModel.clear();
response['shopping_carts'].forEach((item) {
_addToCartModel.add(Wishlist.fromJson(item));
});
AppToast.showSuccessToast(message: TranslationBase.of(context).addToCartMsg
// 'You have added a product to the cart'
);
AppToast.showSuccessToast(
message: TranslationBase.of(context).addToCartMsg
// 'You have added a product to the cart'
);
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
AppToast.showErrorToast(message: error ?? Utils.generateContactAdminMessage());
AppToast.showErrorToast(
message: error ?? Utils.generateContactAdminMessage());
}, body: request);
return Future.value(localRes);
@ -125,15 +139,19 @@ class ProductDetailService extends BaseService {
Future notifyMe(customerId, itemID) async {
hasError = false;
await baseAppClient.getPharmacy(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) {
AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).notifyMeMsg
// TranslationBase.of(context).notifyMeMsg
//'You will be notified when product available'
await baseAppClient.getPharmacy(
SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID",
onSuccess: (dynamic response, int statusCode) {
AppToast.showSuccessToast(
message: TranslationBase.of(AppGlobal.context).notifyMeMsg
// TranslationBase.of(context).notifyMeMsg
//'You will be notified when product available'
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
AppToast.showErrorToast(message: error ?? Utils.generateContactAdminMessage());
AppToast.showErrorToast(
message: error ?? Utils.generateContactAdminMessage());
});
}
@ -143,28 +161,39 @@ class ProductDetailService extends BaseService {
Map<String, dynamic> request;
request = {
"shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1}
"shopping_cart_item": {
"quantity": 1,
"shopping_cart_type": "Wishlist",
"product_id": itemID,
"customer_id": customerId,
"language_id": 1
}
};
await baseAppClient.pharmacyPost(GET_SHOPPING_CART, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.pharmacyPost(GET_SHOPPING_CART,
onSuccess: (dynamic response, int statusCode) {
_wishListProducts.clear();
response['shopping_carts'].forEach((item) {
_wishListProducts.add(Wishlist.fromJson(item));
});
AppToast.showSuccessToast(message: TranslationBase.of(context).addToWishlistMsg
// 'You have added a product to the Wishlist'
);
AppToast.showSuccessToast(
message: TranslationBase.of(context).addToWishlistMsg
// 'You have added a product to the Wishlist'
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
AppToast.showErrorToast(message: error ?? Utils.generateContactAdminMessage());
AppToast.showErrorToast(
message: error ?? Utils.generateContactAdminMessage());
}, body: request);
}
Future getWishlistItems() async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
var custGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false;
await baseAppClient.getPharmacy(GET_WISHLIST + customerId+ "/$customerGUID/" + "?shopping_cart_type=2", onSuccess: (dynamic response, int statusCode) {
await baseAppClient.getPharmacy(
GET_WISHLIST + customerId + "/$custGUID" + "?shopping_cart_type=2",
onSuccess: (dynamic response, int statusCode) {
_wishListProducts.clear();
response['shopping_carts'].forEach((item) {
_wishListProducts.add(Wishlist.fromJson(item));
@ -177,26 +206,37 @@ class ProductDetailService extends BaseService {
Future deleteItemFromWishlist(itemID, context) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
var custGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false;
await baseAppClient.getPharmacy(DELETE_WISHLIST + customerId + "+&product_id=" + itemID + "&cart_type=Wishlist", onSuccess: (dynamic response, int statusCode) {
await baseAppClient.getPharmacy(
DELETE_WISHLIST +
customerId +
"/$custGUID" +
"+&product_id=" +
itemID +
"&cart_type=Wishlist",
onSuccess: (dynamic response, int statusCode) {
_wishListProducts.clear();
response['shopping_carts'].forEach((item) {
_wishListProducts.add(Wishlist.fromJson(item));
});
AppToast.showSuccessToast(message: TranslationBase.of(context).removeFromWishlistMsg
// 'You have removed a product from the Wishlist'
);
AppToast.showSuccessToast(
message: TranslationBase.of(context).removeFromWishlistMsg
// 'You have removed a product from the Wishlist'
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
AppToast.showErrorToast(message: error ?? Utils.generateContactAdminMessage());
AppToast.showErrorToast(
message: error ?? Utils.generateContactAdminMessage());
});
}
Future productSpecificationData(itemID) async {
hasError = false;
await baseAppClient.getPharmacy(GET_SPECIFICATION + itemID, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.getPharmacy(GET_SPECIFICATION + itemID,
onSuccess: (dynamic response, int statusCode) {
_productSpecification.clear();
response['specification'].forEach((item) {
_productSpecification.add(SpecificationModel.fromJson(item));

Loading…
Cancel
Save