-
Notifications
You must be signed in to change notification settings - Fork 0
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
Date 관련 컴포넌트 개편 #334
Merged
Merged
Date 관련 컴포넌트 개편 #334
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a86ff60
RenewDateUtil 추가
toastmeister1 4ab3b1d
Session의 date 값을 LocalDateTime으로 변경
toastmeister1 245b83a
기존 DateUtil 제거
toastmeister1 3d1d849
RenewDateUtil 을 DateUtil로 네이밍 변경
toastmeister1 f513e62
DateParser를 다른 파일로 분리
toastmeister1 5e46440
develop 브랜치 rebase후 코드 수정
toastmeister1 7f3b2d9
기존 RemoteConfig에서 SessionList를 가져오는 로직 제거
toastmeister1 c4ed691
출석시 Session 모델에 담긴 Code로 출석하도록 수정
toastmeister1 fd662a7
불필요한 Nullable 제거
toastmeister1 b8052d1
메서드명 오탈자 수정
toastmeister1 40911c1
메서드명을 더 직관적으로 이해할수 있도록 변경
toastmeister1 3fc90df
WarningSign 제거
toastmeister1 c61af06
DateUtil의 함수명과 동작방식을 변경
toastmeister1 040f10a
불필요한 Test파일 제거
toastmeister1 f2686db
DateUtil 제거
toastmeister1 25a3a64
UseCase에서 DateUtil을 대신 LocalDateTime의 확장함수로 연산하도록 수정
toastmeister1 187278e
사용하지 않는 엔티티 제거
toastmeister1 48aac2e
YDSAttendanceType이 ResId를 가지고 있지 않도록 수정
toastmeister1 160adbb
UI에서 사용되던 checkSessionAttendance를 메서드 제거
toastmeister1 cfefc43
AdminMain 화면 DateUtil제거
toastmeister1 55e6af0
SessionDetail 화면 개선
toastmeister1 30ee163
MemberScore 화면 개선
toastmeister1 1160788
년, 월, 일, 일치하는 경우 오늘의 세션을 리턴하도록 수정
toastmeister1 0b78a99
출석 시간을 계산하는 로직을 GetUpComingSessionUseCase에 의존하도록 수정
toastmeister1 5c9afb6
UseCase 네이밍 수정
toastmeister1 a717860
오탈자 수정
toastmeister1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 0 additions & 22 deletions
22
app/src/androidTest/java/com/yapp/attendance/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
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
22 changes: 0 additions & 22 deletions
22
data/src/androidTest/java/com/yapp/data/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ package com.yapp.data.model | |
import com.google.firebase.firestore.PropertyName | ||
import com.yapp.domain.model.Session | ||
import com.yapp.domain.model.types.NeedToAttendType | ||
import com.yapp.domain.util.DateParser | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
|
@@ -21,24 +22,24 @@ data class SessionEntity( | |
val code: String? = null | ||
) | ||
|
||
fun SessionEntity.toDomain(): Session { | ||
fun SessionEntity.toDomain(dateParser: DateParser): Session { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 도메인 계층으로 매핑할 때 날짜를 |
||
return Session( | ||
sessionId = sessionId!!, | ||
title = title!!, | ||
startTime = startTime!!, | ||
description = description!!, | ||
type = NeedToAttendType.valueOf(type!!), | ||
code = code ?: "" | ||
startTime = dateParser.parse(rawDate = startTime!!), | ||
description = description!!, | ||
code = code!! | ||
) | ||
} | ||
|
||
fun Session.toData(): SessionEntity { | ||
fun Session.toData(dateParser: DateParser): SessionEntity { | ||
return SessionEntity( | ||
sessionId = sessionId, | ||
title = title, | ||
startTime = startTime, | ||
description = description, | ||
type = type.name, | ||
startTime = dateParser.format(date = startTime), | ||
description = description, | ||
code = code | ||
) | ||
} | ||
} |
24 changes: 0 additions & 24 deletions
24
data/src/main/java/com/yapp/data/model/types/AttendanceTypeEntity.kt
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YDSAttendanceType
이ResId
를 가지고 있는 바람에ViewModel
단에서 사용하지 못하는 단점이 존재이 부분에 대해 제대로 이해하지 못했어요 ㅠㅠ
AttendanceTypeMapper
가 있다면ResId
가 있더라도ViewModel
에서 매핑이 가능하지 않나용?? ㅠㅠThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkAttendanceType 메서드가 왜 UI쪽에 있는지를 보다가
YDSAttendanceType이 ResId를 가지고 있어서 ViewModel에서 사용이 어려워서 그랬구나 판단했습니다
(ViewModel에서 리소스를 사용하는건 메모리 릭 우려가 있어 권장되지 않는다는 글이 생각났네요)
그리고 YDSAttendanceType은 icon과 텍스트 resId를 가지고 있지 않게 수정한 이유는 단순 아이콘, 텍스트 이외에도 컬러를 지정할때도 사용하고 있는데요
그렇다면 YDSAttendanceType에는 또 다시 컬러의 resId가 들어가게 될것이고,
앞으로 AttendanceType에 관련된 컴포넌트들이 생긴다면 이곳에 계속 몰리는걸 우려했네요
YDSAttendanceType를 최대한 가볍게 가져가는 게 좋을것 같다는 이유였어요