Skip to content

OBPIH-5889 Order of statuses in Status filter of the requests list with approvals supported#4432

Merged
awalkowiak merged 4 commits intofeature/upgrade-to-grails-3.3.10from
OBPIH-5889
Jan 9, 2024
Merged

OBPIH-5889 Order of statuses in Status filter of the requests list with approvals supported#4432
awalkowiak merged 4 commits intofeature/upgrade-to-grails-3.3.10from
OBPIH-5889

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

if (isElectronicType) {
return RequisitionStatus.listRequestOptions()
}
return RequisitionStatus.listOutboundOptions()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would look better as a one liner:
return isElectronicType ? RequisitionStatus.listRequestOptions() : RequisitionStatus.listOutboundOptions()

Copy link
Collaborator

@kchelstowski kchelstowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused for a while (before I jumped into the ticket's comments), because the title of the PR and the ticket is "Order of statuses" and here I can see that you got rid of some options.
It'd be good next time to mention that there was some additional scope added while working on a ticket.

Copy link
Member

@jmiranda jmiranda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just commenting. Besides adding additional context to the RequisitionStatus list methods, this looks fine to me.

// but if we are on the requests list return listRequestsOptions
if (!isApprovalRequired) {
return RequisitionStatus.listOutboundOptions()
return isElectronicType ? RequisitionStatus.listRequestOptions() : RequisitionStatus.listOutboundOptions()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to need to rethink all of this as we redesign the API over the next few months.

This seems to be one of the most complicated methods in the system and it's at-best an NPC. This tells me that we did something wrong somewhere along the way and we should use this example as our guiding light to undo some of the complexity.

My first problem is that I never liked the distinction between paper and electronic requests. I know there was a reason for it, but as we went down the path of supporting electronic requests, we never revisited whether this was the best approach for handling that distinction. So this needs to be redesigned to be more intuitive.

Secondly, this method should probably be called getRequisitionStatusCodes() or getRequisitionStatuses() since it doesn't return outbound requisition statuses any longer.

But the fact that this is so complex means we probably messed up somewhere else. This might be caused by the fact that enum might not be the right construct for what we're trying to accomplish.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a large part of the problem is that Approval should have been implemented as a separate state machine. This is becoming clear to me because we should be able to apply the approval model to any of our activities: requests, purchase orders, supplier preferences, receipts, etc.

}

// Options for request list when current location is supporting request approval (Added approved and waiting for approval)
// Options for request list when current location is supporting request approval (Added approved, rejected and waiting for approval)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some additional context for each of these to provide a reason why we are restricting the options? You could potentially find this information in the ticket.

@awalkowiak awalkowiak merged commit 7e8707c into feature/upgrade-to-grails-3.3.10 Jan 9, 2024
@awalkowiak awalkowiak deleted the OBPIH-5889 branch January 9, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants