Skip to content
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

Closed

Conversation

dixidroid
Copy link
Collaborator

Ticket

Expired Not Upgradeable Expired Upgradeable
Expired Upgradeable Not Configured Not Started

@dixidroid dixidroid force-pushed the feat/course_error_handling branch 5 times, most recently from d85c202 to 6a3502d Compare July 24, 2024 12:52
@dixidroid dixidroid force-pushed the feat/course_error_handling branch from 6a3502d to 9732384 Compare July 25, 2024 07:31
@@ -1,22 +1,33 @@
package org.openedx.core.data.model

import com.google.gson.annotations.SerializedName
import org.openedx.core.domain.model.CourseAccessDetails

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(

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,

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

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 {

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"

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"

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"

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"

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.

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

@omerhabib26
Copy link

Closing this PR in response of #18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants