chore(core-edu): merge core-edu full implementation into main

Merge feat/core-edu-ai08 with complete teaching core service
This commit is contained in:
SpecialX
2026-07-10 19:12:44 +08:00
55 changed files with 4111 additions and 325 deletions

View File

@@ -2,18 +2,38 @@ syntax = "proto3";
package next_edu_cloud.events.v1;
// Cross-service event contracts published via the transactional outbox pattern
// and consumed by downstream services (notifications, analytics, audit, etc.).
// Topics follow the convention edu.<domain>.<aggregate>.<action>.
// Cross-service event contracts published by CoreEdu via the transactional
// outbox pattern and consumed by downstream services (notifications, analytics,
// audit, etc.).
//
// Event routing (TOPIC_MAP in outbox publisher):
// edu.exam.events <- exam.created / exam.updated / exam.deleted
// edu.homework.events <- homework.assigned / homework.submitted / homework.graded
// edu.grade.events <- grade.recorded / grade.updated
// edu.class.events <- class.transferred
// edu.iam.user.events <- user.created / user.updated / user.disabled / user.role_changed
// edu.iam.role.events <- role.created / role.updated
// edu.iam.audit.created <- audit (unified audit topic, action field distinguishes)
// Topic naming follows the arbitration in coord-cross-review §3.1:
// edu.teaching.<aggregate>.<action>
//
// Event routing (TOPIC_MAP in outbox.publisher.ts):
// edu.teaching.exam.created <- ExamEvent.created
// edu.teaching.exam.updated <- ExamEvent.updated
// edu.teaching.exam.published <- ExamEvent.published
// edu.teaching.exam.submitted <- ExamEvent.submitted
// edu.teaching.exam.deleted <- ExamEvent.deleted
// edu.teaching.homework.assigned <- HomeworkEvent.assigned
// edu.teaching.homework.submitted <- HomeworkEvent.submitted
// edu.teaching.homework.graded <- HomeworkEvent.graded
// edu.teaching.grade.recorded <- GradeEvent.recorded
// edu.teaching.grade.updated <- GradeEvent.updated
// edu.teaching.attendance.recorded <- AttendanceEvent.recorded
// edu.teaching.class.transferred <- ClassEvent.transferred
//
// All events MUST include:
// - schema_version: event schema version (default "v1")
// - event_id: UUID for idempotent consumption
// - occurred_at: business timestamp (ms epoch)
// - metadata: { traceId, userId }
message EventMetadata {
string schema_version = 1;
string trace_id = 2;
string user_id = 3;
}
message ClassEvent {
string event_id = 1;
@@ -23,7 +43,7 @@ message ClassEvent {
string class_id = 5;
string name = 6;
string action = 7;
map<string, string> metadata = 8;
EventMetadata metadata = 8;
}
message ExamEvent {
@@ -33,9 +53,10 @@ message ExamEvent {
int64 occurred_at = 4;
string exam_id = 5;
string class_id = 6;
string title = 7;
string action = 8;
map<string, string> metadata = 9;
string subject_id = 7;
string title = 8;
string action = 9;
EventMetadata metadata = 10;
}
message HomeworkEvent {
@@ -45,9 +66,10 @@ message HomeworkEvent {
int64 occurred_at = 4;
string homework_id = 5;
string class_id = 6;
string title = 7;
string action = 8;
map<string, string> metadata = 9;
string subject_id = 7;
string title = 8;
string action = 9;
EventMetadata metadata = 10;
}
message GradeEvent {
@@ -58,8 +80,21 @@ message GradeEvent {
string grade_id = 5;
string student_id = 6;
string score = 7;
string action = 8;
map<string, string> metadata = 9;
string total_score = 8;
string action = 9;
EventMetadata metadata = 10;
}
message AttendanceEvent {
string event_id = 1;
string aggregate_id = 2;
string event_type = 3;
int64 occurred_at = 4;
string attendance_id = 5;
string schedule_id = 6;
string student_id = 7;
string status = 8;
EventMetadata metadata = 9;
}
// IAM 用户事件edu.iam.user.events topic