-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shared use new gamification toolbar API (#716)
^ALTAPPS-993 Needs testing
- Loading branch information
Showing
14 changed files
with
172 additions
and
174 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
12 changes: 12 additions & 0 deletions
12
.../hyperskill/app/gamification_toolbar/data/repository/GamificationToolbarRepositoryImpl.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,12 @@ | ||
package org.hyperskill.app.gamification_toolbar.data.repository | ||
|
||
import org.hyperskill.app.gamification_toolbar.data.source.GamificationToolbarRemoteDataSource | ||
import org.hyperskill.app.gamification_toolbar.domain.model.GamificationToolbarData | ||
import org.hyperskill.app.gamification_toolbar.domain.repository.GamificationToolbarRepository | ||
|
||
class GamificationToolbarRepositoryImpl( | ||
private val gamificationToolbarRemoteDataSource: GamificationToolbarRemoteDataSource | ||
) : GamificationToolbarRepository { | ||
override suspend fun getGamificationToolbarData(): Result<GamificationToolbarData> = | ||
gamificationToolbarRemoteDataSource.getGamificationToolbarData() | ||
} |
7 changes: 7 additions & 0 deletions
7
...rg/hyperskill/app/gamification_toolbar/data/source/GamificationToolbarRemoteDataSource.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,7 @@ | ||
package org.hyperskill.app.gamification_toolbar.data.source | ||
|
||
import org.hyperskill.app.gamification_toolbar.domain.model.GamificationToolbarData | ||
|
||
interface GamificationToolbarRemoteDataSource { | ||
suspend fun getGamificationToolbarData(): Result<GamificationToolbarData> | ||
} |
17 changes: 17 additions & 0 deletions
17
...in/kotlin/org/hyperskill/app/gamification_toolbar/domain/model/GamificationToolbarData.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,17 @@ | ||
package org.hyperskill.app.gamification_toolbar.domain.model | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import org.hyperskill.app.streaks.domain.model.StreakState | ||
|
||
@Serializable | ||
data class GamificationToolbarData( | ||
@SerialName("track_progress") | ||
val trackProgress: GamificationToolbarTrackProgress?, | ||
@SerialName("current_streak") | ||
val currentStreak: Int, | ||
@SerialName("streak_state") | ||
val streakState: StreakState, | ||
@SerialName("hypercoins_balance") | ||
val hypercoinsBalance: Int | ||
) |
12 changes: 12 additions & 0 deletions
12
.../org/hyperskill/app/gamification_toolbar/domain/model/GamificationToolbarTrackProgress.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,12 @@ | ||
package org.hyperskill.app.gamification_toolbar.domain.model | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class GamificationToolbarTrackProgress( | ||
@SerialName("is_completed") | ||
val isCompleted: Boolean, | ||
@SerialName("average_progress") | ||
val averageProgress: Int | ||
) |
7 changes: 7 additions & 0 deletions
7
...rg/hyperskill/app/gamification_toolbar/domain/repository/GamificationToolbarRepository.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,7 @@ | ||
package org.hyperskill.app.gamification_toolbar.domain.repository | ||
|
||
import org.hyperskill.app.gamification_toolbar.domain.model.GamificationToolbarData | ||
|
||
interface GamificationToolbarRepository { | ||
suspend fun getGamificationToolbarData(): Result<GamificationToolbarData> | ||
} |
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
Oops, something went wrong.