dokumentasi antrian operasi

This commit is contained in:
renaldybrada
2026-02-02 09:24:11 +07:00
parent 919085ba3a
commit 3edbd8b193
10 changed files with 1222 additions and 10 deletions

No files matched your search

+4 -2
View File
@@ -19,8 +19,9 @@ func NewDokterHandler(repo IDokterRepository) DokterHandler {
// GetListDokter godoc
// @Summary Get List Dokter
// @Tags dokter
// @Success 200 {shared.BaseResponse} []DokterResponse
// @Tags Dokter
// @Param search query string false "Search keyword"
// @Success 200 {object} []DokterResponse
// @Failure 500 {object} shared.BaseErrorResponse
// @Router /dokter/ [get]
func (h DokterHandler) ListDokter(c *gin.Context) {
@@ -34,6 +35,7 @@ func (h DokterHandler) ListDokter(c *gin.Context) {
Message: err.Error(),
}
c.JSON(http.StatusInternalServerError, errorResponse)
return
}
response := baseResponse.ToBaseResponse(
+14 -1
View File
@@ -16,10 +16,23 @@ func NewKategoriHandler(repo IKategoriRepository) KategoriHandler {
return KategoriHandler{repo}
}
// ListKategoriOperasi godoc
// @Summary Get List Kategori Operasi
// @Tags Kategori Operasi
// @Param search query string false "Search keyword"
// @Success 200 {object} []KategoriOperasiModel
// @Failure 500 {object} shared.BaseErrorResponse
// @Router /kategori/ [get]
func (h KategoriHandler) ListKategoriOperasi(c *gin.Context) {
list, err := h.repo.SearchableListKategori(c)
if err != nil {
c.JSON(http.StatusInternalServerError, err)
errorResponse := baseResponse.BaseErrorResponse{
Success: false,
Code: 500,
Message: err.Error(),
}
c.JSON(http.StatusInternalServerError, errorResponse)
return
}
response := baseResponse.ToBaseResponse(list, true, 200, "success get kategori operasi")
+1 -1
View File
@@ -10,5 +10,5 @@ type KategoriOperasiModel struct {
Status string `json:"status" db:"status" validate:"oneof=draft published"`
Kategori string `json:"kategori" db:"kategori"`
DateCreated time.Time `json:"date_created" db:"date_created"`
DateUpdated sql.NullTime `json:"date_updated" db:"date_updated"`
DateUpdated sql.NullTime `json:"date_updated" db:"date_updated" swaggertype:"string"`
}
+29 -2
View File
@@ -16,10 +16,23 @@ func NewSpesialisHandler(repo ISpesialisRepository) SpesialisHandler {
return SpesialisHandler{repo}
}
// ListSpesialis godoc
// @Summary Get List Spesialis
// @Tags Spesialis
// @Param search query string false "Search keyword"
// @Success 200 {object} []SpesialisModel
// @Failure 500 {object} shared.BaseErrorResponse
// @Router /spesialis/ [get]
func (h SpesialisHandler) ListSpesialis(c *gin.Context) {
list, err := h.repo.SearchableListSpesialis(c)
if err != nil {
c.JSON(http.StatusInternalServerError, err)
errorResponse := baseResponse.BaseErrorResponse{
Success: false,
Code: 500,
Message: err.Error(),
}
c.JSON(http.StatusInternalServerError, errorResponse)
return
}
response := baseResponse.ToBaseResponse(list, true, 200, "success get list spesialis")
@@ -27,10 +40,24 @@ func (h SpesialisHandler) ListSpesialis(c *gin.Context) {
c.JSON(http.StatusOK, response)
}
// ListSubSpesialis godoc
// @Summary Get List Sub Spesialis
// @Tags Spesialis
// @Param search query string false "Search keyword"
// @Param id_spesialis query int false "Filter by Id Spesialis"
// @Success 200 {object} []SubSpesialisModel
// @Failure 500 {object} shared.BaseErrorResponse
// @Router /sub-spesialis/ [get]
func (h SpesialisHandler) ListSubSpesialis(c *gin.Context) {
list, err := h.repo.SearchableListSubSpesialis(c)
if err != nil {
c.JSON(http.StatusInternalServerError, err)
errorResponse := baseResponse.BaseErrorResponse{
Success: false,
Code: 500,
Message: err.Error(),
}
c.JSON(http.StatusInternalServerError, errorResponse)
return
}
response := baseResponse.ToBaseResponse(list, true, 200, "success get list spesialis")
@@ -124,6 +124,8 @@ func (r spesialisRepo) SearchableListSubSpesialis(c *gin.Context) ([]SubSpesiali
searchFilters := []queryUtils.DynamicFilter{
{Column: "dss.Kode", Operator: queryUtils.OpILike, Value: "%" + search + "%"},
{Column: "dss.Subspesialis", Operator: queryUtils.OpILike, Value: "%" + search + "%"},
{Column: "ds.Kode", Operator: queryUtils.OpILike, Value: "%" + search + "%"},
{Column: "ds.Spesialis", Operator: queryUtils.OpILike, Value: "%" + search + "%"},
}
query.Filters = append(query.Filters, queryUtils.FilterGroup{Filters: searchFilters, LogicOp: "OR"})
}