Skip to content

Commit

Permalink
[Fix]: Flutter 팀 및 직군, APP 팀 추가 대응 (#338)
Browse files Browse the repository at this point in the history
* Fix: Flutter 팀 및 직군, APP 팀 추가 대응

* Fix: GetMemberAttendanceListUseCase collect 에러 대응

* Fix: auto-assign 수정

---------

Co-authored-by: Jihee Han <[email protected]>
  • Loading branch information
jihee-dev and Jihee Han authored May 5, 2024
1 parent d591e4d commit 0b936d9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 35 deletions.
5 changes: 2 additions & 3 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ addReviewers: true
addAssignees: author

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- taeseongyun
reviewers:
- toastmeister1
- jihee-dev
- hoyahozz

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 3
numberOfReviewers: 2
24 changes: 16 additions & 8 deletions data/src/main/java/com/yapp/data/model/types/PositionTypeEntity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,35 @@ import com.yapp.domain.model.types.PositionType


enum class PositionTypeEntity {
DEV_ANDROID, DEV_WEB, DEV_IOS, DEV_SERVER, DESIGNER, PROJECT_MANAGER;
PROJECT_MANAGER,
DESIGNER,
DEV_ANDROID,
DEV_IOS,
DEV_WEB,
DEV_SERVER,
DEV_FLUTTER;
}

fun PositionTypeEntity.toDomain(): PositionType {
return when (this) {
PositionTypeEntity.PROJECT_MANAGER -> PositionType.PROJECT_MANAGER
PositionTypeEntity.DESIGNER -> PositionType.DESIGNER
PositionTypeEntity.DEV_ANDROID -> PositionType.DEV_ANDROID
PositionTypeEntity.DEV_WEB -> PositionType.DEV_WEB
PositionTypeEntity.DEV_IOS -> PositionType.DEV_IOS
PositionTypeEntity.DEV_WEB -> PositionType.DEV_WEB
PositionTypeEntity.DEV_SERVER -> PositionType.DEV_SERVER
PositionTypeEntity.DESIGNER -> PositionType.DESIGNER
PositionTypeEntity.PROJECT_MANAGER -> PositionType.PROJECT_MANAGER
PositionTypeEntity.DEV_FLUTTER -> PositionType.DEV_FLUTTER
}
}

fun PositionType.toData(): PositionTypeEntity {
return when (this) {
PositionType.PROJECT_MANAGER -> PositionTypeEntity.PROJECT_MANAGER
PositionType.DESIGNER -> PositionTypeEntity.DESIGNER
PositionType.DEV_ANDROID -> PositionTypeEntity.DEV_ANDROID
PositionType.DEV_WEB -> PositionTypeEntity.DEV_WEB
PositionType.DEV_IOS -> PositionTypeEntity.DEV_IOS
PositionType.DEV_WEB -> PositionTypeEntity.DEV_WEB
PositionType.DEV_SERVER -> PositionTypeEntity.DEV_SERVER
PositionType.DESIGNER -> PositionTypeEntity.DESIGNER
PositionType.PROJECT_MANAGER -> PositionTypeEntity.PROJECT_MANAGER
PositionType.DEV_FLUTTER -> PositionTypeEntity.DEV_FLUTTER
}
}
}
12 changes: 7 additions & 5 deletions domain/src/main/java/com/yapp/domain/model/types/PositionType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ enum class PositionType(val value: String) {
DEV_ANDROID("Android"),
DEV_IOS("iOS"),
DEV_WEB("Web"),
DEV_SERVER("Server");
DEV_SERVER("Server"),
DEV_FLUTTER("Flutter"),;

companion object {
fun of(value: String): PositionType {
return when (value) {
"PROJECT_MANAGER" -> PROJECT_MANAGER
"DESIGNER" -> DESIGNER
"DEV_ANDROID" -> DEV_ANDROID
"DEV_WEB" -> DEV_WEB
"DEV_IOS" -> DEV_IOS
"DEV_WEB" -> DEV_WEB
"DEV_SERVER" -> DEV_SERVER
"DESIGNER" -> DESIGNER
"PROJECT_MANAGER" -> PROJECT_MANAGER
"DEV_FLUTTER" -> DEV_FLUTTER
else -> error("잘못된 PositionType 입니다.")
}
}
}
}
}
4 changes: 4 additions & 0 deletions domain/src/main/java/com/yapp/domain/model/types/TeamType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ package com.yapp.domain.model.types
enum class TeamType(val value: String) {
ANDROID("Android"),
IOS("iOS"),
APP("APP"),
WEB("Web"),
FLUTTER("Flutter"),
BASECAMP("BASECAMP"),
NONE("None");

Expand All @@ -14,7 +16,9 @@ enum class TeamType(val value: String) {
"NONE" -> NONE
"ANDROID" -> ANDROID
"IOS" -> IOS
"APP" -> APP
"WEB" -> WEB
"FLUTTER" -> FLUTTER
"BASECAMP" -> BASECAMP
else -> error("$rawValue 에 해당하는 TeamType이 없습니다.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.yapp.presentation.ui.member.score.MemberScoreContract.MemberScoreUiEv
import com.yapp.presentation.ui.member.score.MemberScoreContract.MemberScoreUiSideEffect
import com.yapp.presentation.ui.member.score.MemberScoreContract.MemberScoreUiState
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
import javax.inject.Inject

Expand All @@ -22,7 +23,7 @@ class MemberScoreViewModel @Inject constructor(

private suspend fun fetchMemberScore() {
setState { copy(loadState = MemberScoreUiState.LoadState.Loading) }
getMemberAttendanceListUseCase().collect { result ->
getMemberAttendanceListUseCase().collectLatest { result ->
result.onSuccess { (sessions, attendances) ->
if (attendances.isEmpty()) {
setState { copy(loadState = MemberScoreUiState.LoadState.Error) }
Expand Down Expand Up @@ -50,4 +51,4 @@ class MemberScoreViewModel @Inject constructor(
is MemberScoreUiEvent.GetMemberScore -> fetchMemberScore()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.yapp.common.base.BaseViewModel
import com.yapp.domain.usecases.GetMemberAttendanceListUseCase
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import javax.inject.Inject
Expand All @@ -24,24 +25,21 @@ class SessionDetailViewModel @Inject constructor(

if (sessionId != null) {
viewModelScope.launch {
withContext(Dispatchers.IO) {
getMemberAttendanceListUseCase().collect { result ->
result.onSuccess { (sessions, attendances) ->
if (attendances.isEmpty()) {
setState { copy(loadState = SessionDetailContract.SessionDetailUiState.LoadState.Error) }
return@onSuccess
}
getMemberAttendanceListUseCase().collectLatest { result ->
result.onSuccess { (sessions, attendances) ->
if (attendances.isEmpty()) {
setState { copy(loadState = SessionDetailContract.SessionDetailUiState.LoadState.Error) }
return@onSuccess
}

setState {
copy(
loadState = SessionDetailContract.SessionDetailUiState.LoadState.Idle,
session = sessions[sessionId] to attendances[sessionId]
)
}
setState {
copy(
loadState = SessionDetailContract.SessionDetailUiState.LoadState.Idle,
session = sessions[sessionId] to attendances[sessionId]
)
}
.onFailure {
setState { copy(loadState = SessionDetailContract.SessionDetailUiState.LoadState.Error) }
}
}.onFailure {
setState { copy(loadState = SessionDetailContract.SessionDetailUiState.LoadState.Error) }
}
}
}
Expand All @@ -54,4 +52,4 @@ class SessionDetailViewModel @Inject constructor(
TODO("Not yet implemented")
}

}
}

0 comments on commit 0b936d9

Please sign in to comment.