Add isAuthorized flag to students

This commit is contained in:
Mikołaj Pich 2023-05-10 22:57:25 +02:00
parent 5ce34018e3
commit d897ce49ae
6 changed files with 15 additions and 6 deletions

View file

@ -1515,7 +1515,7 @@ public final class io/github/wulkanowy/sdk/scrapper/register/RegisterEmployee :
}
public final class io/github/wulkanowy/sdk/scrapper/register/RegisterStudent : io/github/wulkanowy/sdk/scrapper/register/RegisterSubject {
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;)V
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;Z)V
public final fun component1 ()I
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
@ -1524,8 +1524,9 @@ public final class io/github/wulkanowy/sdk/scrapper/register/RegisterStudent : i
public final fun component6 ()I
public final fun component7 ()Z
public final fun component8 ()Ljava/util/List;
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;)Lio/github/wulkanowy/sdk/scrapper/register/RegisterStudent;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/scrapper/register/RegisterStudent;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;ILjava/lang/Object;)Lio/github/wulkanowy/sdk/scrapper/register/RegisterStudent;
public final fun component9 ()Z
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;Z)Lio/github/wulkanowy/sdk/scrapper/register/RegisterStudent;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/scrapper/register/RegisterStudent;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;ZILjava/lang/Object;)Lio/github/wulkanowy/sdk/scrapper/register/RegisterStudent;
public fun equals (Ljava/lang/Object;)Z
public final fun getClassId ()I
public final fun getClassName ()Ljava/lang/String;
@ -1535,6 +1536,7 @@ public final class io/github/wulkanowy/sdk/scrapper/register/RegisterStudent : i
public final fun getStudentSecondName ()Ljava/lang/String;
public final fun getStudentSurname ()Ljava/lang/String;
public fun hashCode ()I
public final fun isAuthorized ()Z
public final fun isParent ()Z
public fun toString ()Ljava/lang/String;
}

View file

@ -48,4 +48,5 @@ data class RegisterStudent(
val classId: Int,
val isParent: Boolean,
val semesters: List<Semester>,
val isAuthorized: Boolean,
) : RegisterSubject

View file

@ -168,6 +168,7 @@ internal class RegisterRepository(
className = diary.symbol.orEmpty(),
classId = classId,
isParent = cache?.isParent == true,
isAuthorized = diary.isAuthorized == true,
semesters = diaries.toSemesters(
studentId = diary.studentId,
classId = classId,

View file

@ -897,7 +897,7 @@ public final class io/github/wulkanowy/sdk/pojo/RegisterEmployee : io/github/wul
}
public final class io/github/wulkanowy/sdk/pojo/RegisterStudent : io/github/wulkanowy/sdk/pojo/RegisterSubject {
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;)V
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;Z)V
public final fun component1 ()I
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
@ -906,8 +906,9 @@ public final class io/github/wulkanowy/sdk/pojo/RegisterStudent : io/github/wulk
public final fun component6 ()I
public final fun component7 ()Z
public final fun component8 ()Ljava/util/List;
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;)Lio/github/wulkanowy/sdk/pojo/RegisterStudent;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/pojo/RegisterStudent;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;ILjava/lang/Object;)Lio/github/wulkanowy/sdk/pojo/RegisterStudent;
public final fun component9 ()Z
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;Z)Lio/github/wulkanowy/sdk/pojo/RegisterStudent;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/pojo/RegisterStudent;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/util/List;ZILjava/lang/Object;)Lio/github/wulkanowy/sdk/pojo/RegisterStudent;
public fun equals (Ljava/lang/Object;)Z
public final fun getClassId ()I
public final fun getClassName ()Ljava/lang/String;
@ -917,6 +918,7 @@ public final class io/github/wulkanowy/sdk/pojo/RegisterStudent : io/github/wulk
public final fun getStudentSecondName ()Ljava/lang/String;
public final fun getStudentSurname ()Ljava/lang/String;
public fun hashCode ()I
public final fun isAuthorized ()Z
public final fun isParent ()Z
public fun toString ()Ljava/lang/String;
}

View file

@ -70,6 +70,7 @@ internal fun ScrapperRegisterStudent.mapStudent(): RegisterStudent = RegisterStu
classId = classId,
isParent = isParent,
semesters = semesters.mapSemesters(),
isAuthorized = isAuthorized,
)
fun List<StudentInfo>.mapHebeUser(
@ -118,6 +119,7 @@ private fun List<StudentInfo>.mapUnit(): List<RegisterUnit> {
className = student.classDisplay,
classId = -1, // todo
isParent = student.login.loginRole != "Uczen",
isAuthorized = true,
semesters = student.periods.map { period ->
Semester(
diaryId = student.journal.id,

View file

@ -50,4 +50,5 @@ data class RegisterStudent(
val classId: Int,
val isParent: Boolean,
val semesters: List<Semester>,
val isAuthorized: Boolean,
) : RegisterSubject