diff --git a/.github/workflows/partial-backend.yaml b/.github/workflows/partial-backend.yaml index fe4dac23..c534f902 100644 --- a/.github/workflows/partial-backend.yaml +++ b/.github/workflows/partial-backend.yaml @@ -34,3 +34,8 @@ jobs: - name: Test run: task go:coverage + + - name: Validate OpenAPI definition + uses: swaggerexpert/swagger-editor-validate@v1 + with: + definition-file: backend/app/api/static/docs/swagger.json diff --git a/Taskfile.yml b/Taskfile.yml index dc3f73c4..1eb74f50 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -28,7 +28,6 @@ tasks: - "./backend/internal/data/**" - "./backend/internal/core/services/**/*" - "./backend/app/tools/typegen/main.go" - typescript-types: desc: Generates typescript types from swagger definition cmds: @@ -116,6 +115,21 @@ tasks: cmds: - cd backend && go run app/tools/migrations/main.go {{ .CLI_ARGS }} + db:migration:postgresql: + env: + HBOX_DATABASE_DRIVER: postgres + HBOX_DATABASE_USERNAME: homebox + HBOX_DATABASE_PASSWORD: homebox + HBOX_DATABASE_DATABASE: homebox + HBOX_DATABASE_HOST: localhost + HBOX_DATABASE_PORT: 5432 + HBOX_DATABASE_SSL_MODE: disable + desc: Runs the database diff engine to generate a SQL migration files for postgresql + deps: + - db:generate + cmds: + - cd backend && go run app/tools/migrations/main.go {{ .CLI_ARGS }} + ui:watch: desc: Starts the vitest test runner in watch mode dir: frontend diff --git a/backend/app/api/handlers/v1/v1_ctrl_maint_entry.go b/backend/app/api/handlers/v1/v1_ctrl_maint_entry.go index e9f1f97c..b981405b 100644 --- a/backend/app/api/handlers/v1/v1_ctrl_maint_entry.go +++ b/backend/app/api/handlers/v1/v1_ctrl_maint_entry.go @@ -15,6 +15,7 @@ import ( // @Summary Get Maintenance Log // @Tags Item Maintenance // @Produce json +// @Param id path string true "Item ID" // @Param filters query repo.MaintenanceFilters false "which maintenance to retrieve" // @Success 200 {array} repo.MaintenanceEntryWithDetails[] // @Router /v1/items/{id}/maintenance [GET] @@ -33,6 +34,7 @@ func (ctrl *V1Controller) HandleMaintenanceLogGet() errchain.HandlerFunc { // @Summary Create Maintenance Entry // @Tags Item Maintenance // @Produce json +// @Param id path string true "Item ID" // @Param payload body repo.MaintenanceEntryCreate true "Entry Data" // @Success 201 {object} repo.MaintenanceEntry // @Router /v1/items/{id}/maintenance [POST] diff --git a/backend/app/api/handlers/v1/v1_ctrl_maintenance.go b/backend/app/api/handlers/v1/v1_ctrl_maintenance.go index 647bfa70..ed539a6d 100644 --- a/backend/app/api/handlers/v1/v1_ctrl_maintenance.go +++ b/backend/app/api/handlers/v1/v1_ctrl_maintenance.go @@ -33,6 +33,7 @@ func (ctrl *V1Controller) HandleMaintenanceGetAll() errchain.HandlerFunc { // @Summary Update Maintenance Entry // @Tags Maintenance // @Produce json +// @Param id path string true "Maintenance ID" // @Param payload body repo.MaintenanceEntryUpdate true "Entry Data" // @Success 200 {object} repo.MaintenanceEntry // @Router /v1/maintenance/{id} [PUT] diff --git a/backend/app/api/handlers/v1/v1_ctrl_notifiers.go b/backend/app/api/handlers/v1/v1_ctrl_notifiers.go index f46b9102..697605c4 100644 --- a/backend/app/api/handlers/v1/v1_ctrl_notifiers.go +++ b/backend/app/api/handlers/v1/v1_ctrl_notifiers.go @@ -86,7 +86,6 @@ func (ctrl *V1Controller) HandleUpdateNotifier() errchain.HandlerFunc { // @Summary Test Notifier // @Tags Notifiers // @Produce json -// @Param id path string true "Notifier ID" // @Param url query string true "URL" // @Success 204 // @Router /v1/notifiers/test [POST]