Files
dth/openspec/changes/chg_0006_lms_bootstrap/spec.md
T

38 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
change_id: chg_0006
owner: pd@dth
status: draft
requires_human_validation: false
---
# Spec: lms
## Requirement
WHEN 管理员调用学员/课程列表接口 THE SYSTEM SHALL 返回资源列表(含 seed 初始数据)。
WHEN 管理员对学员/课程发起 create/update/delete/enroll THE SYSTEM SHALL 返回操作结果。
## ADDED Scenarios
### S1 list_students_returns_seeded
- **WHEN** admin GET /api/ssw/dth/lms/students
- **THEN** 响应 data 数组长度 ≥ 2,每个元素含 id/student_no/name/email/created_at
### S2 create_then_get_student
- **WHEN** admin POST /api/ssw/dth/lms/students body={"student_no":"S2026001","name":"张三","email":"zhangsan@school.edu"}
- **THEN** data.id 为 36 位 UUID
- **AND** GET /api/ssw/dth/lms/students/:id 的 data.name == "张三"
### S3 list_courses_returns_seeded
- **WHEN** admin GET /api/ssw/dth/lms/courses
- **THEN** 响应 data 数组长度 ≥ 2,每个元素含 id/code/name/credits/instructor/created_at
### S4 enroll_student_to_course
- **WHEN** admin POST /api/ssw/dth/lms/courses/:courseId/enroll body={"student_id":"<seed student id>"}
- **THEN** 响应 code = 200
- **AND** GET /api/ssw/dth/lms/students/:studentId/enrollments 返回 ≥ 1 条含 course_id=enrolled
### all test_runner_and_gate_pass
- **WHEN** 跑 `bash tests/e2e/dth_lms.test.sh`
- **THEN** C5_test_runner_passes_all 通过(≥4 S 场景断言)
- **AND** 跑 `bash openspec/scripts/check_spec_coverage.sh`
- **AND** C6_check_spec_coverage_gap_zero 通过(gap=0)