From f94945e2316a1610e7f05e4fa656ff6ea9f8b8ba Mon Sep 17 00:00:00 2001 From: Govarthanan Date: Tue, 13 Oct 2026 12:14:40 +0530 Subject: [PATCH] Update packet status check logic and modify status handling for processed, failed, and in-progress states --- .../packet-status/packet-status.component.ts | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/admin-ui/src/app/features/packet-status/packet-status/packet-status.component.ts b/admin-ui/src/app/features/packet-status/packet-status/packet-status.component.ts index 2a9807c9..d4311cd2 100644 --- a/admin-ui/src/app/features/packet-status/packet-status/packet-status.component.ts +++ b/admin-ui/src/app/features/packet-status/packet-status/packet-status.component.ts @@ -68,15 +68,26 @@ export class PacketStatusComponent implements OnInit { this.errorMessage = this.serverMessage[response['errors'][0].errorCode]; } else{ this.data = response['response']['packetStatusUpdateList']; - for (let i = 0 ; i < this.data.length; i++) { - if (this.data[i].statusCode.includes('FAILED')) { - this.statusCheck = this.messages.statuscheckFailed; - break; + this.error = false; + this.showDetails = true; + if (this.data && this.data.length > 0) { + const latestRecord = + this.data[this.data.length - 1]; + if ( + latestRecord.statusCode.includes('PROCESSED') && + latestRecord.transactionTypeCode.includes('INTERNAL_WORKFLOW_ACTION') + ) { + this.statusCheck = + this.messages.statuscheckCompleted; + } else if ( + latestRecord.statusCode.includes('FAILED') + ) { + this.statusCheck = + this.messages.statuscheckFailed; } else { - this.statusCheck = this.messages.statuscheckCompleted; + this.statusCheck = + this.messages.statuscheckInprogress; } - this.error = false; - this.showDetails = true; } } });