Skip to content

Commit

Permalink
Merge pull request #748 from odisha-muktasoft/uat_new_component
Browse files Browse the repository at this point in the history
Api playload changed for update muster roll after the new LTS migrati…
  • Loading branch information
Tulika-eGov authored Oct 23, 2024
2 parents 7b08c8d + 8333144 commit d36f67e
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class MusterCreateBloc extends Bloc<MusterCreateEvent, MusterCreateState> {
}),
body: {
"musterRoll": {
"startDate":event.startDate,
"registerId":event.registerId,
"tenantId": event.tenantId,
"id": event.id,
"additionalDetails": {"computeAttendance": "true"},
Expand Down Expand Up @@ -133,6 +135,8 @@ class MusterCreateEvent with _$MusterCreateEvent {
required String contractId,
required String registerNo,
required String registerName,
required int startDate,
required String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList}) = UpdateMusterEvent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ final _privateConstructorUsedError = UnsupportedError(
/// @nodoc
mixin _$MusterCreateEvent {
String get tenantId => throw _privateConstructorUsedError;
String get registerId => throw _privateConstructorUsedError;
String get contractId => throw _privateConstructorUsedError;
String get orgName => throw _privateConstructorUsedError;
String get registerNo => throw _privateConstructorUsedError;
String get registerName => throw _privateConstructorUsedError;
int get startDate => throw _privateConstructorUsedError;
List<Map<String, dynamic>>? get skillsList =>
throw _privateConstructorUsedError;
@optionalTypeArgs
Expand Down Expand Up @@ -52,6 +54,8 @@ mixin _$MusterCreateEvent {
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList)
update,
Expand Down Expand Up @@ -86,6 +90,8 @@ mixin _$MusterCreateEvent {
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList)?
update,
Expand Down Expand Up @@ -120,6 +126,8 @@ mixin _$MusterCreateEvent {
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList)?
update,
Expand Down Expand Up @@ -159,10 +167,12 @@ abstract class $MusterCreateEventCopyWith<$Res> {
@useResult
$Res call(
{String tenantId,
String registerId,
String contractId,
String orgName,
String registerNo,
String registerName,
int startDate,
List<Map<String, dynamic>>? skillsList});
}

Expand All @@ -180,17 +190,23 @@ class _$MusterCreateEventCopyWithImpl<$Res, $Val extends MusterCreateEvent>
@override
$Res call({
Object? tenantId = null,
Object? registerId = null,
Object? contractId = null,
Object? orgName = null,
Object? registerNo = null,
Object? registerName = null,
Object? startDate = null,
Object? skillsList = freezed,
}) {
return _then(_value.copyWith(
tenantId: null == tenantId
? _value.tenantId
: tenantId // ignore: cast_nullable_to_non_nullable
as String,
registerId: null == registerId
? _value.registerId
: registerId // ignore: cast_nullable_to_non_nullable
as String,
contractId: null == contractId
? _value.contractId
: contractId // ignore: cast_nullable_to_non_nullable
Expand All @@ -207,6 +223,10 @@ class _$MusterCreateEventCopyWithImpl<$Res, $Val extends MusterCreateEvent>
? _value.registerName
: registerName // ignore: cast_nullable_to_non_nullable
as String,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as int,
skillsList: freezed == skillsList
? _value.skillsList
: skillsList // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -523,6 +543,8 @@ class _$CreateMusterEventImpl implements CreateMusterEvent {
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList)
update,
Expand Down Expand Up @@ -578,6 +600,8 @@ class _$CreateMusterEventImpl implements CreateMusterEvent {
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList)?
update,
Expand Down Expand Up @@ -633,6 +657,8 @@ class _$CreateMusterEventImpl implements CreateMusterEvent {
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList)?
update,
Expand Down Expand Up @@ -717,6 +743,7 @@ abstract class CreateMusterEvent implements MusterCreateEvent {

@override
String get tenantId;
@override
String get registerId;
@override
String get contractId;
Expand All @@ -726,6 +753,7 @@ abstract class CreateMusterEvent implements MusterCreateEvent {
String get registerNo;
@override
String get registerName;
@override
int get startDate;
String? get serviceCode;
String? get referenceId;
Expand Down Expand Up @@ -760,6 +788,8 @@ abstract class _$$UpdateMusterEventImplCopyWith<$Res>
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList});
}
Expand All @@ -781,6 +811,8 @@ class __$$UpdateMusterEventImplCopyWithImpl<$Res>
Object? contractId = null,
Object? registerNo = null,
Object? registerName = null,
Object? startDate = null,
Object? registerId = null,
Object? reSubmitAction = freezed,
Object? skillsList = freezed,
}) {
Expand Down Expand Up @@ -809,6 +841,14 @@ class __$$UpdateMusterEventImplCopyWithImpl<$Res>
? _value.registerName
: registerName // ignore: cast_nullable_to_non_nullable
as String,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as int,
registerId: null == registerId
? _value.registerId
: registerId // ignore: cast_nullable_to_non_nullable
as String,
reSubmitAction: freezed == reSubmitAction
? _value.reSubmitAction
: reSubmitAction // ignore: cast_nullable_to_non_nullable
Expand All @@ -831,6 +871,8 @@ class _$UpdateMusterEventImpl implements UpdateMusterEvent {
required this.contractId,
required this.registerNo,
required this.registerName,
required this.startDate,
required this.registerId,
this.reSubmitAction,
final List<Map<String, dynamic>>? skillsList})
: _skillsList = skillsList;
Expand All @@ -848,6 +890,10 @@ class _$UpdateMusterEventImpl implements UpdateMusterEvent {
@override
final String registerName;
@override
final int startDate;
@override
final String registerId;
@override
final String? reSubmitAction;
final List<Map<String, dynamic>>? _skillsList;
@override
Expand All @@ -861,7 +907,7 @@ class _$UpdateMusterEventImpl implements UpdateMusterEvent {

@override
String toString() {
return 'MusterCreateEvent.update(tenantId: $tenantId, id: $id, orgName: $orgName, contractId: $contractId, registerNo: $registerNo, registerName: $registerName, reSubmitAction: $reSubmitAction, skillsList: $skillsList)';
return 'MusterCreateEvent.update(tenantId: $tenantId, id: $id, orgName: $orgName, contractId: $contractId, registerNo: $registerNo, registerName: $registerName, startDate: $startDate, registerId: $registerId, reSubmitAction: $reSubmitAction, skillsList: $skillsList)';
}

@override
Expand All @@ -879,6 +925,10 @@ class _$UpdateMusterEventImpl implements UpdateMusterEvent {
other.registerNo == registerNo) &&
(identical(other.registerName, registerName) ||
other.registerName == registerName) &&
(identical(other.startDate, startDate) ||
other.startDate == startDate) &&
(identical(other.registerId, registerId) ||
other.registerId == registerId) &&
(identical(other.reSubmitAction, reSubmitAction) ||
other.reSubmitAction == reSubmitAction) &&
const DeepCollectionEquality()
Expand All @@ -894,6 +944,8 @@ class _$UpdateMusterEventImpl implements UpdateMusterEvent {
contractId,
registerNo,
registerName,
startDate,
registerId,
reSubmitAction,
const DeepCollectionEquality().hash(_skillsList));

Expand Down Expand Up @@ -934,12 +986,14 @@ class _$UpdateMusterEventImpl implements UpdateMusterEvent {
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList)
update,
}) {
return update(tenantId, id, orgName, contractId, registerNo, registerName,
reSubmitAction, skillsList);
startDate, registerId, reSubmitAction, skillsList);
}

@override
Expand Down Expand Up @@ -972,12 +1026,14 @@ class _$UpdateMusterEventImpl implements UpdateMusterEvent {
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList)?
update,
}) {
return update?.call(tenantId, id, orgName, contractId, registerNo,
registerName, reSubmitAction, skillsList);
registerName, startDate, registerId, reSubmitAction, skillsList);
}

@override
Expand Down Expand Up @@ -1010,14 +1066,16 @@ class _$UpdateMusterEventImpl implements UpdateMusterEvent {
String contractId,
String registerNo,
String registerName,
int startDate,
String registerId,
String? reSubmitAction,
List<Map<String, dynamic>>? skillsList)?
update,
required TResult orElse(),
}) {
if (update != null) {
return update(tenantId, id, orgName, contractId, registerNo, registerName,
reSubmitAction, skillsList);
startDate, registerId, reSubmitAction, skillsList);
}
return orElse();
}
Expand Down Expand Up @@ -1062,6 +1120,8 @@ abstract class UpdateMusterEvent implements MusterCreateEvent {
required final String contractId,
required final String registerNo,
required final String registerName,
required final int startDate,
required final String registerId,
final String? reSubmitAction,
final List<Map<String, dynamic>>? skillsList}) = _$UpdateMusterEventImpl;

Expand All @@ -1076,6 +1136,10 @@ abstract class UpdateMusterEvent implements MusterCreateEvent {
String get registerNo;
@override
String get registerName;
@override
int get startDate;
@override
String get registerId;
String? get reSubmitAction;
@override
List<Map<String, dynamic>>? get skillsList;
Expand Down
6 changes: 5 additions & 1 deletion frontend/works_shg_app/lib/pages/shg_inbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,11 @@ class _SHGInboxPage extends State<SHGInboxPage> {
// Toast.showToast(context, message: AppLocalizations.of(context).translate(i18.attendanceMgmt.reviewSkills), type: ToastType.info);
} else {
updateLoaded = false;
context.read<MusterCreateBloc>().add(UpdateMusterEvent(tenantId: widget.tenantId, id: musterId.toString(), reSubmitAction: musterWorkFlowModel?.processInstances?.first.nextActions?.first.action, contractId: individualMusterRollModel.musterRoll!.first.musterAdditionalDetails!.contractId ?? 'NA', registerNo: individualMusterRollModel.musterRoll!.first.musterAdditionalDetails!.attendanceRegisterNo ?? 'NA', registerName: individualMusterRollModel.musterRoll!.first.musterAdditionalDetails!.attendanceRegisterName ?? 'NA', orgName: individualMusterRollModel.musterRoll!.first.musterAdditionalDetails!.contractId ?? 'NA', skillsList: skillsPayLoad));
context.read<MusterCreateBloc>().add(UpdateMusterEvent(tenantId: widget.tenantId, id: musterId.toString(), reSubmitAction: musterWorkFlowModel?.processInstances?.first.nextActions?.first.action,

contractId: individualMusterRollModel.musterRoll!.first.musterAdditionalDetails!.contractId ?? 'NA',
// contractId: individualMusterRollModel.musterRoll!.first.startDate.toString() ,
registerNo: individualMusterRollModel.musterRoll!.first.musterAdditionalDetails!.attendanceRegisterNo ?? 'NA', registerName: individualMusterRollModel.musterRoll!.first.musterAdditionalDetails!.attendanceRegisterName ?? 'NA', orgName: individualMusterRollModel.musterRoll!.first.musterAdditionalDetails!.contractId ?? 'NA', skillsList: skillsPayLoad, startDate: individualMusterRollModel.musterRoll!.first.startDate!, registerId: individualMusterRollModel.musterRoll!.first.registerId!));
}
}
: null,
Expand Down
9 changes: 3 additions & 6 deletions frontend/works_shg_app/lib/pages/track_attendance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,6 @@ class _TrackAttendancePage extends State<TrackAttendancePage> {
),
),

// old search

// end of search

DigitSearchBar(
// suffixIcon: Icons
// .search_sharp,
Expand Down Expand Up @@ -1347,7 +1343,7 @@ class _TrackAttendancePage extends State<TrackAttendancePage> {
// Toast.showToast(context, message: AppLocalizations.of(context).translate(i18.attendanceMgmt.reviewSkills), type: ToastType.info);
} else {
createMusterLoaded = false;
context.read<MusterCreateBloc>().add(UpdateMusterEvent(tenantId: widget.tenantId, id: musterRollsSearch.musterRoll!.first.id.toString(), orgName: individualAttendanceRegisterModel.attendanceRegister?.first.attendanceRegisterAdditionalDetails?.orgName ?? 'NA', reSubmitAction: musterWorkFlowModel?.processInstances?.first.nextActions?.first.action, contractId: individualAttendanceRegisterModel.attendanceRegister?.first.attendanceRegisterAdditionalDetails?.contractId ?? 'NA', registerNo: individualAttendanceRegisterModel.attendanceRegister?.first.registerNumber ?? 'NA', registerName: individualAttendanceRegisterModel.attendanceRegister?.first.name ?? 'NA', skillsList: skillsPayLoad));
context.read<MusterCreateBloc>().add(UpdateMusterEvent(tenantId: widget.tenantId, id: musterRollsSearch.musterRoll!.first.id.toString(), orgName: individualAttendanceRegisterModel.attendanceRegister?.first.attendanceRegisterAdditionalDetails?.orgName ?? 'NA', reSubmitAction: musterWorkFlowModel?.processInstances?.first.nextActions?.first.action, contractId: individualAttendanceRegisterModel.attendanceRegister?.first.attendanceRegisterAdditionalDetails?.contractId ?? 'NA', registerNo: individualAttendanceRegisterModel.attendanceRegister?.first.registerNumber ?? 'NA', registerName: individualAttendanceRegisterModel.attendanceRegister?.first.name ?? 'NA', skillsList: skillsPayLoad, startDate: individualAttendanceRegisterModel.attendanceRegister!.first.startDate!, registerId: individualAttendanceRegisterModel.attendanceRegister!.first.id!));
}
});
}
Expand Down Expand Up @@ -2105,7 +2101,8 @@ class _TrackAttendancePage extends State<TrackAttendancePage> {
morning),
widget.tenantId));
}
};
}
;
});
}
}
Expand Down

0 comments on commit d36f67e

Please sign in to comment.