Files
tm_back/internal/tender_approval/errors.go
T
Mazyar fa3d466579 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.
2026-07-12 21:41:53 +03:30

19 lines
898 B
Go

package tender_approval
import "errors"
// Common error messages for tender approval operations
var (
ErrTenderApprovalNotFound = errors.New("tender approval not found")
ErrTenderApprovalExists = errors.New("tender approval already exists for this tender and company")
ErrInvalidStatus = errors.New("invalid tender approval status")
ErrInvalidSubmissionMode = errors.New("invalid submission mode")
ErrTenderNotFound = errors.New("tender not found")
ErrCompanyNotFound = errors.New("company not found")
ErrInvalidTenderID = errors.New("invalid tender ID")
ErrInvalidCompanyID = errors.New("invalid company ID")
ErrUnauthorized = errors.New("unauthorized to perform this action")
ErrInvalidData = errors.New("invalid tender approval data")
ErrSubmissionSyncFailed = errors.New("failed to sync tender submission workflow")
)