docs: add Swagger annotations for Company UPDATE and DELETE endpoints
- PATCH /api/v1/companies/{id} - Update Company
- DELETE /api/v1/companies/{id} - Delete Company
- Both endpoints require admin authentication
This commit is contained in:
parent
afab4e89cd
commit
4712193ade
1 changed files with 24 additions and 0 deletions
|
|
@ -356,6 +356,20 @@ func (h *AdminHandlers) ListCandidates(w http.ResponseWriter, r *http.Request) {
|
|||
json.NewEncoder(w).Encode(response)
|
||||
}
|
||||
|
||||
// UpdateCompany updates a company's information
|
||||
// @Summary Update Company
|
||||
// @Description Updates company information by ID (admin only)
|
||||
// @Tags Companies
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path string true "Company ID"
|
||||
// @Param body body dto.UpdateCompanyRequest true "Company update data"
|
||||
// @Success 200 {object} object
|
||||
// @Failure 400 {string} string "Invalid Request"
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 500 {string} string "Internal Server Error"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/companies/{id} [patch]
|
||||
func (h *AdminHandlers) UpdateCompany(w http.ResponseWriter, r *http.Request) {
|
||||
id := r.PathValue("id")
|
||||
var req dto.UpdateCompanyRequest
|
||||
|
|
@ -374,6 +388,16 @@ func (h *AdminHandlers) UpdateCompany(w http.ResponseWriter, r *http.Request) {
|
|||
json.NewEncoder(w).Encode(company)
|
||||
}
|
||||
|
||||
// DeleteCompany deletes a company
|
||||
// @Summary Delete Company
|
||||
// @Description Deletes a company by ID (admin only)
|
||||
// @Tags Companies
|
||||
// @Param id path string true "Company ID"
|
||||
// @Success 204 "No Content"
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 500 {string} string "Internal Server Error"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/companies/{id} [delete]
|
||||
func (h *AdminHandlers) DeleteCompany(w http.ResponseWriter, r *http.Request) {
|
||||
id := r.PathValue("id")
|
||||
if err := h.adminService.DeleteCompany(r.Context(), id); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue