From 007b764e82e1a0a64f957884c58f7f084bcb6f0b Mon Sep 17 00:00:00 2001 From: Rahul Dev Garg <34365102+rahuldevgarg@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:30:20 +0530 Subject: [PATCH] mdms v2 and location changes --- .../providers/consumer_details_provider.dart | 28 +++++++++++++++++-- .../providers/expenses_details_provider.dart | 2 +- frontend/mgramseva/lib/services/urls.dart | 2 +- frontend/mgramseva/pubspec.yaml | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index 2048a5d92..802b2f554 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -479,11 +479,35 @@ class ConsumerProvider with ChangeNotifier { "tenantId": commonProvider.userDetails!.selectedtenant!.code }); boundaryList = []; - boundaryList.addAll( - TenantBoundary.fromJson(result['TenantBoundary'][0]).boundary!); + result['TenantBoundary']!=null && result['TenantBoundary'].length>0?boundaryList.addAll( + TenantBoundary.fromJson(result['TenantBoundary'][0]).boundary!):{}; if (boundaryList.length == 1) { property.address.localityCtrl = boundaryList.first; onChangeOfLocality(property.address.localityCtrl); + }else{ + boundaryList.add(Boundary.fromJson({ + "code": "WARD1", + "name": commonProvider.userDetails!.selectedtenant!.name, + "label": "Locality", + "latitude": null, + "longitude": null, + "area": null, + "pincode": null, + "boundaryNum": 1, + "children": [] + })); + property.address.localityCtrl = Locality.fromJson({ + "code": "WARD1", + "name": commonProvider.userDetails!.selectedtenant!.name, + "label": "Locality", + "latitude": null, + "longitude": null, + "area": null, + "pincode": null, + "boundaryNum": 1, + "children": [] + }); + onChangeOfLocality(property.address.localityCtrl); } // notifyListeners(); } catch (e) { diff --git a/frontend/mgramseva/lib/providers/expenses_details_provider.dart b/frontend/mgramseva/lib/providers/expenses_details_provider.dart index c7aa47077..366999108 100644 --- a/frontend/mgramseva/lib/providers/expenses_details_provider.dart +++ b/frontend/mgramseva/lib/providers/expenses_details_provider.dart @@ -285,7 +285,7 @@ class ExpensesDetailsProvider with ChangeNotifier { if (boundaryList.length > 0) { code = boundaryList.first.code; } else { - code = commonProvider.userDetails?.selectedtenant?.city?.code; + code = "WARD1"; } var body = { diff --git a/frontend/mgramseva/lib/services/urls.dart b/frontend/mgramseva/lib/services/urls.dart index 7a467755b..53a9a368c 100644 --- a/frontend/mgramseva/lib/services/urls.dart +++ b/frontend/mgramseva/lib/services/urls.dart @@ -3,7 +3,7 @@ class Url { static const String LOCALIZATION = 'localization/messages/v1/_search'; - static const String MDMS = 'egov-mdms-service/v1/_search'; + static const String MDMS = 'mdms-v2/v1/_search'; static const String FILE_UPLOAD = 'filestore/v1/files'; static const String FILE_FETCH = 'filestore/v1/files/url'; static const String URL_SHORTNER = 'egov-url-shortening/shortener'; diff --git a/frontend/mgramseva/pubspec.yaml b/frontend/mgramseva/pubspec.yaml index 8a45a54a2..765917714 100644 --- a/frontend/mgramseva/pubspec.yaml +++ b/frontend/mgramseva/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.20+36 +version: 1.2.21+37 environment: sdk: ">=2.12.0 <4.0.0"