Story 2: Class & Section Management
Overview
| Field | Value |
|---|---|
| Story ID | NGE-13-2 |
| Story Points | 8 |
| Sprint | Sprint 7 |
User Story
As a School Admin
I want to manage classes and sections with capacity planning
So that I can organize students effectively
Technical Implementation
Create Academic Year Structure
@Injectable()
export class ClassesService {
async createAcademicYearStructure(academicYear: string) {
const classes = [
{ name: 'LKG', gradeLevel: 0 },
{ name: 'UKG', gradeLevel: 1 },
...Array.from({ length: 12 }, (_, i) => ({
name: `${i + 1}`,
gradeLevel: i + 2,
})),
];
// Create classes and sections in transaction
await this.prisma.$transaction(async (tx) => {
for (const cls of classes) {
const classRecord = await tx.class.create({ data: cls });
// Create sections A, B, C
for (const name of ['A', 'B', 'C']) {
await tx.section.create({
data: { classId: classRecord.id, name, capacity: 40 }
});
}
}
});
}
}
Tasks
| Task | Title | Estimate |
|---|---|---|
| T1 | Create class/section tables | 2h |
| T2 | Implement ClassesService | 6h |
| T3 | Build class management UI | 6h |
| T4 | Build section management UI | 4h |