实现工单核心:创建、列表、状态流转与分派
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- backend
Research direction
Start with the referenced designs in issues #2, #3, and #4, then inspect the validator in #12 and event contract in #7. The issue calls for ticket migrations and repository work, creation, filtering, workflow transitions, assignments, and integration tests. Done means the listed state paths and errors behave as specified, concurrent creation produces unique ticket numbers, and requesters receive 404 for other users’ tickets.
Written by the indexing model from the issue text.
Description
Background
工单域的核心逻辑。设计见 #2(表)、#3(端点与语义)、#4(workflow 运行时)。本 issue 实现创建、列表、详情、状态流转与分派。
Technical requirement
- 创建:
POST /api/tickets;custom_fields按该类型 form_schema 校验(调 #12 的校验器)后落库;工单号取租户内递增序号(行锁或等价方案保证并发唯一);初始 state 取 workflow 的initial;发布ticket.created事件; - 列表:筛选(type / state / assignee / priority / keyword)+ 分页契约;requester 只见自己创建的;keyword 匹配标题与工单号;
- 详情:返回工单全量 + 类型摘要(状态名、可用 transitions 预计算,供前端渲染按钮);
- 状态流转:
POST /api/tickets/:id/transitions按 action 查 workflow,校验角色(#6 矩阵与creator相对角色取交集),更新state,写 timelinestate_change(meta 含 from / to / action),维护closed_at,发布ticket.state_changed;非法动作返回STATE_CONFLICT; - 分派 / 转交:
POST /api/tickets/:id/assignments,仅 agent / tenant_admin;写 timelineassignment,发布ticket.assigned; - 事件发布走
internal/events(#7 契约:事务提交后同步分发,订阅者 panic 隔离)。
Expect
- 状态机集成测试:合法路径全走通(pending → processing → confirming → closed → reopen)、每类非法流转(错误角色、不存在的 action、final 后无 reopen 的动作)均返回
STATE_CONFLICT或FORBIDDEN; - 并发创建工单号不重号(并发测试);
- requester 越权查看他人工单返回 404。
Potential TODO list
- tickets 迁移与 repository(索引见 #2)
- 工单号生成(并发安全)
- 创建 + 校验 + 事件
- 列表筛选与分页
- transitions 状态机
- assignments 分派
- 集成测试
依赖
#12(类型与校验器)。
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LinuxSuRen/tick-flow
-
项目门面:logo、README 与仓库 AboutPossibly taken @linuxsuren-fs claimed this 9 days ago. Opendocumentation good first issue help wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 20/100
LinuxSuRen/tick-flow#20 ·
-
编写四个内置种子模板包Possibly taken @linuxsuren-fs claimed this 9 days ago. Opengood first issue help wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 35/100
LinuxSuRen/tick-flow#19 ·
-
实现处理工作台前端:列表、详情与处理动作Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 5/5 Over a week Newbie friendliness 25/100
LinuxSuRen/tick-flow#18 ·
-
实现提交门户前端:表单渲染器与我的工单Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 25/100
LinuxSuRen/tick-flow#17 ·
-
实现站内通知与邮件通知Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 25/100
LinuxSuRen/tick-flow#16 ·
All issues in LinuxSuRen/tick-flow
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
vetro-protocol/vetro-monorepo#1262 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ProyectoRespira/respira-webapp#334 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100