Update API Documentation for Tender ID Parameter Location

- Changed the parameter location for `tender_id` from "query" to "path" in the API documentation across multiple files, including Swagger JSON, YAML, and Go documentation.
- Updated the handler method to retrieve `tender_id` from the path instead of the query parameters, ensuring consistency with the updated API structure.
- This change enhances the clarity of the API documentation and aligns with Clean Architecture principles by accurately reflecting the intended usage of the `tender_id` parameter.
This commit is contained in:
n.nakhostin
2025-08-19 14:38:51 +03:30
parent b3575bb5e6
commit e292839732
4 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -93,7 +93,7 @@ func (h *Handler) GetPublicTenderApproval(c echo.Context) error {
// @Tags TenderApprovals
// @Accept json
// @Produce json
// @Param tender_id query string true "Tender ID"
// @Param tender_id path string true "Tender ID"
// @Success 200 {object} response.APIResponse{data=TenderApprovalResponse} "Tender approval retrieved successfully"
// @Failure 400 {object} response.APIResponse "Bad request - Invalid tender ID or company ID"
// @Failure 404 {object} response.APIResponse "Not found - Tender approval not found"
@@ -101,15 +101,15 @@ func (h *Handler) GetPublicTenderApproval(c echo.Context) error {
// @Security BearerAuth
// @Router /api/v1/tender-approvals/tender/{tender_id} [get]
func (h *Handler) GetTenderApprovalByTenderAndCompany(c echo.Context) error {
tenderID := c.QueryParam("tender_id")
companyID := c.Get("company_id").(string)
if companyID == "" {
return response.Unauthorized(c, "Unauthorized")
}
tenderID := c.Param("tender_id")
if tenderID == "" {
return response.BadRequest(c, "Missing required parameters", "tender_id and company_id are required")
return response.BadRequest(c, "Missing required parameters", "tender_id required")
}
tenderApprovalWithTender, err := h.service.GetTenderApprovalByTenderAndCompanyWithTender(c.Request().Context(), tenderID, companyID)