feat: update education and work history

This commit is contained in:
hanif salafi 2025-09-22 00:06:06 +07:00
parent 21c68096c3
commit 86ea5f66d1
9 changed files with 404 additions and 550 deletions

View File

@ -32,14 +32,12 @@ func NewEducationHistoryController(educationHistoryService service.EducationHist
// All Education History // All Education History
// @Summary Get all Education History // @Summary Get all Education History
// @Description API for getting all Education History for authenticated user // @Description API for getting all Education History for specific user
// @Tags Education History // @Tags Education History
// @Security Bearer
// @Param req query request.EducationHistoryQueryRequest false "query parameters" // @Param req query request.EducationHistoryQueryRequest false "query parameters"
// @Param req query paginator.Pagination false "pagination parameters" // @Param req query paginator.Pagination false "pagination parameters"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /education-history [get] // @Router /education-history [get]
func (_i *educationHistoryController) All(c *fiber.Ctx) error { func (_i *educationHistoryController) All(c *fiber.Ctx) error {
@ -47,10 +45,8 @@ func (_i *educationHistoryController) All(c *fiber.Ctx) error {
if err != nil { if err != nil {
return err return err
} }
authHeader := c.Get("Authorization")
reqContext := request.EducationHistoryQueryRequestContext{ reqContext := request.EducationHistoryQueryRequestContext{
UserID: c.Query("userId"),
SchoolName: c.Query("schoolName"), SchoolName: c.Query("schoolName"),
Major: c.Query("major"), Major: c.Query("major"),
EducationLevel: c.Query("educationLevel"), EducationLevel: c.Query("educationLevel"),
@ -59,7 +55,7 @@ func (_i *educationHistoryController) All(c *fiber.Ctx) error {
req := reqContext.ToParamRequest() req := reqContext.ToParamRequest()
req.Pagination = paginate req.Pagination = paginate
educationData, paging, err := _i.educationHistoryService.All(authHeader, req) educationData, paging, err := _i.educationHistoryService.All(req)
if err != nil { if err != nil {
return err return err
} }
@ -76,11 +72,10 @@ func (_i *educationHistoryController) All(c *fiber.Ctx) error {
// @Summary Get one Education History // @Summary Get one Education History
// @Description API for getting one Education History // @Description API for getting one Education History
// @Tags Education History // @Tags Education History
// @Security Bearer
// @Param id path int true "Education History ID" // @Param id path int true "Education History ID"
// @Param userId query uint true "User ID"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /education-history/{id} [get] // @Router /education-history/{id} [get]
func (_i *educationHistoryController) Show(c *fiber.Ctx) error { func (_i *educationHistoryController) Show(c *fiber.Ctx) error {
@ -89,9 +84,15 @@ func (_i *educationHistoryController) Show(c *fiber.Ctx) error {
return err return err
} }
authHeader := c.Get("Authorization") userId, err := strconv.ParseUint(c.Query("userId"), 10, 0)
if err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"userId parameter is required and must be a valid number"},
})
}
educationData, err := _i.educationHistoryService.Show(authHeader, uint(id)) educationData, err := _i.educationHistoryService.Show(uint(userId), uint(id))
if err != nil { if err != nil {
return err return err
} }
@ -107,24 +108,28 @@ func (_i *educationHistoryController) Show(c *fiber.Ctx) error {
// @Summary Create Education History // @Summary Create Education History
// @Description API for create Education History // @Description API for create Education History
// @Tags Education History // @Tags Education History
// @Security Bearer
// @Param X-Csrf-Token header string true "Insert the X-Csrf-Token" // @Param X-Csrf-Token header string true "Insert the X-Csrf-Token"
// @Param Authorization header string false "Insert your access token" default(Bearer <Add access token here>) // @Param userId query uint true "User ID"
// @Param payload body request.EducationHistoryCreateRequest true "Required payload" // @Param payload body request.EducationHistoryCreateRequest true "Required payload"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /education-history [post] // @Router /education-history [post]
func (_i *educationHistoryController) Save(c *fiber.Ctx) error { func (_i *educationHistoryController) Save(c *fiber.Ctx) error {
userId, err := strconv.ParseUint(c.Query("userId"), 10, 0)
if err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"userId parameter is required and must be a valid number"},
})
}
req := new(request.EducationHistoryCreateRequest) req := new(request.EducationHistoryCreateRequest)
if err := utilVal.ParseAndValidate(c, req); err != nil { if err := utilVal.ParseAndValidate(c, req); err != nil {
return err return err
} }
authHeader := c.Get("Authorization") dataResult, err := _i.educationHistoryService.Save(uint(userId), *req)
dataResult, err := _i.educationHistoryService.Save(authHeader, *req)
if err != nil { if err != nil {
return err return err
} }
@ -140,13 +145,12 @@ func (_i *educationHistoryController) Save(c *fiber.Ctx) error {
// @Summary Update Education History // @Summary Update Education History
// @Description API for update Education History // @Description API for update Education History
// @Tags Education History // @Tags Education History
// @Security Bearer
// @Param X-Csrf-Token header string true "Insert the X-Csrf-Token" // @Param X-Csrf-Token header string true "Insert the X-Csrf-Token"
// @Param id path int true "Education History ID" // @Param id path int true "Education History ID"
// @Param userId query uint true "User ID"
// @Param payload body request.EducationHistoryUpdateRequest true "Required payload" // @Param payload body request.EducationHistoryUpdateRequest true "Required payload"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /education-history/{id} [put] // @Router /education-history/{id} [put]
func (_i *educationHistoryController) Update(c *fiber.Ctx) error { func (_i *educationHistoryController) Update(c *fiber.Ctx) error {
@ -155,14 +159,20 @@ func (_i *educationHistoryController) Update(c *fiber.Ctx) error {
return err return err
} }
userId, err := strconv.ParseUint(c.Query("userId"), 10, 0)
if err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"userId parameter is required and must be a valid number"},
})
}
req := new(request.EducationHistoryUpdateRequest) req := new(request.EducationHistoryUpdateRequest)
if err := utilVal.ParseAndValidate(c, req); err != nil { if err := utilVal.ParseAndValidate(c, req); err != nil {
return err return err
} }
authHeader := c.Get("Authorization") err = _i.educationHistoryService.Update(uint(userId), uint(id), *req)
err = _i.educationHistoryService.Update(authHeader, uint(id), *req)
if err != nil { if err != nil {
return err return err
} }
@ -177,12 +187,11 @@ func (_i *educationHistoryController) Update(c *fiber.Ctx) error {
// @Summary Delete Education History // @Summary Delete Education History
// @Description API for delete Education History // @Description API for delete Education History
// @Tags Education History // @Tags Education History
// @Security Bearer
// @Param X-Csrf-Token header string true "Insert the X-Csrf-Token" // @Param X-Csrf-Token header string true "Insert the X-Csrf-Token"
// @Param id path int true "Education History ID" // @Param id path int true "Education History ID"
// @Param userId query uint true "User ID"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /education-history/{id} [delete] // @Router /education-history/{id} [delete]
func (_i *educationHistoryController) Delete(c *fiber.Ctx) error { func (_i *educationHistoryController) Delete(c *fiber.Ctx) error {
@ -191,9 +200,15 @@ func (_i *educationHistoryController) Delete(c *fiber.Ctx) error {
return err return err
} }
authHeader := c.Get("Authorization") userId, err := strconv.ParseUint(c.Query("userId"), 10, 0)
if err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"userId parameter is required and must be a valid number"},
})
}
err = _i.educationHistoryService.Delete(authHeader, uint(id)) err = _i.educationHistoryService.Delete(uint(userId), uint(id))
if err != nil { if err != nil {
return err return err
} }
@ -208,13 +223,12 @@ func (_i *educationHistoryController) Delete(c *fiber.Ctx) error {
// @Summary Upload Certificate for Education History // @Summary Upload Certificate for Education History
// @Description API for upload certificate image for Education History // @Description API for upload certificate image for Education History
// @Tags Education History // @Tags Education History
// @Security Bearer
// @Param X-Csrf-Token header string true "Insert the X-Csrf-Token" // @Param X-Csrf-Token header string true "Insert the X-Csrf-Token"
// @Param id path int true "Education History ID" // @Param id path int true "Education History ID"
// @Param userId query uint true "User ID"
// @Param certificate formData file true "Certificate image file" // @Param certificate formData file true "Certificate image file"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /education-history/{id}/certificate [post] // @Router /education-history/{id}/certificate [post]
func (_i *educationHistoryController) UploadCertificate(c *fiber.Ctx) error { func (_i *educationHistoryController) UploadCertificate(c *fiber.Ctx) error {
@ -223,9 +237,15 @@ func (_i *educationHistoryController) UploadCertificate(c *fiber.Ctx) error {
return err return err
} }
authHeader := c.Get("Authorization") userId, err := strconv.ParseUint(c.Query("userId"), 10, 0)
if err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"userId parameter is required and must be a valid number"},
})
}
err = _i.educationHistoryService.UploadCertificate(authHeader, uint(id), c) err = _i.educationHistoryService.UploadCertificate(uint(userId), uint(id), c)
if err != nil { if err != nil {
return err return err
} }

View File

@ -7,6 +7,7 @@ import (
) )
type EducationHistoryQueryRequest struct { type EducationHistoryQueryRequest struct {
UserID uint `json:"userId" validate:"required"`
SchoolName *string `json:"schoolName"` SchoolName *string `json:"schoolName"`
Major *string `json:"major"` Major *string `json:"major"`
EducationLevel *string `json:"educationLevel"` EducationLevel *string `json:"educationLevel"`
@ -22,13 +23,14 @@ type EducationHistoryCreateRequest struct {
CertificateImage string `json:"certificateImage,omitempty"` CertificateImage string `json:"certificateImage,omitempty"`
} }
func (req EducationHistoryCreateRequest) ToEntity() *entity.EducationHistory { func (req EducationHistoryCreateRequest) ToEntity(userId uint) *entity.EducationHistory {
certificateImage := &req.CertificateImage certificateImage := &req.CertificateImage
if req.CertificateImage == "" { if req.CertificateImage == "" {
certificateImage = nil certificateImage = nil
} }
return &entity.EducationHistory{ return &entity.EducationHistory{
UserID: userId,
SchoolName: req.SchoolName, SchoolName: req.SchoolName,
Major: req.Major, Major: req.Major,
EducationLevel: req.EducationLevel, EducationLevel: req.EducationLevel,
@ -45,13 +47,14 @@ type EducationHistoryUpdateRequest struct {
CertificateImage string `json:"certificateImage,omitempty"` CertificateImage string `json:"certificateImage,omitempty"`
} }
func (req EducationHistoryUpdateRequest) ToEntity() *entity.EducationHistory { func (req EducationHistoryUpdateRequest) ToEntity(userId uint) *entity.EducationHistory {
certificateImage := &req.CertificateImage certificateImage := &req.CertificateImage
if req.CertificateImage == "" { if req.CertificateImage == "" {
certificateImage = nil certificateImage = nil
} }
return &entity.EducationHistory{ return &entity.EducationHistory{
UserID: userId,
SchoolName: req.SchoolName, SchoolName: req.SchoolName,
Major: req.Major, Major: req.Major,
EducationLevel: req.EducationLevel, EducationLevel: req.EducationLevel,
@ -61,6 +64,7 @@ func (req EducationHistoryUpdateRequest) ToEntity() *entity.EducationHistory {
} }
type EducationHistoryQueryRequestContext struct { type EducationHistoryQueryRequestContext struct {
UserID string `json:"userId"`
SchoolName string `json:"schoolName"` SchoolName string `json:"schoolName"`
Major string `json:"major"` Major string `json:"major"`
EducationLevel string `json:"educationLevel"` EducationLevel string `json:"educationLevel"`
@ -70,6 +74,12 @@ type EducationHistoryQueryRequestContext struct {
func (req EducationHistoryQueryRequestContext) ToParamRequest() EducationHistoryQueryRequest { func (req EducationHistoryQueryRequestContext) ToParamRequest() EducationHistoryQueryRequest {
var request EducationHistoryQueryRequest var request EducationHistoryQueryRequest
if userId := req.UserID; userId != "" {
userIdUint, err := strconv.ParseUint(userId, 10, 0)
if err == nil {
request.UserID = uint(userIdUint)
}
}
if schoolName := req.SchoolName; schoolName != "" { if schoolName := req.SchoolName; schoolName != "" {
request.SchoolName = &schoolName request.SchoolName = &schoolName
} }

View File

@ -18,7 +18,6 @@ import (
"narasi-ahli-be/config/config" "narasi-ahli-be/config/config"
minioStorage "narasi-ahli-be/config/config" minioStorage "narasi-ahli-be/config/config"
"narasi-ahli-be/utils/paginator" "narasi-ahli-be/utils/paginator"
utilSvc "narasi-ahli-be/utils/service"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7"
@ -34,12 +33,12 @@ type educationHistoryService struct {
} }
type EducationHistoryService interface { type EducationHistoryService interface {
All(authToken string, req request.EducationHistoryQueryRequest) (educationHistories []*response.EducationHistoryResponse, paging paginator.Pagination, err error) All(req request.EducationHistoryQueryRequest) (educationHistories []*response.EducationHistoryResponse, paging paginator.Pagination, err error)
Show(authToken string, id uint) (educationHistory *response.EducationHistoryResponse, err error) Show(userId uint, id uint) (educationHistory *response.EducationHistoryResponse, err error)
Save(authToken string, req request.EducationHistoryCreateRequest) (educationHistory *response.EducationHistoryResponse, err error) Save(userId uint, req request.EducationHistoryCreateRequest) (educationHistory *response.EducationHistoryResponse, err error)
Update(authToken string, id uint, req request.EducationHistoryUpdateRequest) (err error) Update(userId uint, id uint, req request.EducationHistoryUpdateRequest) (err error)
Delete(authToken string, id uint) error Delete(userId uint, id uint) error
UploadCertificate(authToken string, id uint, c *fiber.Ctx) error UploadCertificate(userId uint, id uint, c *fiber.Ctx) error
} }
func NewEducationHistoryService(repo repository.EducationHistoryRepository, usersRepo usersRepository.UsersRepository, log zerolog.Logger, cfg *config.Config, minioStorage *minioStorage.MinioStorage) EducationHistoryService { func NewEducationHistoryService(repo repository.EducationHistoryRepository, usersRepo usersRepository.UsersRepository, log zerolog.Logger, cfg *config.Config, minioStorage *minioStorage.MinioStorage) EducationHistoryService {
@ -52,13 +51,8 @@ func NewEducationHistoryService(repo repository.EducationHistoryRepository, user
} }
} }
func (_i *educationHistoryService) All(authToken string, req request.EducationHistoryQueryRequest) (educationHistories []*response.EducationHistoryResponse, paging paginator.Pagination, err error) { func (_i *educationHistoryService) All(req request.EducationHistoryQueryRequest) (educationHistories []*response.EducationHistoryResponse, paging paginator.Pagination, err error) {
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken) results, paging, err := _i.Repo.GetAll(req.UserID, req)
if userInfo == nil {
return nil, paginator.Pagination{}, errors.New("unauthorized")
}
results, paging, err := _i.Repo.GetAll(userInfo.ID, req)
if err != nil { if err != nil {
return return
} }
@ -70,13 +64,8 @@ func (_i *educationHistoryService) All(authToken string, req request.EducationHi
return return
} }
func (_i *educationHistoryService) Show(authToken string, id uint) (educationHistory *response.EducationHistoryResponse, err error) { func (_i *educationHistoryService) Show(userId uint, id uint) (educationHistory *response.EducationHistoryResponse, err error) {
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken) result, err := _i.Repo.FindOneByUserAndId(userId, id)
if userInfo == nil {
return nil, errors.New("unauthorized")
}
result, err := _i.Repo.FindOneByUserAndId(userInfo.ID, id)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -84,16 +73,10 @@ func (_i *educationHistoryService) Show(authToken string, id uint) (educationHis
return mapper.EducationHistoryResponseMapper(result), nil return mapper.EducationHistoryResponseMapper(result), nil
} }
func (_i *educationHistoryService) Save(authToken string, req request.EducationHistoryCreateRequest) (educationHistory *response.EducationHistoryResponse, err error) { func (_i *educationHistoryService) Save(userId uint, req request.EducationHistoryCreateRequest) (educationHistory *response.EducationHistoryResponse, err error) {
_i.Log.Info().Interface("data", req).Msg("Creating education history") _i.Log.Info().Interface("data", req).Msg("Creating education history")
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken) entity := req.ToEntity(userId)
if userInfo == nil {
return nil, errors.New("unauthorized")
}
entity := req.ToEntity()
entity.UserID = userInfo.ID
result, err := _i.Repo.Create(entity) result, err := _i.Repo.Create(entity)
if err != nil { if err != nil {
@ -103,16 +86,11 @@ func (_i *educationHistoryService) Save(authToken string, req request.EducationH
return mapper.EducationHistoryResponseMapper(result), nil return mapper.EducationHistoryResponseMapper(result), nil
} }
func (_i *educationHistoryService) Update(authToken string, id uint, req request.EducationHistoryUpdateRequest) (err error) { func (_i *educationHistoryService) Update(userId uint, id uint, req request.EducationHistoryUpdateRequest) (err error) {
_i.Log.Info().Interface("data", req).Msg("Updating education history") _i.Log.Info().Interface("data", req).Msg("Updating education history")
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if userInfo == nil {
return errors.New("unauthorized")
}
// Check if record exists and belongs to user // Check if record exists and belongs to user
existing, err := _i.Repo.FindOneByUserAndId(userInfo.ID, id) existing, err := _i.Repo.FindOneByUserAndId(userId, id)
if err != nil { if err != nil {
return err return err
} }
@ -120,20 +98,15 @@ func (_i *educationHistoryService) Update(authToken string, id uint, req request
return errors.New("education history not found") return errors.New("education history not found")
} }
entity := req.ToEntity() entity := req.ToEntity(userId)
return _i.Repo.Update(userInfo.ID, id, entity) return _i.Repo.Update(userId, id, entity)
} }
func (_i *educationHistoryService) Delete(authToken string, id uint) error { func (_i *educationHistoryService) Delete(userId uint, id uint) error {
_i.Log.Info().Str("authToken", authToken).Uint("id", id).Msg("Deleting education history") _i.Log.Info().Uint("userId", userId).Uint("id", id).Msg("Deleting education history")
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if userInfo == nil {
return errors.New("unauthorized")
}
// Check if record exists and belongs to user // Check if record exists and belongs to user
existing, err := _i.Repo.FindOneByUserAndId(userInfo.ID, id) existing, err := _i.Repo.FindOneByUserAndId(userId, id)
if err != nil { if err != nil {
return err return err
} }
@ -141,19 +114,14 @@ func (_i *educationHistoryService) Delete(authToken string, id uint) error {
return errors.New("education history not found") return errors.New("education history not found")
} }
return _i.Repo.Delete(userInfo.ID, id) return _i.Repo.Delete(userId, id)
} }
func (_i *educationHistoryService) UploadCertificate(authToken string, id uint, c *fiber.Ctx) error { func (_i *educationHistoryService) UploadCertificate(userId uint, id uint, c *fiber.Ctx) error {
_i.Log.Info().Str("authToken", authToken).Uint("id", id).Msg("Uploading certificate") _i.Log.Info().Uint("userId", userId).Uint("id", id).Msg("Uploading certificate")
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if userInfo == nil {
return errors.New("unauthorized")
}
// Check if record exists and belongs to user // Check if record exists and belongs to user
existing, err := _i.Repo.FindOneByUserAndId(userInfo.ID, id) existing, err := _i.Repo.FindOneByUserAndId(userId, id)
if err != nil { if err != nil {
return err return err
} }
@ -214,5 +182,5 @@ func (_i *educationHistoryService) UploadCertificate(authToken string, id uint,
// Update certificate image path with MinIO object name // Update certificate image path with MinIO object name
existing.CertificateImage = &objectName existing.CertificateImage = &objectName
return _i.Repo.Update(userInfo.ID, id, existing) return _i.Repo.Update(userId, id, existing)
} }

View File

@ -31,14 +31,12 @@ func NewWorkHistoryController(workHistoryService service.WorkHistoryService) Wor
// All Work History // All Work History
// @Summary Get all Work History // @Summary Get all Work History
// @Description API for getting all Work History for authenticated user // @Description API for getting all Work History for specific user
// @Tags Work History // @Tags Work History
// @Security Bearer
// @Param req query request.WorkHistoryQueryRequest false "query parameters" // @Param req query request.WorkHistoryQueryRequest false "query parameters"
// @Param req query paginator.Pagination false "pagination parameters" // @Param req query paginator.Pagination false "pagination parameters"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /work-history [get] // @Router /work-history [get]
func (_i *workHistoryController) All(c *fiber.Ctx) error { func (_i *workHistoryController) All(c *fiber.Ctx) error {
@ -46,18 +44,16 @@ func (_i *workHistoryController) All(c *fiber.Ctx) error {
if err != nil { if err != nil {
return err return err
} }
authHeader := c.Get("Authorization")
reqContext := request.WorkHistoryQueryRequestContext{ reqContext := request.WorkHistoryQueryRequestContext{
JobTitle: c.Query("jobTitle"), JobTitle: c.Query("jobTitle"),
CompanyName: c.Query("companyName"), CompanyName: c.Query("companyName"),
IsCurrent: c.Query("isCurrent"), IsCurrent: c.Query("isCurrent"),
UserID: c.Query("userId"),
} }
req := reqContext.ToParamRequest() req := reqContext.ToParamRequest()
req.Pagination = paginate req.Pagination = paginate
workData, paging, err := _i.workHistoryService.All(authHeader, req) workData, paging, err := _i.workHistoryService.All(req)
if err != nil { if err != nil {
return err return err
} }
@ -74,11 +70,10 @@ func (_i *workHistoryController) All(c *fiber.Ctx) error {
// @Summary Get one Work History // @Summary Get one Work History
// @Description API for getting one Work History // @Description API for getting one Work History
// @Tags Work History // @Tags Work History
// @Security Bearer
// @Param id path int true "Work History ID" // @Param id path int true "Work History ID"
// @Param userId query uint true "User ID"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /work-history/{id} [get] // @Router /work-history/{id} [get]
func (_i *workHistoryController) Show(c *fiber.Ctx) error { func (_i *workHistoryController) Show(c *fiber.Ctx) error {
@ -87,9 +82,15 @@ func (_i *workHistoryController) Show(c *fiber.Ctx) error {
return err return err
} }
authHeader := c.Get("Authorization") userId, err := strconv.ParseUint(c.Query("userId"), 10, 0)
if err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"userId parameter is required and must be a valid number"},
})
}
workData, err := _i.workHistoryService.Show(authHeader, uint(id)) workData, err := _i.workHistoryService.Show(uint(userId), uint(id))
if err != nil { if err != nil {
return err return err
} }
@ -105,24 +106,28 @@ func (_i *workHistoryController) Show(c *fiber.Ctx) error {
// @Summary Create Work History // @Summary Create Work History
// @Description API for create Work History // @Description API for create Work History
// @Tags Work History // @Tags Work History
// @Security Bearer
// @Param X-Csrf-Token header string true "Insert the X-Csrf-Token" // @Param X-Csrf-Token header string true "Insert the X-Csrf-Token"
// @Param Authorization header string false "Insert your access token" default(Bearer <Add access token here>) // @Param userId query uint true "User ID"
// @Param payload body request.WorkHistoryCreateRequest true "Required payload" // @Param payload body request.WorkHistoryCreateRequest true "Required payload"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /work-history [post] // @Router /work-history [post]
func (_i *workHistoryController) Save(c *fiber.Ctx) error { func (_i *workHistoryController) Save(c *fiber.Ctx) error {
userId, err := strconv.ParseUint(c.Query("userId"), 10, 0)
if err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"userId parameter is required and must be a valid number"},
})
}
req := new(request.WorkHistoryCreateRequest) req := new(request.WorkHistoryCreateRequest)
if err := utilVal.ParseAndValidate(c, req); err != nil { if err := utilVal.ParseAndValidate(c, req); err != nil {
return err return err
} }
authHeader := c.Get("Authorization") dataResult, err := _i.workHistoryService.Save(uint(userId), *req)
dataResult, err := _i.workHistoryService.Save(authHeader, *req)
if err != nil { if err != nil {
return err return err
} }
@ -138,13 +143,12 @@ func (_i *workHistoryController) Save(c *fiber.Ctx) error {
// @Summary Update Work History // @Summary Update Work History
// @Description API for update Work History // @Description API for update Work History
// @Tags Work History // @Tags Work History
// @Security Bearer
// @Param X-Csrf-Token header string true "Insert the X-Csrf-Token" // @Param X-Csrf-Token header string true "Insert the X-Csrf-Token"
// @Param id path int true "Work History ID" // @Param id path int true "Work History ID"
// @Param userId query uint true "User ID"
// @Param payload body request.WorkHistoryUpdateRequest true "Required payload" // @Param payload body request.WorkHistoryUpdateRequest true "Required payload"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /work-history/{id} [put] // @Router /work-history/{id} [put]
func (_i *workHistoryController) Update(c *fiber.Ctx) error { func (_i *workHistoryController) Update(c *fiber.Ctx) error {
@ -153,14 +157,20 @@ func (_i *workHistoryController) Update(c *fiber.Ctx) error {
return err return err
} }
userId, err := strconv.ParseUint(c.Query("userId"), 10, 0)
if err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"userId parameter is required and must be a valid number"},
})
}
req := new(request.WorkHistoryUpdateRequest) req := new(request.WorkHistoryUpdateRequest)
if err := utilVal.ParseAndValidate(c, req); err != nil { if err := utilVal.ParseAndValidate(c, req); err != nil {
return err return err
} }
authHeader := c.Get("Authorization") err = _i.workHistoryService.Update(uint(userId), uint(id), *req)
err = _i.workHistoryService.Update(authHeader, uint(id), *req)
if err != nil { if err != nil {
return err return err
} }
@ -175,12 +185,11 @@ func (_i *workHistoryController) Update(c *fiber.Ctx) error {
// @Summary Delete Work History // @Summary Delete Work History
// @Description API for delete Work History // @Description API for delete Work History
// @Tags Work History // @Tags Work History
// @Security Bearer
// @Param X-Csrf-Token header string true "Insert the X-Csrf-Token" // @Param X-Csrf-Token header string true "Insert the X-Csrf-Token"
// @Param id path int true "Work History ID" // @Param id path int true "Work History ID"
// @Param userId query uint true "User ID"
// @Success 200 {object} response.Response // @Success 200 {object} response.Response
// @Failure 400 {object} response.BadRequestError // @Failure 400 {object} response.BadRequestError
// @Failure 401 {object} response.UnauthorizedError
// @Failure 500 {object} response.InternalServerError // @Failure 500 {object} response.InternalServerError
// @Router /work-history/{id} [delete] // @Router /work-history/{id} [delete]
func (_i *workHistoryController) Delete(c *fiber.Ctx) error { func (_i *workHistoryController) Delete(c *fiber.Ctx) error {
@ -189,9 +198,15 @@ func (_i *workHistoryController) Delete(c *fiber.Ctx) error {
return err return err
} }
authHeader := c.Get("Authorization") userId, err := strconv.ParseUint(c.Query("userId"), 10, 0)
if err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"userId parameter is required and must be a valid number"},
})
}
err = _i.workHistoryService.Delete(authHeader, uint(id)) err = _i.workHistoryService.Delete(uint(userId), uint(id))
if err != nil { if err != nil {
return err return err
} }

View File

@ -3,10 +3,12 @@ package request
import ( import (
"narasi-ahli-be/app/database/entity" "narasi-ahli-be/app/database/entity"
"narasi-ahli-be/utils/paginator" "narasi-ahli-be/utils/paginator"
"strconv"
"time" "time"
) )
type WorkHistoryQueryRequest struct { type WorkHistoryQueryRequest struct {
UserID uint `json:"userId" validate:"required"`
JobTitle *string `json:"jobTitle"` JobTitle *string `json:"jobTitle"`
CompanyName *string `json:"companyName"` CompanyName *string `json:"companyName"`
IsCurrent *bool `json:"isCurrent"` // filter for current job (EndDate is null) IsCurrent *bool `json:"isCurrent"` // filter for current job (EndDate is null)
@ -20,8 +22,9 @@ type WorkHistoryCreateRequest struct {
EndDate *time.Time `json:"endDate"` EndDate *time.Time `json:"endDate"`
} }
func (req WorkHistoryCreateRequest) ToEntity() *entity.WorkHistory { func (req WorkHistoryCreateRequest) ToEntity(userId uint) *entity.WorkHistory {
return &entity.WorkHistory{ return &entity.WorkHistory{
UserID: userId,
JobTitle: req.JobTitle, JobTitle: req.JobTitle,
CompanyName: req.CompanyName, CompanyName: req.CompanyName,
StartDate: req.StartDate, StartDate: req.StartDate,
@ -36,8 +39,9 @@ type WorkHistoryUpdateRequest struct {
EndDate *time.Time `json:"endDate"` EndDate *time.Time `json:"endDate"`
} }
func (req WorkHistoryUpdateRequest) ToEntity() *entity.WorkHistory { func (req WorkHistoryUpdateRequest) ToEntity(userId uint) *entity.WorkHistory {
return &entity.WorkHistory{ return &entity.WorkHistory{
UserID: userId,
JobTitle: req.JobTitle, JobTitle: req.JobTitle,
CompanyName: req.CompanyName, CompanyName: req.CompanyName,
StartDate: req.StartDate, StartDate: req.StartDate,
@ -46,6 +50,7 @@ func (req WorkHistoryUpdateRequest) ToEntity() *entity.WorkHistory {
} }
type WorkHistoryQueryRequestContext struct { type WorkHistoryQueryRequestContext struct {
UserID string `json:"userId"`
JobTitle string `json:"jobTitle"` JobTitle string `json:"jobTitle"`
CompanyName string `json:"companyName"` CompanyName string `json:"companyName"`
IsCurrent string `json:"isCurrent"` IsCurrent string `json:"isCurrent"`
@ -54,6 +59,12 @@ type WorkHistoryQueryRequestContext struct {
func (req WorkHistoryQueryRequestContext) ToParamRequest() WorkHistoryQueryRequest { func (req WorkHistoryQueryRequestContext) ToParamRequest() WorkHistoryQueryRequest {
var request WorkHistoryQueryRequest var request WorkHistoryQueryRequest
if userId := req.UserID; userId != "" {
userIdUint, err := strconv.ParseUint(userId, 10, 0)
if err == nil {
request.UserID = uint(userIdUint)
}
}
if jobTitle := req.JobTitle; jobTitle != "" { if jobTitle := req.JobTitle; jobTitle != "" {
request.JobTitle = &jobTitle request.JobTitle = &jobTitle
} }

View File

@ -8,7 +8,6 @@ import (
"narasi-ahli-be/app/module/work_history/request" "narasi-ahli-be/app/module/work_history/request"
"narasi-ahli-be/app/module/work_history/response" "narasi-ahli-be/app/module/work_history/response"
"narasi-ahli-be/utils/paginator" "narasi-ahli-be/utils/paginator"
utilSvc "narasi-ahli-be/utils/service"
"github.com/rs/zerolog" "github.com/rs/zerolog"
) )
@ -20,11 +19,11 @@ type workHistoryService struct {
} }
type WorkHistoryService interface { type WorkHistoryService interface {
All(authToken string, req request.WorkHistoryQueryRequest) (workHistories []*response.WorkHistoryResponse, paging paginator.Pagination, err error) All(req request.WorkHistoryQueryRequest) (workHistories []*response.WorkHistoryResponse, paging paginator.Pagination, err error)
Show(authToken string, id uint) (workHistory *response.WorkHistoryResponse, err error) Show(userId uint, id uint) (workHistory *response.WorkHistoryResponse, err error)
Save(authToken string, req request.WorkHistoryCreateRequest) (workHistory *response.WorkHistoryResponse, err error) Save(userId uint, req request.WorkHistoryCreateRequest) (workHistory *response.WorkHistoryResponse, err error)
Update(authToken string, id uint, req request.WorkHistoryUpdateRequest) (err error) Update(userId uint, id uint, req request.WorkHistoryUpdateRequest) (err error)
Delete(authToken string, id uint) error Delete(userId uint, id uint) error
} }
func NewWorkHistoryService(repo repository.WorkHistoryRepository, usersRepo usersRepository.UsersRepository, log zerolog.Logger) WorkHistoryService { func NewWorkHistoryService(repo repository.WorkHistoryRepository, usersRepo usersRepository.UsersRepository, log zerolog.Logger) WorkHistoryService {
@ -35,13 +34,8 @@ func NewWorkHistoryService(repo repository.WorkHistoryRepository, usersRepo user
} }
} }
func (_i *workHistoryService) All(authToken string, req request.WorkHistoryQueryRequest) (workHistories []*response.WorkHistoryResponse, paging paginator.Pagination, err error) { func (_i *workHistoryService) All(req request.WorkHistoryQueryRequest) (workHistories []*response.WorkHistoryResponse, paging paginator.Pagination, err error) {
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken) results, paging, err := _i.Repo.GetAll(req.UserID, req)
if userInfo == nil {
return nil, paginator.Pagination{}, errors.New("unauthorized")
}
results, paging, err := _i.Repo.GetAll(userInfo.ID, req)
if err != nil { if err != nil {
return return
} }
@ -53,13 +47,8 @@ func (_i *workHistoryService) All(authToken string, req request.WorkHistoryQuery
return return
} }
func (_i *workHistoryService) Show(authToken string, id uint) (workHistory *response.WorkHistoryResponse, err error) { func (_i *workHistoryService) Show(userId uint, id uint) (workHistory *response.WorkHistoryResponse, err error) {
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken) result, err := _i.Repo.FindOneByUserAndId(userId, id)
if userInfo == nil {
return nil, errors.New("unauthorized")
}
result, err := _i.Repo.FindOneByUserAndId(userInfo.ID, id)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -67,21 +56,15 @@ func (_i *workHistoryService) Show(authToken string, id uint) (workHistory *resp
return mapper.WorkHistoryResponseMapper(result), nil return mapper.WorkHistoryResponseMapper(result), nil
} }
func (_i *workHistoryService) Save(authToken string, req request.WorkHistoryCreateRequest) (workHistory *response.WorkHistoryResponse, err error) { func (_i *workHistoryService) Save(userId uint, req request.WorkHistoryCreateRequest) (workHistory *response.WorkHistoryResponse, err error) {
_i.Log.Info().Interface("data", req).Msg("Creating work history") _i.Log.Info().Interface("data", req).Msg("Creating work history")
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if userInfo == nil {
return nil, errors.New("unauthorized")
}
// Validate business rules // Validate business rules
if req.EndDate != nil && req.EndDate.Before(req.StartDate) { if req.EndDate != nil && req.EndDate.Before(req.StartDate) {
return nil, errors.New("end date cannot be before start date") return nil, errors.New("end date cannot be before start date")
} }
entity := req.ToEntity() entity := req.ToEntity(userId)
entity.UserID = userInfo.ID
result, err := _i.Repo.Create(entity) result, err := _i.Repo.Create(entity)
if err != nil { if err != nil {
@ -91,16 +74,11 @@ func (_i *workHistoryService) Save(authToken string, req request.WorkHistoryCrea
return mapper.WorkHistoryResponseMapper(result), nil return mapper.WorkHistoryResponseMapper(result), nil
} }
func (_i *workHistoryService) Update(authToken string, id uint, req request.WorkHistoryUpdateRequest) (err error) { func (_i *workHistoryService) Update(userId uint, id uint, req request.WorkHistoryUpdateRequest) (err error) {
_i.Log.Info().Interface("data", req).Msg("Updating work history") _i.Log.Info().Interface("data", req).Msg("Updating work history")
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if userInfo == nil {
return errors.New("unauthorized")
}
// Check if record exists and belongs to user // Check if record exists and belongs to user
existing, err := _i.Repo.FindOneByUserAndId(userInfo.ID, id) existing, err := _i.Repo.FindOneByUserAndId(userId, id)
if err != nil { if err != nil {
return err return err
} }
@ -113,20 +91,15 @@ func (_i *workHistoryService) Update(authToken string, id uint, req request.Work
return errors.New("end date cannot be before start date") return errors.New("end date cannot be before start date")
} }
entity := req.ToEntity() entity := req.ToEntity(userId)
return _i.Repo.Update(userInfo.ID, id, entity) return _i.Repo.Update(userId, id, entity)
} }
func (_i *workHistoryService) Delete(authToken string, id uint) error { func (_i *workHistoryService) Delete(userId uint, id uint) error {
_i.Log.Info().Str("authToken", authToken).Uint("id", id).Msg("Deleting work history") _i.Log.Info().Uint("userId", userId).Uint("id", id).Msg("Deleting work history")
userInfo := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if userInfo == nil {
return errors.New("unauthorized")
}
// Check if record exists and belongs to user // Check if record exists and belongs to user
existing, err := _i.Repo.FindOneByUserAndId(userInfo.ID, id) existing, err := _i.Repo.FindOneByUserAndId(userId, id)
if err != nil { if err != nil {
return err return err
} }
@ -134,5 +107,5 @@ func (_i *workHistoryService) Delete(authToken string, id uint) error {
return errors.New("work history not found") return errors.New("work history not found")
} }
return _i.Repo.Delete(userInfo.ID, id) return _i.Repo.Delete(userId, id)
} }

View File

@ -7264,12 +7264,7 @@ const docTemplate = `{
}, },
"/education-history": { "/education-history": {
"get": { "get": {
"security": [ "description": "API for getting all Education History for specific user",
{
"Bearer": []
}
],
"description": "API for getting all Education History for authenticated user",
"tags": [ "tags": [
"Education History" "Education History"
], ],
@ -7295,6 +7290,12 @@ const docTemplate = `{
"name": "schoolName", "name": "schoolName",
"in": "query" "in": "query"
}, },
{
"type": "integer",
"name": "userId",
"in": "query",
"required": true
},
{ {
"type": "integer", "type": "integer",
"name": "count", "name": "count",
@ -7349,12 +7350,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7364,11 +7359,6 @@ const docTemplate = `{
} }
}, },
"post": { "post": {
"security": [
{
"Bearer": []
}
],
"description": "API for create Education History", "description": "API for create Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7383,11 +7373,11 @@ const docTemplate = `{
"required": true "required": true
}, },
{ {
"type": "string", "type": "integer",
"default": "Bearer \u003cAdd access token here\u003e", "description": "User ID",
"description": "Insert your access token", "name": "userId",
"name": "Authorization", "in": "query",
"in": "header" "required": true
}, },
{ {
"description": "Required payload", "description": "Required payload",
@ -7412,12 +7402,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7429,11 +7413,6 @@ const docTemplate = `{
}, },
"/education-history/{id}": { "/education-history/{id}": {
"get": { "get": {
"security": [
{
"Bearer": []
}
],
"description": "API for getting one Education History", "description": "API for getting one Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7446,6 +7425,13 @@ const docTemplate = `{
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
},
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@ -7461,12 +7447,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7476,11 +7456,6 @@ const docTemplate = `{
} }
}, },
"put": { "put": {
"security": [
{
"Bearer": []
}
],
"description": "API for update Education History", "description": "API for update Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7501,6 +7476,13 @@ const docTemplate = `{
"in": "path", "in": "path",
"required": true "required": true
}, },
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
},
{ {
"description": "Required payload", "description": "Required payload",
"name": "payload", "name": "payload",
@ -7524,12 +7506,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7539,11 +7515,6 @@ const docTemplate = `{
} }
}, },
"delete": { "delete": {
"security": [
{
"Bearer": []
}
],
"description": "API for delete Education History", "description": "API for delete Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7563,6 +7534,13 @@ const docTemplate = `{
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
},
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@ -7578,12 +7556,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7595,11 +7567,6 @@ const docTemplate = `{
}, },
"/education-history/{id}/certificate": { "/education-history/{id}/certificate": {
"post": { "post": {
"security": [
{
"Bearer": []
}
],
"description": "API for upload certificate image for Education History", "description": "API for upload certificate image for Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7620,6 +7587,13 @@ const docTemplate = `{
"in": "path", "in": "path",
"required": true "required": true
}, },
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
},
{ {
"type": "file", "type": "file",
"description": "Certificate image file", "description": "Certificate image file",
@ -7641,12 +7615,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -12943,12 +12911,7 @@ const docTemplate = `{
}, },
"/work-history": { "/work-history": {
"get": { "get": {
"security": [ "description": "API for getting all Work History for specific user",
{
"Bearer": []
}
],
"description": "API for getting all Work History for authenticated user",
"tags": [ "tags": [
"Work History" "Work History"
], ],
@ -12970,6 +12933,12 @@ const docTemplate = `{
"name": "jobTitle", "name": "jobTitle",
"in": "query" "in": "query"
}, },
{
"type": "integer",
"name": "userId",
"in": "query",
"required": true
},
{ {
"type": "integer", "type": "integer",
"name": "count", "name": "count",
@ -13024,12 +12993,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -13039,11 +13002,6 @@ const docTemplate = `{
} }
}, },
"post": { "post": {
"security": [
{
"Bearer": []
}
],
"description": "API for create Work History", "description": "API for create Work History",
"tags": [ "tags": [
"Work History" "Work History"
@ -13058,11 +13016,11 @@ const docTemplate = `{
"required": true "required": true
}, },
{ {
"type": "string", "type": "integer",
"default": "Bearer \u003cAdd access token here\u003e", "description": "User ID",
"description": "Insert your access token", "name": "userId",
"name": "Authorization", "in": "query",
"in": "header" "required": true
}, },
{ {
"description": "Required payload", "description": "Required payload",
@ -13087,12 +13045,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -13104,11 +13056,6 @@ const docTemplate = `{
}, },
"/work-history/{id}": { "/work-history/{id}": {
"get": { "get": {
"security": [
{
"Bearer": []
}
],
"description": "API for getting one Work History", "description": "API for getting one Work History",
"tags": [ "tags": [
"Work History" "Work History"
@ -13121,6 +13068,13 @@ const docTemplate = `{
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
},
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@ -13136,12 +13090,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -13151,11 +13099,6 @@ const docTemplate = `{
} }
}, },
"put": { "put": {
"security": [
{
"Bearer": []
}
],
"description": "API for update Work History", "description": "API for update Work History",
"tags": [ "tags": [
"Work History" "Work History"
@ -13176,6 +13119,13 @@ const docTemplate = `{
"in": "path", "in": "path",
"required": true "required": true
}, },
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
},
{ {
"description": "Required payload", "description": "Required payload",
"name": "payload", "name": "payload",
@ -13199,12 +13149,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -13214,11 +13158,6 @@ const docTemplate = `{
} }
}, },
"delete": { "delete": {
"security": [
{
"Bearer": []
}
],
"description": "API for delete Work History", "description": "API for delete Work History",
"tags": [ "tags": [
"Work History" "Work History"
@ -13238,6 +13177,13 @@ const docTemplate = `{
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
},
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@ -13253,12 +13199,6 @@ const docTemplate = `{
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {

View File

@ -7253,12 +7253,7 @@
}, },
"/education-history": { "/education-history": {
"get": { "get": {
"security": [ "description": "API for getting all Education History for specific user",
{
"Bearer": []
}
],
"description": "API for getting all Education History for authenticated user",
"tags": [ "tags": [
"Education History" "Education History"
], ],
@ -7284,6 +7279,12 @@
"name": "schoolName", "name": "schoolName",
"in": "query" "in": "query"
}, },
{
"type": "integer",
"name": "userId",
"in": "query",
"required": true
},
{ {
"type": "integer", "type": "integer",
"name": "count", "name": "count",
@ -7338,12 +7339,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7353,11 +7348,6 @@
} }
}, },
"post": { "post": {
"security": [
{
"Bearer": []
}
],
"description": "API for create Education History", "description": "API for create Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7372,11 +7362,11 @@
"required": true "required": true
}, },
{ {
"type": "string", "type": "integer",
"default": "Bearer \u003cAdd access token here\u003e", "description": "User ID",
"description": "Insert your access token", "name": "userId",
"name": "Authorization", "in": "query",
"in": "header" "required": true
}, },
{ {
"description": "Required payload", "description": "Required payload",
@ -7401,12 +7391,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7418,11 +7402,6 @@
}, },
"/education-history/{id}": { "/education-history/{id}": {
"get": { "get": {
"security": [
{
"Bearer": []
}
],
"description": "API for getting one Education History", "description": "API for getting one Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7435,6 +7414,13 @@
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
},
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@ -7450,12 +7436,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7465,11 +7445,6 @@
} }
}, },
"put": { "put": {
"security": [
{
"Bearer": []
}
],
"description": "API for update Education History", "description": "API for update Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7490,6 +7465,13 @@
"in": "path", "in": "path",
"required": true "required": true
}, },
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
},
{ {
"description": "Required payload", "description": "Required payload",
"name": "payload", "name": "payload",
@ -7513,12 +7495,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7528,11 +7504,6 @@
} }
}, },
"delete": { "delete": {
"security": [
{
"Bearer": []
}
],
"description": "API for delete Education History", "description": "API for delete Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7552,6 +7523,13 @@
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
},
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@ -7567,12 +7545,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -7584,11 +7556,6 @@
}, },
"/education-history/{id}/certificate": { "/education-history/{id}/certificate": {
"post": { "post": {
"security": [
{
"Bearer": []
}
],
"description": "API for upload certificate image for Education History", "description": "API for upload certificate image for Education History",
"tags": [ "tags": [
"Education History" "Education History"
@ -7609,6 +7576,13 @@
"in": "path", "in": "path",
"required": true "required": true
}, },
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
},
{ {
"type": "file", "type": "file",
"description": "Certificate image file", "description": "Certificate image file",
@ -7630,12 +7604,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -12932,12 +12900,7 @@
}, },
"/work-history": { "/work-history": {
"get": { "get": {
"security": [ "description": "API for getting all Work History for specific user",
{
"Bearer": []
}
],
"description": "API for getting all Work History for authenticated user",
"tags": [ "tags": [
"Work History" "Work History"
], ],
@ -12959,6 +12922,12 @@
"name": "jobTitle", "name": "jobTitle",
"in": "query" "in": "query"
}, },
{
"type": "integer",
"name": "userId",
"in": "query",
"required": true
},
{ {
"type": "integer", "type": "integer",
"name": "count", "name": "count",
@ -13013,12 +12982,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -13028,11 +12991,6 @@
} }
}, },
"post": { "post": {
"security": [
{
"Bearer": []
}
],
"description": "API for create Work History", "description": "API for create Work History",
"tags": [ "tags": [
"Work History" "Work History"
@ -13047,11 +13005,11 @@
"required": true "required": true
}, },
{ {
"type": "string", "type": "integer",
"default": "Bearer \u003cAdd access token here\u003e", "description": "User ID",
"description": "Insert your access token", "name": "userId",
"name": "Authorization", "in": "query",
"in": "header" "required": true
}, },
{ {
"description": "Required payload", "description": "Required payload",
@ -13076,12 +13034,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -13093,11 +13045,6 @@
}, },
"/work-history/{id}": { "/work-history/{id}": {
"get": { "get": {
"security": [
{
"Bearer": []
}
],
"description": "API for getting one Work History", "description": "API for getting one Work History",
"tags": [ "tags": [
"Work History" "Work History"
@ -13110,6 +13057,13 @@
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
},
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@ -13125,12 +13079,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -13140,11 +13088,6 @@
} }
}, },
"put": { "put": {
"security": [
{
"Bearer": []
}
],
"description": "API for update Work History", "description": "API for update Work History",
"tags": [ "tags": [
"Work History" "Work History"
@ -13165,6 +13108,13 @@
"in": "path", "in": "path",
"required": true "required": true
}, },
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
},
{ {
"description": "Required payload", "description": "Required payload",
"name": "payload", "name": "payload",
@ -13188,12 +13138,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
@ -13203,11 +13147,6 @@
} }
}, },
"delete": { "delete": {
"security": [
{
"Bearer": []
}
],
"description": "API for delete Work History", "description": "API for delete Work History",
"tags": [ "tags": [
"Work History" "Work History"
@ -13227,6 +13166,13 @@
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
},
{
"type": "integer",
"description": "User ID",
"name": "userId",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@ -13242,12 +13188,6 @@
"$ref": "#/definitions/response.BadRequestError" "$ref": "#/definitions/response.BadRequestError"
} }
}, },
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {

View File

@ -5812,7 +5812,7 @@ paths:
- Ebook Wishlist - Ebook Wishlist
/education-history: /education-history:
get: get:
description: API for getting all Education History for authenticated user description: API for getting all Education History for specific user
parameters: parameters:
- in: query - in: query
name: educationLevel name: educationLevel
@ -5826,6 +5826,10 @@ paths:
- in: query - in: query
name: schoolName name: schoolName
type: string type: string
- in: query
name: userId
required: true
type: integer
- in: query - in: query
name: count name: count
type: integer type: integer
@ -5859,16 +5863,10 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/response.BadRequestError' $ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500": "500":
description: Internal Server Error description: Internal Server Error
schema: schema:
$ref: '#/definitions/response.InternalServerError' $ref: '#/definitions/response.InternalServerError'
security:
- Bearer: []
summary: Get all Education History summary: Get all Education History
tags: tags:
- Education History - Education History
@ -5880,11 +5878,11 @@ paths:
name: X-Csrf-Token name: X-Csrf-Token
required: true required: true
type: string type: string
- default: Bearer <Add access token here> - description: User ID
description: Insert your access token in: query
in: header name: userId
name: Authorization required: true
type: string type: integer
- description: Required payload - description: Required payload
in: body in: body
name: payload name: payload
@ -5900,16 +5898,10 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/response.BadRequestError' $ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500": "500":
description: Internal Server Error description: Internal Server Error
schema: schema:
$ref: '#/definitions/response.InternalServerError' $ref: '#/definitions/response.InternalServerError'
security:
- Bearer: []
summary: Create Education History summary: Create Education History
tags: tags:
- Education History - Education History
@ -5927,34 +5919,38 @@ paths:
name: id name: id
required: true required: true
type: integer type: integer
responses: - description: User ID
"200": in: query
description: OK name: userId
schema: required: true
$ref: '#/definitions/response.Response' type: integer
"400": responses:
description: Bad Request "200":
schema: description: OK
$ref: '#/definitions/response.BadRequestError' schema:
"401": $ref: '#/definitions/response.Response'
description: Unauthorized "400":
schema: description: Bad Request
$ref: '#/definitions/response.UnauthorizedError' schema:
"500": $ref: '#/definitions/response.BadRequestError'
description: Internal Server Error "500":
schema: description: Internal Server Error
$ref: '#/definitions/response.InternalServerError' schema:
security: $ref: '#/definitions/response.InternalServerError'
- Bearer: [] summary: Delete Education History
summary: Delete Education History tags:
tags: - Education History
- Education History get:
get: description: API for getting one Education History
description: API for getting one Education History parameters:
parameters: - description: Education History ID
- description: Education History ID in: path
in: path name: id
name: id required: true
type: integer
- description: User ID
in: query
name: userId
required: true required: true
type: integer type: integer
responses: responses:
@ -5966,16 +5962,10 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/response.BadRequestError' $ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500": "500":
description: Internal Server Error description: Internal Server Error
schema: schema:
$ref: '#/definitions/response.InternalServerError' $ref: '#/definitions/response.InternalServerError'
security:
- Bearer: []
summary: Get one Education History summary: Get one Education History
tags: tags:
- Education History - Education History
@ -5992,6 +5982,11 @@ paths:
name: id name: id
required: true required: true
type: integer type: integer
- description: User ID
in: query
name: userId
required: true
type: integer
- description: Required payload - description: Required payload
in: body in: body
name: payload name: payload
@ -6007,16 +6002,10 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/response.BadRequestError' $ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500": "500":
description: Internal Server Error description: Internal Server Error
schema: schema:
$ref: '#/definitions/response.InternalServerError' $ref: '#/definitions/response.InternalServerError'
security:
- Bearer: []
summary: Update Education History summary: Update Education History
tags: tags:
- Education History - Education History
@ -6034,6 +6023,11 @@ paths:
name: id name: id
required: true required: true
type: integer type: integer
- description: User ID
in: query
name: userId
required: true
type: integer
- description: Certificate image file - description: Certificate image file
in: formData in: formData
name: certificate name: certificate
@ -6048,16 +6042,10 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/response.BadRequestError' $ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500": "500":
description: Internal Server Error description: Internal Server Error
schema: schema:
$ref: '#/definitions/response.InternalServerError' $ref: '#/definitions/response.InternalServerError'
security:
- Bearer: []
summary: Upload Certificate for Education History summary: Upload Certificate for Education History
tags: tags:
- Education History - Education History
@ -9423,7 +9411,7 @@ paths:
- Users - Users
/work-history: /work-history:
get: get:
description: API for getting all Work History for authenticated user description: API for getting all Work History for specific user
parameters: parameters:
- in: query - in: query
name: companyName name: companyName
@ -9435,6 +9423,10 @@ paths:
- in: query - in: query
name: jobTitle name: jobTitle
type: string type: string
- in: query
name: userId
required: true
type: integer
- in: query - in: query
name: count name: count
type: integer type: integer
@ -9468,16 +9460,10 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/response.BadRequestError' $ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500": "500":
description: Internal Server Error description: Internal Server Error
schema: schema:
$ref: '#/definitions/response.InternalServerError' $ref: '#/definitions/response.InternalServerError'
security:
- Bearer: []
summary: Get all Work History summary: Get all Work History
tags: tags:
- Work History - Work History
@ -9489,11 +9475,11 @@ paths:
name: X-Csrf-Token name: X-Csrf-Token
required: true required: true
type: string type: string
- default: Bearer <Add access token here> - description: User ID
description: Insert your access token in: query
in: header name: userId
name: Authorization required: true
type: string type: integer
- description: Required payload - description: Required payload
in: body in: body
name: payload name: payload
@ -9509,16 +9495,10 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/response.BadRequestError' $ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500": "500":
description: Internal Server Error description: Internal Server Error
schema: schema:
$ref: '#/definitions/response.InternalServerError' $ref: '#/definitions/response.InternalServerError'
security:
- Bearer: []
summary: Create Work History summary: Create Work History
tags: tags:
- Work History - Work History
@ -9536,34 +9516,38 @@ paths:
name: id name: id
required: true required: true
type: integer type: integer
responses: - description: User ID
"200": in: query
description: OK name: userId
schema: required: true
$ref: '#/definitions/response.Response' type: integer
"400": responses:
description: Bad Request "200":
schema: description: OK
$ref: '#/definitions/response.BadRequestError' schema:
"401": $ref: '#/definitions/response.Response'
description: Unauthorized "400":
schema: description: Bad Request
$ref: '#/definitions/response.UnauthorizedError' schema:
"500": $ref: '#/definitions/response.BadRequestError'
description: Internal Server Error "500":
schema: description: Internal Server Error
$ref: '#/definitions/response.InternalServerError' schema:
security: $ref: '#/definitions/response.InternalServerError'
- Bearer: [] summary: Delete Work History
summary: Delete Work History tags:
tags: - Work History
- Work History get:
get: description: API for getting one Work History
description: API for getting one Work History parameters:
parameters: - description: Work History ID
- description: Work History ID in: path
in: path name: id
name: id required: true
type: integer
- description: User ID
in: query
name: userId
required: true required: true
type: integer type: integer
responses: responses:
@ -9575,16 +9559,10 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/response.BadRequestError' $ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500": "500":
description: Internal Server Error description: Internal Server Error
schema: schema:
$ref: '#/definitions/response.InternalServerError' $ref: '#/definitions/response.InternalServerError'
security:
- Bearer: []
summary: Get one Work History summary: Get one Work History
tags: tags:
- Work History - Work History
@ -9601,6 +9579,11 @@ paths:
name: id name: id
required: true required: true
type: integer type: integer
- description: User ID
in: query
name: userId
required: true
type: integer
- description: Required payload - description: Required payload
in: body in: body
name: payload name: payload
@ -9616,16 +9599,10 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/response.BadRequestError' $ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500": "500":
description: Internal Server Error description: Internal Server Error
schema: schema:
$ref: '#/definitions/response.InternalServerError' $ref: '#/definitions/response.InternalServerError'
security:
- Bearer: []
summary: Update Work History summary: Update Work History
tags: tags:
- Work History - Work History