Unify DAO names
This commit is contained in:
		
							parent
							
								
									81e777f21d
								
							
						
					
					
						commit
						4419c86b05
					
				
					 6 changed files with 16 additions and 16 deletions
				
			
		|  | @ -26,11 +26,11 @@ abstract class DatabaseModule { | |||
|     abstract fun provideConfigurationService(impl: FirebaseConfigurationService): ConfigurationService | ||||
| 
 | ||||
|     @Binds | ||||
|     abstract fun provideSessionDAO(impl: FireBaseSessionDAO): SessionDAO | ||||
|     abstract fun provideSessionDAO(impl: FirebaseSessionDAO): SessionDAO | ||||
| 
 | ||||
|     @Binds | ||||
|     abstract fun provideSubjectDAO(impl: FireBaseSubjectDAO): SubjectDAO | ||||
|     abstract fun provideSubjectDAO(impl: FirebaseSubjectDAO): SubjectDAO | ||||
| 
 | ||||
|     @Binds | ||||
|     abstract fun provideTaskDAO(impl: FireBaseTaskDAO): TaskDAO | ||||
|     abstract fun provideTaskDAO(impl: FirebaseTaskDAO): TaskDAO | ||||
| } | ||||
|  | @ -1,6 +1,6 @@ | |||
| package be.ugent.sel.studeez.domain.implementation | ||||
| 
 | ||||
| object FireBaseCollections { | ||||
| object FirebaseCollections { | ||||
|     const val SESSION_COLLECTION = "sessions" | ||||
|     const val USER_COLLECTION = "users" | ||||
|     const val TIMER_COLLECTION = "timers" | ||||
|  | @ -11,7 +11,7 @@ import kotlinx.coroutines.flow.Flow | |||
| import kotlinx.coroutines.flow.map | ||||
| import javax.inject.Inject | ||||
| 
 | ||||
| class FireBaseSessionDAO @Inject constructor( | ||||
| class FirebaseSessionDAO @Inject constructor( | ||||
|     private val firestore: FirebaseFirestore, | ||||
|     private val auth: AccountDAO | ||||
| ) : SessionDAO { | ||||
|  | @ -31,7 +31,7 @@ class FireBaseSessionDAO @Inject constructor( | |||
|     } | ||||
| 
 | ||||
|     private fun currentUserSessionsCollection(): CollectionReference = | ||||
|         firestore.collection(FireBaseCollections.USER_COLLECTION) | ||||
|         firestore.collection(FirebaseCollections.USER_COLLECTION) | ||||
|             .document(auth.currentUserId) | ||||
|             .collection(FireBaseCollections.SESSION_COLLECTION) | ||||
|             .collection(FirebaseCollections.SESSION_COLLECTION) | ||||
| } | ||||
|  | @ -10,7 +10,7 @@ import kotlinx.coroutines.flow.Flow | |||
| import kotlinx.coroutines.flow.map | ||||
| import javax.inject.Inject | ||||
| 
 | ||||
| class FireBaseSubjectDAO @Inject constructor( | ||||
| class FirebaseSubjectDAO @Inject constructor( | ||||
|     private val firestore: FirebaseFirestore, | ||||
|     private val auth: AccountDAO, | ||||
| ) : SubjectDAO { | ||||
|  | @ -33,7 +33,7 @@ class FireBaseSubjectDAO @Inject constructor( | |||
|     } | ||||
| 
 | ||||
|     private fun currentUserSubjectsCollection(): CollectionReference = | ||||
|         firestore.collection(FireBaseCollections.USER_COLLECTION) | ||||
|         firestore.collection(FirebaseCollections.USER_COLLECTION) | ||||
|             .document(auth.currentUserId) | ||||
|             .collection(FireBaseCollections.SUBJECT_COLLECTION) | ||||
|             .collection(FirebaseCollections.SUBJECT_COLLECTION) | ||||
| } | ||||
|  | @ -12,7 +12,7 @@ import kotlinx.coroutines.flow.Flow | |||
| import kotlinx.coroutines.flow.map | ||||
| import javax.inject.Inject | ||||
| 
 | ||||
| class FireBaseTaskDAO @Inject constructor( | ||||
| class FirebaseTaskDAO @Inject constructor( | ||||
|     private val firestore: FirebaseFirestore, | ||||
|     private val auth: AccountDAO, | ||||
| ) : TaskDAO { | ||||
|  | @ -41,9 +41,9 @@ class FireBaseTaskDAO @Inject constructor( | |||
|     } | ||||
| 
 | ||||
|     private fun selectedSubjectTasksCollection(subjectId: String): CollectionReference = | ||||
|         firestore.collection(FireBaseCollections.USER_COLLECTION) | ||||
|         firestore.collection(FirebaseCollections.USER_COLLECTION) | ||||
|             .document(auth.currentUserId) | ||||
|             .collection(FireBaseCollections.SUBJECT_COLLECTION) | ||||
|             .collection(FirebaseCollections.SUBJECT_COLLECTION) | ||||
|             .document(subjectId) | ||||
|             .collection(FireBaseCollections.TASK_COLLECTION) | ||||
|             .collection(FirebaseCollections.TASK_COLLECTION) | ||||
| } | ||||
|  | @ -48,8 +48,8 @@ class FirebaseTimerDAO @Inject constructor( | |||
|     } | ||||
| 
 | ||||
|     private fun currentUserTimersCollection(): CollectionReference = | ||||
|         firestore.collection(FireBaseCollections.USER_COLLECTION) | ||||
|         firestore.collection(FirebaseCollections.USER_COLLECTION) | ||||
|             .document(auth.currentUserId) | ||||
|             .collection(FireBaseCollections.TIMER_COLLECTION) | ||||
|             .collection(FirebaseCollections.TIMER_COLLECTION) | ||||
| 
 | ||||
| } | ||||
		Reference in a new issue