-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from Central-MakeUs/feature/issue-30
feature/issue-30 OT전 개발
- Loading branch information
Showing
71 changed files
with
699 additions
and
739 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
98 changes: 0 additions & 98 deletions
98
src/main/kotlin/com/example/cmc_be/attendance/convertor/AttendanceConvertor.kt
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
src/main/kotlin/com/example/cmc_be/attendance/dto/AttendanceReq.kt
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
src/main/kotlin/com/example/cmc_be/attendance/dto/AttendanceRes.kt
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/com/example/cmc_be/attendance/dto/req/AttendanceCodeReq.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,5 @@ | ||
package com.example.cmc_be.attendance.dto.req | ||
|
||
data class AttendanceCodeReq( | ||
val code: String | ||
) |
16 changes: 16 additions & 0 deletions
16
src/main/kotlin/com/example/cmc_be/attendance/dto/req/GenerateCode.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,16 @@ | ||
package com.example.cmc_be.attendance.dto.req | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
data class GenerateCode( | ||
@Schema(example = "14") | ||
val generation: Int, | ||
@Schema(example = "1") | ||
val week: Int, | ||
@Schema(example = "1") | ||
val hour: Int, | ||
val startTime: HourAndMinute, | ||
val endTime: HourAndMinute, | ||
@Schema(example = "15") | ||
val lateMinute: Long, | ||
) |
10 changes: 10 additions & 0 deletions
10
src/main/kotlin/com/example/cmc_be/attendance/dto/req/HourAndMinute.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,10 @@ | ||
package com.example.cmc_be.attendance.dto.req | ||
|
||
import java.time.LocalTime | ||
|
||
data class HourAndMinute( | ||
val hour: Int, | ||
val minute: Int | ||
) { | ||
fun toLocalTime(): LocalTime = LocalTime.of(hour, minute) | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/kotlin/com/example/cmc_be/attendance/dto/res/AllAttendanceInfos.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,9 @@ | ||
package com.example.cmc_be.attendance.dto.res | ||
|
||
data class AllAttendanceInfos( | ||
val name: String, | ||
val role: String, | ||
val nickname: String, | ||
val attendanceStatus: AttendanceDashboardInfo, | ||
val attandances: List<AttendanceInfo> | ||
) |
13 changes: 13 additions & 0 deletions
13
src/main/kotlin/com/example/cmc_be/attendance/dto/res/AttendanceCodeRes.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,13 @@ | ||
package com.example.cmc_be.attendance.dto.res | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat | ||
import java.time.LocalDate | ||
import java.time.LocalTime | ||
|
||
data class AttendanceCodeRes( | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") | ||
val availableDate: LocalDate, | ||
val startTime: LocalTime, | ||
val endTime: LocalTime, | ||
val lateMinute: Long | ||
) |
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/com/example/cmc_be/attendance/dto/res/AttendanceDashboardInfo.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.example.cmc_be.attendance.dto.res | ||
|
||
import com.example.cmc_be.domain.attendance.enums.AttendanceCategory | ||
|
||
data class AttendanceDashboardInfo( | ||
val attendanceCount: Int, | ||
val lateCount: Int, | ||
val absentCount: Int | ||
) { | ||
|
||
companion object { | ||
fun from(attendanceInfos: List<AttendanceInfo>): AttendanceDashboardInfo { | ||
return AttendanceDashboardInfo( | ||
attendanceCount = attendanceInfos.count { it.firstHour == AttendanceCategory.ATTENDANCE } + attendanceInfos.count { it.secondHour == AttendanceCategory.ATTENDANCE }, | ||
lateCount = attendanceInfos.count { it.firstHour == AttendanceCategory.LATE } + attendanceInfos.count { it.secondHour == AttendanceCategory.LATE }, | ||
absentCount = attendanceInfos.count { it.firstHour == AttendanceCategory.ABSENT } + attendanceInfos.count { it.secondHour == AttendanceCategory.ABSENT }, | ||
) | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/com/example/cmc_be/attendance/dto/res/AttendanceInfo.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,15 @@ | ||
package com.example.cmc_be.attendance.dto.res | ||
|
||
import com.example.cmc_be.domain.attendance.enums.AttendanceCategory | ||
import com.fasterxml.jackson.annotation.JsonFormat | ||
import java.time.LocalDate | ||
|
||
data class AttendanceInfo( | ||
val week: Int, | ||
val firstHour: AttendanceCategory, | ||
val secondHour: AttendanceCategory, | ||
val isOffline: Boolean, | ||
val enable: Boolean, | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") | ||
val date: LocalDate | ||
) |
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/com/example/cmc_be/attendance/dto/res/AttendancesDashboard.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 com.example.cmc_be.attendance.dto.res | ||
|
||
data class AttendancesDashboard( | ||
val attendanceStatus: AttendanceDashboardInfo, | ||
val attandances: List<AttendanceInfo> | ||
) { | ||
|
||
companion object { | ||
fun from(attendanceInfos: List<AttendanceInfo>): AttendancesDashboard { | ||
val enableAttendances = attendanceInfos.filter { it.enable } | ||
return AttendancesDashboard( | ||
attendanceStatus = AttendanceDashboardInfo.from(enableAttendances), | ||
attandances = attendanceInfos | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.