-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Connect the app to Database layer. (#1)
* added : Database source * added : BoardListCardLabelEntity relation model * fix: KSP Compile time issues. * feat: Add Board implemented * fix: ListDetail Scaffold for CardDetailScreen * insert: Card to DB base. * insert: List to DB base. * remove: Static data from Dashboard Screen. * remove: Static data from TaskboardScreen. * fix: DB Relationship with List and Card entities
- Loading branch information
Showing
84 changed files
with
1,563 additions
and
678 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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
20 changes: 20 additions & 0 deletions
20
core/data/src/main/java/com/jetapps/jettaskboard/di/DatasourceModule.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.jetapps.jettaskboard.di | ||
|
||
import com.jetapps.jettaskboard.local.source.DatabaseSource | ||
import com.jetapps.jettaskboard.local.source.DatabaseSourceImpl | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
abstract class DatasourceModule { | ||
|
||
@Singleton | ||
@Binds | ||
abstract fun bindsDataSourceModule( | ||
datasourceModuleImpl: DatabaseSourceImpl, | ||
): DatabaseSource | ||
} |
This file contains 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
17 changes: 8 additions & 9 deletions
17
core/data/src/main/java/com/jetapps/jettaskboard/local/dao/BoardDao.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
package com.jetapps.jettaskboard.local.dao | ||
|
||
import androidx.room.Dao | ||
import androidx.room.Insert | ||
import androidx.room.OnConflictStrategy | ||
import androidx.room.Query | ||
import com.jetapps.jettaskboard.local.entity.BoardEntity | ||
import androidx.room.Transaction | ||
import com.jetapps.jettaskboard.local.entity.CardEntity | ||
import com.jetapps.jettaskboard.local.entity.ListEntity | ||
import com.jetapps.jettaskboard.model.db.BoardWithLists | ||
|
||
@Dao | ||
interface BoardDao { | ||
|
||
@Query("SELECT * FROM boardTable") | ||
fun getAllBoards(): List<BoardEntity> | ||
|
||
@Insert(onConflict = OnConflictStrategy.REPLACE) | ||
fun insertBoard(board: BoardEntity) | ||
} | ||
@Transaction | ||
@Query("SELECT * FROM boardTable WHERE boardId = :boardId") | ||
fun getBoardWithListsAndCards(boardId: Int): BoardWithLists | ||
} |
This file contains 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
42 changes: 42 additions & 0 deletions
42
core/data/src/main/java/com/jetapps/jettaskboard/local/dao/DashboardDao.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.jetapps.jettaskboard.local.dao | ||
|
||
import androidx.room.Dao | ||
import androidx.room.Delete | ||
import androidx.room.Insert | ||
import androidx.room.OnConflictStrategy | ||
import androidx.room.Query | ||
import androidx.room.Transaction | ||
import androidx.room.Update | ||
import com.jetapps.jettaskboard.local.entity.BoardEntity | ||
import com.jetapps.jettaskboard.local.entity.ListEntity | ||
import com.jetapps.jettaskboard.model.db.BoardWithLists | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
@Dao | ||
interface DashboardDao { | ||
|
||
@Query("SELECT * FROM boardTable") | ||
fun getAllBoards(): Flow<List<BoardEntity>> | ||
|
||
@Transaction | ||
@Query("SELECT * FROM boardTable WHERE boardId = :boardId") | ||
fun getBoardDetails(boardId: Int): Flow<BoardWithLists> | ||
|
||
@Insert(onConflict = OnConflictStrategy.REPLACE) | ||
fun insertBoard(board: BoardEntity) | ||
|
||
@Delete | ||
fun deleteBoard(board: BoardEntity) | ||
|
||
@Update | ||
fun markBoardFavourite(board: BoardEntity) | ||
|
||
@Query("SELECT title FROM boardTable") | ||
fun getBoardNames(): List<String> | ||
|
||
@Query("SELECT * FROM listTable") | ||
fun getAllLists(): List<ListEntity> | ||
|
||
@Query("SELECT * FROM listTable where boardId = :boardId") | ||
fun getAllBoardRelatedLists(boardId: Int): List<ListEntity> | ||
} |
This file contains 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 file contains 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 file contains 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 file contains 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
8 changes: 4 additions & 4 deletions
8
core/data/src/main/java/com/jetapps/jettaskboard/local/entity/BoardEntity.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
package com.jetapps.jettaskboard.local.entity | ||
|
||
import androidx.room.ColumnInfo | ||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
|
||
@Entity( | ||
tableName = "boardTable" | ||
) | ||
data class BoardEntity( | ||
@PrimaryKey val id: String, | ||
@PrimaryKey | ||
val boardId: Int, | ||
val title: String, | ||
val description: String, | ||
@ColumnInfo(name = "work_space_id") | ||
val workSpaceId: String | ||
val isFav : Int, | ||
val workSpaceId : Int, | ||
) |
This file contains 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
Oops, something went wrong.