Skip to content

Commit cb63b15

Browse files
authored
feat: add categories in API v3 (#877)
1 parent e862a5a commit cb63b15

15 files changed

+2120
-21
lines changed

api/docs.go

Lines changed: 462 additions & 2 deletions
Large diffs are not rendered by default.

api/swagger.json

Lines changed: 462 additions & 2 deletions
Large diffs are not rendered by default.

api/swagger.yaml

Lines changed: 319 additions & 2 deletions
Large diffs are not rendered by default.

pkg/controllers/category.go renamed to pkg/controllers/category_v1.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ func (co Controller) RegisterCategoryRoutes(r *gin.RouterGroup) {
113113
// @Tags Categories
114114
// @Success 204
115115
// @Router /v1/categories [options]
116+
// @Deprecated true
116117
func (co Controller) OptionsCategoryList(c *gin.Context) {
117118
httputil.OptionsGetPost(c)
118119
}
@@ -128,6 +129,7 @@ func (co Controller) OptionsCategoryList(c *gin.Context) {
128129
// @Failure 500 {object} httperrors.HTTPError
129130
// @Param id path string true "ID formatted as string"
130131
// @Router /v1/categories/{id} [options]
132+
// @Deprecated true
131133
func (co Controller) OptionsCategoryDetail(c *gin.Context) {
132134
id, err := uuid.Parse(c.Param("id"))
133135
if err != nil {
@@ -154,6 +156,7 @@ func (co Controller) OptionsCategoryDetail(c *gin.Context) {
154156
// @Failure 500 {object} httperrors.HTTPError
155157
// @Param category body models.CategoryCreate true "Category"
156158
// @Router /v1/categories [post]
159+
// @Deprecated true
157160
func (co Controller) CreateCategory(c *gin.Context) {
158161
var create models.CategoryCreate
159162

@@ -197,6 +200,7 @@ func (co Controller) CreateCategory(c *gin.Context) {
197200
// @Param budget query string false "Filter by budget ID"
198201
// @Param hidden query bool false "Is the category hidden?"
199202
// @Param search query string false "Search for this text in name and note"
203+
// @Deprecated true
200204
func (co Controller) GetCategories(c *gin.Context) {
201205
var filter CategoryQueryFilter
202206

@@ -247,6 +251,7 @@ func (co Controller) GetCategories(c *gin.Context) {
247251
// @Failure 500 {object} httperrors.HTTPError
248252
// @Param id path string true "ID formatted as string"
249253
// @Router /v1/categories/{id} [get]
254+
// @Deprecated true
250255
func (co Controller) GetCategory(c *gin.Context) {
251256
id, err := uuid.Parse(c.Param("id"))
252257
if err != nil {
@@ -276,6 +281,7 @@ func (co Controller) GetCategory(c *gin.Context) {
276281
// @Param id path string true "ID formatted as string"
277282
// @Param category body models.CategoryCreate true "Category"
278283
// @Router /v1/categories/{id} [patch]
284+
// @Deprecated true
279285
func (co Controller) UpdateCategory(c *gin.Context) {
280286
id, err := uuid.Parse(c.Param("id"))
281287
if err != nil {
@@ -320,6 +326,7 @@ func (co Controller) UpdateCategory(c *gin.Context) {
320326
// @Failure 500 {object} httperrors.HTTPError
321327
// @Param id path string true "ID formatted as string"
322328
// @Router /v1/categories/{id} [delete]
329+
// @Deprecated true
323330
func (co Controller) DeleteCategory(c *gin.Context) {
324331
id, err := uuid.Parse(c.Param("id"))
325332
if err != nil {
File renamed without changes.

0 commit comments

Comments
 (0)