Skip to content

Commit

Permalink
wayBillNumber key change from waybillNumber (#571)
Browse files Browse the repository at this point in the history
* wayBillNumber key change from waybillNumber

return transaction type logic change in stock_details and report_details bloc

* validation for wayBillNumber

* Delivery action label and administered_success status update based on the project

* Revert "Delivery action label and administered_success status update based on the project"

This reverts commit 8673a48.

* published digit_components - privacy notice component
  • Loading branch information
naveenr-egov authored Sep 17, 2024
1 parent b9b65bb commit 6317df4
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 53 deletions.
15 changes: 8 additions & 7 deletions apps/health_campaign_field_worker_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ packages:
description:
path: "packages/dart_mappable_builder"
ref: master
resolved-ref: "9b887d24c05459c027a92391869d4c10b440e00f"
resolved-ref: e3d8ac43f70568b4a17c200cae5cde285050ef23
url: "https://github.com/egovernments/health-campaign-field-worker-app/"
source: git
version: "4.2.0"
Expand Down Expand Up @@ -493,10 +493,11 @@ packages:
digit_components:
dependency: "direct main"
description:
path: "../../packages/digit_components"
relative: true
source: path
version: "1.0.1+1"
name: digit_components
sha256: dcdab9542149022cb66241c3c379ca96916f8b6116e585f4799748d859a2ca49
url: "https://pub.dev"
source: hosted
version: "1.0.2"
digit_data_model:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1119,10 +1120,10 @@ packages:
dependency: "direct main"
description:
name: inventory_management
sha256: "1a5976ab807666629704f559730d5418e1c723fed898df2cc6e7d9807f813b6f"
sha256: "1d0dd4f7811941092653426a86548a31d475237d318eee71505b21a57ebc310b"
url: "https://pub.dev"
source: hosted
version: "1.0.3+2"
version: "1.0.3+4"
io:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions apps/health_campaign_field_worker_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
sqlite3_flutter_libs: ^0.5.10
path_provider: ^2.0.11
path: ^1.8.2
digit_components: ^1.0.1+1
digit_components: ^1.0.2
auto_route: ^7.8.4
flutter_bloc: ^8.1.1
collection: ^1.16.0
Expand Down Expand Up @@ -67,7 +67,7 @@ dependencies:
camera: ^0.10.5+7
attendance_management: ^1.0.2+1
digit_scanner: ^1.0.3+1
inventory_management: ^1.0.3+2
inventory_management: ^1.0.3+4
referral_reconciliation: ^1.0.2+1
digit_data_model: ^1.0.3+1
registration_delivery: ^1.0.3+1
Expand Down
3 changes: 3 additions & 0 deletions packages/digit_components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.0.2
* Added privacy notice component

## 1.0.1+1
* Changed similar dialogs to a common hideDialog

Expand Down
2 changes: 1 addition & 1 deletion packages/digit_components/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.1+1"
version: "1.0.2"
easy_stepper:
dependency: transitive
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:digit_components/widgets/digit_card.dart';
import 'package:digit_components/widgets/digit_elevated_button.dart';
import 'package:digit_components/widgets/digit_outline_button.dart';
import 'package:flutter/material.dart';
import '../../models/privacy_policy_model.dart';
import '../../theme/digit_theme.dart';
import '../localized.dart';
import 'privacy_notice_expand_component.dart';
Expand All @@ -25,10 +24,10 @@ class FullPageDialog extends LocalizedStatefulWidget {
});

@override
_FullPageDialogState createState() => _FullPageDialogState();
FullPageDialogState createState() => FullPageDialogState();
}

class _FullPageDialogState extends LocalizedState<FullPageDialog> {
class FullPageDialogState extends LocalizedState<FullPageDialog> {
@override
Widget build(BuildContext context) {
return Dialog.fullscreen(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:digit_components/theme/colors.dart';
import 'package:flutter/material.dart';
import '../../models/privacy_notice/privacy_notice_model.dart';
import '../../models/privacy_policy_model.dart';
import '../../theme/digit_theme.dart';
import '../localized.dart';

Expand All @@ -15,10 +14,10 @@ class ExpandableSection extends LocalizedStatefulWidget {
});

@override
_ExpandableSectionState createState() => _ExpandableSectionState();
ExpandableSectionState createState() => ExpandableSectionState();
}

class _ExpandableSectionState extends LocalizedState<ExpandableSection> {
class ExpandableSectionState extends LocalizedState<ExpandableSection> {
bool _isExpanded = false;

@override
Expand Down Expand Up @@ -103,10 +102,10 @@ class DescriptionWidget extends LocalizedStatefulWidget {
});

@override
_DescriptionWidgetState createState() => _DescriptionWidgetState();
DescriptionWidgetState createState() => DescriptionWidgetState();
}

class _DescriptionWidgetState extends LocalizedState<DescriptionWidget> {
class DescriptionWidgetState extends LocalizedState<DescriptionWidget> {
@override
Widget build(BuildContext context) {
final descriptionText = widget.description.text ?? '';
Expand Down Expand Up @@ -213,10 +212,10 @@ class SubDescriptionWidget extends LocalizedStatefulWidget {
});

@override
_SubDescriptionWidgetState createState() => _SubDescriptionWidgetState();
SubDescriptionWidgetState createState() => SubDescriptionWidgetState();
}

class _SubDescriptionWidgetState extends LocalizedState<SubDescriptionWidget> {
class SubDescriptionWidgetState extends LocalizedState<SubDescriptionWidget> {
@override
Widget build(BuildContext context) {
final subDescriptionText = widget.subDescription.text ?? '';
Expand Down
2 changes: 1 addition & 1 deletion packages/digit_components/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: digit_components
description: Digit UI Design specification Flutter widgets. Import this package by adding digit_components <latest> in respective pubspec.yaml dependencies.
version: 1.0.1+1
version: 1.0.2
homepage: https://github.com/egovernments/health-campaign-field-worker-app/tree/master/packages/digit_components
repository: https://github.com/egovernments/health-campaign-field-worker-app

Expand Down
11 changes: 10 additions & 1 deletion packages/inventory_management/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
## 1.0.3+1
## 1.0.3+4

* Updated wayBillNumber validation

## 1.0.3+3

* Updated key name of waybillNumber to wayBillNumber
* Return transaction type logic change in stock_details and report_details bloc

## 1.0.3+2

* Updated digit_scanner package, digit_components, digit_data_model

Expand Down
4 changes: 2 additions & 2 deletions packages/inventory_management/lib/blocs/inventory_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class InventoryReportBloc
} else if (reportType == InventoryReportType.returned) {
transactionType = [TransactionType.received.toValue()];
transactionReason = [TransactionReason.returned.toValue()];
receiverId = null;
senderId = facilityId;
receiverId = facilityId;
senderId = null;
} else if (reportType == InventoryReportType.damage) {
transactionType = [TransactionType.dispatched.toValue()];
transactionReason = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class StockLocalRepository
transactingPartyId: data.transactingPartyId,
transactingPartyType: data.transactingPartyType,
quantity: data.quantity,
waybillNumber: data.waybillNumber,
wayBillNumber: data.waybillNumber,
clientReferenceId: data.clientReferenceId,
isDeleted: data.isDeleted,
rowVersion: data.rowVersion,
Expand Down
6 changes: 3 additions & 3 deletions packages/inventory_management/lib/models/entities/stock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class StockModel extends EntityModel with StockModelMappable {
final String? transactingPartyId;
final String? transactingPartyType;
final String? quantity;
final String? waybillNumber;
final String? wayBillNumber;
final String? receiverId;
final String? receiverType;
final String? senderId;
Expand All @@ -100,7 +100,7 @@ class StockModel extends EntityModel with StockModelMappable {
this.transactingPartyId,
this.transactingPartyType,
this.quantity,
this.waybillNumber,
this.wayBillNumber,
this.receiverId,
this.receiverType,
this.senderId,
Expand Down Expand Up @@ -136,7 +136,7 @@ class StockModel extends EntityModel with StockModelMappable {
transactingPartyId: Value(transactingPartyId),
transactingPartyType: Value(transactingPartyType),
quantity: Value(quantity),
waybillNumber: Value(waybillNumber),
waybillNumber: Value(wayBillNumber),
receiverId: Value(receiverId),
receiverType: Value(receiverType),
senderId: Value(senderId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ class StockModelMapper extends SubClassMapperBase<StockModel> {
static String? _$quantity(StockModel v) => v.quantity;
static const Field<StockModel, String> _f$quantity =
Field('quantity', _$quantity, opt: true);
static String? _$waybillNumber(StockModel v) => v.waybillNumber;
static const Field<StockModel, String> _f$waybillNumber =
Field('waybillNumber', _$waybillNumber, opt: true);
static String? _$wayBillNumber(StockModel v) => v.wayBillNumber;
static const Field<StockModel, String> _f$wayBillNumber =
Field('wayBillNumber', _$wayBillNumber, opt: true);
static String? _$receiverId(StockModel v) => v.receiverId;
static const Field<StockModel, String> _f$receiverId =
Field('receiverId', _$receiverId, opt: true);
Expand Down Expand Up @@ -415,7 +415,7 @@ class StockModelMapper extends SubClassMapperBase<StockModel> {
#transactingPartyId: _f$transactingPartyId,
#transactingPartyType: _f$transactingPartyType,
#quantity: _f$quantity,
#waybillNumber: _f$waybillNumber,
#wayBillNumber: _f$wayBillNumber,
#receiverId: _f$receiverId,
#receiverType: _f$receiverType,
#senderId: _f$senderId,
Expand Down Expand Up @@ -452,7 +452,7 @@ class StockModelMapper extends SubClassMapperBase<StockModel> {
transactingPartyId: data.dec(_f$transactingPartyId),
transactingPartyType: data.dec(_f$transactingPartyType),
quantity: data.dec(_f$quantity),
waybillNumber: data.dec(_f$waybillNumber),
wayBillNumber: data.dec(_f$wayBillNumber),
receiverId: data.dec(_f$receiverId),
receiverType: data.dec(_f$receiverType),
senderId: data.dec(_f$senderId),
Expand Down Expand Up @@ -539,7 +539,7 @@ abstract class StockModelCopyWith<$R, $In extends StockModel, $Out>
String? transactingPartyId,
String? transactingPartyType,
String? quantity,
String? waybillNumber,
String? wayBillNumber,
String? receiverId,
String? receiverType,
String? senderId,
Expand Down Expand Up @@ -587,7 +587,7 @@ class _StockModelCopyWithImpl<$R, $Out>
Object? transactingPartyId = $none,
Object? transactingPartyType = $none,
Object? quantity = $none,
Object? waybillNumber = $none,
Object? wayBillNumber = $none,
Object? receiverId = $none,
Object? receiverType = $none,
Object? senderId = $none,
Expand All @@ -613,7 +613,7 @@ class _StockModelCopyWithImpl<$R, $Out>
if (transactingPartyType != $none)
#transactingPartyType: transactingPartyType,
if (quantity != $none) #quantity: quantity,
if (waybillNumber != $none) #waybillNumber: waybillNumber,
if (wayBillNumber != $none) #wayBillNumber: wayBillNumber,
if (receiverId != $none) #receiverId: receiverId,
if (receiverType != $none) #receiverType: receiverType,
if (senderId != $none) #senderId: senderId,
Expand Down Expand Up @@ -645,7 +645,7 @@ class _StockModelCopyWithImpl<$R, $Out>
transactingPartyType:
data.get(#transactingPartyType, or: $value.transactingPartyType),
quantity: data.get(#quantity, or: $value.quantity),
waybillNumber: data.get(#waybillNumber, or: $value.waybillNumber),
wayBillNumber: data.get(#wayBillNumber, or: $value.wayBillNumber),
receiverId: data.get(#receiverId, or: $value.receiverId),
receiverType: data.get(#receiverType, or: $value.receiverType),
senderId: data.get(#senderId, or: $value.senderId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ class StockDetailsPageState extends LocalizedState<StockDetailsPage> {
Validators.max(10000),
]),
_transactionReasonKey: FormControl<String>(),
_waybillNumberKey: FormControl<String>(),
_waybillNumberKey: FormControl<String>(
validators: [Validators.minLength(2), Validators.maxLength(200)],
),
_waybillQuantityKey: FormControl<String>(),
_vehicleNumberKey: FormControl<String>(),
_typeOfTransportKey: FormControl<String>(),
Expand Down Expand Up @@ -385,6 +387,7 @@ class StockDetailsPageState extends LocalizedState<StockDetailsPage> {
case StockRecordEntryType.receipt:
case StockRecordEntryType.loss:
case StockRecordEntryType.damaged:
case StockRecordEntryType.returned:
if (deliveryTeamSelected) {
senderId = deliveryTeamName;
senderType = "STAFF";
Expand All @@ -397,7 +400,6 @@ class StockDetailsPageState extends LocalizedState<StockDetailsPage> {

break;
case StockRecordEntryType.dispatch:
case StockRecordEntryType.returned:
if (deliveryTeamSelected) {
receiverId = deliveryTeamName;
receiverType = "STAFF";
Expand All @@ -420,7 +422,7 @@ class StockDetailsPageState extends LocalizedState<StockDetailsPage> {
referenceId: stockState.projectId,
referenceIdType: 'PROJECT',
quantity: quantity.toString(),
waybillNumber: waybillNumber,
wayBillNumber: waybillNumber,
receiverId: receiverId,
receiverType: receiverType,
senderId: senderId,
Expand Down Expand Up @@ -834,16 +836,25 @@ class StockDetailsPageState extends LocalizedState<StockDetailsPage> {
),
if (isWareHouseMgr)
DigitTextFormField(
key: const Key(_waybillNumberKey),
label: localizations.translate(
i18.stockDetails.waybillNumberLabel,
),
formControlName: _waybillNumberKey,
keyboardType:
const TextInputType.numberWithOptions(
decimal: true,
),
),
key: const Key(_waybillNumberKey),
label: localizations.translate(
i18.stockDetails.waybillNumberLabel,
),
formControlName: _waybillNumberKey,
keyboardType:
const TextInputType.numberWithOptions(
decimal: true,
),
validationMessages: {
'maxLength': (object) => localizations
.translate(
i18.common.maxCharsRequired)
.replaceAll('{}', '200'),
'minLength': (object) => localizations
.translate(
i18.common.min2CharsRequired)
.replaceAll('{}', ''),
}),
if (isWareHouseMgr)
DigitTextFormField(
label: localizations.translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,9 @@ class InventoryReportDetailsPageState
DigitGridCell(
key: waybillKey,
value: model
.waybillNumber ??
.wayBillNumber ??
model
.waybillNumber ??
.wayBillNumber ??
'',
),
DigitGridCell(
Expand Down
2 changes: 1 addition & 1 deletion packages/inventory_management/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: inventory_management
description: This package offers inventory management features, allowing users to view stock reports and perform inventory resource reconciliation.
version: 1.0.3+2
version: 1.0.3+4
homepage: https://github.com/egovernments/health-campaign-field-worker-app/tree/master/packages/inventory_management
repository: https://github.com/egovernments/health-campaign-field-worker-app

Expand Down

0 comments on commit 6317df4

Please sign in to comment.