Refactor Tender Approval Management and Update API Documentation
- Replaced the existing tender approval update and delete endpoints with a new toggle functionality, allowing for more streamlined management of tender approvals. - Introduced the `ToggleTenderApproval` method in the service layer to handle both approval and rejection actions based on the current state of the tender approval. - Updated the API documentation to reflect the new endpoint structure and response formats, including the `TenderApprovalWithTenderResponse`. - Enhanced Swagger documentation to ensure accurate representation of the updated tender approval operations. - Removed obsolete methods and routes to maintain a clean and efficient codebase, adhering to Clean Architecture principles.
This commit is contained in:
@@ -10,10 +10,8 @@ import (
|
||||
type FeedbackType string
|
||||
|
||||
const (
|
||||
FeedbackTypeLike FeedbackType = "like"
|
||||
FeedbackTypeDislike FeedbackType = "dislike"
|
||||
FeedbackTypeUnLike FeedbackType = "unlike"
|
||||
FeedbackTypeUnDislike FeedbackType = "undislike"
|
||||
FeedbackTypeLike FeedbackType = "like"
|
||||
FeedbackTypeDislike FeedbackType = "dislike"
|
||||
)
|
||||
|
||||
// Feedback represents feedback given to a tender by a user
|
||||
|
||||
@@ -54,12 +54,6 @@ func (s *feedbackService) ToggleFeedback(ctx context.Context, req ToggleFeedback
|
||||
}
|
||||
|
||||
if existing.FeedbackType == req.FeedbackType {
|
||||
if existing.FeedbackType == FeedbackTypeLike {
|
||||
existing.FeedbackType = FeedbackTypeUnLike
|
||||
} else {
|
||||
existing.FeedbackType = FeedbackTypeUnDislike
|
||||
}
|
||||
|
||||
err = s.feedbackRepo.Delete(ctx, existing.GetID())
|
||||
if err != nil {
|
||||
s.logger.Error("Failed to update existing feedback", map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user