feat(identity): группы-когорты, история и импорт v2

This commit is contained in:
2026-10-26 15:47:49 +03:00
parent 24a92632fd
commit 07a223b759
34 changed files with 1459 additions and 248 deletions

View File

@@ -12,6 +12,8 @@ classDiagram
+String login
+String passwordHash
+LmsRole role
+AccountStatus status
+Instant archivedAt
+Boolean mustChangePassword
+String tempPassword
+Instant createdAt
@@ -25,11 +27,19 @@ classDiagram
+String middleName
+String basis
+String note
+StudentStatus status
+Short enrollmentYear
+String fullName
}
class GroupEntity {
+UUID id
+String name
+String stream
+Short course
+Short number
+String degree
+Short enrollmentYear
+GroupStatus status
+Int taskDurationMin
+Instant createdAt
}
@@ -37,6 +47,17 @@ classDiagram
+UUID id
+Instant enrolledAt
}
class MembershipHistory {
+UUID id
+UUID studentId
+UUID fromGroupId
+UUID toGroupId
+MembershipAction action
+String reason
+UUID actorAccountId
+UUID promotionRunId
+Instant at
}
class Setting {
+String key
+String value
@@ -44,12 +65,15 @@ classDiagram
class LmsRole {
<<enumeration>>
ADMIN
TEACHER
STUDENT
}
Account "1" --> "1" Student : @MapsId account_id
GroupEntity "1" --> "*" Enrollment : group_id
Student "1" --> "*" Enrollment : student_id
Student "1" --> "*" MembershipHistory : student_id
GroupEntity "1" --> "*" MembershipHistory : from/to_group_id
Account --> LmsRole : role
```
@@ -68,20 +92,28 @@ classDiagram
class GroupService {
+list() List~GroupSummary~
+create(CreateGroupRequest) GroupSummary
+createStudent(UUID, CreateStudentRequest) Credential
+createStudent(UUID, CreateStudentRequest, UUID) Credential
+candidates(UUID) List~StudentCandidate~
+enroll(UUID, UUID) GroupDetail
+unenroll(UUID, UUID) GroupDetail
+import(String, String, ByteArray) ImportResult
+enroll(UUID, UUID, UUID) GroupDetail
+unenroll(UUID, UUID, UUID) GroupDetail
+groupOfStudent(UUID) GroupSummary
+detail(UUID) GroupDetail
+resetPassword(UUID) ResetPasswordResponse
+credentials(UUID, String) ExportFile
}
class GroupImportService {
+import(String, ByteArray, UUID) ImportResult
}
class GroupCohortResolver {
+resolve(CreateGroupRequest) GroupCohort
+validate(GroupCohort) GroupCohort
+defaultEnrollmentYear(Short) Short
}
class AccountRepository
class GroupRepository
class EnrollmentRepository
class StudentRepository
class MembershipHistoryRepository
class SettingRepository
class StudentImportParser {
+parse(String, ByteArray) ParsedGroup
@@ -96,6 +128,7 @@ classDiagram
AuthController --> AuthService
GroupController --> GroupService
GroupController --> GroupImportService
StudentController --> GroupService
AuthService --> AccountRepository
AuthService --> StudentRepository
@@ -103,7 +136,14 @@ classDiagram
GroupService --> EnrollmentRepository
GroupService --> StudentRepository
GroupService --> AccountRepository
GroupService --> StudentImportParser
GroupService --> MembershipHistoryRepository
GroupService --> GroupCohortResolver
GroupImportService --> GroupRepository
GroupImportService --> EnrollmentRepository
GroupImportService --> StudentRepository
GroupImportService --> AccountRepository
GroupImportService --> MembershipHistoryRepository
GroupImportService --> StudentImportParser
GroupService --> CredentialsExporter
GroupService --> Passwords
```
@@ -516,6 +556,8 @@ erDiagram
varchar login UK
varchar password_hash
varchar role
varchar status
timestamptz archived_at
boolean must_change_password
varchar temp_password
timestamptz created_at
@@ -529,10 +571,18 @@ erDiagram
varchar middle_name
varchar basis
text note
varchar status
smallint enrollment_year
}
GROUPS {
uuid id PK
varchar name UK
varchar name
varchar stream
smallint course
smallint number
varchar degree
smallint enrollment_year
varchar status
int task_duration_min
timestamptz created_at
}
@@ -542,14 +592,27 @@ erDiagram
uuid student_id FK
timestamptz enrolled_at
}
MEMBERSHIP_HISTORY {
uuid id PK
uuid student_id FK
uuid from_group_id FK
uuid to_group_id FK
varchar action
text reason
uuid actor_account_id
uuid promotion_run_id
timestamptz at
}
SETTINGS {
varchar key PK
varchar value
}
ACCOUNTS ||--|| STUDENTS : "account_id"
ACCOUNTS ||--o| STUDENTS : "account_id"
GROUPS ||--o{ ENROLLMENTS : "group_id"
STUDENTS ||--o{ ENROLLMENTS : "student_id"
STUDENTS ||--o{ MEMBERSHIP_HISTORY : "student_id"
GROUPS ||--o{ MEMBERSHIP_HISTORY : "from/to_group_id"
SEMESTERS {
uuid id PK