-
-
Notifications
You must be signed in to change notification settings - Fork 0
feature/new_model #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mshdabiola
wants to merge
49
commits into
develop
Choose a base branch
from
feature/new_model
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit updates several dependencies and configures the Gradle build:
- **Gradle Wrapper:** Updates the Gradle distribution to version `8.10.2`.
- **Android Gradle Plugin:** Updates the Android Gradle plugin to version `8.8.0`.
- **Dependencies:**
- Updates various AndroidX libraries including `activity`, `appcompat`, `core`, `lifecycle`, and more.
- Updates compose libraries to 1.7.7
- Updates Coil to version `3.0.4`.
- Updates Kotlin to version `2.1.0`.
- Updates Kotlin coroutines to `1.10.1`.
- Updates koin and koinCompose
- Updates room and sqlite
- Updates kermit
- Updates androidx paging
- Updates slf4j
- Updates kotlinx collections
- Updates turbine and truth
- Update all compose related library
- update androidx browser, splashscreen, hilt, windowmanager
- update protobuf and plugin
- update kstore
- update vaniktech gradle plugin
- Update kover
- update screenshot
- - Updates Room to version `2.7.0-alpha13` and sqlite `2.5.0-alpha13`.
- - Updates Koin to version `4.0.2`.
- - Updates Koin Compose to version `4.0.1`.
- Removes commented-out code in `AndroidRoomConventionPlugin.kt`.
- **Compose Configuration:**
- Sets `featureFlags` to `StrongSkipping` in `AndroidCompose.kt`.
- **Android Library Configuration:**
- Sets the default `targetSdk` to `35` in `AndroidLibraryConventionPlugin.kt`.
- **Version Catalogs:**
- Updates coil-kt-network to coil-network-ktor3.
- Add androidx-compose-material3-adaptive to version catalog.
- Remove commented out code from version catalog
- update many other version.
This commit updates several dependencies and configures the Gradle build:
- **Gradle Wrapper:** Updates the Gradle distribution to version `8.10.2`.
- **Android Gradle Plugin:** Updates the Android Gradle plugin to version `8.8.0`.
- **Dependencies:**
- Updates various AndroidX libraries including `activity`, `appcompat`, `core`, `lifecycle`, and more.
- Updates compose libraries to 1.7.7
- Updates Coil to version `3.0.4`.
- Updates Kotlin to version `2.1.0`.
- Updates Kotlin coroutines to `1.10.1`.
- Updates koin and koinCompose
- Updates room and sqlite
- Updates kermit
- Updates androidx paging
- Updates slf4j
- Updates kotlinx collections
- Updates turbine and truth
- Update all compose related library
- update androidx browser, splashscreen, hilt, windowmanager
- update protobuf and plugin
- update kstore
- update vaniktech gradle plugin
- Update kover
- update screenshot
- - Updates Room to version `2.7.0-alpha13` and sqlite `2.5.0-alpha13`.
- - Updates Koin to version `4.0.2`.
- - Updates Koin Compose to version `4.0.1`.
- Removes commented-out code in `AndroidRoomConventionPlugin.kt`.
- **Compose Configuration:**
- Sets `featureFlags` to `StrongSkipping` in `AndroidCompose.kt`.
- **Android Library Configuration:**
- Sets the default `targetSdk` to `35` in `AndroidLibraryConventionPlugin.kt`.
- **Version Catalogs:**
- Updates coil-kt-network to coil-network-ktor3.
- Add androidx-compose-material3-adaptive to version catalog.
- Remove commented out code from version catalog
- update many other version.
This commit replaces the `com.vanniktech.maven.publish` plugin with the custom `mshdabiola.android.library.publish` plugin in the following modules: - jretex - database - testing - model It removes redundant configurations related to publishing, such as repositories, pom, developers,licenses, SCM information, and central repository setup, as this functionality will be handled by the custom plugin. It also removes the group id and version form mavenPublishing coordinates, becuse the custom plugin manage it. It also remove the use of `PasswordCredentials`.
This commit implements tests for exporting and importing data. - Adds `exportData` test to export data to a file. - Adds `importData` test to import data from a file. - Adds `path` variable to the ExInPutTest class. - Adds insertData function that insert all data to test data base. - Modifies existing function to match the new test
This commit removes the following unused imports and configurations from `AndroidLibraryPublishConventionPlugin.kt`: - `LibraryAndroidComponentsExtension` - `LibraryExtension` - `configureFlavors` - `configureGradleManagedDevices` - `configureKotlinAndroid` - `configurePrintApksTask` - `disableUnnecessaryAndroidTests` - `VersionCatalogsExtension` - `MavenPublishPlugin` - `dependencies` - `getByType` - `kotlin` - `ExperimentalKotlinGradlePluginApi` - `KotlinMultiplatformExtension` - `PowerAssertGradleExtension` - `File` - `Properties` These components were likely remnants from previous configurations and are no longer needed. The removal simplifies the plugin's code and reduces potential conflicts.
This commit introduces a complete redesign of the database schema, replacing the previous schema with a new, more comprehensive structure. This includes:
- **Removal of old entities:** `ExaminationEntity`, `OptionEntity`, `PaperEntity`, `QuestionEntity`, `SeriesEntity`, `SessionExamination`, `SessionQuestion`, `SubjectEntity`, `TopicCategoryEntity`, `TopicEntity` and `UserEntity` have been removed.
- **Introduction of new entities:** The following new entities have been added:
- `AcademicStaffEntity`
- `ChoiceOptionEntity`
- `ClassAttendanceEntity`
- `ClassEntity`
- `CourseEntity`
- `CourseGradeEntity`
- `ExamAttendanceEntity`
- `ExamInstructionEntity`( renamed from InstructionEntity)
- `ExamPaperEntity`
- `ExamQuestionEntity`
- `ExamScheduleEntity`
- `GradeLevelEntity`
- `LearningMaterialEntity`
- `LearningObjectiveEntity`
- `LessonTopicEntity`
- `SchoolEntity`
- `StudentAnswerEntity`
- `StudentAnswerSheetEntity`
- `StudentEntity`
- **Updates to relationships:** The `ExaminationWithSubjectRelation`, `QuestionWithOptsInstTopRelation`, `SubjectWithSeriesRelation`, `CategoryWithTopicsRelation`, `TopicWithCategoryRelation` have been updated to reflect the new schema and relations.
- These changes aim to provide a more robust and flexible database structure to support the application's features and data requirements.
This commit introduces a new `Converters` object containing type converters for `StaffType`, `MaterialType`, `AttendanceStatus`, `LocalDate`, `LocalTime`, and `LocalDateTime` to facilitate database operations. It also updates the package name for `Constant` to `com.mshdabiola.seriesdatabase.util`.
This commit introduces new database entities and their corresponding converters for a school management system. The changes include:
- **Entities:**
- `SchoolEntity`
- `AcademicStaffEntity`
- `GradeLevelEntity`
- `ClassEntity`
- `StudentEntity`
- `CourseEntity`
- `LessonTopicEntity`
- `LearningMaterialEntity`
- `LearningObjectiveEntity`
- `ExamPaperEntity`
- `ExamQuestionEntity`
- `ChoiceOptionEntity`
- `ExamScheduleEntity`
- `StudentAnswerSheetEntity`
- `StudentAnswerEntity`
- `CourseGradeEntity`
- `ClassAttendanceEntity`
- `ExamAttendanceEntity`
- - `ExamInstructionEntity`
- **Converters:**
- Added `toDomain()` and `toEntity()` functions for each new entity to convert between the database model and the domain model.
- **Database:**
- Added all new entities to the `SeriesDatabase`.
This commit replaces previous database entities, and adds support for managing schools, staff, students, courses, exams, attendance, and grading.
The database name is not explicitly mentioned, the diffs use SeriesDatabase.
This commit introduces the following model entities for school management: - `StudentAnswerSheet`: Represents a student's answer sheet for an exam. - `StudentAnswer`: Represents a student's answer to a specific question. - `Student`: Represents a student in the school. - `School`: Represents the school itself. - `StaffType`: Enumerates the different types of staff. - `MaterialType`: Enumerates the different types of learning materials. - `AttendanceStatus`: Enumerates the different attendance statuses. - `GradeLevel`: Represents a grade level in the school. - `LessonTopic`: Represents a topic within a course. - `ExamQuestion`: Represents a question in an exam. - `LearningMaterial`: Represents a piece of learning material. - `ExamAttendance`: Represents a student's attendance for an exam. - `ExamSchedule`: Represents the schedule for an exam. - `ExamPaper`: Represents an exam paper. - `LearningObjective`: Represents a learning objective. - `CourseGrade`: Represents a student's grade in a course. - `Course`: Represents a course offered in the school. - `ClassAttendance`: Represents a student's attendance in a class. - `ClassS`: Represents a class in the school. - `ChoiceOption`: Represents an option for a multiple-choice question. - `AcademicStaff`: Represents a member of the academic staff.
This commit updates the import path for the `Constant` class in both the `Platform.jvm.kt` and `Platform.android.kt` files. The import is changed from `com.mshabiola.database.util.Constant` to `com.mshdabiola.seriesdatabase.util.Constant`. This ensures that the correct Constant is used across all platforms.
This commit refactors the database schema by removing the old DAO files and introducing new DAO interfaces for a more structured and comprehensive data model. The following changes have been made: - Removed `ExaminationDao`, `InstructionDao`, `OptionDao`, `QuestionDao`, `SeriesDao`, `SubjectDao`, `TopicCategoryDao`, `TopicDao` and `UserDao`. - Added `LessonTopicDao` to handle operations for `LessonTopicEntity`. - Added `LearningMaterialDao` to handle operations for `LearningMaterialEntity`. - Added `StudentDao` to handle operations for `StudentEntity`. - Added `CourseDao` to handle operations for `CourseEntity`. - Added `GradeLevelDao` to handle operations for `GradeLevelEntity`. - Added `ClassDao` to handle operations for `ClassEntity`. - Added `SchoolDao` to handle operations for `SchoolEntity`. - Added `AcademicStaffDao` to handle operations for `AcademicStaffEntity`. - Added `StudentAnswerDao` to handle operations for `StudentAnswerEntity`. - Added `CourseGradeDao` to handle operations for `CourseGradeEntity`. - Added `ChoiceOptionDao` to handle operations for `ChoiceOptionEntity`. - Added `StudentAnswerSheetDao` to handle operations for `StudentAnswerSheetEntity`. - Added `ExamScheduleDao` to handle operations for `ExamScheduleEntity`. - Added `ExamQuestionDao` to handle operations for `ExamQuestionEntity`. - Added `LearningObjectiveDao` to handle operations for `LearningObjectiveEntity`. - Added `TeacherCourseQualificationDao` to handle operations for `TeacherCourseQualificationEntity`. - Added `ExamPaperDao` to handle operations for `ExamPaperEntity`. - Added `ClassAttendanceDao` to handle operations for `ClassAttendanceEntity`. - Added `ExamAttendanceDao` to handle operations for `ExamAttendanceEntity`. - These new DAOs provide a structured way to interact with the database, supporting operations like upserting, deleting, and querying data for various entities within the application.
This commit refactors the database entities to use `Long` as the primary key type instead of `Int`. It also removes the `SyllabusEntity` as it's not needed. The changes include: - Modify `SchoolEntity`: Change `schoolId` type to Long?. - Modify `LearningMaterialEntity`: Change `learningMaterialId` type to Long? and `lessonTopicId` to Long. - Modify `StudentEntity`: Change `studentId` type to Long? and `classId` to Long. - Modify `ExamPaperEntity`: Change `examPaperId` type to Long?, `courseId`, and `creatorStaffId` to Long, and `examScheduleId` to Long?. - Modify `LessonTopicEntity`: Change `topicId` type to Long? and `courseId` to Long. - Modify `ExamQuestionEntity`: Change `questionId` type to Long?, `examPaperId` to Long, `marks` to Long, and `lessonTopicId` to Long?. - Modify `LearningObjectiveEntity`: Change `learningObjectiveId` type to Long? and `lessonTopicId` to Long. - Modify `ExamScheduleEntity`: Change `examScheduleId` type to Long?, `classId` to Long, and `examPaperId` to Long?. - Modify `ChoiceOptionEntity`: Change `optionId` type to Long? and `examQuestionId` to Long. - Modify `AcademicStaffEntity`: Change `staffId` type to Long?. - Modify `StudentAnswerSheetEntity`: Change `answerSheetId` type to Long?, `studentId`, and `examScheduleId` to Long. - Modify `ClassEntity`: Change `classId` type to Long?, `gradeLevelId` to Long, and `teacherStaffId` to Long?. - Modify `StudentAnswerEntity`: Change `studentAnswerId` type to Long?, `answerSheetId`, `examQuestionId` to Long, and `choiceOptionId` to Long?. change `marksObtained` to long. - Modify `CourseGradeEntity`: Change `studentId` and `courseId` type to Long. - Modify `ClassAttendanceEntity`: Change `classAttendanceId` to Long?, `studentId`, and `classId` to Long. - Modify `ExamAttendanceEntity`: Change `examAttendanceId` type to Long?, `studentId`, and `examScheduleId` to Long. - Modify `CourseEntity`: Change `courseId` type to Long? and `gradeLevelId` to Long. - Modify `GradeLevelEntity`: Change `gradeLevelId` type to Long? and `levelNumber` to Long. - Remove `SyllabusEntity` file. - - add `TeacherCourseQualificationEntity` entity. - - modify `ExamInstructionEntity` : change `ExaminationEntity` to `ExamPaperEntity` - - change `questionType` : from string to `QuestionType` + - add `TeacherCourseQualificationEntity` + - modify `ExamInstructionEntity` : change foreign key `ExaminationEntity` to `ExamPaperEntity` + - change `questionType` : from string to `QuestionType` enum - - use `kotlinx.datetime.LocalDate` instead `java.time.LocalDate` - - use `kotlinx.datetime.LocalDateTime` instead `java.time.LocalDateTime` - - use `kotlinx.datetime.LocalTime` instead `java.time.LocalTime` + - use `kotlinx.datetime.LocalDate` instead `java.time.LocalDate` + - use `kotlinx.datetime.LocalDateTime` instead `java.time.LocalDateTime` + - use `kotlinx.datetime.LocalTime` instead `java.time.LocalTime`
This commit renames `SeriesDatabase` to `SchoolDatabase` and updates all references to the old name in the `Platform.kt` file. This includes changes to the following: - DAO accessors: `getExaminationDao`, `getInstructionDao`, `getOptionDao`, `getQuestionDao`, `getSubjectDao`, `getTopicDao`, `getSeriesDao`, `getUserDao`, `getTopicCategoryDao`. - Database builder in `getRoomDatabase` function.
This commit adds a `QuestionType` converter to the `Converters` object. This allows Room to store and retrieve `QuestionType` enums in the database. The `fromQuestionType` function converts a `QuestionType` to a String, and the `toQuestionType` function converts a String back to a `QuestionType`. Also the import are updated to use kotlinx time.
This commit refactors the database structure and implements a new export/import mechanism.
**Key Changes:**
* **Database Refactor:**
* Replaces `SeriesDatabase` with `SchoolDatabase`.
* Migrates data models and DAOs to the new database.
* Introduces `Converters` for handling custom data types.
* Removes unused `SeriesDatabaseCtor` and other deprecated code.
* **Export/Import:**
* Removes the `DatabaseExportImport` class.
* Introduces `ExportImport` class for managing export/import operations.
* Updates `ModelExtension` to support the new database models and structure.
* Implements the `export` function to export all data to json file.
* Implements the `import` function to import all data from json file.
* Utilizes `async`/`await` for concurrent data retrieval during export.
* Adds the ability to export/import all data to/from all entities.
* Adds the `checkId()` helper function to check if id is valid.
* **Model extension:**
* Adds `toDomain()` and `toEntity()` for all entities
* Adds `TeacherCourseQualification` converter.
* **Data classes:**
* Adds `ExportableData` data class for exporting data.
* Updates the data class to reflect the database changes.
This commit renames `SeriesDatabase` to `SchoolDatabase` to better reflect the database's purpose. It also updates the `getDatabaseBuilder` function to use `SchoolDatabase` instead of `SeriesDatabase` in both `Platform.jvm.kt` and `Platform.android.kt` files.
This commit introduces the following changes to the database schema: - Adds `updatedAt` field of type `LocalDateTime` to the following entities: `SchoolEntity`, `LearningMaterialEntity`, `StudentEntity`, `ExamPaperEntity`, `LessonTopicEntity`, `ExamQuestionEntity`, `LearningObjectiveEntity`, `ExamScheduleEntity`, `ExamInstructionEntity`, `ChoiceOptionEntity`, `AcademicStaffEntity`, `TeacherCourseQualificationEntity`, `StudentAnswerSheetEntity`, `ClassEntity`, `StudentAnswerEntity`, `CourseGradeEntity`, `ClassAttendanceEntity`, `ExamAttendanceEntity`, `CourseEntity`, and `GradeLevelEntity`. - Removes the relation classes `ExaminationWithSubjectRelation`, `QuestionWithOptsInstTopRelation`, `SubjectWithSeriesRelation`, `CategoryWithTopicsRelation`, and `TopicWithCategoryRelation` by commenting out their code. - Updates the `AcademicStaffEntity` to include a foreign key reference to `SchoolEntity` and add closing parenthesis. - Updates the `TeacherCourseQualificationEntity` to reference `staff_id` instead of `staffId` in the `AcademicStaffEntity` foreign key. - Updates `GradeLevelEntity` to reference `school_id` instead of `schoolId` in the `SchoolEntity` foreign key. - Updates `ExamInstructionEntity` add `ColumnInfo` - Update `ExamQuestionEntity`,`ChoiceOptionEntity`,`LearningObjectiveEntity`,`StudentAnswerEntity` change content type from String to list of `Content` - update `TeacherCourseQualificationEntity` to remove `?` for `LocalDateTime` - remove `PrimaryKey` annotation from `CourseGradeEntity` and `ClassAttendanceEntity` because it are composite keys
…danceDao This commit introduces a new `ExamInstructionDao` for managing `ExamInstructionEntity` data, including delete, upsert, upsertAll, and getExamInstruction operations. It also updates the `ClassDao` by removing the unused `update` function. Additionally, the commit modifies `ClassAttendanceDao` by commenting out the `getClassAttendanceByCompositeKey` and `getClassAttendancesByDate` functions, which are likely not in use.
This commit introduces a new type converter for handling `Content` lists in the database, enabling storage and retrieval of this data type. It also updates the DAO modules to include a comprehensive list of all DAO interfaces provided by the `SchoolDatabase`. The updated DAO modules now include: - `academicStaffDao` - `choiceOptionDao` - `classDao` - `classAttendanceDao` - `courseDao` - `examAttendanceDao` - `examPaperDao` - `examQuestionDao` - `examScheduleDao` - `gradeLevelDao` - `learningMaterialDao` - `learningObjectiveDao` - `lessonTopicDao` - `schoolDao` - `studentAnswerDao` - `studentAnswerSheetDao` - `studentDao` - `teacherCourseQualificationDao` - `ExportImport`
This commit introduces extension functions to convert between database entities and domain models. Key changes include: - Added `updatedAt` timestamp to most entity conversions, capturing the last update time. - Added conversion functions for `ExamInstruction` to enable the extension of its functionality. - Added `schoolId` to `AcademicStaff` and `GradeLevel` entity conversions. - Removed redundant `title` from `ExamQuestion` and `ChoiceOption` converters. - Added `updatedAt` field in `ExamInstruction` to record the date of any update. - Added `updatedAt` field to `ExamQuestion` to record the date of any update. - Added `updatedAt` field to `ChoiceOption` to record the date of any update. - Added `updatedAt` field to `StudentAnswer` to record the date of any update. - Added `updatedAt` field to `StudentAnswerSheet` to record the date of any update. - Added `updatedAt` field to `ExamAttendance` to record the date of any update. - Added `updatedAt` field to `ClassAttendance` to record the date of any update. - Added `updatedAt` field to `CourseGrade` to record the date of any update. - Added `updatedAt` field to `LearningObjective` to record the date of any update. - Added `updatedAt` field to `LearningMaterial` to record the date of any update. - Added `updatedAt` field to `LessonTopic` to record the date of any update. - Added `updatedAt` field to `Course` to record the date of any update. - Added `updatedAt` field to `Student` to record the date of any update. - Added `updatedAt` field to `Class` to record the date of any update. - Added `updatedAt` field to `GradeLevel` to record the date of any update. - Added `updatedAt` field to `AcademicStaff` to record the date of any update. - Added `updatedAt` field to `School` to record the date of any update. - Added `updatedAt` field to `ExamPaper` to record the date of any update. - Added `updatedAt` field to `ExamSchedule` to record the date of any update. - Added `updatedAt` field to `TeacherCourseQualification` to record the date of any update.
This commit introduces the `ExamInstructionEntity` and `ExamInstructionDao` to the database. It also adds `ExamInstructionEntity` in the database schema. It add a new `examInstructionDao` function to `SchoolDatabase` .
This commit introduces a significant refactor of the data models, enhancing and updating them to better represent the educational domain. The following changes were made: - Removed unused or redundant models: Examination, ExaminationWithSubject, Option, Question, QuestionPlain, QuestionWithOptsInstTop, Series, Subject, SubjectWithSeries, Topic, TopicCategory, TopicWithCategory, User, UserType. - Renamed `Instruction` to `ExamInstruction`. - Updated `StudentAnswerSheet` to use Long for IDs and to be serializable. - Updated `ExportableData` to include a comprehensive list of new models, removing old models. - Updated `StudentAnswer` to use Long for IDs, and to include `Content` type for `answerText`, and to be serializable. - Updated `Student` to use Long for IDs and to be serializable. - Renamed `Type` to `ContentType`. - Updated `Content` to use `ContentType`. - Created `TeacherCourseQualification` model. - Updated `School` to use Long for IDs and to be serializable. - Updated `GradeLevel` to use Long for IDs, added `schoolId`, and to be serializable. - Updated `LessonTopic` to use Long for IDs and to be serializable. - Updated `ExamQuestion` to use Long for IDs, `Content` type for text and answer, and to be serializable. - Updated `LearningMaterial` to use Long for IDs and to be serializable. - Updated `ExamAttendance` to use Long for IDs and to be serializable. - Updated `ExamSchedule` to use Long for IDs and to be serializable. - Updated `ExamPaper` to use Long for IDs and to be serializable. - Updated `LearningObjective` to use Long for IDs, `Content` type for text and to be serializable. - Updated `CourseGrade` to use Long for IDs and to be serializable. - Updated `Course` to use Long for IDs and to be serializable. - Updated `ClassAttendance` to use Long for IDs and to be serializable. - Updated `ClassS` to use Long for IDs and to be serializable. - Renamed `QUESTION_TYPE` to `QuestionType`. - Updated `ChoiceOption` to use Long for IDs and to be serializable. - Updated `AcademicStaff` to use Long for IDs and added `schoolId`, and to be serializable. - Many Models made serializable.
This commit adds the `kotlinx-datetime` library as a dependency in the `model` module.
This commit removes the `DatabaseRule.kt` file and its contents. This file likely contained components used for testing the database, and it is no longer needed.
This commit removes the `DatabaseRule.kt` file and its contents. This file likely contained components used for testing the database, and it is no longer needed.
This commit refactors the database tests by removing individual test files for Examination, Instruction, Options, Question, Subject, and Topic entities. It also introduces a new `ExportImportTest` file to house comprehensive tests for the export and import functionality. Additionally, this commit modifies the `ExInPutTest` class to use a more generic `insertData` function and adds the new entities in database to be inserted. - Removes `ExaminationTest`, `InstructionTest`, `OptionsTest`, `QuestionTest`, `SubjectTest`, `TopicTest` - Creates `ExportImportTest` with comprehensive export and import tests - Refactors `ExInPutTest` to use a generic `insertData` function - adds new database entities to `insertData` function in `ExInPutTest` - Removes unused abstract function in `AbstractTest` class
This commit introduces indices to the `AcademicStaffEntity` and `GradeLevelEntity` for the `school_id` column to improve query performance. It also adds accessors to the SchoolDatabase for: - `examInstructionDao` - `courseGradeDao`
This commit reorders the database operations in the `ExInPutTest` file to ensure that `teacherCourseQualificationDao` is inserted after `courseDao` and the attendance data is inserted last.
This commit refactors the database import logic in `ExportImport.kt` to remove the unnecessary `launch` blocks and `join` calls. It also implements the `exportData` and `importData` tests in `ExInPutTest.kt` to verify the database export/import functionality.
Key changes:
- **ExportImport.kt**:
- Removed `launch` and `join` from import logic.
- Streamlined the data insertion process for various entities.
- **ExInPutTest.kt**:
- Implemented the `exportData` test to export database to a file.
- Implemented the `importData` test to import database from a file and verify the content.
- Added helper function insertData to insert data into the database for testing.
- Added `toDomain()` function for data mapping.
- Changed the name of the export data file from `data.se` to `data2.se`
This commit updates the Gradle version to 8.12.1 and various project dependencies to their latest versions, including: - Android Gradle Plugin to 8.8.1 - Android Tools to 31.8.1 - Kotlin to 2.1.10 - kotlinx.serialization.json to 1.8.0 - KSP to 2.1.10-1.0.30 - Module Graph to 0.12.0 - POI to 5.4.0 - Room to 2.7.0-beta01 - Compose Plugin to 1.8.0-alpha03 - ComposeNavigation to 2.8.0-alpha13 - androidxNavigationTest to 2.8.7 - Compose to 1.7.8 - uiTextGoogleFonts to 1.7.8 - koinCompose to 4.0.2 - androidx-paging to 3.3.6 - sqlite to 2.5.0-beta01 - Screenshot to 0.0.1-alpha09 - Kover to 0.9.1 - androidxTracing to 1.3.0-beta01 These updates ensure the project is using the latest features and improvements.
This commit updates the Room and SQLite dependencies to their release candidate versions: - Room to 2.7.0-rc03 - SQLite to 2.5.0-rc03 These updates ensure the project is using the latest pre-release versions with potential bug fixes and improvements before the final stable releases.
This commit removes the `@TypeConverters` annotation from all entity classes in the database module. This change might be related to how type conversion is handled or optimized within the database implementation, or a shift in how data types are managed.
This commit updates the `kotlinx-datetime` conversion functions in `Converters.kt` to handle non-nullable types. It removes the nullable types and associated null checks in the following functions: `fromLocalDate`, `toLocalDate`, `fromLocalTime`, `toLocalTime`, and `toLocalDateTime`. This change ensures that these functions always return a valid value and simplifies the code by removing unnecessary null handling.
This commit adds the following converters to the `SchoolDatabase`: - `ContentConverter` - `DateTimeConverter` - `TimeConverter` - `DateConverter` - `AttendanceStatusConverter` - `QuestionTypeConverter` - `StaffTypeConverter` - `MaterialTypeConverter` These converters are necessary for handling custom data types in the database.
This commit removes the unused `TypeConverters` import and the associated `Converters` class reference from all database entity files. This cleanup simplifies the code and removes unnecessary dependencies.
This commit introduces Room Type Converters to handle custom data type conversions for database storage. The following converters are implemented: - **ContentConverter**: Converts between `List<Content>` and its string representation. - **DateTimeConverter**: Converts between `LocalDateTime` and its string representation. - **TimeConverter**: Converts between `LocalTime` and its string representation. - **DateConverter**: Converts between `LocalDate` and its string representation. - **AttendanceStatusConverter**: Converts between `AttendanceStatus` enum and its string representation. - **QuestionTypeConverter**: Converts between `QuestionType` enum and its string representation. - **StaffTypeConverter**: Converts between `StaffType` enum and its string representation. - **MaterialTypeConverter**: Converts between `MaterialType` enum and its string representation. Additionally, the file `Converters.kt` in the `util` directory has been moved to the root of the `com.mshdabiola.seriesdatabase` package and renamed to `Converters.kt`.
This commit updates the Android Tools dependency to version 31.9.1 and adds a Jacoco version entry. It also comments out the `signAllPublications()` function in the AndroidLibraryPublishConventionPlugin.kt file, likely to disable GPG signing for publications.
This commit updates the `ExamQuestion` data class to make the `answer` property nullable. This change allows for exam questions to be created without a predefined answer.
This commit modifies several entity properties in the database module to use primitive types (Int) instead of enums and strings instead of lists of content. The affected entities and their changes are: - `ExamInstructionEntity`: `content` changed from `List<Content>` to `String` - `LearningMaterialEntity`: `materialType` changed from `MaterialType` to `Int` - `ExamQuestionEntity`: `questionType` changed from `QuestionType` to `Int`, `questionText` changed from `List<Content>` to `String`, `answer` changed from `List<Content>` to `String?` - `AcademicStaffEntity`: `staffType` changed from `StaffType` to `Int` - `LearningObjectiveEntity`: `objectiveText` changed from `List<Content>` to `String` - `ExamAttendanceEntity`: `attendanceStatus` changed from `AttendanceStatus` to `Int` - `ClassAttendanceEntity`: `attendanceStatus` changed from `AttendanceStatus` to `Int` - `ChoiceOptionEntity`: `optionText` changed from `List<Content>` to `String` - `StudentAnswerEntity`: `answerText` changed from `List<Content>?` to `String?` These changes likely aim to simplify data storage and retrieval by using more basic data types.
This commit introduces `toEntity` extension functions for various domain models, enabling conversion to their corresponding database entity representations. The changes include:
- Adding `toEntity` functions for:
- `AcademicStaff`
- `LearningMaterial`
- `LearningObjective`
- `ExamQuestion`
- `ChoiceOption`
- `StudentAnswer`
- `ClassAttendance`
- `ExamAttendance`
- `ExamInstruction`
These functions facilitate data persistence by converting domain objects into database-compatible entities.
…nTypeConverter, StaffTypeConverter and MaterialTypeConverter from SchoolDatabase This commit removes `ContentConverter`, `AttendanceStatusConverter`, `QuestionTypeConverter`, `StaffTypeConverter`, and `MaterialTypeConverter` from the `TypeConverters` annotation in the `SchoolDatabase` class. These converters are no longer needed at the database level, and their handling has likely been moved elsewhere.
This commit refactors the type converters by moving each converter to its own file. This improves code organization and maintainability by separating concerns for each data type conversion.
This commit temporarily comments out the `exportData` and `importData` tests in `ExInPutTest.kt`.
This commit introduces several new entities to the database schema, including: - `ExamPaperEntity` - `StudentEntity` - `LessonTopicEntity` - `ExamQuestionEntity` - `LearningObjectiveEntity` - `ExamAttendanceEntity` - `AcademicStaffEntity` - `GradeLevelEntity` - `ClassEntity` - `CourseGradeEntity` - `ClassAttendanceEntity` - `StudentAnswerEntity` - `LearningMaterialEntity` - `StudentAnswerSheetEntity` - `ExamInstructionEntity` - `ExamScheduleEntity` - `SchoolEntity` - `ChoiceOptionEntity` - `CourseEntity` It also updates the Gradle version and increments the project's version code and name. Additionally, the commit comments out the `@TypeConverters` annotation in all entity classes, suggesting that type conversion handling might be undergoing changes or being deferred. The `ExInPutTest` class is also modified, but the specific changes are not clear from this summary.
This commit updates the `compileSdk` version in the `KotlinAndroid.kt` file to 35.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.