Hebe: Add attendance

This commit is contained in:
ProgramistaZpolski 2024-07-11 19:07:54 +02:00
parent f4e0ab9561
commit b2767c7fce
9 changed files with 700 additions and 7 deletions

View file

@ -2,6 +2,9 @@ public final class io/github/wulkanowy/sdk/hebe/Hebe {
public fun <init> ()V
public final fun addInterceptor (Lokhttp3/Interceptor;Z)V
public static synthetic fun addInterceptor$default (Lio/github/wulkanowy/sdk/hebe/Hebe;Lokhttp3/Interceptor;ZILjava/lang/Object;)V
public final fun getAttendance (ILjava/time/LocalDate;Ljava/time/LocalDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getAttendanceSummary (ILjava/time/LocalDate;Ljava/time/LocalDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getAttendanceSummaryForWholeYear (ILjava/time/LocalDate;Ljava/time/LocalDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getBaseUrl ()Ljava/lang/String;
public final fun getDeviceModel ()Ljava/lang/String;
public final fun getExams (Ljava/time/LocalDate;Ljava/time/LocalDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@ -53,6 +56,384 @@ public final class io/github/wulkanowy/sdk/hebe/exception/UnknownTokenException
public fun <init> (Ljava/lang/String;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/AttendanceSummary {
public fun <init> (Ljava/time/Month;IIIIIII)V
public final fun component1 ()Ljava/time/Month;
public final fun component2 ()I
public final fun component3 ()I
public final fun component4 ()I
public final fun component5 ()I
public final fun component6 ()I
public final fun component7 ()I
public final fun component8 ()I
public final fun copy (Ljava/time/Month;IIIIIII)Lio/github/wulkanowy/sdk/hebe/models/AttendanceSummary;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/AttendanceSummary;Ljava/time/Month;IIIIIIIILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/AttendanceSummary;
public fun equals (Ljava/lang/Object;)Z
public final fun getAbsence ()I
public final fun getAbsenceExcused ()I
public final fun getAbsenceForSchoolReasons ()I
public final fun getExemption ()I
public final fun getLateness ()I
public final fun getLatenessExcused ()I
public final fun getMonth ()Ljava/time/Month;
public final fun getPresence ()I
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Companion;
public fun <init> (ILio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;IILio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;ZLjava/lang/String;ZLio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;Z)V
public final fun component1 ()I
public final fun component10 ()Ljava/lang/String;
public final fun component11 ()Ljava/lang/String;
public final fun component12 ()Ljava/lang/String;
public final fun component13 ()I
public final fun component14 ()Ljava/lang/String;
public final fun component15 ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;
public final fun component16 ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;
public final fun component17 ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;
public final fun component18 ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;
public final fun component19 ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;
public final fun component2 ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;
public final fun component20 ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;
public final fun component21 ()Z
public final fun component3 ()I
public final fun component4 ()I
public final fun component5 ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;
public final fun component6 ()Z
public final fun component7 ()Ljava/lang/String;
public final fun component8 ()Z
public final fun component9 ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;
public final fun copy (ILio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;IILio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;ZLjava/lang/String;ZLio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;Z)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson;ILio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;IILio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;ZLjava/lang/String;ZLio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;ZILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson;
public fun equals (Ljava/lang/Object;)Z
public final fun getCalculatePresence ()Z
public final fun getClass ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;
public final fun getDateModify ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;
public final fun getDay ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;
public final fun getDistribution ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;
public final fun getGlobalKey ()Ljava/lang/String;
public final fun getGroupDefinition ()Ljava/lang/String;
public final fun getId ()I
public final fun getLessonClassGlobalKey ()Ljava/lang/String;
public final fun getLessonClassId ()I
public final fun getLessonId ()I
public final fun getLessonNumber ()I
public final fun getNote ()Ljava/lang/String;
public final fun getPresenceType ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;
public final fun getPrimaryTeacher ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;
public final fun getReplacement ()Z
public final fun getSecondaryTeacher ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;
public final fun getSubject ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;
public final fun getTimeSlot ()Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;
public final fun getTopic ()Ljava/lang/String;
public final fun getVisible ()Z
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class$Companion;
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()I
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;
public fun equals (Ljava/lang/Object;)Z
public final fun getDisplayName ()Ljava/lang/String;
public final fun getId ()I
public final fun getKey ()Ljava/lang/String;
public final fun getSymbol ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Class$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify$Companion;
public fun <init> (Ljava/time/LocalDate;Ljava/lang/String;Ljava/lang/String;J)V
public final fun component1 ()Ljava/time/LocalDate;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()J
public final fun copy (Ljava/time/LocalDate;Ljava/lang/String;Ljava/lang/String;J)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;Ljava/time/LocalDate;Ljava/lang/String;Ljava/lang/String;JILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;
public fun equals (Ljava/lang/Object;)Z
public final fun getDate ()Ljava/time/LocalDate;
public final fun getDateDisplay ()Ljava/lang/String;
public final fun getTime ()Ljava/lang/String;
public final fun getTimestamp ()J
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$DateModify$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day$Companion;
public fun <init> (Ljava/time/LocalDate;Ljava/lang/String;Ljava/lang/String;J)V
public final fun component1 ()Ljava/time/LocalDate;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()J
public final fun copy (Ljava/time/LocalDate;Ljava/lang/String;Ljava/lang/String;J)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;Ljava/time/LocalDate;Ljava/lang/String;Ljava/lang/String;JILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;
public fun equals (Ljava/lang/Object;)Z
public final fun getDate ()Ljava/time/LocalDate;
public final fun getDateDisplay ()Ljava/lang/String;
public final fun getTime ()Ljava/lang/String;
public final fun getTimestamp ()J
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Day$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution$Companion;
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()I
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun component5 ()Ljava/lang/String;
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;
public fun equals (Ljava/lang/Object;)Z
public final fun getId ()I
public final fun getKey ()Ljava/lang/String;
public final fun getName ()Ljava/lang/String;
public final fun getPartType ()Ljava/lang/String;
public final fun getShortcut ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Distribution$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType$Companion;
public fun <init> (ILjava/lang/String;Ljava/lang/String;ILjava/lang/String;IZZZZZZ)V
public final fun component1 ()I
public final fun component10 ()Z
public final fun component11 ()Z
public final fun component12 ()Z
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()I
public final fun component5 ()Ljava/lang/String;
public final fun component6 ()I
public final fun component7 ()Z
public final fun component8 ()Z
public final fun component9 ()Z
public final fun copy (ILjava/lang/String;Ljava/lang/String;ILjava/lang/String;IZZZZZZ)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;ILjava/lang/String;Ljava/lang/String;ILjava/lang/String;IZZZZZZILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;
public fun equals (Ljava/lang/Object;)Z
public final fun getAbsence ()Z
public final fun getAbsenceJustified ()Z
public final fun getCategoryId ()I
public final fun getCategoryName ()Ljava/lang/String;
public final fun getId ()I
public final fun getLate ()Z
public final fun getLegalAbsence ()Z
public final fun getName ()Ljava/lang/String;
public final fun getPosition ()I
public final fun getPresence ()Z
public final fun getRemoved ()Z
public final fun getSymbol ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$PresenceType$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject$Companion;
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
public final fun component1 ()I
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun component5 ()I
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;IILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;
public fun equals (Ljava/lang/Object;)Z
public final fun getId ()I
public final fun getKey ()Ljava/lang/String;
public final fun getKod ()Ljava/lang/String;
public final fun getName ()Ljava/lang/String;
public final fun getPosition ()I
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Subject$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher$Companion;
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()I
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;
public fun equals (Ljava/lang/Object;)Z
public final fun getDisplayName ()Ljava/lang/String;
public final fun getId ()I
public final fun getName ()Ljava/lang/String;
public final fun getSurname ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$Teacher$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot$Companion;
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
public final fun component1 ()I
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun component5 ()I
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;IILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;
public fun equals (Ljava/lang/Object;)Z
public final fun getDisplay ()Ljava/lang/String;
public final fun getEnd ()Ljava/lang/String;
public final fun getId ()I
public final fun getPosition ()I
public final fun getStart ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/CompletedLesson$TimeSlot$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Exam {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/Exam$Companion;
public fun <init> (ILjava/lang/String;Ljava/lang/String;ILjava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Exam$DateCreated;Lio/github/wulkanowy/sdk/hebe/models/Exam$DateModify;Lio/github/wulkanowy/sdk/hebe/models/Exam$Deadline;Lio/github/wulkanowy/sdk/hebe/models/Exam$Creator;Lio/github/wulkanowy/sdk/hebe/models/Exam$Subject;I)V

View file

@ -1,5 +1,7 @@
package io.github.wulkanowy.sdk.hebe
import io.github.wulkanowy.sdk.hebe.models.AttendanceSummary
import io.github.wulkanowy.sdk.hebe.models.CompletedLesson
import io.github.wulkanowy.sdk.hebe.models.Exam
import io.github.wulkanowy.sdk.hebe.models.Grade
import io.github.wulkanowy.sdk.hebe.models.GradeAverage
@ -19,6 +21,7 @@ import okhttp3.Interceptor
import okhttp3.logging.HttpLoggingInterceptor
import java.time.Duration
import java.time.LocalDate
import java.time.temporal.ChronoUnit
class Hebe {
@ -218,6 +221,66 @@ class Hebe {
)
}
suspend fun getAttendanceSummary(pupilId: Int, startDate: LocalDate, endDate: LocalDate): AttendanceSummary {
val completedLessons = studentRepository.getCompletedLessons(pupilId, startDate, endDate)
var presences = 0
var absences = 0
var legalAbsences = 0
var latenesses = 0
var justifiedAbsences = 0
var exemptions = 0
var justifiedLatenesses = 0
completedLessons
.forEach { lesson ->
if (lesson.presenceType != null) {
when (lesson.presenceType.categoryId) {
1 -> presences++
6 -> legalAbsences++
7 -> exemptions++
2 -> absences++
3 -> justifiedAbsences++
4 -> latenesses++
5 -> justifiedLatenesses++
}
}
}
return AttendanceSummary(
month = startDate.month,
presence = presences,
absence = absences,
absenceExcused = justifiedAbsences,
absenceForSchoolReasons = legalAbsences,
lateness = latenesses,
latenessExcused = justifiedLatenesses,
exemption = exemptions,
)
}
suspend fun getAttendanceSummaryForWholeYear(pupilId: Int, startDate: LocalDate, endDate: LocalDate): List<AttendanceSummary> {
val months = ChronoUnit.MONTHS.between(startDate, endDate)
val summaries = arrayListOf<AttendanceSummary>()
for (i in 0..<months) {
summaries.add(
getAttendanceSummary(
pupilId,
startDate.plusMonths(i).minusDays(startDate.dayOfMonth.toLong() - 1),
startDate.plusMonths(i + 1).minusDays(startDate.dayOfMonth.toLong() - 1),
),
)
}
return summaries
}
suspend fun getAttendance(pupilId: Int, startDate: LocalDate, endDate: LocalDate): List<CompletedLesson> = studentRepository
.getCompletedLessons(
pupilId = pupilId,
startDate = startDate,
endDate = endDate,
)
suspend fun setMessageStatus(pupilId: Int?, boxKey: String, messageKey: String, status: Int): Boolean? = studentRepository.setMessageStatus(
pupilId = pupilId,
boxKey = boxKey,

View file

@ -0,0 +1,14 @@
package io.github.wulkanowy.sdk.hebe.models
import java.time.Month
data class AttendanceSummary(
val month: Month,
val presence: Int,
val absence: Int,
val absenceExcused: Int,
val absenceForSchoolReasons: Int,
val lateness: Int,
val latenessExcused: Int,
val exemption: Int,
)

View file

@ -0,0 +1,172 @@
package io.github.wulkanowy.sdk.hebe.models
import io.github.wulkanowy.sdk.hebe.CustomDateAdapter
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.time.LocalDate
@Serializable
data class CompletedLesson(
@SerialName("LessonId")
val lessonId: Int,
@SerialName("PresenceType")
val presenceType: PresenceType?,
@SerialName("Id")
val id: Int,
@SerialName("LessonClassId")
val lessonClassId: Int,
@SerialName("Day")
val day: Day,
@SerialName("CalculatePresence")
val calculatePresence: Boolean,
@SerialName("GroupDefinition")
val groupDefinition: String,
@SerialName("Replacement")
val replacement: Boolean,
@SerialName("DateModify")
val dateModify: DateModify,
@SerialName("GlobalKey")
val globalKey: String,
@SerialName("Note")
val note: String?,
@SerialName("Topic")
val topic: String,
@SerialName("LessonNumber")
val lessonNumber: Int,
@SerialName("LessonClassGlobalKey")
val lessonClassGlobalKey: String,
@SerialName("TimeSlot")
val timeSlot: TimeSlot,
@SerialName("Subject")
val subject: Subject?,
@SerialName("TeacherPrimary")
val primaryTeacher: Teacher?,
@SerialName("TeacherSecondary")
val secondaryTeacher: Teacher?,
@SerialName("Clazz")
val `class`: Class,
@SerialName("Distribution")
val distribution: Distribution?,
@SerialName("Visible")
val visible: Boolean,
) {
@Serializable
data class PresenceType(
@SerialName("Id")
val id: Int,
@SerialName("Symbol")
val symbol: String,
@SerialName("Name")
val name: String,
@SerialName("CategoryId")
val categoryId: Int,
@SerialName("CategoryName")
val categoryName: String,
@SerialName("Position")
val position: Int,
@SerialName("Presence")
val presence: Boolean,
@SerialName("Absence")
val absence: Boolean,
@SerialName("LegalAbsence")
val legalAbsence: Boolean,
@SerialName("Late")
val late: Boolean,
@SerialName("AbsenceJustified")
val absenceJustified: Boolean,
@SerialName("Removed")
val removed: Boolean,
)
@Serializable
data class Day(
@SerialName("Date")
@Serializable(with = CustomDateAdapter::class)
val date: LocalDate,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class DateModify(
@SerialName("Date")
@Serializable(with = CustomDateAdapter::class)
val date: LocalDate,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class TimeSlot(
@SerialName("Id")
val id: Int,
@SerialName("Start")
val start: String,
@SerialName("End")
val end: String,
@SerialName("Display")
val display: String,
@SerialName("Position")
val position: Int,
)
@Serializable
data class Subject(
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Name")
val name: String,
@SerialName("Kod")
val kod: String,
@SerialName("Position")
val position: Int,
)
@Serializable
data class Teacher(
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
@SerialName("Surname")
val surname: String,
@SerialName("DisplayName")
val displayName: String,
)
@Serializable
data class Class(
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("DisplayName")
val displayName: String,
@SerialName("Symbol")
val symbol: String,
)
@Serializable
data class Distribution(
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Name")
val name: String,
@SerialName("Shortcut")
val shortcut: String,
@SerialName("PartType")
val partType: String,
)
}

View file

@ -115,6 +115,17 @@ internal class StudentRepository(
).getEnvelopeOrThrowError()
.orEmpty()
suspend fun getCompletedLessons(pupilId: Int, startDate: LocalDate, endDate: LocalDate) = studentService
.getCompletedLessons(
createQueryMap(
pupilId = pupilId,
dateFrom = startDate,
dateTo = endDate,
),
).getEnvelopeOrThrowError()
.orEmpty()
.distinctBy { it.lessonId }
suspend fun setMessageStatus(pupilId: Int?, boxKey: String, messageKey: String, status: Int) = studentService
.setStatus(
ApiRequest(

View file

@ -2,6 +2,7 @@ package io.github.wulkanowy.sdk.hebe.service
import io.github.wulkanowy.sdk.hebe.ApiRequest
import io.github.wulkanowy.sdk.hebe.ApiResponse
import io.github.wulkanowy.sdk.hebe.models.CompletedLesson
import io.github.wulkanowy.sdk.hebe.models.Exam
import io.github.wulkanowy.sdk.hebe.models.Grade
import io.github.wulkanowy.sdk.hebe.models.GradeAverage
@ -59,6 +60,9 @@ internal interface StudentService {
@GET("api/mobile/school/vacation")
suspend fun getVacations(@QueryMap query: Map<String, Any?>): ApiResponse<List<Vacation>>
@GET("api/mobile/lesson/byPupil")
suspend fun getCompletedLessons(@QueryMap query: Map<String, Any?>): ApiResponse<List<CompletedLesson>>
@POST("api/mobile/messages/statuses")
suspend fun setStatus(@Body request: ApiRequest<List<SetMessageStatusRequest>>): ApiResponse<Boolean>
}

View file

@ -9,8 +9,8 @@ public final class io/github/wulkanowy/sdk/Sdk {
public static synthetic fun excuseForAbsence$default (Lio/github/wulkanowy/sdk/Sdk;Ljava/util/List;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public final fun getAndroidVersion ()Ljava/lang/String;
public final fun getAttendance (Ljava/time/LocalDate;Ljava/time/LocalDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getAttendanceSummary (Ljava/lang/Integer;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun getAttendanceSummary$default (Lio/github/wulkanowy/sdk/Sdk;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public final fun getAttendanceSummary (Ljava/lang/Integer;Ljava/time/LocalDate;Ljava/time/LocalDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun getAttendanceSummary$default (Lio/github/wulkanowy/sdk/Sdk;Ljava/lang/Integer;Ljava/time/LocalDate;Ljava/time/LocalDate;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public final fun getBuildTag ()Ljava/lang/String;
public final fun getClassId ()I
public final fun getCompletedLessons (Ljava/time/LocalDate;Ljava/time/LocalDate;ILkotlin/coroutines/Continuation;)Ljava/lang/Object;

View file

@ -436,15 +436,21 @@ class Sdk {
suspend fun getAttendance(startDate: LocalDate, endDate: LocalDate): List<Attendance> = withContext(Dispatchers.IO) {
when (mode) {
Mode.HYBRID, Mode.SCRAPPER -> scrapper.getAttendance(startDate, endDate).mapAttendance()
Mode.HEBE -> throw NotImplementedError("Not available in HEBE mode")
Mode.SCRAPPER -> scrapper.getAttendance(startDate, endDate).mapAttendance()
Mode.HYBRID, Mode.HEBE -> hebe.getAttendance(studentId, startDate, endDate).mapAttendance()
}
}
suspend fun getAttendanceSummary(subjectId: Int? = -1): List<AttendanceSummary> = withContext(Dispatchers.IO) {
suspend fun getAttendanceSummary(subjectId: Int? = -1, startDate: LocalDate, endDate: LocalDate): List<AttendanceSummary> = withContext(Dispatchers.IO) {
when (mode) {
Mode.HYBRID, Mode.SCRAPPER -> scrapper.getAttendanceSummary(subjectId).mapAttendanceSummary()
Mode.HEBE -> throw NotImplementedError("Not available in HEBE mode")
Mode.SCRAPPER -> scrapper.getAttendanceSummary(subjectId).mapAttendanceSummary()
Mode.HYBRID, Mode.HEBE ->
hebe
.getAttendanceSummaryForWholeYear(
pupilId = studentId,
startDate = startDate,
endDate = endDate,
).mapAttendanceSummary()
}
}

View file

@ -3,6 +3,7 @@ package io.github.wulkanowy.sdk.mapper
import io.github.wulkanowy.sdk.pojo.Absent
import io.github.wulkanowy.sdk.pojo.Attendance
import io.github.wulkanowy.sdk.pojo.AttendanceSummary
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceCategory
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceCategory.ABSENCE_EXCUSED
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceCategory.ABSENCE_FOR_SCHOOL_REASONS
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceCategory.ABSENCE_UNEXCUSED
@ -10,10 +11,13 @@ import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceCategory.EXCUSED_LA
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceCategory.EXEMPTION
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceCategory.PRESENCE
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceCategory.UNEXCUSED_LATENESS
import io.github.wulkanowy.sdk.hebe.models.AttendanceSummary as HebeAttendanceSummary
import io.github.wulkanowy.sdk.hebe.models.CompletedLesson as HebeCompletedLesson
import io.github.wulkanowy.sdk.scrapper.attendance.Absent as ScrapperAbsent
import io.github.wulkanowy.sdk.scrapper.attendance.Attendance as ScrapperAttendance
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceSummary as ScrapperAttendanceSummary
@JvmName("mapScrapperAttendance")
internal fun List<ScrapperAttendance>.mapAttendance() = map {
Attendance(
number = it.number,
@ -33,6 +37,7 @@ internal fun List<ScrapperAttendance>.mapAttendance() = map {
)
}
@JvmName("mapScrapperAttendanceSummary")
internal fun List<ScrapperAttendanceSummary>.mapAttendanceSummary() = map {
AttendanceSummary(
month = it.month,
@ -46,9 +51,46 @@ internal fun List<ScrapperAttendanceSummary>.mapAttendanceSummary() = map {
)
}
@JvmName("mapScrapperAbsence")
internal fun List<Absent>.mapToScrapperAbsent() = map {
ScrapperAbsent(
date = it.date,
timeId = it.timeId,
)
}
@JvmName("mapHebeAttendanceSummary")
internal fun List<HebeAttendanceSummary>.mapAttendanceSummary() = map {
AttendanceSummary(
month = it.month,
presence = it.presence,
absence = it.absence,
absenceExcused = it.absenceExcused,
absenceForSchoolReasons = it.absenceForSchoolReasons,
lateness = it.lateness,
latenessExcused = it.latenessExcused,
exemption = it.exemption,
)
}
@JvmName("mapHebeAttendance")
internal fun List<HebeCompletedLesson>.mapAttendance() = map {
val category = AttendanceCategory.getCategoryById(it.presenceType?.categoryId ?: 0)
Attendance(
number = it.timeSlot.position,
name = category.toString(),
subject = it.subject?.name ?: "",
date = it.day.date,
timeId = it.timeSlot.id,
categoryId = it.presenceType?.categoryId ?: 0,
deleted = it.presenceType?.removed ?: false,
excuseStatus = null,
excusable = false,
absence = category == ABSENCE_UNEXCUSED || category == ABSENCE_EXCUSED,
excused = category == ABSENCE_EXCUSED || category == EXCUSED_LATENESS,
exemption = category == EXEMPTION,
lateness = category == EXCUSED_LATENESS || category == UNEXCUSED_LATENESS,
presence = category == PRESENCE || category == ABSENCE_FOR_SCHOOL_REASONS,
)
}