litzvi / avc-beta

trying to build first demo for avc
0 stars 0 forks source link

confirm, save buttons in management #559

Closed litzvi closed 3 years ago

litzvi commented 3 years ago

A little bizarre bug we had this morning. I removed approval for Eli in receipts but left the Management. There are still lots from last week in pending - therefore they still require approval. But he couldn't finalize the lot because you removed the confirm button based on current requirements.

Managed to get around it for now.

They way I designed it, approval requirements aren't changed retroactively. Therefore shouldn't depend on management configuration but on given process. Perhaps it should be changed, so I need to change the design for flexible approval. Create approval/rejection when added.

litzvi commented 3 years ago
litzvi commented 3 years ago

The problem is adding an approval for a user will add approvals from beginning of time.

litzvi commented 3 years ago

Or maybe remove the connection between the approval and status.

litzvi commented 3 years ago

The problem is adding an approval for a user will add approvals from beginning of time.

only need to approve not finalized processes.

litzvi commented 3 years ago
litzvi commented 3 years ago

old code:

Optional optional = getProcessRepository().findProcessApprovalByProcessAndUser(processId, getCurrentUserId()); //(change) if exists send to previous method, otherwise IF THE USER NEEDS APPROVAL, create one and add ApprovalTask approval = optional.orElseThrow(() -> new AccessControlException("No approval task for current user")); approval.setDecision(decision); approval.setProcessSnapshot(processSnapshot); approval.setRemarks(remarks); editEntity(approval); approvalAlerts(approval);

litzvi commented 3 years ago

@litzvi don't use com.avc.mis.beta.repositories.ProcessInfoRepository.findApprovals(Integer, DecisionType[], Instant, Instant). Change to a dedicated method to get the report.

litzvi commented 3 years ago

@litzvi don't use com.avc.mis.beta.repositories.ProcessInfoRepository.findApprovals(Integer, DecisionType[], Instant, Instant). Change to a dedicated method to get the report.

done