Skip to content

TICKET::HCMPRE-2565 #694

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

Merged
merged 9 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 21 additions & 27 deletions apps/health_campaign_field_worker_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,10 @@ packages:
dependency: "direct main"
description:
name: complaints
sha256: "6c83c0f9bf9e099d958817b923ff9d1e7de777ffb6ae0cb960b816548e8fd80f"
sha256: cba8a9d32754fa28a0987d844b9b050aacb5c62a7345dfd41254f26b0bb4f0ea
url: "https://pub.dev"
source: hosted
version: "1.0.3-dev.1-enumeration"
version: "1.0.2+1"
connectivity_plus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -433,14 +433,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.8"
curl_logger_dio_interceptor:
dependency: "direct main"
description:
name: curl_logger_dio_interceptor
sha256: f20d89187a321d2150e1412bca30ebf4d89130bafc648ce21bd4f1ef4062b214
url: "https://pub.dev"
source: hosted
version: "1.0.0"
dart_mappable:
dependency: "direct main"
description:
Expand Down Expand Up @@ -517,10 +509,11 @@ packages:
digit_data_model:
dependency: "direct main"
description:
path: "../../packages/digit_data_model"
relative: true
source: path
version: "1.0.7-dev.3-enumeration"
name: digit_data_model
sha256: "8e67281c34e030b471a33d8889cb4e96d94d3d9fa6c6cf833e5d6d792ace1471"
url: "https://pub.dev"
source: hosted
version: "1.0.6+2"
digit_dss:
dependency: "direct main"
description:
Expand Down Expand Up @@ -565,10 +558,10 @@ packages:
dependency: "direct main"
description:
name: digit_ui_components
sha256: "764292c02746fa372ce93ea4d67f3941cdfa5197a552a33d586ce01aa44650f1"
sha256: f371af457d5be79c25d05b3e05c230c12be347c664c577619087f5575df8530f
url: "https://pub.dev"
source: hosted
version: "0.2.1+1"
version: "0.2.1"
dio:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1336,10 +1329,10 @@ packages:
dependency: "direct main"
description:
name: inventory_management
sha256: f645ecd84a450cefe1e9ce085c5f86fcb0c98b5fbec790070e880367b43e19f8
sha256: "68271fd2f99fae4b3f826403b16b6b3568bb74ba96dc92c45c1eff457fdbcd49"
url: "https://pub.dev"
source: hosted
version: "1.0.6-dev.1-enumeration"
version: "1.0.5+1"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -1808,17 +1801,17 @@ packages:
dependency: "direct main"
description:
name: referral_reconciliation
sha256: "35e3694cea71f9b47148fa3cb0c6e7e9b4460887318bea90bb6ba87788d3f852"
sha256: "5d3ea365246978776c0d247d9dbe35ebc04b7df1b85d7f38db20ec7e4021b977"
url: "https://pub.dev"
source: hosted
version: "1.0.5-dev.2-enumeration"
version: "1.0.4+2"
registration_delivery:
dependency: "direct main"
description:
path: "../../packages/registration_delivery"
relative: true
source: path
version: "1.0.7-dev.6-enumeration"
version: "1.0.6+2"
rxdart:
dependency: transitive
description:
Expand Down Expand Up @@ -2027,10 +2020,11 @@ packages:
survey_form:
dependency: "direct main"
description:
path: "../../packages/survey_form"
relative: true
source: path
version: "1.0.2-dev.4-enumeration"
name: survey_form
sha256: e81e71beff6c4982ff6944ad34da056ea5b4adba860d9552a5eb554356dd816d
url: "https://pub.dev"
source: hosted
version: "1.0.1+3"
sync_http:
dependency: transitive
description:
Expand All @@ -2043,10 +2037,10 @@ packages:
dependency: "direct main"
description:
name: sync_service
sha256: "992cd5889a192716c9e77fe29bd10b9f3dc771797d6a91a7a94bc34193b21444"
sha256: eb214ed7351f1f4ab63c90a23d2ad9f554ac92d73dbbe0dd7ce167776b941de9
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "1.0.0"
synchronized:
dependency: transitive
description:
Expand Down
2 changes: 2 additions & 0 deletions packages/digit_scanner/lib/utils/i18_key_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ class AcknowledgementSuccess {
class Scanner {
const Scanner();

String get scannedQtyExceed => 'SCANNED_QTY_EXCEED_THAN_REQUIRED';

String get changingCameraLens => 'CHANGING_CAMERA_LENS';

String get flashOn => 'FLASH_ON';
Expand Down
7 changes: 6 additions & 1 deletion packages/digit_scanner/lib/utils/scanner_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,13 @@ class DigitScannerUtils {
} else if (quantity > result.length) {
// Store the parsed result if the quantity is greater than result length
await storeValue(parsedResult);
} else {
} else if(quantity <= result.length) {
// Handle error if there is a mismatch in the scanned resource count
await handleError(
localizations.translate(i18.scanner.scannedQtyExceed));
}
else{
// Handle error if there is a mismatch in the scanned resource
await handleError(
localizations.translate(i18.scanner.invalidBarcode));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1096,8 +1096,12 @@ class StockDetailsPageState extends LocalizedState<StockDetailsPage> {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
const DigitScannerPage(
quantity: 5,
DigitScannerPage(
quantity: int.parse((form
.control(
_transactionQuantityKey)
.value)
.toString()),
isGS1code: true,
singleValue: false,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ enum AdditionalFieldsType {
houseStructureTypes,
@MappableValue("reasonOfRefusal")
reasonOfRefusal,
@MappableValue("height")
height,
@MappableValue("weight")
weight,
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class AdditionalFieldsTypeMapper extends EnumMapper<AdditionalFieldsType> {
return AdditionalFieldsType.houseStructureTypes;
case "reasonOfRefusal":
return AdditionalFieldsType.reasonOfRefusal;
case "height":
return AdditionalFieldsType.height;
case "weight":
return AdditionalFieldsType.weight;
default:
throw MapperException.unknownEnumValue(value);
}
Expand Down Expand Up @@ -121,6 +125,10 @@ class AdditionalFieldsTypeMapper extends EnumMapper<AdditionalFieldsType> {
return "houseStructureTypes";
case AdditionalFieldsType.reasonOfRefusal:
return "reasonOfRefusal";
case AdditionalFieldsType.height:
return "height";
case AdditionalFieldsType.weight:
return "weight";
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,67 +164,109 @@ class BeneficiaryDetailsPageState
c.id ==
deliverState.cycle);
if (selectedCycle != null) {
bloc.add(
DeliverInterventionEvent
.selectFutureCycleDose(
dose: deliverState.dose,
cycle:
RegistrationDeliverySingleton()
final currentCycle =
deliverState.cycle >= 0
? deliverState.cycle
: 0;

// Calculate the current dose. If deliverInterventionState.dose is negative, set it to 0.
final currentDose =
deliverState.dose >= 0
? deliverState.dose
: 0;

final items =
RegistrationDeliverySingleton()
.projectType!
.cycles!
.firstWhere((c) =>
c.id ==
deliverState
.cycle),
individualModel: state
.selectedIndividual,
),
);
showCustomPopup(
context: context,
builder: (popUpContext) => Popup(
title: localizations
.translate(i18
.beneficiaryDetails
.resourcesTobeDelivered),
type: PopUpType.simple,
contentPadding:
EdgeInsets.zero,
additionalWidgets: [
buildTableContent(
deliverState,
context,
variant,
.cycles?[
currentCycle - 1]
.deliveries?[
currentDose - 1];
final matchedDoses =
fetchProductVariant(
items,
state
.selectedIndividual,
state
.householdMemberWrapper
.household),
],
actions: [
DigitButton(
label: localizations
.translate(i18
.beneficiaryDetails
.ctaProceed),
onPressed: () {
Navigator.of(
context,
rootNavigator:
true,
).pop();
router.push(
DeliverInterventionRoute(),
);
},
type:
DigitButtonType
.primary,
size:
DigitButtonSize
.large),
]),
);
.household) ??
[];

if ((matchedDoses != null &&
matchedDoses
.isNotEmpty)) {
bloc.add(
DeliverInterventionEvent
.selectFutureCycleDose(
dose: deliverState.dose,
cycle:
RegistrationDeliverySingleton()
.projectType!
.cycles!
.firstWhere((c) =>
c.id ==
deliverState
.cycle),
individualModel: state
.selectedIndividual,
),
);
showCustomPopup(
context: context,
builder: (popUpContext) => Popup(
title: localizations
.translate(i18
.beneficiaryDetails
.resourcesTobeDelivered),
type:
PopUpType.simple,
contentPadding:
EdgeInsets.zero,
additionalWidgets: [
buildTableContent(
deliverState,
context,
variant,
state
.selectedIndividual,
state
.householdMemberWrapper
.household),
],
actions: [
DigitButton(
label: localizations
.translate(i18
.beneficiaryDetails
.ctaProceed),
onPressed: () {
Navigator.of(
context,
rootNavigator:
true,
).pop();
router.push(
DeliverInterventionRoute(),
);
},
type:
DigitButtonType
.primary,
size:
DigitButtonSize
.large),
]),
);
} else {
Toast.showToast(
context,
type: ToastType.error,
message: localizations
.translate(i18
.beneficiaryDetails
.notMeetDeliveryRulesCriteria),
);
}
}
},
),
Expand Down
Loading