实现工单类型(模板包)管理 API

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

@linuxsuren-fs is already working on this.

Since Nov 14, 2026.

  • #22 by @linuxsuren-fs — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
go, yaml

Research direction

Read the designs in issues #2, #3, and #4, then check the tenant and member work in #11 and the shared fixtures in #19. Start with the ticket_types migration and repository, followed by the Go validators in internal/templating and seed/*.yaml. Done means validator unit tests cover invalid examples and the create, query, update, and deactivate integration tests pass; an open linked pull request (#22) shows work is already underway.

Written by the indexing model from the issue text.

Description

help wanted P0

Background

模板包的管理侧。设计见 #4(各 JSONB 结构与校验规则)、#2(表)、#3(端点)。本 issue 实现工单类型的 CRUD 与全部校验器。

Technical requirement

  • 端点:类型列表 / 创建 / 详情 / 更新 / 停用启用(#3 清单),角色 tenant_admin;
  • Go 校验器(独立包 internal/templating,便于测试与前端对齐):
    • form_schema:类型集、字段 key 蛇形且不重复、options / 校验项合法;
    • workflow:唯一 initial、至少一个 final、from / to 存在、action 同状态下不重复;
    • assignment:mode 枚举合法(P0 仅 manual);
    • view_config:field 引用必须存在于内置字段或 form_schema;
    • sla_policy:数值为非负整数即可(计时 P1);
  • 校验错误返回 VALIDATION_FAILED,message 逐字段列出原因(英文,面向开发者);
  • 新租户导入种子模板包:读取 seed/*.yaml,复制为该租户的初始类型(is_builtin = true);
  • 校验器测试 fixtures 与 seed/ 共用(见 #19),保证前后端语义同源。

Expect

  • 校验器单测覆盖每个非法样例(未知字段类型、重复 key、悬空状态引用等);
  • 创建 - 查询 - 更新 - 停用的接口集成测试通过。

Potential TODO list

  • ticket_types 迁移与 repository
  • 校验器包 + 单测
  • CRUD 端点与集成测试
  • 种子导入机制

依赖

#4 评审通过;#11(租户与成员,登录可用)。

Dominant language
No language data
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LinuxSuRen/tick-flow

All issues in LinuxSuRen/tick-flow

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.