-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feature/tgyuu/#106
- Loading branch information
Showing
78 changed files
with
2,187 additions
and
131 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
14 changes: 14 additions & 0 deletions
14
core/data/src/main/java/com/wap/wapp/core/data/repository/attendance/AttendanceRepository.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,14 @@ | ||
package com.wap.wapp.core.data.repository.attendance | ||
|
||
import com.wap.wapp.core.model.attendance.Attendance | ||
import java.time.LocalDateTime | ||
|
||
interface AttendanceRepository { | ||
suspend fun getAttendance(eventId: String): Result<Attendance> | ||
|
||
suspend fun postAttendance( | ||
eventId: String, | ||
code: String, | ||
deadline: LocalDateTime, | ||
): Result<Unit> | ||
} |
27 changes: 27 additions & 0 deletions
27
...ta/src/main/java/com/wap/wapp/core/data/repository/attendance/AttendanceRepositoryImpl.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,27 @@ | ||
package com.wap.wapp.core.data.repository.attendance | ||
|
||
import com.wap.wapp.core.data.utils.toISOLocalDateTimeString | ||
import com.wap.wapp.core.model.attendance.Attendance | ||
import com.wap.wapp.core.network.source.attendance.AttendanceDataSource | ||
import java.time.LocalDateTime | ||
import javax.inject.Inject | ||
|
||
class AttendanceRepositoryImpl @Inject constructor( | ||
private val attendanceDataSource: AttendanceDataSource, | ||
) : AttendanceRepository { | ||
override suspend fun getAttendance(eventId: String): Result<Attendance> = | ||
attendanceDataSource.getAttendance(eventId).mapCatching { attendanceResponse -> | ||
attendanceResponse.toDomain() | ||
} | ||
|
||
override suspend fun postAttendance( | ||
eventId: String, | ||
code: String, | ||
deadline: LocalDateTime, | ||
): Result<Unit> = | ||
attendanceDataSource.postAttendance( | ||
eventId = eventId, | ||
code = code, | ||
deadline = deadline.toISOLocalDateTimeString(), | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
...ain/java/com/wap/wapp/core/data/repository/attendancestatus/AttendanceStatusRepository.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 com.wap.wapp.core.data.repository.attendancestatus | ||
|
||
import com.wap.wapp.core.model.attendancestatus.AttendanceStatus | ||
|
||
interface AttendanceStatusRepository { | ||
suspend fun getAttendanceStatus(eventId: String, userId: String): Result<AttendanceStatus> | ||
|
||
suspend fun postAttendance( | ||
eventId: String, | ||
userId: String, | ||
): Result<Unit> | ||
} |
20 changes: 20 additions & 0 deletions
20
...java/com/wap/wapp/core/data/repository/attendancestatus/AttendanceStatusRepositoryImpl.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.wap.wapp.core.data.repository.attendancestatus | ||
|
||
import com.wap.wapp.core.model.attendancestatus.AttendanceStatus | ||
import com.wap.wapp.core.network.source.attendancestatus.AttendanceStatusDataSource | ||
import javax.inject.Inject | ||
|
||
class AttendanceStatusRepositoryImpl @Inject constructor( | ||
private val attendanceStatusDataSource: AttendanceStatusDataSource, | ||
) : AttendanceStatusRepository { | ||
override suspend fun getAttendanceStatus( | ||
eventId: String, | ||
userId: String, | ||
): Result<AttendanceStatus> = attendanceStatusDataSource.getAttendanceStatus( | ||
eventId = eventId, | ||
userId = userId, | ||
).mapCatching { it.toDomain() } | ||
|
||
override suspend fun postAttendance(eventId: String, userId: String): Result<Unit> = | ||
attendanceStatusDataSource.postAttendanceStatus(eventId = eventId, userId = userId) | ||
} |
9 changes: 9 additions & 0 deletions
9
core/designresource/src/main/res/drawable/ic_forward_yellow.xml
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="7dp" | ||
android:height="14dp" | ||
android:viewportWidth="10" | ||
android:viewportHeight="20"> | ||
<path | ||
android:pathData="M0,1.788L1.517,0L10,10L1.517,20L0,18.212L6.967,10L0,1.788Z" | ||
android:fillColor="#FFFBCF34"/> | ||
</vector> |
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.