diff --git a/assets/images/asset_image_upload/side_bottom.svg b/assets/images/asset_image_upload/side_bottom.svg
new file mode 100644
index 00000000..7d9ec605
--- /dev/null
+++ b/assets/images/asset_image_upload/side_bottom.svg
@@ -0,0 +1,13 @@
+
diff --git a/assets/images/asset_image_upload/side_left.svg b/assets/images/asset_image_upload/side_left.svg
new file mode 100644
index 00000000..bdf7e6d9
--- /dev/null
+++ b/assets/images/asset_image_upload/side_left.svg
@@ -0,0 +1,13 @@
+
diff --git a/assets/images/asset_image_upload/side_right.svg b/assets/images/asset_image_upload/side_right.svg
new file mode 100644
index 00000000..f8db13a1
--- /dev/null
+++ b/assets/images/asset_image_upload/side_right.svg
@@ -0,0 +1,13 @@
+
diff --git a/assets/images/asset_image_upload/side_top.svg b/assets/images/asset_image_upload/side_top.svg
new file mode 100644
index 00000000..52841a4e
--- /dev/null
+++ b/assets/images/asset_image_upload/side_top.svg
@@ -0,0 +1,13 @@
+
diff --git a/lib/controllers/api_routes/api_manager.dart b/lib/controllers/api_routes/api_manager.dart
index 722e894e..6142dbc5 100644
--- a/lib/controllers/api_routes/api_manager.dart
+++ b/lib/controllers/api_routes/api_manager.dart
@@ -19,9 +19,9 @@ import 'package:test_sa/new_views/pages/login_page.dart';
class _CachedResponse {
final http.Response response;
final DateTime timestamp;
-
+
_CachedResponse(this.response, this.timestamp);
-
+
bool isValid(Duration cacheDuration) {
return DateTime.now().difference(timestamp) < cacheDuration;
}
@@ -41,26 +41,26 @@ class ApiManager {
User? user;
AssetGroup? assetGroup;
-
+
// OPTIMIZATION: HTTP Connection Pooling - Reuse connections instead of creating new ones
// This improves performance by 100-200ms on subsequent API calls
static final http.Client _httpClient = http.Client();
-
+
// OPTIMIZATION: Response Caching - Cache lookup/static data to reduce network calls
// This reduces API calls by 60% for frequently accessed but rarely changing data
static final Map _cache = {};
static const Duration _defaultCacheDuration = Duration(hours: 1);
-
+
/// Clear all cached responses (call on logout or when needed)
void clearCache() {
_cache.clear();
}
-
+
/// Clear specific cache entry
void clearCacheEntry(String url) {
_cache.remove(_generateCacheKey(url));
}
-
+
/// Generate cache key from URL and user context
String _generateCacheKey(String url) {
// Include user and asset group in cache key to avoid cross-user pollution
@@ -68,7 +68,7 @@ class ApiManager {
}
/// GET request with optional caching support
- ///
+ ///
/// [url] - API endpoint URL
/// [headers] - Optional additional headers
/// [enableToastMessage] - Show toast message from API response
@@ -86,12 +86,12 @@ class ApiManager {
headers ??= {};
headers.addAll(_headers);
Uri url0 = Uri.parse(url);
-
+
// OPTIMIZATION: Check cache first if enabled
if (useCache && !forceRefresh) {
final cacheKey = _generateCacheKey(url);
final cachedResponse = _cache[cacheKey];
-
+
if (cachedResponse != null && cachedResponse.isValid(cacheDuration ?? _defaultCacheDuration)) {
if (kDebugMode) {
print('📦 Cache HIT: $url');
@@ -99,10 +99,10 @@ class ApiManager {
return cachedResponse.response;
}
}
-
+
// OPTIMIZATION: Use persistent HTTP client for connection pooling
http.Response response = await _httpClient.get(url0, headers: headers);
-
+
// OPTIMIZATION: Cache the response if caching is enabled
if (useCache && response.statusCode >= 200 && response.statusCode < 300) {
final cacheKey = _generateCacheKey(url);
@@ -310,7 +310,7 @@ class ApiManager {
Uri url0 = Uri.parse(url);
// print(headers);
// log(json.encode(body));
-
+
// OPTIMIZATION: Use persistent HTTP client for connection pooling
var request = http.Request('PUT', url0);
request.body = json.encode(body);
@@ -337,10 +337,9 @@ class ApiManager {
}
Future multiPart(String url, {Map? headers, required Map body, required List> files}) async {
- Map headers0 = const {
- 'Content-Type': 'multipart/form-data',
- };
+ Map headers0 = _headers;
+ headers0["Content-Type"] = 'multipart/form-data';
headers ??= {};
headers.addAll(headers0);
@@ -423,7 +422,7 @@ class ApiManager {
Navigator.pop(context);
Navigator.of(context).pushNamedAndRemoveUntil(LoginPage.routeName, (routes) => true);
}
-
+
/// Dispose HTTP client (call when app is closing if needed)
/// Note: In most cases, keep client alive for app lifetime for best performance
void dispose() {
diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart
index 0f67db7d..67e8225b 100644
--- a/lib/controllers/api_routes/urls.dart
+++ b/lib/controllers/api_routes/urls.dart
@@ -1,15 +1,14 @@
class URLs {
URLs._();
- static const String appReleaseBuildNumber = "40";
+ static const String appReleaseBuildNumber = "49";
- // static const host1 = "https://atomsm.hmg.com"; // production url
+ static const host1 = "https://atomsm.hmg.com"; // production url
// static const host1 = "https://atomsmdev.hmg.com"; // local DEV url
- static const host1 = "https://atomsmuat.hmg.com"; // local UAT url
+ // static const host1 = "https://atomsmuat.hmg.com"; // local UAT url
- // static final String _baseUrl = "$_host/mobile"; // host local UAT
- // static final String _baseUrl = "$_host/v1/mobile"; // new V1 apis
- static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
+ static final String _baseUrl = "$_host/mobile"; // host local UAT
+ // static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
// static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM
// static final String _baseUrl = "$_host/v4/mobile"; // v4 for Demo module
// static final String _baseUrl = "$_host/v5/mobile"; // v5 for data segregation
@@ -85,13 +84,23 @@ class URLs {
static get getFaultDescription => "$_baseUrl/Asset/GetDefectForModelDefinition"; // get
static get getAssetById => "$_baseUrl/Asset/GetAssetById?assetId="; // get
static get getAssetColumnsMetadata => "$_baseUrl/Asset/columns/metadata"; // get asset export columns metadata
+ static get saveAssetImages => "$_baseUrl/Asset/SaveAssetImages"; // get
static get getModels => "$_baseUrl/ModelDefinition/GetModelDefinitionAsset"; // get ?client=2
static get getAllRequestsAndCount => "$_baseUrl/CallRequest/GetAllRequestsAndCount"; // get
static get updateUserContactInformation => "$_baseUrl/Account/UpdateContactInfo"; // get
static get searchPlanRecurrentTaskListSearch => "$_baseUrl/PlanRecurrentTasks/PlanRecurrentTaskListSearchDto"; // get
static get checkQRSameRoom => "$_baseUrl/PlanRecurrentTasks/CheckQRSameRoom"; // get
- //
+ //One Time Task Urls cleaner module new flow urls ....
+ static get getTaskType => "$_baseUrl/OneTimeTasks/GetTaskTypes";
+
+ static get scanQRCode => "$_baseUrl/OneTimeTasks/ScanQRCode";
+
+ static get proceedRequest => "$_baseUrl/OneTimeTasks/Proceed";
+
+ static get completeRequest => "$_baseUrl/OneTimeTasks/Complete";
+
+ static get getRequestById => "$_baseUrl/OneTimeTasks/GetById";
//service request new flow urls.
static get nurseDashboardCountUrl => '$_baseUrl/ServiceRequest/GetDashboardNurseCount';
@@ -176,6 +185,8 @@ class URLs {
static get uploadWorkOrderAttachmentsUrl => '$_baseUrl/ServiceRequest/UploadAttachmentsWorkOrder';
+ static get workOrderByAssetIdAutoComplete => '$_baseUrl/ServiceRequest/WorkOrderByAssetIdAutoComplete';
+
static get getArrivalVerificationTypeUrl => '$_baseUrl/ArrivalVerificationType/GetArrivalVerificationType';
static get sendOtpUrl => '$_baseUrl/SmsNotification/SendOTP/';
@@ -387,6 +398,7 @@ class URLs {
static get getSiteContactInfo => "$_baseUrl/AssetGroupSiteContactInfo"; // add
static get getDepartmentBasedOnSite => "$_baseUrl/TRAFDataSource/GetDepartmentBasedOnSite"; // add
+ static get getCustomersByUserId => "$_baseUrl/TRAFDataSource/GetCustomersByUserId"; // add
// asset inventory Urls.
static get getAssetInventoryById => '$_baseUrl/AssetInventory/GetAssetInventoryById';
diff --git a/lib/controllers/providers/api/all_requests_provider.dart b/lib/controllers/providers/api/all_requests_provider.dart
index 894d7089..0a93116b 100644
--- a/lib/controllers/providers/api/all_requests_provider.dart
+++ b/lib/controllers/providers/api/all_requests_provider.dart
@@ -1,4 +1,5 @@
import 'dart:convert';
+import 'dart:developer';
import 'package:flutter/widgets.dart';
import 'package:http/http.dart';
@@ -157,14 +158,20 @@ class AllRequestsProvider extends ChangeNotifier {
list.add(7); // task mod
}
- // switching asset inventory to users permissions
+ //TODO uncommit this to enable TRAF in production.
context.userProvider.modulesPermissionsList.forEach((module) {
if (module.module!.value! == 8 || module.module!.value! == 9) {
list.add(module.module!.value!);
}
});
-
- // if (context.settingProvider.isUserFlowMedical && context.userProvider.isNurse) {
+ //Todo commit this when passing to production.
+ // context.userProvider.modulesPermissionsList.forEach((module) {
+ // if (module.module!.value! == 8) {
+ // list.add(module.module!.value!);
+ // }
+ // });
+ //
+ // if (context.settingProvider.isUserFlowMedical && !context.userProvider.isAssessor && (context.userProvider.isNurse || context.userProvider.isEngineer)) {
// list.add(9); //
// }
list.add(12);
@@ -177,6 +184,10 @@ class AllRequestsProvider extends ChangeNotifier {
// list = [16];
list.add(16);
}
+ if ( context.userProvider.isHouseKeeper) {
+ list = [5];
+ }
+
return list;
}
@@ -274,23 +285,27 @@ class AllRequestsProvider extends ChangeNotifier {
}
}
- Future updateRecurrentWo({required int status}) async {
- isLoading = true;
+ Future