Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smc facility stock model , bloc changes #601

Open
wants to merge 43 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b9b65bb
Removed privacy policy from main app to digit component (#569)
rachana-egov Sep 10, 2024
6317df4
wayBillNumber key change from waybillNumber (#571)
naveenr-egov Sep 17, 2024
cb7b72f
sorting tasks based on createdTime
naveenr-egov Sep 24, 2024
5fb6235
sorting tasks based on lastModifiedTime
naveenr-egov Sep 25, 2024
eae106b
Added Multi-checklist validation
naveenr-egov Sep 27, 2024
87bfae9
Updated beneficiary_type variable in target entity and table to string
naveenr-egov Oct 7, 2024
ec51d18
unique beneficiary id changes pull back.
naveenr-egov Oct 9, 2024
6e59ff0
Added additionalDetails field to service definition attributes model
Ramkrishna-egov Oct 15, 2024
b4e824a
updated attributs
yash-egov Oct 15, 2024
5099785
updated digit_data_model
yash-egov Oct 14, 2024
6ad0e22
Updated change log for digit_data_model package - uniqueId pre release
Ramkrishna-egov Oct 16, 2024
160047f
linked unique beneficiary id to identifier at registration delivery
naveenr-egov Oct 16, 2024
2a1a1c0
individual name search fix
naveenr-egov Oct 23, 2024
84a2e9f
null check handled
yashita-egov Oct 23, 2024
06a28d8
Modified household search model
naveenr-egov Oct 23, 2024
5cf19b2
Updated query to handle BeneficiaryReferred status search
naveenr-egov Oct 28, 2024
0d0cbfc
Changed additionalDetails of ServiceModel to Map<String, dynamic>
naveenr-egov Nov 5, 2024
ce07a75
published registration_delivery package
naveenr-egov Nov 5, 2024
5366160
updated stock and facility model
yash-egov Nov 6, 2024
88d842c
updated stock and facility model
yash-egov Nov 6, 2024
5156e79
updated stock and facility model
yash-egov Nov 6, 2024
850c7c8
stock model updated
yash-egov Nov 11, 2024
d354b58
update blocs for dateOfEntry
yash-egov Nov 11, 2024
5c63410
updates for facilityName
yash-egov Nov 11, 2024
e392d73
updates for facilityName
yash-egov Nov 11, 2024
c16848f
removed page changes
yash-egov Nov 11, 2024
d314963
removed page changes
yash-egov Nov 11, 2024
5ed02fa
updated local paths
yash-egov Nov 11, 2024
65ab620
added event for setting dateOfReconciliation
yash-egov Nov 12, 2024
1e0ace9
updated stock and facility model
yash-egov Nov 6, 2024
daf574f
updated stock and facility model
yash-egov Nov 6, 2024
1dbe6b1
updated stock and facility model
yash-egov Nov 6, 2024
6f5a2fd
merge conflicts
yash-egov Nov 11, 2024
0afec4e
update blocs for dateOfEntry
yash-egov Nov 11, 2024
123d792
merge conflicts
yash-egov Nov 11, 2024
3fbf48f
updates for facilityName
yash-egov Nov 11, 2024
2254d92
merge conflicts
yash-egov Nov 11, 2024
e8dc5af
removed page changes
yash-egov Nov 11, 2024
97260c7
merge conflicts
yash-egov Nov 11, 2024
92bad7b
added event for setting dateOfReconciliation
yash-egov Nov 12, 2024
b5d2aec
updated packages to dev version for stock and facility changes
naveenr-egov Nov 19, 2024
0b4f119
updated lock and yaml file for the version changes
naveenr-egov Nov 19, 2024
d3d16ad
added name field in search
yash-egov Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/health_campaign_field_worker_app/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ class MainApplicationState extends State<MainApplication>
projectFacilityDataRepository: context.repository<
ProjectFacilityModel,
ProjectFacilitySearchModel>(),
facilityDataRepository: context.repository<
FacilityModel, FacilitySearchModel>(),
),
),
BlocProvider(
Expand Down
34 changes: 16 additions & 18 deletions apps/health_campaign_field_worker_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ packages:
dependency: "direct main"
description:
name: attendance_management
sha256: f1b4373e8d0d9f8227ede0d25d4141f0d16d18ac2525c0347b844098cdab080f
sha256: "8a09814ca11cca736d771be70fb6174303ea0cb3525aa72e7239cbc14b915303"
url: "https://pub.dev"
source: hosted
version: "1.0.2+1"
version: "1.0.2+4"
audioplayers:
dependency: "direct main"
description:
Expand Down Expand Up @@ -501,10 +501,9 @@ packages:
digit_data_model:
dependency: "direct main"
description:
name: digit_data_model
sha256: "0e5a1f8c5f0548e573af9c0279942f2dbc332042865614e0b89fe5952002ef1f"
url: "https://pub.dev"
source: hosted
path: "../../packages/digit_data_model"
relative: true
source: path
version: "1.0.4"
digit_dss:
dependency: "direct main"
Expand All @@ -517,9 +516,10 @@ packages:
digit_firebase_services:
dependency: "direct main"
description:
path: "../../packages/digit_firebase_services"
relative: true
source: path
name: digit_firebase_services
sha256: ce76521d797e123b6fc95c9dfad7d4a918a93b97f57aecd0e1d517b46190909d
url: "https://pub.dev"
source: hosted
version: "0.0.1"
digit_location_tracker:
dependency: "direct main"
Expand Down Expand Up @@ -1127,11 +1127,10 @@ packages:
inventory_management:
dependency: "direct main"
description:
name: inventory_management
sha256: "1d0dd4f7811941092653426a86548a31d475237d318eee71505b21a57ebc310b"
url: "https://pub.dev"
source: hosted
version: "1.0.3+4"
path: "../../packages/inventory_management"
relative: true
source: path
version: "1.0.3+5"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -1591,10 +1590,9 @@ packages:
referral_reconciliation:
dependency: "direct main"
description:
name: referral_reconciliation
sha256: "8aa550fe43e59b9d61ca958a50d9bb90860081807314e376b93f34c879e96569"
url: "https://pub.dev"
source: hosted
path: "../../packages/referral_reconciliation"
relative: true
source: path
version: "1.0.2+2"
registration_delivery:
dependency: "direct main"
Expand Down
6 changes: 3 additions & 3 deletions apps/health_campaign_field_worker_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ dependencies:
camera: ^0.10.5+7
attendance_management: ^1.0.2+4
digit_scanner: ^1.0.3+1
inventory_management: ^1.0.3+4
referral_reconciliation: ^1.0.2+2
digit_data_model: ^1.0.4
inventory_management:
referral_reconciliation:
digit_data_model:
registration_delivery: ^1.0.3+2
disable_battery_optimization: ^1.1.1
digit_dss: ^1.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'dart:async';
import 'package:digit_data_model/models/entities/project_facility.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import '../../models/entities/facility.dart';

import '../../utils/typedefs.dart';

Expand All @@ -19,12 +20,14 @@ class ProjectFacilityBloc
extends Bloc<ProjectFacilityEvent, ProjectFacilityState> {
// The data repository used by this bloc.
final ProjectFacilityDataRepository projectFacilityDataRepository;
final FacilityDataRepository facilityDataRepository;

/// The constructor for `ProjectFacilityBloc`.
/// It initializes the bloc with an empty state and sets up the event handler for loading project facilities.
ProjectFacilityBloc(
super.initialState, {
required this.projectFacilityDataRepository,
required this.facilityDataRepository,
}) {
on(_handleLoad);
}
Expand All @@ -40,10 +43,21 @@ class ProjectFacilityBloc
event.query,
);

final facilities = await facilityDataRepository.search(FacilitySearchModel(
id: results.map((e) => e.facilityId).toList(),
));
Map<String, String> facilityMap = {};
for (var element in facilities) {
facilityMap[element.id] = element.name ?? element.id;
}

if (results.isEmpty) {
emit(const ProjectFacilityEmptyState());
} else {
emit(ProjectFacilityFetchedState(projectFacilities: results));
emit(ProjectFacilityFetchedState(
projectFacilities: results,
facilityMap: facilityMap,
));
}
}
}
Expand All @@ -69,5 +83,6 @@ class ProjectFacilityState with _$ProjectFacilityState {
/// The `ProjectFacilityFetchedState` state represents the state where project facilities have been loaded.
const factory ProjectFacilityState.fetched({
required List<ProjectFacilityModel> projectFacilities,
required Map<String, String> facilityMap,
}) = ProjectFacilityFetchedState;
}
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,27 @@ mixin _$ProjectFacilityState {
TResult when<TResult extends Object?>({
required TResult Function() empty,
required TResult Function() loading,
required TResult Function(List<ProjectFacilityModel> projectFacilities)
required TResult Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)
fetched,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult? Function()? empty,
TResult? Function()? loading,
TResult? Function(List<ProjectFacilityModel> projectFacilities)? fetched,
TResult? Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)?
fetched,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? empty,
TResult Function()? loading,
TResult Function(List<ProjectFacilityModel> projectFacilities)? fetched,
TResult Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)?
fetched,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
Expand Down Expand Up @@ -338,7 +343,8 @@ class _$ProjectFacilityEmptyStateImpl implements ProjectFacilityEmptyState {
TResult when<TResult extends Object?>({
required TResult Function() empty,
required TResult Function() loading,
required TResult Function(List<ProjectFacilityModel> projectFacilities)
required TResult Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)
fetched,
}) {
return empty();
Expand All @@ -349,7 +355,9 @@ class _$ProjectFacilityEmptyStateImpl implements ProjectFacilityEmptyState {
TResult? whenOrNull<TResult extends Object?>({
TResult? Function()? empty,
TResult? Function()? loading,
TResult? Function(List<ProjectFacilityModel> projectFacilities)? fetched,
TResult? Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)?
fetched,
}) {
return empty?.call();
}
Expand All @@ -359,7 +367,9 @@ class _$ProjectFacilityEmptyStateImpl implements ProjectFacilityEmptyState {
TResult maybeWhen<TResult extends Object?>({
TResult Function()? empty,
TResult Function()? loading,
TResult Function(List<ProjectFacilityModel> projectFacilities)? fetched,
TResult Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)?
fetched,
required TResult orElse(),
}) {
if (empty != null) {
Expand Down Expand Up @@ -451,7 +461,8 @@ class _$ProjectFacilityLoadingStateImpl implements ProjectFacilityLoadingState {
TResult when<TResult extends Object?>({
required TResult Function() empty,
required TResult Function() loading,
required TResult Function(List<ProjectFacilityModel> projectFacilities)
required TResult Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)
fetched,
}) {
return loading();
Expand All @@ -462,7 +473,9 @@ class _$ProjectFacilityLoadingStateImpl implements ProjectFacilityLoadingState {
TResult? whenOrNull<TResult extends Object?>({
TResult? Function()? empty,
TResult? Function()? loading,
TResult? Function(List<ProjectFacilityModel> projectFacilities)? fetched,
TResult? Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)?
fetched,
}) {
return loading?.call();
}
Expand All @@ -472,7 +485,9 @@ class _$ProjectFacilityLoadingStateImpl implements ProjectFacilityLoadingState {
TResult maybeWhen<TResult extends Object?>({
TResult Function()? empty,
TResult Function()? loading,
TResult Function(List<ProjectFacilityModel> projectFacilities)? fetched,
TResult Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)?
fetched,
required TResult orElse(),
}) {
if (loading != null) {
Expand Down Expand Up @@ -528,7 +543,9 @@ abstract class _$$ProjectFacilityFetchedStateImplCopyWith<$Res> {
$Res Function(_$ProjectFacilityFetchedStateImpl) then) =
__$$ProjectFacilityFetchedStateImplCopyWithImpl<$Res>;
@useResult
$Res call({List<ProjectFacilityModel> projectFacilities});
$Res call(
{List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap});
}

/// @nodoc
Expand All @@ -545,12 +562,17 @@ class __$$ProjectFacilityFetchedStateImplCopyWithImpl<$Res>
@override
$Res call({
Object? projectFacilities = null,
Object? facilityMap = null,
}) {
return _then(_$ProjectFacilityFetchedStateImpl(
projectFacilities: null == projectFacilities
? _value._projectFacilities
: projectFacilities // ignore: cast_nullable_to_non_nullable
as List<ProjectFacilityModel>,
facilityMap: null == facilityMap
? _value._facilityMap
: facilityMap // ignore: cast_nullable_to_non_nullable
as Map<String, String>,
));
}
}
Expand All @@ -559,8 +581,10 @@ class __$$ProjectFacilityFetchedStateImplCopyWithImpl<$Res>

class _$ProjectFacilityFetchedStateImpl implements ProjectFacilityFetchedState {
const _$ProjectFacilityFetchedStateImpl(
{required final List<ProjectFacilityModel> projectFacilities})
: _projectFacilities = projectFacilities;
{required final List<ProjectFacilityModel> projectFacilities,
required final Map<String, String> facilityMap})
: _projectFacilities = projectFacilities,
_facilityMap = facilityMap;

final List<ProjectFacilityModel> _projectFacilities;
@override
Expand All @@ -571,9 +595,17 @@ class _$ProjectFacilityFetchedStateImpl implements ProjectFacilityFetchedState {
return EqualUnmodifiableListView(_projectFacilities);
}

final Map<String, String> _facilityMap;
@override
Map<String, String> get facilityMap {
if (_facilityMap is EqualUnmodifiableMapView) return _facilityMap;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(_facilityMap);
}

@override
String toString() {
return 'ProjectFacilityState.fetched(projectFacilities: $projectFacilities)';
return 'ProjectFacilityState.fetched(projectFacilities: $projectFacilities, facilityMap: $facilityMap)';
}

@override
Expand All @@ -582,12 +614,16 @@ class _$ProjectFacilityFetchedStateImpl implements ProjectFacilityFetchedState {
(other.runtimeType == runtimeType &&
other is _$ProjectFacilityFetchedStateImpl &&
const DeepCollectionEquality()
.equals(other._projectFacilities, _projectFacilities));
.equals(other._projectFacilities, _projectFacilities) &&
const DeepCollectionEquality()
.equals(other._facilityMap, _facilityMap));
}

@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_projectFacilities));
runtimeType,
const DeepCollectionEquality().hash(_projectFacilities),
const DeepCollectionEquality().hash(_facilityMap));

@JsonKey(ignore: true)
@override
Expand All @@ -601,32 +637,37 @@ class _$ProjectFacilityFetchedStateImpl implements ProjectFacilityFetchedState {
TResult when<TResult extends Object?>({
required TResult Function() empty,
required TResult Function() loading,
required TResult Function(List<ProjectFacilityModel> projectFacilities)
required TResult Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)
fetched,
}) {
return fetched(projectFacilities);
return fetched(projectFacilities, facilityMap);
}

@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult? Function()? empty,
TResult? Function()? loading,
TResult? Function(List<ProjectFacilityModel> projectFacilities)? fetched,
TResult? Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)?
fetched,
}) {
return fetched?.call(projectFacilities);
return fetched?.call(projectFacilities, facilityMap);
}

@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? empty,
TResult Function()? loading,
TResult Function(List<ProjectFacilityModel> projectFacilities)? fetched,
TResult Function(List<ProjectFacilityModel> projectFacilities,
Map<String, String> facilityMap)?
fetched,
required TResult orElse(),
}) {
if (fetched != null) {
return fetched(projectFacilities);
return fetched(projectFacilities, facilityMap);
}
return orElse();
}
Expand Down Expand Up @@ -668,10 +709,12 @@ class _$ProjectFacilityFetchedStateImpl implements ProjectFacilityFetchedState {

abstract class ProjectFacilityFetchedState implements ProjectFacilityState {
const factory ProjectFacilityFetchedState(
{required final List<ProjectFacilityModel> projectFacilities}) =
{required final List<ProjectFacilityModel> projectFacilities,
required final Map<String, String> facilityMap}) =
_$ProjectFacilityFetchedStateImpl;

List<ProjectFacilityModel> get projectFacilities;
Map<String, String> get facilityMap;
@JsonKey(ignore: true)
_$$ProjectFacilityFetchedStateImplCopyWith<_$ProjectFacilityFetchedStateImpl>
get copyWith => throw _privateConstructorUsedError;
Expand Down
Loading