Skip to main content

Story 2: Class & Section Management

Overview

FieldValue
Story IDNGE-13-2
Story Points8
SprintSprint 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

TaskTitleEstimate
T1Create class/section tables2h
T2Implement ClassesService6h
T3Build class management UI6h
T4Build section management UI4h