-
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
feat: added ability to handle course errors #14
Conversation
d85c202
to
6a3502d
Compare
6a3502d
to
9732384
Compare
@@ -1,22 +1,33 @@ | |||
package org.openedx.core.data.model | |||
|
|||
import com.google.gson.annotations.SerializedName | |||
import org.openedx.core.domain.model.CourseAccessDetails |
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.
As data model and domain model have the same names, so it will be a good approach if we can define the domain model alias.
i.e,
import org.openedx.core.domain.model.CourseAccessDetails as DomainCourseAccessDetails
TimeUtils.iso8601ToDate(auditAccessExpires ?: ""), | ||
coursewareAccess?.mapToDomain() | ||
) | ||
fun mapToDomain() = CourseAccessDetails( |
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.
fun mapToDomain() = DomainCourseAccessDetails(
hasUnmetPrerequisites = hasUnmetPrerequisites,
isTooEarly = isTooEarly,
isStaff = isStaff,
auditAccessExpires = TimeUtils.iso8601ToDate(auditAccessExpires ?: ""),
coursewareAccess = coursewareAccess?.mapToDomain(),
)
|
||
fun mapToRoomEntity(): CourseAccessDetailsDb = | ||
CourseAccessDetailsDb(auditAccessExpires, coursewareAccess?.mapToRoomEntity()) | ||
CourseAccessDetailsDb( | ||
hasUnmetPrerequisites, isTooEarly, isStaff, |
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.
please mention the attributes names as well.
fun mapToRoomEntity(): CourseAccessDetailsDb =
CourseAccessDetailsDb(
hasUnmetPrerequisites = hasUnmetPrerequisites,
isTooEarly = isTooEarly,
isStaff = isStaff,
auditAccessExpires = auditAccessExpires,
coursewareAccess = coursewareAccess?.mapToRoomEntity()
)
package org.openedx.core.data.model | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import org.openedx.core.domain.model.CourseEnrollmentDetails |
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.
same here
@SerializedName("course_info_overview") | ||
val courseInfoOverview: CourseInfoOverview, | ||
) { | ||
fun mapToDomain(): CourseEnrollmentDetails { |
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.
please use alias
@@ -0,0 +1,9 @@ | |||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
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.
no need for this file.
@@ -0,0 +1,9 @@ | |||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
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.
no need for this file.
@@ -0,0 +1,9 @@ | |||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
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.
requires auto-format
@@ -0,0 +1,32 @@ | |||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
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.
we need to update the file name, course_ic_arrow_up_circle.xml
also requires auto-format.
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.
better to rename it as course_ic_calendar.xml
Closing this PR in response of #18 |
Ticket