feat: add PATCH /tags/{id}/rules/{then_id} to activate/deactivate rules

- openapi.yaml: new PATCH endpoint with is_active body, returns TagRule
- backend/service: SetRuleActive calls repo.SetActive then returns updated rule
- backend/handler: PatchRule validates body and delegates to service
- backend/router: register PATCH /:tag_id/rules/:then_tag_id
- frontend: TagRuleEditor uses PATCH instead of delete+recreate
- mock: handle PATCH /tags/{id}/rules/{then_id}

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-05 23:31:12 +03:00
parent 871250345a
commit 21f3acadf0
6 changed files with 97 additions and 6 deletions
+31
View File
@@ -825,6 +825,37 @@ paths:
$ref: '#/components/schemas/TagRule'
/tags/{tag_id}/rules/{then_tag_id}:
patch:
tags: [Tags]
summary: Update a tag rule (activate / deactivate)
parameters:
- $ref: '#/components/parameters/tag_id'
- name: then_tag_id
in: path
required: true
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [is_active]
properties:
is_active:
type: boolean
responses:
'200':
description: Rule updated
content:
application/json:
schema:
$ref: '#/components/schemas/TagRule'
'404':
$ref: '#/components/responses/NotFound'
delete:
tags: [Tags]
summary: Remove a tag rule