diff --git a/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.dart b/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.dart index 61c278aeb2..84eaea7129 100644 --- a/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.dart +++ b/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.dart @@ -86,6 +86,7 @@ class BeneficiaryDownSyncBloc ); emit(BeneficiaryDownSyncState.getBatchSize( configuredBatchSize, + event.appConfiguration.first.forceDownSync ?? false, event.projectId, event.boundaryCode, event.pendingSyncCount, @@ -101,7 +102,7 @@ class BeneficiaryDownSyncBloc DownSyncCheckTotalCountEvent event, BeneficiaryDownSyncEmitter emit, ) async { - if (event.pendingSyncCount > 0) { + if (event.pendingSyncCount > 0 && event.forceDownSync == false) { emit(const BeneficiaryDownSyncState.loading(true)); emit(const BeneficiaryDownSyncState.pendingSync()); } else { @@ -136,6 +137,7 @@ class BeneficiaryDownSyncBloc emit(BeneficiaryDownSyncState.dataFound( serverTotalCount, event.batchSize, + event.forceDownSync )); } else { await LocalSecureStore.instance.setManualSyncTrigger(false); @@ -211,7 +213,7 @@ class BeneficiaryDownSyncBloc taskLocalRepository, sideEffectLocalRepository, referralLocalRepository, - ]); + ], event.forceDownSync ?? false); // Update the local downSync data for the boundary with the new values totalCount = downSyncResults["DownsyncCriteria"]["totalCount"]; @@ -277,6 +279,7 @@ class BeneficiaryDownSyncEvent with _$BeneficiaryDownSyncEvent { required int batchSize, required int initialServerCount, required String boundaryName, + bool? forceDownSync, }) = DownSyncBeneficiaryEvent; const factory BeneficiaryDownSyncEvent.checkForData({ @@ -284,6 +287,7 @@ class BeneficiaryDownSyncEvent with _$BeneficiaryDownSyncEvent { required String boundaryCode, required int pendingSyncCount, required int batchSize, + required bool forceDownSync, required String boundaryName, }) = DownSyncCheckTotalCountEvent; @@ -313,6 +317,7 @@ class BeneficiaryDownSyncState with _$BeneficiaryDownSyncState { ) = _DownSyncSuccessState; const factory BeneficiaryDownSyncState.getBatchSize( int batchSize, + bool forceDownSync, String projectId, String boundaryCode, int pendingSyncCount, @@ -325,6 +330,7 @@ class BeneficiaryDownSyncState with _$BeneficiaryDownSyncState { const factory BeneficiaryDownSyncState.dataFound( int initialServerCount, int batchSize, + bool forceDownSync ) = _DownSyncDataFoundState; const factory BeneficiaryDownSyncState.resetState() = _DownSyncResetState; const factory BeneficiaryDownSyncState.totalCountCheckFailed() = diff --git a/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.freezed.dart b/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.freezed.dart index 092150d1b5..0bc7ce1dd6 100644 --- a/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.freezed.dart +++ b/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.freezed.dart @@ -18,11 +18,21 @@ final _privateConstructorUsedError = UnsupportedError( mixin _$BeneficiaryDownSyncEvent { @optionalTypeArgs TResult when({ - required TResult Function(String projectId, String boundaryCode, - int batchSize, int initialServerCount, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int batchSize, + int initialServerCount, + String boundaryName, + bool? forceDownSync) downSync, - required TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName) checkForData, required TResult Function( List appConfiguration, @@ -38,10 +48,15 @@ mixin _$BeneficiaryDownSyncEvent { @optionalTypeArgs TResult? whenOrNull({ TResult? Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult? Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult? Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult? Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -53,10 +68,15 @@ mixin _$BeneficiaryDownSyncEvent { @optionalTypeArgs TResult maybeWhen({ TResult Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -127,7 +147,8 @@ abstract class _$$DownSyncBeneficiaryEventImplCopyWith<$Res> { String boundaryCode, int batchSize, int initialServerCount, - String boundaryName}); + String boundaryName, + bool? forceDownSync}); } /// @nodoc @@ -148,6 +169,7 @@ class __$$DownSyncBeneficiaryEventImplCopyWithImpl<$Res> Object? batchSize = null, Object? initialServerCount = null, Object? boundaryName = null, + Object? forceDownSync = freezed, }) { return _then(_$DownSyncBeneficiaryEventImpl( projectId: null == projectId @@ -170,6 +192,10 @@ class __$$DownSyncBeneficiaryEventImplCopyWithImpl<$Res> ? _value.boundaryName : boundaryName // ignore: cast_nullable_to_non_nullable as String, + forceDownSync: freezed == forceDownSync + ? _value.forceDownSync + : forceDownSync // ignore: cast_nullable_to_non_nullable + as bool?, )); } } @@ -182,7 +208,8 @@ class _$DownSyncBeneficiaryEventImpl implements DownSyncBeneficiaryEvent { required this.boundaryCode, required this.batchSize, required this.initialServerCount, - required this.boundaryName}); + required this.boundaryName, + this.forceDownSync}); @override final String projectId; @@ -194,10 +221,12 @@ class _$DownSyncBeneficiaryEventImpl implements DownSyncBeneficiaryEvent { final int initialServerCount; @override final String boundaryName; + @override + final bool? forceDownSync; @override String toString() { - return 'BeneficiaryDownSyncEvent.downSync(projectId: $projectId, boundaryCode: $boundaryCode, batchSize: $batchSize, initialServerCount: $initialServerCount, boundaryName: $boundaryName)'; + return 'BeneficiaryDownSyncEvent.downSync(projectId: $projectId, boundaryCode: $boundaryCode, batchSize: $batchSize, initialServerCount: $initialServerCount, boundaryName: $boundaryName, forceDownSync: $forceDownSync)'; } @override @@ -214,12 +243,14 @@ class _$DownSyncBeneficiaryEventImpl implements DownSyncBeneficiaryEvent { (identical(other.initialServerCount, initialServerCount) || other.initialServerCount == initialServerCount) && (identical(other.boundaryName, boundaryName) || - other.boundaryName == boundaryName)); + other.boundaryName == boundaryName) && + (identical(other.forceDownSync, forceDownSync) || + other.forceDownSync == forceDownSync)); } @override int get hashCode => Object.hash(runtimeType, projectId, boundaryCode, - batchSize, initialServerCount, boundaryName); + batchSize, initialServerCount, boundaryName, forceDownSync); @JsonKey(ignore: true) @override @@ -231,11 +262,21 @@ class _$DownSyncBeneficiaryEventImpl implements DownSyncBeneficiaryEvent { @override @optionalTypeArgs TResult when({ - required TResult Function(String projectId, String boundaryCode, - int batchSize, int initialServerCount, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int batchSize, + int initialServerCount, + String boundaryName, + bool? forceDownSync) downSync, - required TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName) checkForData, required TResult Function( List appConfiguration, @@ -247,18 +288,23 @@ class _$DownSyncBeneficiaryEventImpl implements DownSyncBeneficiaryEvent { required TResult Function() downSyncReport, required TResult Function() resetState, }) { - return downSync( - projectId, boundaryCode, batchSize, initialServerCount, boundaryName); + return downSync(projectId, boundaryCode, batchSize, initialServerCount, + boundaryName, forceDownSync); } @override @optionalTypeArgs TResult? whenOrNull({ TResult? Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult? Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult? Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult? Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -266,18 +312,23 @@ class _$DownSyncBeneficiaryEventImpl implements DownSyncBeneficiaryEvent { TResult? Function()? downSyncReport, TResult? Function()? resetState, }) { - return downSync?.call( - projectId, boundaryCode, batchSize, initialServerCount, boundaryName); + return downSync?.call(projectId, boundaryCode, batchSize, + initialServerCount, boundaryName, forceDownSync); } @override @optionalTypeArgs TResult maybeWhen({ TResult Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -287,8 +338,8 @@ class _$DownSyncBeneficiaryEventImpl implements DownSyncBeneficiaryEvent { required TResult orElse(), }) { if (downSync != null) { - return downSync( - projectId, boundaryCode, batchSize, initialServerCount, boundaryName); + return downSync(projectId, boundaryCode, batchSize, initialServerCount, + boundaryName, forceDownSync); } return orElse(); } @@ -340,13 +391,15 @@ abstract class DownSyncBeneficiaryEvent implements BeneficiaryDownSyncEvent { required final String boundaryCode, required final int batchSize, required final int initialServerCount, - required final String boundaryName}) = _$DownSyncBeneficiaryEventImpl; + required final String boundaryName, + final bool? forceDownSync}) = _$DownSyncBeneficiaryEventImpl; String get projectId; String get boundaryCode; int get batchSize; int get initialServerCount; String get boundaryName; + bool? get forceDownSync; @JsonKey(ignore: true) _$$DownSyncBeneficiaryEventImplCopyWith<_$DownSyncBeneficiaryEventImpl> get copyWith => throw _privateConstructorUsedError; @@ -364,6 +417,7 @@ abstract class _$$DownSyncCheckTotalCountEventImplCopyWith<$Res> { String boundaryCode, int pendingSyncCount, int batchSize, + bool forceDownSync, String boundaryName}); } @@ -384,6 +438,7 @@ class __$$DownSyncCheckTotalCountEventImplCopyWithImpl<$Res> Object? boundaryCode = null, Object? pendingSyncCount = null, Object? batchSize = null, + Object? forceDownSync = null, Object? boundaryName = null, }) { return _then(_$DownSyncCheckTotalCountEventImpl( @@ -403,6 +458,10 @@ class __$$DownSyncCheckTotalCountEventImplCopyWithImpl<$Res> ? _value.batchSize : batchSize // ignore: cast_nullable_to_non_nullable as int, + forceDownSync: null == forceDownSync + ? _value.forceDownSync + : forceDownSync // ignore: cast_nullable_to_non_nullable + as bool, boundaryName: null == boundaryName ? _value.boundaryName : boundaryName // ignore: cast_nullable_to_non_nullable @@ -420,6 +479,7 @@ class _$DownSyncCheckTotalCountEventImpl required this.boundaryCode, required this.pendingSyncCount, required this.batchSize, + required this.forceDownSync, required this.boundaryName}); @override @@ -431,11 +491,13 @@ class _$DownSyncCheckTotalCountEventImpl @override final int batchSize; @override + final bool forceDownSync; + @override final String boundaryName; @override String toString() { - return 'BeneficiaryDownSyncEvent.checkForData(projectId: $projectId, boundaryCode: $boundaryCode, pendingSyncCount: $pendingSyncCount, batchSize: $batchSize, boundaryName: $boundaryName)'; + return 'BeneficiaryDownSyncEvent.checkForData(projectId: $projectId, boundaryCode: $boundaryCode, pendingSyncCount: $pendingSyncCount, batchSize: $batchSize, forceDownSync: $forceDownSync, boundaryName: $boundaryName)'; } @override @@ -451,13 +513,15 @@ class _$DownSyncCheckTotalCountEventImpl other.pendingSyncCount == pendingSyncCount) && (identical(other.batchSize, batchSize) || other.batchSize == batchSize) && + (identical(other.forceDownSync, forceDownSync) || + other.forceDownSync == forceDownSync) && (identical(other.boundaryName, boundaryName) || other.boundaryName == boundaryName)); } @override int get hashCode => Object.hash(runtimeType, projectId, boundaryCode, - pendingSyncCount, batchSize, boundaryName); + pendingSyncCount, batchSize, forceDownSync, boundaryName); @JsonKey(ignore: true) @override @@ -470,11 +534,21 @@ class _$DownSyncCheckTotalCountEventImpl @override @optionalTypeArgs TResult when({ - required TResult Function(String projectId, String boundaryCode, - int batchSize, int initialServerCount, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int batchSize, + int initialServerCount, + String boundaryName, + bool? forceDownSync) downSync, - required TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName) checkForData, required TResult Function( List appConfiguration, @@ -486,18 +560,23 @@ class _$DownSyncCheckTotalCountEventImpl required TResult Function() downSyncReport, required TResult Function() resetState, }) { - return checkForData( - projectId, boundaryCode, pendingSyncCount, batchSize, boundaryName); + return checkForData(projectId, boundaryCode, pendingSyncCount, batchSize, + forceDownSync, boundaryName); } @override @optionalTypeArgs TResult? whenOrNull({ TResult? Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult? Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult? Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult? Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -505,18 +584,23 @@ class _$DownSyncCheckTotalCountEventImpl TResult? Function()? downSyncReport, TResult? Function()? resetState, }) { - return checkForData?.call( - projectId, boundaryCode, pendingSyncCount, batchSize, boundaryName); + return checkForData?.call(projectId, boundaryCode, pendingSyncCount, + batchSize, forceDownSync, boundaryName); } @override @optionalTypeArgs TResult maybeWhen({ TResult Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -526,8 +610,8 @@ class _$DownSyncCheckTotalCountEventImpl required TResult orElse(), }) { if (checkForData != null) { - return checkForData( - projectId, boundaryCode, pendingSyncCount, batchSize, boundaryName); + return checkForData(projectId, boundaryCode, pendingSyncCount, batchSize, + forceDownSync, boundaryName); } return orElse(); } @@ -580,12 +664,14 @@ abstract class DownSyncCheckTotalCountEvent required final String boundaryCode, required final int pendingSyncCount, required final int batchSize, + required final bool forceDownSync, required final String boundaryName}) = _$DownSyncCheckTotalCountEventImpl; String get projectId; String get boundaryCode; int get pendingSyncCount; int get batchSize; + bool get forceDownSync; String get boundaryName; @JsonKey(ignore: true) _$$DownSyncCheckTotalCountEventImplCopyWith< @@ -722,11 +808,21 @@ class _$DownSyncGetBatchSizeEventImpl implements DownSyncGetBatchSizeEvent { @override @optionalTypeArgs TResult when({ - required TResult Function(String projectId, String boundaryCode, - int batchSize, int initialServerCount, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int batchSize, + int initialServerCount, + String boundaryName, + bool? forceDownSync) downSync, - required TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName) checkForData, required TResult Function( List appConfiguration, @@ -746,10 +842,15 @@ class _$DownSyncGetBatchSizeEventImpl implements DownSyncGetBatchSizeEvent { @optionalTypeArgs TResult? whenOrNull({ TResult? Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult? Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult? Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult? Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -765,10 +866,15 @@ class _$DownSyncGetBatchSizeEventImpl implements DownSyncGetBatchSizeEvent { @optionalTypeArgs TResult maybeWhen({ TResult Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -883,11 +989,21 @@ class _$DownSyncReportEventImpl implements DownSyncReportEvent { @override @optionalTypeArgs TResult when({ - required TResult Function(String projectId, String boundaryCode, - int batchSize, int initialServerCount, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int batchSize, + int initialServerCount, + String boundaryName, + bool? forceDownSync) downSync, - required TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName) checkForData, required TResult Function( List appConfiguration, @@ -906,10 +1022,15 @@ class _$DownSyncReportEventImpl implements DownSyncReportEvent { @optionalTypeArgs TResult? whenOrNull({ TResult? Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult? Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult? Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult? Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -924,10 +1045,15 @@ class _$DownSyncReportEventImpl implements DownSyncReportEvent { @optionalTypeArgs TResult maybeWhen({ TResult Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -1029,11 +1155,21 @@ class _$DownSyncResetStateEventImpl implements DownSyncResetStateEvent { @override @optionalTypeArgs TResult when({ - required TResult Function(String projectId, String boundaryCode, - int batchSize, int initialServerCount, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int batchSize, + int initialServerCount, + String boundaryName, + bool? forceDownSync) downSync, - required TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName) + required TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName) checkForData, required TResult Function( List appConfiguration, @@ -1052,10 +1188,15 @@ class _$DownSyncResetStateEventImpl implements DownSyncResetStateEvent { @optionalTypeArgs TResult? whenOrNull({ TResult? Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult? Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult? Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult? Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -1070,10 +1211,15 @@ class _$DownSyncResetStateEventImpl implements DownSyncResetStateEvent { @optionalTypeArgs TResult maybeWhen({ TResult Function(String projectId, String boundaryCode, int batchSize, - int initialServerCount, String boundaryName)? + int initialServerCount, String boundaryName, bool? forceDownSync)? downSync, - TResult Function(String projectId, String boundaryCode, - int pendingSyncCount, int batchSize, String boundaryName)? + TResult Function( + String projectId, + String boundaryCode, + int pendingSyncCount, + int batchSize, + bool forceDownSync, + String boundaryName)? checkForData, TResult Function(List appConfiguration, String projectId, String boundaryCode, int pendingSyncCount, String boundaryName)? @@ -1139,12 +1285,19 @@ mixin _$BeneficiaryDownSyncState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -1156,12 +1309,14 @@ mixin _$BeneficiaryDownSyncState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -1173,12 +1328,13 @@ mixin _$BeneficiaryDownSyncState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -1341,12 +1497,19 @@ class _$DownSyncInProgressStateImpl extends _DownSyncInProgressState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -1361,12 +1524,14 @@ class _$DownSyncInProgressStateImpl extends _DownSyncInProgressState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -1381,12 +1546,13 @@ class _$DownSyncInProgressStateImpl extends _DownSyncInProgressState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -1548,12 +1714,19 @@ class _$DownSyncSuccessStateImpl extends _DownSyncSuccessState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -1568,12 +1741,14 @@ class _$DownSyncSuccessStateImpl extends _DownSyncSuccessState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -1588,12 +1763,13 @@ class _$DownSyncSuccessStateImpl extends _DownSyncSuccessState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -1692,6 +1868,7 @@ abstract class _$$DownSyncGetBatchSizeStateImplCopyWith<$Res> { @useResult $Res call( {int batchSize, + bool forceDownSync, String projectId, String boundaryCode, int pendingSyncCount, @@ -1712,6 +1889,7 @@ class __$$DownSyncGetBatchSizeStateImplCopyWithImpl<$Res> @override $Res call({ Object? batchSize = null, + Object? forceDownSync = null, Object? projectId = null, Object? boundaryCode = null, Object? pendingSyncCount = null, @@ -1722,6 +1900,10 @@ class __$$DownSyncGetBatchSizeStateImplCopyWithImpl<$Res> ? _value.batchSize : batchSize // ignore: cast_nullable_to_non_nullable as int, + null == forceDownSync + ? _value.forceDownSync + : forceDownSync // ignore: cast_nullable_to_non_nullable + as bool, null == projectId ? _value.projectId : projectId // ignore: cast_nullable_to_non_nullable @@ -1745,13 +1927,20 @@ class __$$DownSyncGetBatchSizeStateImplCopyWithImpl<$Res> /// @nodoc class _$DownSyncGetBatchSizeStateImpl extends _DownSyncGetBatchSizeState { - const _$DownSyncGetBatchSizeStateImpl(this.batchSize, this.projectId, - this.boundaryCode, this.pendingSyncCount, this.boundaryName) + const _$DownSyncGetBatchSizeStateImpl( + this.batchSize, + this.forceDownSync, + this.projectId, + this.boundaryCode, + this.pendingSyncCount, + this.boundaryName) : super._(); @override final int batchSize; @override + final bool forceDownSync; + @override final String projectId; @override final String boundaryCode; @@ -1762,7 +1951,7 @@ class _$DownSyncGetBatchSizeStateImpl extends _DownSyncGetBatchSizeState { @override String toString() { - return 'BeneficiaryDownSyncState.getBatchSize(batchSize: $batchSize, projectId: $projectId, boundaryCode: $boundaryCode, pendingSyncCount: $pendingSyncCount, boundaryName: $boundaryName)'; + return 'BeneficiaryDownSyncState.getBatchSize(batchSize: $batchSize, forceDownSync: $forceDownSync, projectId: $projectId, boundaryCode: $boundaryCode, pendingSyncCount: $pendingSyncCount, boundaryName: $boundaryName)'; } @override @@ -1772,6 +1961,8 @@ class _$DownSyncGetBatchSizeStateImpl extends _DownSyncGetBatchSizeState { other is _$DownSyncGetBatchSizeStateImpl && (identical(other.batchSize, batchSize) || other.batchSize == batchSize) && + (identical(other.forceDownSync, forceDownSync) || + other.forceDownSync == forceDownSync) && (identical(other.projectId, projectId) || other.projectId == projectId) && (identical(other.boundaryCode, boundaryCode) || @@ -1783,8 +1974,8 @@ class _$DownSyncGetBatchSizeStateImpl extends _DownSyncGetBatchSizeState { } @override - int get hashCode => Object.hash(runtimeType, batchSize, projectId, - boundaryCode, pendingSyncCount, boundaryName); + int get hashCode => Object.hash(runtimeType, batchSize, forceDownSync, + projectId, boundaryCode, pendingSyncCount, boundaryName); @JsonKey(ignore: true) @override @@ -1798,20 +1989,27 @@ class _$DownSyncGetBatchSizeStateImpl extends _DownSyncGetBatchSizeState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, required TResult Function(List downsyncCriteriaList) report, required TResult Function() pendingSync, }) { - return getBatchSize( - batchSize, projectId, boundaryCode, pendingSyncCount, boundaryName); + return getBatchSize(batchSize, forceDownSync, projectId, boundaryCode, + pendingSyncCount, boundaryName); } @override @@ -1819,20 +2017,22 @@ class _$DownSyncGetBatchSizeStateImpl extends _DownSyncGetBatchSizeState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, TResult? Function(List downsyncCriteriaList)? report, TResult? Function()? pendingSync, }) { - return getBatchSize?.call( - batchSize, projectId, boundaryCode, pendingSyncCount, boundaryName); + return getBatchSize?.call(batchSize, forceDownSync, projectId, boundaryCode, + pendingSyncCount, boundaryName); } @override @@ -1840,12 +2040,13 @@ class _$DownSyncGetBatchSizeStateImpl extends _DownSyncGetBatchSizeState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -1854,8 +2055,8 @@ class _$DownSyncGetBatchSizeStateImpl extends _DownSyncGetBatchSizeState { required TResult orElse(), }) { if (getBatchSize != null) { - return getBatchSize( - batchSize, projectId, boundaryCode, pendingSyncCount, boundaryName); + return getBatchSize(batchSize, forceDownSync, projectId, boundaryCode, + pendingSyncCount, boundaryName); } return orElse(); } @@ -1928,6 +2129,7 @@ class _$DownSyncGetBatchSizeStateImpl extends _DownSyncGetBatchSizeState { abstract class _DownSyncGetBatchSizeState extends BeneficiaryDownSyncState { const factory _DownSyncGetBatchSizeState( final int batchSize, + final bool forceDownSync, final String projectId, final String boundaryCode, final int pendingSyncCount, @@ -1935,6 +2137,7 @@ abstract class _DownSyncGetBatchSizeState extends BeneficiaryDownSyncState { const _DownSyncGetBatchSizeState._() : super._(); int get batchSize; + bool get forceDownSync; String get projectId; String get boundaryCode; int get pendingSyncCount; @@ -2013,12 +2216,19 @@ class _$DownSyncLoadingStateImpl extends _DownSyncLoadingState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -2033,12 +2243,14 @@ class _$DownSyncLoadingStateImpl extends _DownSyncLoadingState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -2053,12 +2265,13 @@ class _$DownSyncLoadingStateImpl extends _DownSyncLoadingState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -2193,12 +2406,19 @@ class _$DownSyncInsufficientStorageStateImpl TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -2213,12 +2433,14 @@ class _$DownSyncInsufficientStorageStateImpl TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -2233,12 +2455,13 @@ class _$DownSyncInsufficientStorageStateImpl TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -2331,7 +2554,7 @@ abstract class _$$DownSyncDataFoundStateImplCopyWith<$Res> { $Res Function(_$DownSyncDataFoundStateImpl) then) = __$$DownSyncDataFoundStateImplCopyWithImpl<$Res>; @useResult - $Res call({int initialServerCount, int batchSize}); + $Res call({int initialServerCount, int batchSize, bool forceDownSync}); } /// @nodoc @@ -2349,6 +2572,7 @@ class __$$DownSyncDataFoundStateImplCopyWithImpl<$Res> $Res call({ Object? initialServerCount = null, Object? batchSize = null, + Object? forceDownSync = null, }) { return _then(_$DownSyncDataFoundStateImpl( null == initialServerCount @@ -2359,6 +2583,10 @@ class __$$DownSyncDataFoundStateImplCopyWithImpl<$Res> ? _value.batchSize : batchSize // ignore: cast_nullable_to_non_nullable as int, + null == forceDownSync + ? _value.forceDownSync + : forceDownSync // ignore: cast_nullable_to_non_nullable + as bool, )); } } @@ -2366,17 +2594,20 @@ class __$$DownSyncDataFoundStateImplCopyWithImpl<$Res> /// @nodoc class _$DownSyncDataFoundStateImpl extends _DownSyncDataFoundState { - const _$DownSyncDataFoundStateImpl(this.initialServerCount, this.batchSize) + const _$DownSyncDataFoundStateImpl( + this.initialServerCount, this.batchSize, this.forceDownSync) : super._(); @override final int initialServerCount; @override final int batchSize; + @override + final bool forceDownSync; @override String toString() { - return 'BeneficiaryDownSyncState.dataFound(initialServerCount: $initialServerCount, batchSize: $batchSize)'; + return 'BeneficiaryDownSyncState.dataFound(initialServerCount: $initialServerCount, batchSize: $batchSize, forceDownSync: $forceDownSync)'; } @override @@ -2387,11 +2618,14 @@ class _$DownSyncDataFoundStateImpl extends _DownSyncDataFoundState { (identical(other.initialServerCount, initialServerCount) || other.initialServerCount == initialServerCount) && (identical(other.batchSize, batchSize) || - other.batchSize == batchSize)); + other.batchSize == batchSize) && + (identical(other.forceDownSync, forceDownSync) || + other.forceDownSync == forceDownSync)); } @override - int get hashCode => Object.hash(runtimeType, initialServerCount, batchSize); + int get hashCode => + Object.hash(runtimeType, initialServerCount, batchSize, forceDownSync); @JsonKey(ignore: true) @override @@ -2405,19 +2639,26 @@ class _$DownSyncDataFoundStateImpl extends _DownSyncDataFoundState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, required TResult Function(List downsyncCriteriaList) report, required TResult Function() pendingSync, }) { - return dataFound(initialServerCount, batchSize); + return dataFound(initialServerCount, batchSize, forceDownSync); } @override @@ -2425,19 +2666,21 @@ class _$DownSyncDataFoundStateImpl extends _DownSyncDataFoundState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, TResult? Function(List downsyncCriteriaList)? report, TResult? Function()? pendingSync, }) { - return dataFound?.call(initialServerCount, batchSize); + return dataFound?.call(initialServerCount, batchSize, forceDownSync); } @override @@ -2445,12 +2688,13 @@ class _$DownSyncDataFoundStateImpl extends _DownSyncDataFoundState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -2459,7 +2703,7 @@ class _$DownSyncDataFoundStateImpl extends _DownSyncDataFoundState { required TResult orElse(), }) { if (dataFound != null) { - return dataFound(initialServerCount, batchSize); + return dataFound(initialServerCount, batchSize, forceDownSync); } return orElse(); } @@ -2531,12 +2775,14 @@ class _$DownSyncDataFoundStateImpl extends _DownSyncDataFoundState { abstract class _DownSyncDataFoundState extends BeneficiaryDownSyncState { const factory _DownSyncDataFoundState( - final int initialServerCount, final int batchSize) = - _$DownSyncDataFoundStateImpl; + final int initialServerCount, + final int batchSize, + final bool forceDownSync) = _$DownSyncDataFoundStateImpl; const _DownSyncDataFoundState._() : super._(); int get initialServerCount; int get batchSize; + bool get forceDownSync; @JsonKey(ignore: true) _$$DownSyncDataFoundStateImplCopyWith<_$DownSyncDataFoundStateImpl> get copyWith => throw _privateConstructorUsedError; @@ -2583,12 +2829,19 @@ class _$DownSyncResetStateImpl extends _DownSyncResetState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -2603,12 +2856,14 @@ class _$DownSyncResetStateImpl extends _DownSyncResetState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -2623,12 +2878,13 @@ class _$DownSyncResetStateImpl extends _DownSyncResetState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -2757,12 +3013,19 @@ class _$DownSynnCountCheckFailedStateImpl TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -2777,12 +3040,14 @@ class _$DownSynnCountCheckFailedStateImpl TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -2797,12 +3062,13 @@ class _$DownSynnCountCheckFailedStateImpl TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -2929,12 +3195,19 @@ class _$DownSyncFailureStateImpl extends _DownSyncFailureState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -2949,12 +3222,14 @@ class _$DownSyncFailureStateImpl extends _DownSyncFailureState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -2969,12 +3244,13 @@ class _$DownSyncFailureStateImpl extends _DownSyncFailureState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -3137,12 +3413,19 @@ class _$DownSyncReportStateImpl extends _DownSyncReportState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -3157,12 +3440,14 @@ class _$DownSyncReportStateImpl extends _DownSyncReportState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -3177,12 +3462,13 @@ class _$DownSyncReportStateImpl extends _DownSyncReportState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, @@ -3317,12 +3603,19 @@ class _$DownSyncPendingSyncStateImpl extends _DownSyncPendingSyncState { TResult when({ required TResult Function(int syncedCount, int totalCount) inProgress, required TResult Function(DownsyncModel downSyncResult) success, - required TResult Function(int batchSize, String projectId, - String boundaryCode, int pendingSyncCount, String boundaryName) + required TResult Function( + int batchSize, + bool forceDownSync, + String projectId, + String boundaryCode, + int pendingSyncCount, + String boundaryName) getBatchSize, required TResult Function(bool isPop) loading, required TResult Function() insufficientStorage, - required TResult Function(int initialServerCount, int batchSize) dataFound, + required TResult Function( + int initialServerCount, int batchSize, bool forceDownSync) + dataFound, required TResult Function() resetState, required TResult Function() totalCountCheckFailed, required TResult Function() failed, @@ -3337,12 +3630,14 @@ class _$DownSyncPendingSyncStateImpl extends _DownSyncPendingSyncState { TResult? whenOrNull({ TResult? Function(int syncedCount, int totalCount)? inProgress, TResult? Function(DownsyncModel downSyncResult)? success, - TResult? Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult? Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult? Function(bool isPop)? loading, TResult? Function()? insufficientStorage, - TResult? Function(int initialServerCount, int batchSize)? dataFound, + TResult? Function( + int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult? Function()? resetState, TResult? Function()? totalCountCheckFailed, TResult? Function()? failed, @@ -3357,12 +3652,13 @@ class _$DownSyncPendingSyncStateImpl extends _DownSyncPendingSyncState { TResult maybeWhen({ TResult Function(int syncedCount, int totalCount)? inProgress, TResult Function(DownsyncModel downSyncResult)? success, - TResult Function(int batchSize, String projectId, String boundaryCode, - int pendingSyncCount, String boundaryName)? + TResult Function(int batchSize, bool forceDownSync, String projectId, + String boundaryCode, int pendingSyncCount, String boundaryName)? getBatchSize, TResult Function(bool isPop)? loading, TResult Function()? insufficientStorage, - TResult Function(int initialServerCount, int batchSize)? dataFound, + TResult Function(int initialServerCount, int batchSize, bool forceDownSync)? + dataFound, TResult Function()? resetState, TResult Function()? totalCountCheckFailed, TResult Function()? failed, diff --git a/apps/health_campaign_field_worker_app/lib/data/local_store/no_sql/schema/app_configuration.dart b/apps/health_campaign_field_worker_app/lib/data/local_store/no_sql/schema/app_configuration.dart index 1366f26bd8..0478fe53c0 100644 --- a/apps/health_campaign_field_worker_app/lib/data/local_store/no_sql/schema/app_configuration.dart +++ b/apps/health_campaign_field_worker_app/lib/data/local_store/no_sql/schema/app_configuration.dart @@ -21,6 +21,9 @@ class AppConfiguration { @Name("SYNC_TRIGGER") late String? syncTrigger; + @Name("FORCE_DOWNSYNC") + late bool? forceDownSync; + @Name("LANGUAGES") late List? languages; diff --git a/apps/health_campaign_field_worker_app/lib/data/local_store/no_sql/schema/app_configuration.g.dart b/apps/health_campaign_field_worker_app/lib/data/local_store/no_sql/schema/app_configuration.g.dart index a2688a4dbc..076dd28e85 100644 --- a/apps/health_campaign_field_worker_app/lib/data/local_store/no_sql/schema/app_configuration.g.dart +++ b/apps/health_campaign_field_worker_app/lib/data/local_store/no_sql/schema/app_configuration.g.dart @@ -71,110 +71,115 @@ const AppConfigurationSchema = CollectionSchema( type: IsarType.object, target: r'FirebaseConfig', ), - r'GENDER_OPTIONS_POPULATOR': PropertySchema( + r'FORCE_DOWNSYNC': PropertySchema( id: 9, + name: r'FORCE_DOWNSYNC', + type: IsarType.bool, + ), + r'GENDER_OPTIONS_POPULATOR': PropertySchema( + id: 10, name: r'GENDER_OPTIONS_POPULATOR', type: IsarType.objectList, target: r'GenderOptions', ), r'HOUSEHOLD_DELETION_REASON_OPTIONS': PropertySchema( - id: 10, + id: 11, name: r'HOUSEHOLD_DELETION_REASON_OPTIONS', type: IsarType.objectList, target: r'HouseholdDeletionReasonOptions', ), r'HOUSEHOLD_MEMBER_DELETION_REASON_OPTIONS': PropertySchema( - id: 11, + id: 12, name: r'HOUSEHOLD_MEMBER_DELETION_REASON_OPTIONS', type: IsarType.objectList, target: r'HouseholdMemberDeletionReasonOptions', ), r'ID_TYPE_OPTIONS_POPULATOR': PropertySchema( - id: 12, + id: 13, name: r'ID_TYPE_OPTIONS_POPULATOR', type: IsarType.objectList, target: r'IdTypeOptions', ), r'LANGUAGES': PropertySchema( - id: 13, + id: 14, name: r'LANGUAGES', type: IsarType.objectList, target: r'Languages', ), r'NETWORK_DETECTION': PropertySchema( - id: 14, + id: 15, name: r'NETWORK_DETECTION', type: IsarType.string, ), r'PERSISTENCE_MODE': PropertySchema( - id: 15, + id: 16, name: r'PERSISTENCE_MODE', type: IsarType.string, ), r'PROXIMITY_SEARCH_RANGE': PropertySchema( - id: 16, + id: 17, name: r'PROXIMITY_SEARCH_RANGE', type: IsarType.double, ), r'SEARCH_CLF_FILTERS': PropertySchema( - id: 17, + id: 18, name: r'SEARCH_CLF_FILTERS', type: IsarType.objectList, target: r'SearchCLFFilters', ), r'SEARCH_HOUSEHOLD_FILTERS': PropertySchema( - id: 18, + id: 19, name: r'SEARCH_HOUSEHOLD_FILTERS', type: IsarType.objectList, target: r'SearchHouseHoldFilters', ), r'SYNC_METHOD': PropertySchema( - id: 19, + id: 20, name: r'SYNC_METHOD', type: IsarType.string, ), r'SYNC_TRIGGER': PropertySchema( - id: 20, + id: 21, name: r'SYNC_TRIGGER', type: IsarType.string, ), r'TENANT_ID': PropertySchema( - id: 21, + id: 22, name: r'TENANT_ID', type: IsarType.string, ), r'TRANSPORT_TYPES': PropertySchema( - id: 22, + id: 23, name: r'TRANSPORT_TYPES', type: IsarType.objectList, target: r'TransportTypes', ), r'houseStructureTypes': PropertySchema( - id: 23, + id: 24, name: r'houseStructureTypes', type: IsarType.objectList, target: r'HouseStructureTypes', ), r'privacyPolicyConfig': PropertySchema( - id: 24, + id: 25, name: r'privacyPolicyConfig', type: IsarType.object, target: r'PrivacyPolicy', ), r'referralReasons': PropertySchema( - id: 25, + id: 26, name: r'referralReasons', type: IsarType.objectList, target: r'ReferralReasons', ), r'refusalReasons': PropertySchema( - id: 26, + id: 27, name: r'refusalReasons', type: IsarType.objectList, target: r'RefusalReasons', ), r'symptomsTypes': PropertySchema( - id: 27, + id: 28, name: r'symptomsTypes', type: IsarType.objectList, target: r'SymptomsTypes', @@ -605,86 +610,87 @@ void _appConfigurationSerialize( FirebaseConfigSchema.serialize, object.firebaseConfig, ); + writer.writeBool(offsets[9], object.forceDownSync); writer.writeObjectList( - offsets[9], + offsets[10], allOffsets, GenderOptionsSchema.serialize, object.genderOptions, ); writer.writeObjectList( - offsets[10], + offsets[11], allOffsets, HouseholdDeletionReasonOptionsSchema.serialize, object.householdDeletionReasonOptions, ); writer.writeObjectList( - offsets[11], + offsets[12], allOffsets, HouseholdMemberDeletionReasonOptionsSchema.serialize, object.householdMemberDeletionReasonOptions, ); writer.writeObjectList( - offsets[12], + offsets[13], allOffsets, IdTypeOptionsSchema.serialize, object.idTypeOptions, ); writer.writeObjectList( - offsets[13], + offsets[14], allOffsets, LanguagesSchema.serialize, object.languages, ); - writer.writeString(offsets[14], object.networkDetection); - writer.writeString(offsets[15], object.persistenceMode); - writer.writeDouble(offsets[16], object.maxRadius); + writer.writeString(offsets[15], object.networkDetection); + writer.writeString(offsets[16], object.persistenceMode); + writer.writeDouble(offsets[17], object.maxRadius); writer.writeObjectList( - offsets[17], + offsets[18], allOffsets, SearchCLFFiltersSchema.serialize, object.searchCLFFilters, ); writer.writeObjectList( - offsets[18], + offsets[19], allOffsets, SearchHouseHoldFiltersSchema.serialize, object.searchHouseHoldFilters, ); - writer.writeString(offsets[19], object.syncMethod); - writer.writeString(offsets[20], object.syncTrigger); - writer.writeString(offsets[21], object.tenantId); + writer.writeString(offsets[20], object.syncMethod); + writer.writeString(offsets[21], object.syncTrigger); + writer.writeString(offsets[22], object.tenantId); writer.writeObjectList( - offsets[22], + offsets[23], allOffsets, TransportTypesSchema.serialize, object.transportTypes, ); writer.writeObjectList( - offsets[23], + offsets[24], allOffsets, HouseStructureTypesSchema.serialize, object.houseStructureTypes, ); writer.writeObject( - offsets[24], + offsets[25], allOffsets, PrivacyPolicySchema.serialize, object.privacyPolicyConfig, ); writer.writeObjectList( - offsets[25], + offsets[26], allOffsets, ReferralReasonsSchema.serialize, object.referralReasons, ); writer.writeObjectList( - offsets[26], + offsets[27], allOffsets, RefusalReasonsSchema.serialize, object.refusalReasons, ); writer.writeObjectList( - offsets[27], + offsets[28], allOffsets, SymptomsTypesSchema.serialize, object.symptomsTypes, @@ -750,88 +756,89 @@ AppConfiguration _appConfigurationDeserialize( FirebaseConfigSchema.deserialize, allOffsets, ); + object.forceDownSync = reader.readBoolOrNull(offsets[9]); object.genderOptions = reader.readObjectList( - offsets[9], + offsets[10], GenderOptionsSchema.deserialize, allOffsets, GenderOptions(), ); object.householdDeletionReasonOptions = reader.readObjectList( - offsets[10], + offsets[11], HouseholdDeletionReasonOptionsSchema.deserialize, allOffsets, HouseholdDeletionReasonOptions(), ); object.householdMemberDeletionReasonOptions = reader.readObjectList( - offsets[11], + offsets[12], HouseholdMemberDeletionReasonOptionsSchema.deserialize, allOffsets, HouseholdMemberDeletionReasonOptions(), ); object.idTypeOptions = reader.readObjectList( - offsets[12], + offsets[13], IdTypeOptionsSchema.deserialize, allOffsets, IdTypeOptions(), ); object.languages = reader.readObjectList( - offsets[13], + offsets[14], LanguagesSchema.deserialize, allOffsets, Languages(), ); - object.networkDetection = reader.readStringOrNull(offsets[14]); - object.persistenceMode = reader.readStringOrNull(offsets[15]); - object.maxRadius = reader.readDoubleOrNull(offsets[16]); + object.networkDetection = reader.readStringOrNull(offsets[15]); + object.persistenceMode = reader.readStringOrNull(offsets[16]); + object.maxRadius = reader.readDoubleOrNull(offsets[17]); object.searchCLFFilters = reader.readObjectList( - offsets[17], + offsets[18], SearchCLFFiltersSchema.deserialize, allOffsets, SearchCLFFilters(), ); object.searchHouseHoldFilters = reader.readObjectList( - offsets[18], + offsets[19], SearchHouseHoldFiltersSchema.deserialize, allOffsets, SearchHouseHoldFilters(), ); - object.syncMethod = reader.readStringOrNull(offsets[19]); - object.syncTrigger = reader.readStringOrNull(offsets[20]); - object.tenantId = reader.readStringOrNull(offsets[21]); + object.syncMethod = reader.readStringOrNull(offsets[20]); + object.syncTrigger = reader.readStringOrNull(offsets[21]); + object.tenantId = reader.readStringOrNull(offsets[22]); object.transportTypes = reader.readObjectList( - offsets[22], + offsets[23], TransportTypesSchema.deserialize, allOffsets, TransportTypes(), ); object.houseStructureTypes = reader.readObjectList( - offsets[23], + offsets[24], HouseStructureTypesSchema.deserialize, allOffsets, HouseStructureTypes(), ); object.id = id; object.privacyPolicyConfig = reader.readObjectOrNull( - offsets[24], + offsets[25], PrivacyPolicySchema.deserialize, allOffsets, ); object.referralReasons = reader.readObjectList( - offsets[25], + offsets[26], ReferralReasonsSchema.deserialize, allOffsets, ReferralReasons(), ); object.refusalReasons = reader.readObjectList( - offsets[26], + offsets[27], RefusalReasonsSchema.deserialize, allOffsets, RefusalReasons(), ); object.symptomsTypes = reader.readObjectList( - offsets[27], + offsets[28], SymptomsTypesSchema.deserialize, allOffsets, SymptomsTypes(), @@ -907,101 +914,103 @@ P _appConfigurationDeserializeProp

( allOffsets, )) as P; case 9: + return (reader.readBoolOrNull(offset)) as P; + case 10: return (reader.readObjectList( offset, GenderOptionsSchema.deserialize, allOffsets, GenderOptions(), )) as P; - case 10: + case 11: return (reader.readObjectList( offset, HouseholdDeletionReasonOptionsSchema.deserialize, allOffsets, HouseholdDeletionReasonOptions(), )) as P; - case 11: + case 12: return (reader.readObjectList( offset, HouseholdMemberDeletionReasonOptionsSchema.deserialize, allOffsets, HouseholdMemberDeletionReasonOptions(), )) as P; - case 12: + case 13: return (reader.readObjectList( offset, IdTypeOptionsSchema.deserialize, allOffsets, IdTypeOptions(), )) as P; - case 13: + case 14: return (reader.readObjectList( offset, LanguagesSchema.deserialize, allOffsets, Languages(), )) as P; - case 14: - return (reader.readStringOrNull(offset)) as P; case 15: return (reader.readStringOrNull(offset)) as P; case 16: - return (reader.readDoubleOrNull(offset)) as P; + return (reader.readStringOrNull(offset)) as P; case 17: + return (reader.readDoubleOrNull(offset)) as P; + case 18: return (reader.readObjectList( offset, SearchCLFFiltersSchema.deserialize, allOffsets, SearchCLFFilters(), )) as P; - case 18: + case 19: return (reader.readObjectList( offset, SearchHouseHoldFiltersSchema.deserialize, allOffsets, SearchHouseHoldFilters(), )) as P; - case 19: - return (reader.readStringOrNull(offset)) as P; case 20: return (reader.readStringOrNull(offset)) as P; case 21: return (reader.readStringOrNull(offset)) as P; case 22: + return (reader.readStringOrNull(offset)) as P; + case 23: return (reader.readObjectList( offset, TransportTypesSchema.deserialize, allOffsets, TransportTypes(), )) as P; - case 23: + case 24: return (reader.readObjectList( offset, HouseStructureTypesSchema.deserialize, allOffsets, HouseStructureTypes(), )) as P; - case 24: + case 25: return (reader.readObjectOrNull( offset, PrivacyPolicySchema.deserialize, allOffsets, )) as P; - case 25: + case 26: return (reader.readObjectList( offset, ReferralReasonsSchema.deserialize, allOffsets, ReferralReasons(), )) as P; - case 26: + case 27: return (reader.readObjectList( offset, RefusalReasonsSchema.deserialize, allOffsets, RefusalReasons(), )) as P; - case 27: + case 28: return (reader.readObjectList( offset, SymptomsTypesSchema.deserialize, @@ -1803,6 +1812,34 @@ extension AppConfigurationQueryFilter }); } + QueryBuilder + forceDownSyncIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'FORCE_DOWNSYNC', + )); + }); + } + + QueryBuilder + forceDownSyncIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'FORCE_DOWNSYNC', + )); + }); + } + + QueryBuilder + forceDownSyncEqualTo(bool? value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'FORCE_DOWNSYNC', + value: value, + )); + }); + } + QueryBuilder genderOptionsIsNull() { return QueryBuilder.apply(this, (query) { @@ -4180,6 +4217,20 @@ extension AppConfigurationQueryLinks extension AppConfigurationQuerySortBy on QueryBuilder { + QueryBuilder + sortByForceDownSync() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'FORCE_DOWNSYNC', Sort.asc); + }); + } + + QueryBuilder + sortByForceDownSyncDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'FORCE_DOWNSYNC', Sort.desc); + }); + } + QueryBuilder sortByNetworkDetection() { return QueryBuilder.apply(this, (query) { @@ -4267,6 +4318,20 @@ extension AppConfigurationQuerySortBy extension AppConfigurationQuerySortThenBy on QueryBuilder { + QueryBuilder + thenByForceDownSync() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'FORCE_DOWNSYNC', Sort.asc); + }); + } + + QueryBuilder + thenByForceDownSyncDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'FORCE_DOWNSYNC', Sort.desc); + }); + } + QueryBuilder thenByNetworkDetection() { return QueryBuilder.apply(this, (query) { @@ -4367,6 +4432,13 @@ extension AppConfigurationQuerySortThenBy extension AppConfigurationQueryWhereDistinct on QueryBuilder { + QueryBuilder + distinctByForceDownSync() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'FORCE_DOWNSYNC'); + }); + } + QueryBuilder distinctByNetworkDetection({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { @@ -4483,6 +4555,13 @@ extension AppConfigurationQueryProperty }); } + QueryBuilder + forceDownSyncProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'FORCE_DOWNSYNC'); + }); + } + QueryBuilder?, QQueryOperations> genderOptionsProperty() { return QueryBuilder.apply(this, (query) { diff --git a/apps/health_campaign_field_worker_app/lib/data/repositories/remote/mdms.dart b/apps/health_campaign_field_worker_app/lib/data/repositories/remote/mdms.dart index c06bc556cb..b50edad4d9 100644 --- a/apps/health_campaign_field_worker_app/lib/data/repositories/remote/mdms.dart +++ b/apps/health_campaign_field_worker_app/lib/data/repositories/remote/mdms.dart @@ -149,7 +149,8 @@ class MdmsRepository { ..tenantId = appConfig?.tenantId ..maxRadius = appConfig?.maxRadius ..backgroundServiceConfig = backgroundServiceConfig - ..firebaseConfig = firebaseConfig; + ..firebaseConfig = firebaseConfig + ..forceDownSync = appConfig?.forceDownsync; final List? languageList = commonMasters?.stateInfo.first.languages.map((element) { diff --git a/apps/health_campaign_field_worker_app/lib/data/sync_service_mapper.dart b/apps/health_campaign_field_worker_app/lib/data/sync_service_mapper.dart index 92b9957ee9..d3a4cd0801 100644 --- a/apps/health_campaign_field_worker_app/lib/data/sync_service_mapper.dart +++ b/apps/health_campaign_field_worker_app/lib/data/sync_service_mapper.dart @@ -4,6 +4,7 @@ import 'dart:convert'; import 'package:attendance_management/attendance_management.dart'; import 'package:collection/collection.dart'; import 'package:digit_data_model/data_model.dart'; +import 'package:drift/drift.dart'; import 'package:inventory_management/inventory_management.dart'; import 'package:referral_reconciliation/referral_reconciliation.dart'; import 'package:registration_delivery/registration_delivery.dart'; @@ -17,7 +18,7 @@ class SyncServiceMapper extends SyncEntityMapperListener { FutureOr writeToEntityDB( Map response, List> - localRepositories) async { + localRepositories, bool isForceDownSync) async { try { for (int i = 0; i <= response.keys.length - 1; i++) { if (response.keys.elementAt(i) != 'DownsyncCriteria') { @@ -25,6 +26,8 @@ class SyncServiceMapper extends SyncEntityMapperListener { DataModels.getDataModelForEntityName(response.keys.elementAt(i)), localRepositories, ); + + final insertMode = isForceDownSync ? InsertMode.insertOrIgnore : InsertMode.insertOrReplace; final List entityResponse = response[response.keys.elementAt(i)] ?? []; @@ -36,12 +39,12 @@ class SyncServiceMapper extends SyncEntityMapperListener { final entity = entityList .map((e) => IndividualModelMapper.fromJson(jsonEncode(e))) .toList(); - await local.bulkCreate(entity); + await local.bulkCreate(entity, mode: insertMode); case "Households": final entity = entityList .map((e) => HouseholdModelMapper.fromJson(jsonEncode(e))) .toList(); - await local.bulkCreate(entity); + await local.bulkCreate(entity, mode: insertMode); case "HouseholdMembers": final entity = entityList .map( @@ -50,33 +53,33 @@ class SyncServiceMapper extends SyncEntityMapperListener { ), ) .toList(); - await local.bulkCreate(entity); + await local.bulkCreate(entity, mode: insertMode); case "ProjectBeneficiaries": final entity = entityList .map((e) => ProjectBeneficiaryModelMapper.fromJson(jsonEncode(e))) .toList(); - await local.bulkCreate(entity); + await local.bulkCreate(entity, mode: insertMode); case "Tasks": final entity = entityList .map((e) => TaskModelMapper.fromJson(jsonEncode(e))) .toList(); - await local.bulkCreate(entity); + await local.bulkCreate(entity, mode: insertMode); case "SideEffects": final entity = entityList .map((e) => SideEffectModelMapper.fromJson(jsonEncode(e))) .toList(); - await local.bulkCreate(entity); + await local.bulkCreate(entity, mode: insertMode); case "Referrals": final entity = entityList .map((e) => ReferralModelMapper.fromJson(jsonEncode(e))) .toList(); - await local.bulkCreate(entity); + await local.bulkCreate(entity, mode: insertMode); default: final entity = entityList .map((e) => EntityModelMapper.fromJson(jsonEncode(e))) .toList(); - await local.bulkCreate(entity); + await local.bulkCreate(entity, mode: insertMode); } } } diff --git a/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.dart b/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.dart index b2580d3a84..162a9a62f4 100644 --- a/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.dart +++ b/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.dart @@ -183,6 +183,7 @@ class AppConfig with _$AppConfig { @JsonKey(name: 'SYNC_TRIGGER') required String syncTrigger, @JsonKey(name: 'TENANT_ID') final String? tenantId, @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') final double? maxRadius, + @JsonKey(name: 'FORCE_DOWNSYNC') final bool? forceDownsync, }) = _AppConfig; factory AppConfig.fromJson(Map json) => diff --git a/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.freezed.dart b/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.freezed.dart index a94250be81..0a552d9d70 100644 --- a/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.freezed.dart +++ b/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.freezed.dart @@ -2741,6 +2741,8 @@ mixin _$AppConfig { String? get tenantId => throw _privateConstructorUsedError; @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') double? get maxRadius => throw _privateConstructorUsedError; + @JsonKey(name: 'FORCE_DOWNSYNC') + bool? get forceDownsync => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -2759,7 +2761,8 @@ abstract class $AppConfigCopyWith<$Res> { @JsonKey(name: 'SYNC_METHOD') String syncMethod, @JsonKey(name: 'SYNC_TRIGGER') String syncTrigger, @JsonKey(name: 'TENANT_ID') String? tenantId, - @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') double? maxRadius}); + @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') double? maxRadius, + @JsonKey(name: 'FORCE_DOWNSYNC') bool? forceDownsync}); } /// @nodoc @@ -2781,6 +2784,7 @@ class _$AppConfigCopyWithImpl<$Res, $Val extends AppConfig> Object? syncTrigger = null, Object? tenantId = freezed, Object? maxRadius = freezed, + Object? forceDownsync = freezed, }) { return _then(_value.copyWith( networkDetection: null == networkDetection @@ -2807,6 +2811,10 @@ class _$AppConfigCopyWithImpl<$Res, $Val extends AppConfig> ? _value.maxRadius : maxRadius // ignore: cast_nullable_to_non_nullable as double?, + forceDownsync: freezed == forceDownsync + ? _value.forceDownsync + : forceDownsync // ignore: cast_nullable_to_non_nullable + as bool?, ) as $Val); } } @@ -2825,7 +2833,8 @@ abstract class _$$AppConfigImplCopyWith<$Res> @JsonKey(name: 'SYNC_METHOD') String syncMethod, @JsonKey(name: 'SYNC_TRIGGER') String syncTrigger, @JsonKey(name: 'TENANT_ID') String? tenantId, - @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') double? maxRadius}); + @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') double? maxRadius, + @JsonKey(name: 'FORCE_DOWNSYNC') bool? forceDownsync}); } /// @nodoc @@ -2845,6 +2854,7 @@ class __$$AppConfigImplCopyWithImpl<$Res> Object? syncTrigger = null, Object? tenantId = freezed, Object? maxRadius = freezed, + Object? forceDownsync = freezed, }) { return _then(_$AppConfigImpl( networkDetection: null == networkDetection @@ -2871,6 +2881,10 @@ class __$$AppConfigImplCopyWithImpl<$Res> ? _value.maxRadius : maxRadius // ignore: cast_nullable_to_non_nullable as double?, + forceDownsync: freezed == forceDownsync + ? _value.forceDownsync + : forceDownsync // ignore: cast_nullable_to_non_nullable + as bool?, )); } } @@ -2884,7 +2898,8 @@ class _$AppConfigImpl implements _AppConfig { @JsonKey(name: 'SYNC_METHOD') required this.syncMethod, @JsonKey(name: 'SYNC_TRIGGER') required this.syncTrigger, @JsonKey(name: 'TENANT_ID') this.tenantId, - @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') this.maxRadius}); + @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') this.maxRadius, + @JsonKey(name: 'FORCE_DOWNSYNC') this.forceDownsync}); factory _$AppConfigImpl.fromJson(Map json) => _$$AppConfigImplFromJson(json); @@ -2907,10 +2922,13 @@ class _$AppConfigImpl implements _AppConfig { @override @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') final double? maxRadius; + @override + @JsonKey(name: 'FORCE_DOWNSYNC') + final bool? forceDownsync; @override String toString() { - return 'AppConfig(networkDetection: $networkDetection, persistenceMode: $persistenceMode, syncMethod: $syncMethod, syncTrigger: $syncTrigger, tenantId: $tenantId, maxRadius: $maxRadius)'; + return 'AppConfig(networkDetection: $networkDetection, persistenceMode: $persistenceMode, syncMethod: $syncMethod, syncTrigger: $syncTrigger, tenantId: $tenantId, maxRadius: $maxRadius, forceDownsync: $forceDownsync)'; } @override @@ -2929,13 +2947,22 @@ class _$AppConfigImpl implements _AppConfig { (identical(other.tenantId, tenantId) || other.tenantId == tenantId) && (identical(other.maxRadius, maxRadius) || - other.maxRadius == maxRadius)); + other.maxRadius == maxRadius) && + (identical(other.forceDownsync, forceDownsync) || + other.forceDownsync == forceDownsync)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, networkDetection, - persistenceMode, syncMethod, syncTrigger, tenantId, maxRadius); + int get hashCode => Object.hash( + runtimeType, + networkDetection, + persistenceMode, + syncMethod, + syncTrigger, + tenantId, + maxRadius, + forceDownsync); @JsonKey(ignore: true) @override @@ -2959,8 +2986,9 @@ abstract class _AppConfig implements AppConfig { @JsonKey(name: 'SYNC_METHOD') required final String syncMethod, @JsonKey(name: 'SYNC_TRIGGER') required final String syncTrigger, @JsonKey(name: 'TENANT_ID') final String? tenantId, - @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') - final double? maxRadius}) = _$AppConfigImpl; + @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') final double? maxRadius, + @JsonKey(name: 'FORCE_DOWNSYNC') + final bool? forceDownsync}) = _$AppConfigImpl; factory _AppConfig.fromJson(Map json) = _$AppConfigImpl.fromJson; @@ -2984,6 +3012,9 @@ abstract class _AppConfig implements AppConfig { @JsonKey(name: 'PROXIMITY_SEARCH_RANGE') double? get maxRadius; @override + @JsonKey(name: 'FORCE_DOWNSYNC') + bool? get forceDownsync; + @override @JsonKey(ignore: true) _$$AppConfigImplCopyWith<_$AppConfigImpl> get copyWith => throw _privateConstructorUsedError; diff --git a/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.g.dart b/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.g.dart index 25bc7e6158..de4bb27c8c 100644 --- a/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.g.dart +++ b/apps/health_campaign_field_worker_app/lib/models/app_config/app_config_model.g.dart @@ -277,6 +277,7 @@ _$AppConfigImpl _$$AppConfigImplFromJson(Map json) => syncTrigger: json['SYNC_TRIGGER'] as String, tenantId: json['TENANT_ID'] as String?, maxRadius: (json['PROXIMITY_SEARCH_RANGE'] as num?)?.toDouble(), + forceDownsync: json['FORCE_DOWNSYNC'] as bool?, ); Map _$$AppConfigImplToJson(_$AppConfigImpl instance) => @@ -287,6 +288,7 @@ Map _$$AppConfigImplToJson(_$AppConfigImpl instance) => 'SYNC_TRIGGER': instance.syncTrigger, 'TENANT_ID': instance.tenantId, 'PROXIMITY_SEARCH_RANGE': instance.maxRadius, + 'FORCE_DOWNSYNC': instance.forceDownsync, }; _$IdTypeOptionsImpl _$$IdTypeOptionsImplFromJson(Map json) => diff --git a/apps/health_campaign_field_worker_app/lib/pages/boundary_selection.dart b/apps/health_campaign_field_worker_app/lib/pages/boundary_selection.dart index a6d2ad6c9b..1c1c804a73 100644 --- a/apps/health_campaign_field_worker_app/lib/pages/boundary_selection.dart +++ b/apps/health_campaign_field_worker_app/lib/pages/boundary_selection.dart @@ -165,6 +165,7 @@ class _BoundarySelectionPageState }, getBatchSize: ( batchSize, + forceDownSync, projectId, boundaryCode, pendingSyncCount, @@ -184,6 +185,7 @@ class _BoundarySelectionPageState .value!.name .toString(), batchSize: batchSize, + forceDownSync: forceDownSync, ), ), pendingSync: () => showDownloadDialog( @@ -210,7 +212,7 @@ class _BoundarySelectionPageState DigitProgressDialogType.pendingSync, isPop: true, ), - dataFound: (initialServerCount, batchSize) { + dataFound: (initialServerCount, batchSize, forceDownSync) { clickedStatus.value = false; showDownloadDialog( context, diff --git a/apps/health_campaign_field_worker_app/lib/pages/reports/beneficiary/beneficaries_report.dart b/apps/health_campaign_field_worker_app/lib/pages/reports/beneficiary/beneficaries_report.dart index 320155af4c..f74a24858d 100644 --- a/apps/health_campaign_field_worker_app/lib/pages/reports/beneficiary/beneficaries_report.dart +++ b/apps/health_campaign_field_worker_app/lib/pages/reports/beneficiary/beneficaries_report.dart @@ -116,6 +116,7 @@ class BeneficiariesReportState extends LocalizedState { }, getBatchSize: ( batchSize, + forceDownSync, projectId, boundaryCode, pendingSync, @@ -128,6 +129,7 @@ class BeneficiariesReportState extends LocalizedState { pendingSyncCount: pendingSyncCount, boundaryName: boundaryName, batchSize: batchSize, + forceDownSync: forceDownSync, ), ), report: (downSyncCriteriaList) { @@ -157,7 +159,7 @@ class BeneficiariesReportState extends LocalizedState { dialogType: DigitProgressDialogType.pendingSync, isPop: true, ), - dataFound: (initialServerCount, batchSize) => + dataFound: (initialServerCount, batchSize, forceDownSync) => showDownloadDialog( context, model: DownloadBeneficiary( diff --git a/apps/health_campaign_field_worker_app/lib/utils/utils.dart b/apps/health_campaign_field_worker_app/lib/utils/utils.dart index 30eea8b450..db331813f2 100644 --- a/apps/health_campaign_field_worker_app/lib/utils/utils.dart +++ b/apps/health_campaign_field_worker_app/lib/utils/utils.dart @@ -304,6 +304,7 @@ void showDownloadDialog( DownSyncBeneficiaryEvent( projectId: context.projectId, boundaryCode: model.boundary, + forceDownSync: model.appConfiguartion?.forceDownSync ?? false, // Batch Size need to be defined based on Internet speed. batchSize: model.batchSize ?? 1, initialServerCount: model.totalCount ?? 0, diff --git a/apps/health_campaign_field_worker_app/pubspec.lock b/apps/health_campaign_field_worker_app/pubspec.lock index d65cc86d58..fe93abeef4 100644 --- a/apps/health_campaign_field_worker_app/pubspec.lock +++ b/apps/health_campaign_field_worker_app/pubspec.lock @@ -68,10 +68,9 @@ packages: attendance_management: dependency: "direct main" description: - name: attendance_management - sha256: "6b7c39aba4f4c26340daee8dcb8fde3823a28e3fae6065fd3abf3ed90d3c74c5" - url: "https://pub.dev" - source: hosted + path: "../../packages/attendance_management" + relative: true + source: path version: "1.0.4+1" audioplayers: dependency: transitive @@ -340,10 +339,9 @@ packages: closed_household: dependency: "direct main" description: - name: closed_household - sha256: "23beebd659a3619b6ca11f1c4ae090632e7f1dde8219108b4a28a5f568c70760" - url: "https://pub.dev" - source: hosted + path: "../../packages/closed_household" + relative: true + source: path version: "1.0.5" code_builder: dependency: transitive @@ -509,18 +507,16 @@ packages: digit_data_model: dependency: "direct main" description: - name: digit_data_model - sha256: bcb6c328a75df1442672e39c0dbae32bc9cb067a07a581bded672d2b748957b9 - url: "https://pub.dev" - source: hosted + path: "../../packages/digit_data_model" + relative: true + source: path version: "1.0.6" digit_dss: dependency: "direct main" description: - name: digit_dss - sha256: a58aae4c9ad5fe58562706fd5a83419c3fca316821ccc38e249189663e8a0f20 - url: "https://pub.dev" - source: hosted + path: "../../packages/digit_dss" + relative: true + source: path version: "1.0.4" digit_firebase_services: dependency: "direct main" @@ -541,18 +537,16 @@ packages: digit_scanner: dependency: "direct main" description: - name: digit_scanner - sha256: "69580859ba9b63f32e40e6d56bf55a016eb623007ea06552b38f70056ea06dfe" - url: "https://pub.dev" - source: hosted + path: "../../packages/digit_scanner" + relative: true + source: path version: "1.0.5" digit_showcase: dependency: "direct main" description: - name: digit_showcase - sha256: b4f9009c0d1b33b6576fa2d480826cc36f2ba5f62c7330b9f7b436af39508b4e - url: "https://pub.dev" - source: hosted + path: "../../packages/digit_showcase" + relative: true + source: path version: "1.0.2" digit_ui_components: dependency: "direct main" @@ -675,7 +669,7 @@ packages: source: hosted version: "8.0.7" file_selector_linux: - dependency: transitive + dependency: "direct overridden" description: name: file_selector_linux sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" @@ -691,7 +685,7 @@ packages: source: hosted version: "0.9.4+2" file_selector_platform_interface: - dependency: transitive + dependency: "direct overridden" description: name: file_selector_platform_interface sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b @@ -821,7 +815,7 @@ packages: source: hosted version: "3.0.7" flutter_dropzone_platform_interface: - dependency: transitive + dependency: "direct overridden" description: name: flutter_dropzone_platform_interface sha256: b4e2df75364bab2f4c3ca32b87193267d786b6e158c3f345c3a1daeb911d82b9 @@ -1328,10 +1322,9 @@ packages: inventory_management: dependency: "direct main" description: - name: inventory_management - sha256: "481b9ecb81900287632a79048e1ded36bb66415714f0ab5a30a38c94aa3d7cec" - url: "https://pub.dev" - source: hosted + path: "../../packages/inventory_management" + relative: true + source: path version: "1.0.5" io: dependency: transitive @@ -1800,18 +1793,16 @@ packages: referral_reconciliation: dependency: "direct main" description: - name: referral_reconciliation - sha256: "40578f3e86fc3de3431147ea4bf91cf94c3acda488d776f86a85c6fedd7e2cb9" - url: "https://pub.dev" - source: hosted + path: "../../packages/referral_reconciliation" + relative: true + source: path version: "1.0.4" registration_delivery: dependency: "direct main" description: - name: registration_delivery - sha256: "4354d586163faa46a1880a72dfcc380025599d370a194e6f14a7bba68f17906c" - url: "https://pub.dev" - source: hosted + path: "../../packages/registration_delivery" + relative: true + source: path version: "1.0.6" rxdart: dependency: transitive @@ -2021,10 +2012,9 @@ packages: survey_form: dependency: "direct main" description: - name: survey_form - sha256: f601e5205ccd9d945d241789b30365203834d5d3e0ce718706a5f1cc4e49e137 - url: "https://pub.dev" - source: hosted + path: "../../packages/survey_form" + relative: true + source: path version: "1.0.1" sync_http: dependency: transitive @@ -2037,10 +2027,9 @@ packages: sync_service: dependency: "direct main" description: - name: sync_service - sha256: eb214ed7351f1f4ab63c90a23d2ad9f554ac92d73dbbe0dd7ce167776b941de9 - url: "https://pub.dev" - source: hosted + path: "../../packages/sync_service" + relative: true + source: path version: "1.0.0" synchronized: dependency: transitive @@ -2363,5 +2352,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.4.1 <3.9.0" + dart: ">=3.4.0 <4.0.0" flutter: ">=3.22.0" diff --git a/packages/attendance_management/lib/data/repositories/local/attendance_logs.dart b/packages/attendance_management/lib/data/repositories/local/attendance_logs.dart index 05298562a5..fd93aebc10 100644 --- a/packages/attendance_management/lib/data/repositories/local/attendance_logs.dart +++ b/packages/attendance_management/lib/data/repositories/local/attendance_logs.dart @@ -96,8 +96,9 @@ class AttendanceLogsLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final logsCompanions = entities .map((e) => e.companion.copyWith( diff --git a/packages/attendance_management/lib/data/repositories/local/attendance_register.dart b/packages/attendance_management/lib/data/repositories/local/attendance_register.dart index 1d80155334..d6645d1d4b 100644 --- a/packages/attendance_management/lib/data/repositories/local/attendance_register.dart +++ b/packages/attendance_management/lib/data/repositories/local/attendance_register.dart @@ -164,8 +164,9 @@ class AttendanceLocalRepository extends LocalRepository bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final registerCompanions = entities.map((e) => e.companion).toList(); diff --git a/packages/digit_data_model/lib/data/data_repository.dart b/packages/digit_data_model/lib/data/data_repository.dart index 869831b1f3..171747002e 100644 --- a/packages/digit_data_model/lib/data/data_repository.dart +++ b/packages/digit_data_model/lib/data/data_repository.dart @@ -5,6 +5,7 @@ import 'dart:convert'; import 'package:dart_mappable/dart_mappable.dart'; import 'package:digit_data_model/data_model.dart'; import 'package:dio/dio.dart'; +import 'package:drift/drift.dart'; import 'package:flutter/cupertino.dart'; import '../utils/constants.dart'; @@ -418,7 +419,7 @@ abstract class LocalRepository bulkCreate(List entities) => throw UnimplementedError(); + FutureOr bulkCreate(List entities, {InsertMode mode = InsertMode.insertOrReplace}) => throw UnimplementedError(); @override @mustCallSuper diff --git a/packages/digit_data_model/lib/data/repositories/local/boundary.dart b/packages/digit_data_model/lib/data/repositories/local/boundary.dart index eaa89fc4c1..65bcafbd2b 100644 --- a/packages/digit_data_model/lib/data/repositories/local/boundary.dart +++ b/packages/digit_data_model/lib/data/repositories/local/boundary.dart @@ -30,8 +30,9 @@ class BoundaryLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final boundaryCompanions = entities.map((e) => e.companion).toList(); diff --git a/packages/digit_data_model/lib/data/repositories/local/facility.dart b/packages/digit_data_model/lib/data/repositories/local/facility.dart index 2da80ea136..8e3c7639b7 100644 --- a/packages/digit_data_model/lib/data/repositories/local/facility.dart +++ b/packages/digit_data_model/lib/data/repositories/local/facility.dart @@ -100,8 +100,9 @@ class FacilityLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final facilityCompanions = entities.map((e) => e.companion).toList(); diff --git a/packages/digit_data_model/lib/data/repositories/local/individual.dart b/packages/digit_data_model/lib/data/repositories/local/individual.dart index 8ef0e957de..c9fb9e3d9a 100644 --- a/packages/digit_data_model/lib/data/repositories/local/individual.dart +++ b/packages/digit_data_model/lib/data/repositories/local/individual.dart @@ -283,8 +283,9 @@ class IndividualLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final individualCompanions = entities.map((e) => e.companion).toList(); @@ -333,24 +334,24 @@ class IndividualLocalRepository batch.insertAll( sql.name, nameCompanions.whereNotNull().toList(), - mode: InsertMode.insertOrReplace, + mode: mode, ); } batch.insertAll( sql.address, addressCompanions, - mode: InsertMode.insertOrReplace, + mode: mode, ); batch.insertAll( sql.identifier, identifierCompanions.whereNotNull().toList(), - mode: InsertMode.insertOrReplace, + mode: mode, ); batch.insertAll( sql.individual, individualCompanions, - mode: InsertMode.insertOrReplace, + mode: mode, ); }); }); diff --git a/packages/digit_data_model/lib/data/repositories/local/project_facility.dart b/packages/digit_data_model/lib/data/repositories/local/project_facility.dart index 60fc30731e..c6fd977eaf 100644 --- a/packages/digit_data_model/lib/data/repositories/local/project_facility.dart +++ b/packages/digit_data_model/lib/data/repositories/local/project_facility.dart @@ -67,8 +67,9 @@ class ProjectFacilityLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final projectFacilityCompanions = entities.map((e) => e.companion).toList(); diff --git a/packages/referral_reconciliation/lib/data/repositories/local/hf_referral.dart b/packages/referral_reconciliation/lib/data/repositories/local/hf_referral.dart index 9679eb0258..3ec4b1744d 100644 --- a/packages/referral_reconciliation/lib/data/repositories/local/hf_referral.dart +++ b/packages/referral_reconciliation/lib/data/repositories/local/hf_referral.dart @@ -201,8 +201,9 @@ class HFReferralLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, + }) async { return retryLocalCallOperation(() async { final referralCompanions = entities .map((e) => e.companion.copyWith( diff --git a/packages/registration_delivery/lib/data/repositories/local/household.dart b/packages/registration_delivery/lib/data/repositories/local/household.dart index 1607f1d8ed..936c93075d 100644 --- a/packages/registration_delivery/lib/data/repositories/local/household.dart +++ b/packages/registration_delivery/lib/data/repositories/local/household.dart @@ -189,8 +189,9 @@ class HouseholdLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, + }) async { return retryLocalCallOperation(() async { final householdCompanions = entities.map((e) => e.companion).toList(); @@ -211,14 +212,14 @@ class HouseholdLocalRepository batch.insertAll( sql.address, addressCompanions.whereNotNull().toList(), - mode: InsertMode.insertOrReplace, + mode: mode ); } batch.insertAll( sql.household, householdCompanions, - mode: InsertMode.insertOrReplace, + mode: mode, ); }); }); diff --git a/packages/registration_delivery/lib/data/repositories/local/household_member.dart b/packages/registration_delivery/lib/data/repositories/local/household_member.dart index f9d4e07663..f2eca64632 100644 --- a/packages/registration_delivery/lib/data/repositories/local/household_member.dart +++ b/packages/registration_delivery/lib/data/repositories/local/household_member.dart @@ -123,8 +123,9 @@ class HouseholdMemberLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final householdMemberCompanions = entities.map((e) => e.companion).toList(); @@ -133,7 +134,7 @@ class HouseholdMemberLocalRepository batch.insertAll( sql.householdMember, householdMemberCompanions, - mode: InsertMode.insertOrReplace, + mode: mode, ); }); }); diff --git a/packages/registration_delivery/lib/data/repositories/local/project_beneficiary.dart b/packages/registration_delivery/lib/data/repositories/local/project_beneficiary.dart index 3beb9ed454..c145a54b64 100644 --- a/packages/registration_delivery/lib/data/repositories/local/project_beneficiary.dart +++ b/packages/registration_delivery/lib/data/repositories/local/project_beneficiary.dart @@ -54,8 +54,9 @@ class ProjectBeneficiaryLocalRepository extends LocalRepository< @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final projectBeneficiaryCompanions = entities.map((e) => e.companion).toList(); @@ -64,7 +65,7 @@ class ProjectBeneficiaryLocalRepository extends LocalRepository< batch.insertAll( sql.projectBeneficiary, projectBeneficiaryCompanions, - mode: InsertMode.insertOrReplace, + mode: mode, ); }); }); diff --git a/packages/registration_delivery/lib/data/repositories/local/referral.dart b/packages/registration_delivery/lib/data/repositories/local/referral.dart index 5bd72f96df..46006108a8 100644 --- a/packages/registration_delivery/lib/data/repositories/local/referral.dart +++ b/packages/registration_delivery/lib/data/repositories/local/referral.dart @@ -134,8 +134,9 @@ class ReferralLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final referralCompanions = entities.map((e) => e.companion).toList(); @@ -143,7 +144,7 @@ class ReferralLocalRepository batch.insertAll( sql.referral, referralCompanions, - mode: InsertMode.insertOrReplace, + mode: mode, ); }); }); diff --git a/packages/registration_delivery/lib/data/repositories/local/side_effect.dart b/packages/registration_delivery/lib/data/repositories/local/side_effect.dart index 4e70800922..cc69c3cb79 100644 --- a/packages/registration_delivery/lib/data/repositories/local/side_effect.dart +++ b/packages/registration_delivery/lib/data/repositories/local/side_effect.dart @@ -129,8 +129,9 @@ class SideEffectLocalRepository @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { return retryLocalCallOperation(() async { final sideEffectCompanions = entities.map((e) => e.companion).toList(); @@ -138,7 +139,7 @@ class SideEffectLocalRepository batch.insertAll( sql.sideEffect, sideEffectCompanions, - mode: InsertMode.insertOrReplace, + mode: mode, ); }); }); diff --git a/packages/registration_delivery/lib/data/repositories/local/task.dart b/packages/registration_delivery/lib/data/repositories/local/task.dart index 6d350830d9..e5a9f18e17 100644 --- a/packages/registration_delivery/lib/data/repositories/local/task.dart +++ b/packages/registration_delivery/lib/data/repositories/local/task.dart @@ -314,8 +314,9 @@ class TaskLocalRepository extends LocalRepository { @override FutureOr bulkCreate( - List entities, - ) async { + List entities,{ + InsertMode mode = InsertMode.insertOrReplace, // Default to insertOrReplace + }) async { final taskCompanions = entities.map((e) => e.companion).toList(); List addressCompanions = []; @@ -348,18 +349,26 @@ class TaskLocalRepository extends LocalRepository { batch.insertAll( sql.task, taskCompanions, - mode: InsertMode.insertOrReplace, + mode: mode, ); if (addressCompanions.isNotEmpty) { batch.insertAll( sql.address, addressCompanions.whereNotNull().toList(), - mode: InsertMode.insertOrReplace, + mode: mode, ); } + if(mode == InsertMode.insertOrIgnore){ + batch.insertAll( + sql.taskResource, + resourceCompanions, + mode: mode, + ); + }else{ + batch.insertAllOnConflictUpdate(sql.taskResource, resourceCompanions); + } - batch.insertAllOnConflictUpdate(sql.taskResource, resourceCompanions); }); } diff --git a/packages/sync_service/lib/data/sync_entity_mapper_listener.dart b/packages/sync_service/lib/data/sync_entity_mapper_listener.dart index 63cfb63c50..b84370ff30 100644 --- a/packages/sync_service/lib/data/sync_entity_mapper_listener.dart +++ b/packages/sync_service/lib/data/sync_entity_mapper_listener.dart @@ -13,6 +13,7 @@ abstract class SyncEntityMapperListener { FutureOr writeToEntityDB( Map response, List localRepositories, + bool isForceDownSync, ); /// Returns the sync count for the given list of `OpLog` objects. diff --git a/packages/sync_service/lib/data/sync_service.dart b/packages/sync_service/lib/data/sync_service.dart index 43ba120dfe..7bd96dbf26 100644 --- a/packages/sync_service/lib/data/sync_service.dart +++ b/packages/sync_service/lib/data/sync_service.dart @@ -98,10 +98,12 @@ class SyncService { FutureOr writeToEntityDB( Map response, List localRepositories, + bool isForceDownSync ) async { SyncServiceSingleton().entityMapper?.writeToEntityDB( response, localRepositories, + isForceDownSync ); }