Enhance tender approval and submission handling
- Added a new error for submission sync failures, improving error handling in the tender approval process. - Updated the `ToggleTenderApproval` method to handle the new error, providing clearer responses for sync issues. - Introduced a method to reopen terminal submissions when tender approvals are resubmitted, enhancing submission state management. - Implemented optimistic locking in the repository to prevent concurrent updates, improving data integrity. - Added unit tests for new submission handling logic, ensuring robust functionality and error management. This update strengthens the tender approval workflow and submission handling, ensuring better error reporting and state management.
This commit is contained in:
@@ -15,6 +15,7 @@ var (
|
||||
ErrApprovalRequired = errors.New("tender must be approved before starting submission workflow")
|
||||
ErrInvalidStatusTransition = errors.New("invalid status transition")
|
||||
ErrTerminalStatus = errors.New("tender submission is in a terminal state and cannot be updated")
|
||||
ErrConcurrentUpdate = errors.New("tender submission was modified concurrently")
|
||||
)
|
||||
|
||||
// InvalidStatusTransitionError is returned when a status change is not allowed.
|
||||
|
||||
Reference in New Issue
Block a user