Update Tender Approval Status to Include Submitted State and Revise API Documentation

- Changed the approval status from "approved" to "submitted" in various locations, including entity definitions, forms, and service methods, to accurately reflect the tender approval process.
- Updated API documentation in Swagger JSON, YAML, and Go files to describe the new status options ("submitted" and "rejected") and their corresponding descriptions.
- Enhanced the tender approval statistics structures to include a count for submitted tenders, improving the overall data model for tender management.
- These changes ensure clarity in the tender approval workflow and enhance the usability of the API for clients interacting with tender approvals.
This commit is contained in:
n.nakhostin
2025-08-25 13:51:14 +03:30
parent 0e14a11daf
commit 3024998e7e
9 changed files with 89 additions and 88 deletions
+7 -7
View File
@@ -130,7 +130,7 @@ func (h *Handler) GetTenderApprovalByTenderAndCompany(c echo.Context) error {
// @Accept json
// @Produce json
// @Param submission_mode query string false "Filter by submission mode Enums(self-apply, partnership)"
// @Param status query string false "Filter by status Enums(approved, rejected)"
// @Param status query string false "Filter by status Enums(submitted, rejected)"
// @Success 200 {object} response.APIResponse{data=[]TenderApprovalWithTenderResponse} "Tender approvals retrieved successfully"
// @Failure 400 {object} response.APIResponse "Bad request - Invalid company ID"
// @Failure 500 {object} response.APIResponse "Internal server error"
@@ -160,8 +160,8 @@ func (h *Handler) PublicGetTenderApprovals(c echo.Context) error {
var status *ApprovalStatus
if statusStr != "" {
statusVal := ApprovalStatus(statusStr)
if statusVal != ApprovalStatusApproved && statusVal != ApprovalStatusRejected {
return response.BadRequest(c, "Invalid status value", "Must be 'approved' or 'rejected'")
if statusVal != ApprovalStatusSubmitted && statusVal != ApprovalStatusRejected {
return response.BadRequest(c, "Invalid status value", "Must be 'submitted' or 'rejected'")
}
status = &statusVal
}
@@ -258,11 +258,11 @@ func (h *Handler) GetCompanyTenderApprovalStats(c echo.Context) error {
// GetTenderApprovalsByStatus retrieves tender approvals by status
// @Summary Get tender approvals by status
// @Description Retrieve tender approvals filtered by their status (approved, rejected)
// @Description Retrieve tender approvals filtered by their status (submitted, rejected)
// @Tags Admin-TenderApprovals
// @Accept json
// @Produce json
// @Param status path string true "Tender approval status" Enums(approved, rejected)
// @Param status path string true "Tender approval status" Enums(submitted, rejected)
// @Param limit query integer false "Number of approvals per page (1-100)" minimum(1) maximum(100) default(20)
// @Param offset query integer false "Number of approvals to skip for pagination" minimum(0) default(0)
// @Success 200 {object} response.APIResponse{data=[]TenderApprovalResponse,meta=response.Meta} "Tender approvals retrieved successfully"
@@ -275,8 +275,8 @@ func (h *Handler) GetTenderApprovalsByStatus(c echo.Context) error {
status := ApprovalStatus(statusStr)
// Validate status
if status != ApprovalStatusApproved && status != ApprovalStatusRejected {
return response.BadRequest(c, "Invalid tender approval status", "Must be approved or rejected")
if status != ApprovalStatusSubmitted && status != ApprovalStatusRejected {
return response.BadRequest(c, "Invalid tender approval status", "Must be submitted or rejected")
}
limit := 20