Files
TIS_RMS/frontend/lib/domain/entities/setup_models.dart
T
ssbg04 bd2a8acbfe feat(settings): clean academic setup buttons and rename screen to Academic & Class Management
- Update screen, settings card, and dashboard titles to 'Academic & Class Management'

- Clean and balance Academic Structure toolbar for mobile and desktop

- Remove redundant buttons on section cards in favor of interactive adviser chip

- Modernize teacher action button to OutlinedButton.icon 'Sections'

- Add responsive bulk academic structure import support across backend and frontend
2026-09-27 02:05:47 +08:00

88 lines
2.3 KiB
Dart

class AcademicYearModel {
final int id;
final String yearRange;
final String status;
final String? startDate;
final String? endDate;
AcademicYearModel({
required this.id,
required this.yearRange,
required this.status,
this.startDate,
this.endDate,
});
factory AcademicYearModel.fromJson(Map<String, dynamic> json) {
return AcademicYearModel(
id: (json['id'] as num).toInt(),
yearRange: json['year_range'] as String,
status: json['status'] as String,
startDate: json['start_date'] as String? ?? json['startDate'] as String?,
endDate: json['end_date'] as String? ?? json['endDate'] as String?,
);
}
}
class SectionModel {
final int id;
final String name;
final int gradeLevel;
final int? academicYearId;
final String? academicYearRange;
final int? teacherId;
final String? teacherFirstName;
final String? teacherLastName;
String? get teacherFullName {
if (teacherLastName != null && teacherFirstName != null) {
return '$teacherLastName, $teacherFirstName';
}
return teacherFirstName ?? teacherLastName;
}
SectionModel({
required this.id,
required this.name,
required this.gradeLevel,
this.academicYearId,
this.academicYearRange,
this.teacherId,
this.teacherFirstName,
this.teacherLastName,
});
factory SectionModel.fromJson(Map<String, dynamic> json) {
return SectionModel(
id: (json['id'] as num).toInt(),
name: json['name'] as String,
gradeLevel: (json['grade_level'] as num).toInt(),
academicYearId: json['academic_year_id'] != null
? (json['academic_year_id'] as num).toInt()
: null,
academicYearRange: json['academic_year_range'] as String?,
teacherId: json['teacher_id'] != null
? (json['teacher_id'] as num).toInt()
: null,
teacherFirstName: json['teacher_first_name'] as String?,
teacherLastName: json['teacher_last_name'] as String?,
);
}
}
class GradeLevelModel {
final int id;
final int level;
final String name;
GradeLevelModel({required this.id, required this.level, required this.name});
factory GradeLevelModel.fromJson(Map<String, dynamic> json) {
return GradeLevelModel(
id: (json['id'] as num).toInt(),
level: (json['level'] as num).toInt(),
name: json['name'] as String,
);
}
}