Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.chukchukhaksa.mobile.common.model.academic

data class AcademicRecord(
val courses: AcademicRecordCourses,
val semesterGrade: SemesterGrade
)

data class AcademicRecordCourses(
val liberal: List<Liberal>,
val major: List<Major>
)

data class SemesterGrade(
val attemptedCredits: Int,
val classRank: Int,
val earnedCredits: Int,
val percentile: Double,
val semester: Int,
val semesterGpa: Double,
val totalStudents: Int,
val year: Int
)

data class Major(
val areaType: String,
val courseCode: String,
val courseName: String,
val credits: Int,
val grade: String,
val id: String,
val isOnline: Boolean,
val isRetake: Boolean,
val isRetakeDelete: Boolean,
val originalScore: Int,
val professor: String,
val score: Int,
val semester: Int,
val year: Int
)

data class Liberal(
val areaType: String,
val courseCode: String,
val courseName: String,
val credits: Int,
val grade: String,
val id: String,
val isOnline: Boolean,
val isRetake: Boolean,
val isRetakeDelete: Boolean,
val originalScore: Int,
val professor: String,
val score: Int,
val semester: Int,
val year: Int
)
Comment on lines +24 to +56

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿงน Nitpick | ๐Ÿ”ต Trivial

Major/Liberal ๋ชจ๋ธ ์ค‘๋ณต์„ ์ค„์ด๋Š” ๋ฆฌํŒฉํ„ฐ๋ง์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

Line 24-56์€ ํ•„๋“œ๊ฐ€ 100% ๋™์ผํ•ด์„œ ๋ณ€๊ฒฝ ๋ˆ„๋ฝ ์œ„ํ—˜์ด ํฝ๋‹ˆ๋‹ค. ๊ณตํ†ต Course ๋ชจ๋ธ๋กœ ํ†ตํ•ฉํ•˜๊ณ  ๋ฆฌ์ŠคํŠธ๋งŒ ๊ตฌ๋ถ„ํ•˜๋Š” ๊ตฌ์กฐ๊ฐ€ ์œ ์ง€๋ณด์ˆ˜์— ์œ ๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

โ™ป๏ธ ๊ตฌ์กฐ ๋‹จ์ˆœํ™” ์˜ˆ์‹œ
 data class AcademicRecordCourses(
-  val liberal: List<Liberal>,
-  val major: List<Major>
+  val liberal: List<Course>,
+  val major: List<Course>
 )

-data class Major(
+data class Course(
   val areaType: String,
   val courseCode: String,
   val courseName: String,
   val credits: Int,
   val grade: String,
   val id: String,
   val isOnline: Boolean,
   val isRetake: Boolean,
   val isRetakeDelete: Boolean,
   val originalScore: Int,
   val professor: String,
   val score: Int,
   val semester: Int,
   val year: Int
 )
-
-data class Liberal(
-  ...
-)
๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/academic/AcademicRecord.kt`
around lines 24 - 56, Replace the duplicated Major and Liberal models with a
single shared data class named Course that contains the common fields (areaType,
courseCode, courseName, credits, grade, id, isOnline, isRetake, isRetakeDelete,
originalScore, professor, score, semester, year), then update the file to either
typealias Major = Course and typealias Liberal = Course or change usages to
List<Course> (and adjust any callers expecting Major/Liberal accordingly) so
only one canonical model holds the fields and lists distinguish the roles.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.chukchukhaksa.mobile.common.model.academic

data class AcademicSummary(
val cumulativeGpa: Double,
val percentile: Double,
val requiredCredits: Int,
val totalEarnedCredits: Int
)

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.chukchukhaksa.mobile.common.model.graduation

data class GraduationProcess(
val areaType: String,
val completedElectiveCourses: Int,
val courses: List<GraduationProcessCourse>,
val earnedCredits: Int,
val requiredCredits: Int,
val requiredElectiveCourses: Int,
val totalElectiveCourses: Int
)

data class GraduationProcessCourse(
val courseName: String,
val credits: Int,
val grade: String,
val semester: Int,
val year: Int
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.chukchukhaksa.mobile.common.model.profile

data class Profile(
val name: String,
val studentCode: String,
val departmentName: String,
val majorName: String,
val gradeLevel: Int,
val currentSemester: Int,
val status : String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
package com.chukchukhaksa.mobile.common.model.response.academic

import com.chukchukhaksa.mobile.common.model.academic.AcademicRecord
import com.chukchukhaksa.mobile.common.model.academic.AcademicRecordCourses
import com.chukchukhaksa.mobile.common.model.academic.Liberal
import com.chukchukhaksa.mobile.common.model.academic.Major
import com.chukchukhaksa.mobile.common.model.academic.SemesterGrade

data class AcademicRecordResponse(
val data: AcademicRecordResponseData,
val message: String,
val success: Boolean
)
Comment on lines +9 to +13

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿงน Nitpick | ๐Ÿ”ต Trivial

์‘๋‹ต ๋ชจ๋ธ ๋ณ€ํ™˜ ์ง„์ž…์ ์„ ๋ฃจํŠธ์—๋„ ๋งž์ถฐ์ฃผ๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

ํ˜„์žฌ๋Š” data.toAcademicRecord()๋งŒ ๊ฐ€๋Šฅํ•ด์„œ ํ˜ธ์ถœ ํŒจํ„ด์ด ๋ถ„์‚ฐ๋ฉ๋‹ˆ๋‹ค. ๋ฃจํŠธ(AcademicRecordResponse)์— ๋ณ€ํ™˜ ํ•จ์ˆ˜๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด ์‚ฌ์šฉ์„ฑ์ด ์ผ๊ด€๋ฉ๋‹ˆ๋‹ค.

๐Ÿ”ง ์ œ์•ˆ ์ˆ˜์ •์•ˆ
 data class AcademicRecordResponse(
     val data: AcademicRecordResponseData,
     val message: String,
     val success: Boolean
-)
+) {
+  fun toAcademicRecord() = data.toAcademicRecord()
+}
๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/academic/AcademicRecordResponse.kt`
around lines 9 - 13, AcademicRecordResponse์— ๋ฃจํŠธ ์ˆ˜์ค€ ๋ณ€ํ™˜ ์ง„์ž…์ ์„ ์ถ”๊ฐ€ํ•ด ํ˜ธ์ถœ ํŒจํ„ด์„ ์ผ๊ด€ํ™”ํ•˜์„ธ์š”:
AcademicRecordResponse ํด๋ž˜์Šค(๋˜๋Š” ํ™•์žฅ ํ•จ์ˆ˜)์— toAcademicRecord() ๋ฉ”์„œ๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๋‚ด๋ถ€์ ์œผ๋กœ ํ˜„์žฌ์˜
AcademicRecordResponseData.toAcademicRecord()๋ฅผ ํ˜ธ์ถœํ•˜๊ณ  ํ•„์š”ํ•œ ๋ฉ”ํƒ€(success/message)๊ฐ€ ์žˆ๋‹ค๋ฉด
ํ•จ๊ป˜ ๋งคํ•‘ํ•˜๋„๋ก ์œ„์ž„ํ•˜๋„๋ก ๊ตฌํ˜„ํ•˜์„ธ์š”; ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๊ธฐ์กด ํ˜ธ์ถœ์ž๋“ค์ด data.toAcademicRecord() ๋Œ€์‹ 
AcademicRecordResponse.toAcademicRecord()๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.


data class AcademicRecordResponseData(
val courses: AcademicRecordCoursesData,
val semesterGrade: SemesterGradeData
) {
fun toAcademicRecord() = AcademicRecord(
courses = courses.toAcademicRecordCourses(),
semesterGrade = semesterGrade.toSemesterGrade()
)
}

data class AcademicRecordCoursesData(
val liberal: List<LiberalData>,
val major: List<MajorData>
) {
fun toAcademicRecordCourses() = AcademicRecordCourses(
liberal = liberal.map { it.toLiberal() },
major = major.map { it.toMajor() }
)
}


data class SemesterGradeData(
val attemptedCredits: Int,
val classRank: Int,
val earnedCredits: Int,
val percentile: Double,
val semester: Int,
val semesterGpa: Double,
val totalStudents: Int,
val year: Int
) {
fun toSemesterGrade() = SemesterGrade(
attemptedCredits = attemptedCredits,
classRank = classRank,
earnedCredits = earnedCredits,
percentile = percentile,
semester = semester,
semesterGpa = semesterGpa,
totalStudents = totalStudents,
year = year,
)
}

data class MajorData(
val areaType: String,
val courseCode: String,
val courseName: String,
val credits: Int,
val grade: String,
val id: String,
val isOnline: Boolean,
val isRetake: Boolean,
val isRetakeDelete: Boolean,
val originalScore: Int,
val professor: String,
val score: Int,
val semester: Int,
val year: Int
) {
fun toMajor() = Major(
areaType = areaType,
courseCode = courseCode,
courseName = courseName,
credits = credits,
grade = grade,
id = id,
isOnline = isOnline,
isRetake = isRetake,
isRetakeDelete = isRetakeDelete,
originalScore = originalScore,
professor = professor,
score = score,
semester = semester,
year = year,
)
}

data class LiberalData(
val areaType: String,
val courseCode: String,
val courseName: String,
val credits: Int,
val grade: String,
val id: String,
val isOnline: Boolean,
val isRetake: Boolean,
val isRetakeDelete: Boolean,
val originalScore: Int,
val professor: String,
val score: Int,
val semester: Int,
val year: Int
) {
fun toLiberal() = Liberal(
areaType = areaType,
courseCode = courseCode,
courseName = courseName,
credits = credits,
grade = grade,
id = id,
isOnline = isOnline,
isRetake = isRetake,
isRetakeDelete = isRetakeDelete,
originalScore = originalScore,
professor = professor,
score = score,
semester = semester,
year = year,
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.chukchukhaksa.mobile.common.model.response.academic

import com.chukchukhaksa.mobile.common.model.academic.AcademicSummary

data class AcademicSummaryResponse(
val data: AcademicSummaryResponseData,
val message: String,
val success: Boolean
)
Comment on lines +5 to +9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue | ๐ŸŸก Minor

๐Ÿงฉ Analysis chain

๐Ÿ Script executed:

# Search for `@Serializable` usage in Response models
echo "=== Checking for `@Serializable` in Response models ==="
rg -n "@Serializable" --type=kt composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile -A 2 | head -50

# Check other Response models in the same academic directory
echo -e "\n=== Response models in academic directory ==="
fd "Response\.kt$" composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/academic/

# Check general Response model directory
echo -e "\n=== Response files in response directory ==="
find composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response -name "*.kt" -type f | head -20

Repository: cchaksa/cchaksa-app

Length of output: 1174


๐Ÿ Script executed:

# Let's examine a few Response model files to understand the pattern
echo "=== Examining AcademicSummaryResponse ==="
cat -n composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/academic/AcademicSummaryResponse.kt

echo -e "\n=== Examining AcademicSummaryResponseData ==="
fd "AcademicSummaryResponseData\.kt$" -x cat -n

Repository: cchaksa/cchaksa-app

Length of output: 944


๐Ÿ Script executed:

# Check if there's a serialization configuration file or setup
echo "=== Checking for serialization setup ==="
rg -n "kotlinx.serialization|Json|Serializable" --type=kt composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response -A 1 | head -40

Repository: cchaksa/cchaksa-app

Length of output: 147


๐Ÿ Script executed:

# Examine other Response models
echo "=== ProfileResponse ==="
cat -n composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/profile/ProfileResponse.kt

echo -e "\n=== SemesterListResponse ==="
cat -n composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/semester/SemesterListResponse.kt

echo -e "\n=== AcademicRecordResponse ==="
cat -n composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/academic/AcademicRecordResponse.kt

Repository: cchaksa/cchaksa-app

Length of output: 5817


๐Ÿ Script executed:

# Check for serialization library setup in build files
echo "=== Checking gradle for serialization ==="
find composeApp -name "build.gradle*" -o -name "*.gradle.kts" | xargs grep -l "serialization\|json" 2>/dev/null | head -5

# Check where API responses are deserialized
echo -e "\n=== Searching for Json parsing/deserialization logic ==="
rg "Json\.|Json\.decode\|parseJson\|fromJson" --type-add="kt:*.kt" composeApp/src/commonMain/kotlin -A 2 | head -50

Repository: cchaksa/cchaksa-app

Length of output: 5412


๐Ÿ Script executed:

# Check for HTTP client usage and serialization
echo "=== Checking for HTTP client setup ==="
rg "HttpClient\|Ktor\|Retrofit" --type-add="kt:*.kt" composeApp/src/commonMain/kotlin -B 1 -A 1 | head -40

Repository: cchaksa/cchaksa-app

Length of output: 101


๐Ÿ Script executed:

# Check the build.gradle.kts for serialization configuration
cat -n composeApp/build.gradle.kts | head -100

Repository: cchaksa/cchaksa-app

Length of output: 3981


๐Ÿ Script executed:

# Check if there's a custom Json setup that might handle serialization without `@Serializable`
echo "=== Checking common Json configuration ==="
cat -n composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/ui/Json.kt

# Check for `@Serializable` in common/ui directory
echo -e "\n=== Checking for `@Serializable` setup ==="
find composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common -name "*.kt" | xargs grep -l "@Serializable" | head -10

Repository: cchaksa/cchaksa-app

Length of output: 1590


๐Ÿ Script executed:

# Check how API responses are deserialized - look for HTTP client/API service
echo "=== Searching for API service or HTTP client configuration ==="
fd "Api.kt|Service.kt|Client.kt" composeApp/src/commonMain/kotlin -x cat -n

echo -e "\n=== Checking for Ktor HTTP client ==="
rg "HttpClient|createHttpClient|httpClient" --type-add="kt:*.kt" composeApp/src/commonMain -B 2 -A 5 | head -60

Repository: cchaksa/cchaksa-app

Length of output: 850


๐Ÿ Script executed:

# Check one of the models that has `@Serializable` to see the pattern
echo "=== Checking OpenLecture.kt with `@Serializable` ==="
cat -n composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/OpenLecture.kt

echo -e "\n=== Checking Timetable.kt with `@Serializable` ==="
head -20 composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/Timetable.kt

Repository: cchaksa/cchaksa-app

Length of output: 1328


Response ๋ชจ๋ธ์— @Serializable ์–ด๋…ธํ…Œ์ด์…˜์ด ๋ˆ„๋ฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์ด ํ”„๋กœ์ ํŠธ๋Š” kotlinx.serialization์„ ์‚ฌ์šฉํ•˜๋ฉฐ, API ์‘๋‹ต์„ JSON์—์„œ ์—ญ์ง๋ ฌํ™”ํ•˜๋ ค๋ฉด @Serializable ์–ด๋…ธํ…Œ์ด์…˜์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. OpenLecture, Timetable ๋“ฑ ๋‹ค๋ฅธ ์ง๋ ฌํ™” ๋Œ€์ƒ ๋ชจ๋ธ๋“ค์€ ๋ชจ๋‘ ์ด ์–ด๋…ธํ…Œ์ด์…˜์„ ํฌํ•จํ•˜๊ณ  ์žˆ์œผ๋ฏ€๋กœ, AcademicSummaryResponse์™€ AcademicSummaryResponseData๋„ ์ถ”๊ฐ€ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/academic/AcademicSummaryResponse.kt`
around lines 5 - 9, AcademicSummaryResponse ๋ฐ ๊ทธ ๋‚ด๋ถ€ ๋ฐ์ดํ„ฐ ํด๋ž˜์Šค
AcademicSummaryResponseData์— kotlinx.serialization์šฉ `@Serializable` ์–ด๋…ธํ…Œ์ด์…˜์„ ์ถ”๊ฐ€ํ•˜์„ธ์š”:
ํŒŒ์ผ์˜ data class AcademicSummaryResponse๊ณผ ํ•ด๋‹น AcademicSummaryResponseData ์„ ์–ธ ์œ„์— ๊ฐ๊ฐ
`@Serializable์„` ๋ถ™์—ฌ JSON ์—ญ์ง๋ ฌํ™”๊ฐ€ ๊ฐ€๋Šฅํ•˜๋„๋ก ํ•˜๊ณ , ๋‹ค๋ฅธ ๋ชจ๋ธ(OpenLecture, Timetable ๋“ฑ)๊ณผ ๋™์ผํ•œ ์ง๋ ฌํ™”
๊ทœ์น™์„ ๋”ฐ๋ฅด๋„๋ก ๋งŒ๋“œ์„ธ์š”.


data class AcademicSummaryResponseData(
val cumulativeGpa: Double,
val percentile: Double,
val requiredCredits: Int,
val totalEarnedCredits: Int
) {
fun toAcademicSummary() = AcademicSummary(
cumulativeGpa = cumulativeGpa,
percentile = percentile,
requiredCredits = requiredCredits,
totalEarnedCredits = totalEarnedCredits,
)
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.chukchukhaksa.mobile.common.model.response.graduation

import com.chukchukhaksa.mobile.common.model.graduation.GraduationProcess
import com.chukchukhaksa.mobile.common.model.graduation.GraduationProcessCourse

data class GraduationProcessResponse(
val data: GraduationProcessResponseData,
val message: String,
val success: Boolean
)
Comment on lines +6 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿงน Nitpick | ๐Ÿ”ต Trivial

๋“ค์—ฌ์“ฐ๊ธฐ ๋ถˆ์ผ์น˜

GraduationProcessResponse ํด๋ž˜์Šค๋Š” 4์นธ ๋“ค์—ฌ์“ฐ๊ธฐ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์ง€๋งŒ, ํŒŒ์ผ ๋‚ด ๋‹ค๋ฅธ ํด๋ž˜์Šค๋“ค์€ 2์นธ ๋“ค์—ฌ์“ฐ๊ธฐ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ผ๊ด€์„ฑ์„ ์œ„ํ•ด ํ†ต์ผํ•ด ์ฃผ์„ธ์š”.

โ™ป๏ธ ๋“ค์—ฌ์“ฐ๊ธฐ ์ˆ˜์ • ์ œ์•ˆ
 data class GraduationProcessResponse(
-    val data: GraduationProcessResponseData,
-    val message: String,
-    val success: Boolean
+  val data: GraduationProcessResponseData,
+  val message: String,
+  val success: Boolean
 )
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
data class GraduationProcessResponse(
val data: GraduationProcessResponseData,
val message: String,
val success: Boolean
)
data class GraduationProcessResponse(
val data: GraduationProcessResponseData,
val message: String,
val success: Boolean
)
๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/graduation/GraduationProcessResponse.kt`
around lines 6 - 10, The GraduationProcessResponse declaration uses 4-space
indentation while the rest of the file uses 2-space indentation; update the
class block so each property line (data: GraduationProcessResponseData, message:
String, success: Boolean) and the closing parenthesis are indented with 2 spaces
to match the project's style and other classes in this file (look for the
GraduationProcessResponse class and its properties to adjust).


data class GraduationProcessResponseData(
val graduationProgress: List<GraduationProgressData>,
val hasDifferentGraduationRequirement: Boolean
)

data class GraduationProgressData(
val areaType: String,
val completedElectiveCourses: Int,
val courses: List<GraduationProcessCourseData>,
val earnedCredits: Int,
val requiredCredits: Int,
val requiredElectiveCourses: Int,
val totalElectiveCourses: Int
) {
fun toGraduationProcess() = GraduationProcess(
areaType = areaType,
completedElectiveCourses = completedElectiveCourses,
courses = courses.map { it.toGraduationProcessCourse() },
earnedCredits = earnedCredits,
requiredCredits = requiredCredits,
requiredElectiveCourses = requiredElectiveCourses,
totalElectiveCourses = totalElectiveCourses,
)
}

data class GraduationProcessCourseData(
val courseName: String,
val credits: Int,
val grade: String,
val semester: Int,
val year: Int
) {
fun toGraduationProcessCourse() = GraduationProcessCourse(
courseName = courseName,
credits = credits,
grade = grade,
semester = semester,
year = year,
)
}
Comment on lines +6 to +51

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue | ๐ŸŸ  Major

๐Ÿงฉ Analysis chain

๐Ÿ Script executed:

# First, let's check the full content of the file in question
cat -n "composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/graduation/GraduationProcessResponse.kt"

Repository: cchaksa/cchaksa-app

Length of output: 1905


๐Ÿ Script executed:

# Search for `@Serializable` annotations in other response models
rg -l "@Serializable" --type=kotlin "composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/" | head -20

Repository: cchaksa/cchaksa-app

Length of output: 799


๐Ÿ Script executed:

# Check for other response model patterns
fd "Response\.kt$" "composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/" | head -10

Repository: cchaksa/cchaksa-app

Length of output: 752


๐Ÿ Script executed:

# Check for serialization library setup in build files
fd "build\.gradle|build\.gradle\.kts" | xargs grep -l "serialization\|gson\|moshi" 2>/dev/null

Repository: cchaksa/cchaksa-app

Length of output: 90


๐Ÿ Script executed:

# Search for actual serialization annotations in the project
rg "@Serializable|@SerializedName|@Json" --type=kotlin "composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/" | head -20

Repository: cchaksa/cchaksa-app

Length of output: 1134


๐Ÿ Script executed:

# Check if other response models have `@Serializable` annotations
cat -n "composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/profile/ProfileResponse.kt" 2>/dev/null | head -30

Repository: cchaksa/cchaksa-app

Length of output: 1044


๐Ÿ Script executed:

# Check another response model
cat -n "composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/academic/AcademicRecordResponse.kt" 2>/dev/null | head -30

Repository: cchaksa/cchaksa-app

Length of output: 1286


๐Ÿ Script executed:

# Check build.gradle.kts for serialization setup
grep -A5 -B5 "serialization\|kotlinx" "composeApp/build.gradle.kts" | head -50

Repository: cchaksa/cchaksa-app

Length of output: 881


๐Ÿ Script executed:

# Check if any response models use `@Serializable`
rg "@Serializable" --type=kotlin "composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/"

Repository: cchaksa/cchaksa-app

Length of output: 45


์ง๋ ฌํ™” ์–ด๋…ธํ…Œ์ด์…˜ ์ถ”๊ฐ€ ํ•„์š”

API ์‘๋‹ต ๋ชจ๋ธ์—์„œ @Serializable ์–ด๋…ธํ…Œ์ด์…˜์ด ๋ˆ„๋ฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ํ”„๋กœ์ ํŠธ๋Š” kotlinx.serialization์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์œผ๋ฉฐ, ๋‹ค๋ฅธ ๋ชจ๋ธ ํด๋ž˜์Šค๋“ค(Timetable.kt, OpenLecture.kt ๋“ฑ)์€ ๋ชจ๋‘ ์ด ์–ด๋…ธํ…Œ์ด์…˜์„ ํฌํ•จํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. JSON ์—ญ์ง๋ ฌํ™” ์‹œ ๋Ÿฐํƒ€์ž„ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์œผ๋‹ˆ @Serializable์„ ๊ฐ ๋ฐ์ดํ„ฐ ํด๋ž˜์Šค์— ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”:

`@Serializable`
data class GraduationProcessResponse(...)

`@Serializable`
data class GraduationProcessResponseData(...)

`@Serializable`
data class GraduationProgressData(...)

`@Serializable`
data class GraduationProcessCourseData(...)
๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/graduation/GraduationProcessResponse.kt`
around lines 6 - 51, Add kotlinx.serialization support by annotating each
response model with `@Serializable`: GraduationProcessResponse,
GraduationProcessResponseData, GraduationProgressData, and
GraduationProcessCourseData; also add the import for
kotlinx.serialization.Serializable where these classes are declared so the JSON
(de)serializer can recognize and parse instances of these classes at runtime.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.chukchukhaksa.mobile.common.model.response.profile

import com.chukchukhaksa.mobile.common.model.profile.Profile

data class ProfileResponse(
val success: Boolean,
val data: ProfileResponseData,
val message: String,
)

data class ProfileResponseData(
val name: String,
val studentCode: String,
val departmentName: String,
val majorName: String,
val gradeLevel: Int,
val currentSemester: Int,
val status : String,
val lastUpdatedAt: String,
val lastSyncedAt : String,
val reconnectionRequired: Boolean
) {
fun toProfile() = Profile(
name = name,
studentCode = studentCode,
departmentName = departmentName,
majorName = majorName,
gradeLevel = gradeLevel,
currentSemester = currentSemester,
status = status
)
Comment on lines +23 to +31

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿงน Nitpick | ๐Ÿ”ต Trivial

๋งคํ•‘์—์„œ ์ œ์™ธ๋œ ํ•„๋“œ ๊ฒ€ํ† 

toProfile()์—์„œ lastUpdatedAt, lastSyncedAt, reconnectionRequired ํ•„๋“œ๊ฐ€ ๋งคํ•‘๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํŠนํžˆ reconnectionRequired๋Š” ์‚ฌ์šฉ์ž์—๊ฒŒ ์žฌ์—ฐ๊ฒฐ์ด ํ•„์š”ํ•จ์„ ์•Œ๋ ค์•ผ ํ•  ๋•Œ UI์—์„œ ํ™œ์šฉ๋  ์ˆ˜ ์žˆ๋Š” ์ค‘์š”ํ•œ ์ƒํƒœ ์ •๋ณด์ž…๋‹ˆ๋‹ค.

ํ•ด๋‹น ํ•„๋“œ๋“ค์ด ์˜๋„์ ์œผ๋กœ ์ œ์™ธ๋œ ๊ฒƒ์ธ์ง€, ๋˜๋Š” ๋ณ„๋„์˜ ์ƒํƒœ ๊ด€๋ฆฌ๋ฅผ ํ†ตํ•ด ์ฒ˜๋ฆฌ๋˜๋Š”์ง€ ํ™•์ธํ•ด ์ฃผ์„ธ์š”.

๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/profile/ProfileResponse.kt`
around lines 23 - 31, toProfile() currently omits lastUpdatedAt, lastSyncedAt,
and reconnectionRequired from the Profile conversion; update the toProfile()
function to map these fields into the Profile constructor (e.g., lastUpdatedAt =
lastUpdatedAt, lastSyncedAt = lastSyncedAt, reconnectionRequired =
reconnectionRequired), handling any nullable/format conversions required to
match Profile's property types and preserving existing behavior for defaults if
fields are absent.

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.chukchukhaksa.mobile.common.model.response.semester

import com.chukchukhaksa.mobile.common.model.semester.SemesterGrades
import com.chukchukhaksa.mobile.common.model.semester.SemesterGradesList

data class SemesterGradesListResponse(
val data: List<SemesterGradesData>,
val message: String,
val success: Boolean
) {
fun toSemesterGradesList() = SemesterGradesList(
semesterGradesList = data.map { it.toSemesterGrades() }
)
Comment on lines +11 to +13

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue | ๐ŸŸ  Major

์‹คํŒจ ์‘๋‹ต๋„ ์ •์ƒ ๋ชจ๋ธ๋กœ ๋ณ€ํ™˜๋˜๋Š” ๊ฒฝ๋กœ๋ฅผ ์ฐจ๋‹จํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

Line 11-13์—์„œ success ํ™•์ธ ์—†์ด ๋ณ€ํ™˜ํ•˜๋ฉด, ์‹คํŒจ ์‘๋‹ต์ด ์ •์ƒ ๋ฐ์ดํ„ฐ์ฒ˜๋Ÿผ UI๋กœ ์ „๋‹ฌ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ”ง ์ œ์•ˆ ์ˆ˜์ •์•ˆ
 data class SemesterGradesListResponse(
     val data: List<SemesterGradesData>,
     val message: String,
     val success: Boolean
 ) {
-  fun toSemesterGradesList() = SemesterGradesList(
-    semesterGradesList = data.map { it.toSemesterGrades() }
-  )
+  fun toSemesterGradesList(): SemesterGradesList {
+    require(success) { "Semester grades API failed: $message" }
+    return SemesterGradesList(
+      semesterGradesList = data.map { it.toSemesterGrades() },
+    )
+  }
 }
๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/semester/SemesterGradesListResponse.kt`
around lines 11 - 13, toSemesterGradesList currently converts response->model
without verifying the response succeeded, allowing error responses to flow to
the UI; update the toSemesterGradesList function to first check the response's
success boolean (the success property on this response) and if it's false stop
conversionโ€”e.g. throw an IllegalStateException (or return null/Result as your
codebase prefers) instead of mapping data; reference the toSemesterGradesList
function, the success property, data collection and the target
SemesterGradesList model when making the change.

}

data class SemesterGradesData(
val attemptedCredits: Int,
val classRank: Int,
val earnedCredits: Int,
val percentile: Double,
val semester: Int,
val semesterGpa: Double,
val totalStudents: Int,
val year: Int
) {
fun toSemesterGrades() = SemesterGrades(
attemptedCredits = attemptedCredits,
classRank = classRank,
earnedCredits = earnedCredits,
percentile = percentile,
semester = semester,
semesterGpa = semesterGpa,
totalStudents = totalStudents,
year = year,
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.chukchukhaksa.mobile.common.model.response.semester

import com.chukchukhaksa.mobile.common.model.semester.SemesterList
import com.chukchukhaksa.mobile.presentation.timetable.semesterselect.Semester

data class SemesterListResponse(
val data: List<SemesterData>,
val message: String,
val success: Boolean
) {
fun toSemesterList() = SemesterList(
semesterList = data.map { it.toSemester() }
)
Comment on lines +11 to +13

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue | ๐ŸŸ  Major

์‹คํŒจ ์‘๋‹ต์„ ์ •์ƒ ๋ฐ์ดํ„ฐ๋กœ ๋งคํ•‘ํ•  ์œ„ํ—˜์ด ์žˆ์Šต๋‹ˆ๋‹ค

Line 11~13์˜ toSemesterList()๊ฐ€ success/message๋ฅผ ๋ฌด์‹œํ•˜๊ณ  ํ•ญ์ƒ ๋งคํ•‘ํ•ฉ๋‹ˆ๋‹ค. ํ˜ธ์ถœ๋ถ€ ์‹ค์ˆ˜ ์‹œ ์‹คํŒจ ์‘๋‹ต์ด ์ •์ƒ ๋ฐ์ดํ„ฐ๋กœ ํ˜๋Ÿฌ๊ฐ€๋ฏ€๋กœ, ์ตœ์†Œํ•œ ์„ฑ๊ณต ์—ฌ๋ถ€๋ฅผ ๊ฒ€์ฆํ•˜๊ฑฐ๋‚˜ nullable/Result ๊ธฐ๋ฐ˜์œผ๋กœ ๊ณ„์•ฝ์„ ๋ช…์‹œํ•ด ์ฃผ์„ธ์š”.

๊ถŒ์žฅ ์ˆ˜์ • ์˜ˆ์‹œ (fail-fast)
-  fun toSemesterList() = SemesterList(
-    semesterList = data.map { it.toSemester() }
-  )
+  fun toSemesterList(): SemesterList {
+    require(success) { "Failed to map SemesterListResponse: $message" }
+    return SemesterList(
+      semesterList = data.map { it.toSemester() }
+    )
+  }
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fun toSemesterList() = SemesterList(
semesterList = data.map { it.toSemester() }
)
fun toSemesterList(): SemesterList {
require(success) { "Failed to map SemesterListResponse: $message" }
return SemesterList(
semesterList = data.map { it.toSemester() }
)
}
๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/common/model/response/semester/SemesterListResponse.kt`
around lines 11 - 13, toSemesterList() currently ignores response
success/message and always maps data to a SemesterList, risking propagation of
failure responses; update the toSemesterList() implementation to check the
response's success (and/or message) first and only map data when success is
trueโ€”otherwise return a nullable (SemesterList?) or a Result/Failure (or throw)
to make the contract explicit; reference the toSemesterList() function, the
SemesterList type, and the response properties (data, success, message) and
update callers accordingly to handle the nullable/Result/exception return.

}

data class SemesterData(
val semester: Int,
val year: Int
) {
fun toSemester() = Semester(
semester = semester.toString(),
year = year.toString(),
)
}
Loading
Loading