added guardian login with views for their assigned childs
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import '../../../../../access/user_role.dart';
|
||||
import '../../../../../api/marianumconnect/queries/get_capabilities/guardian_child.dart';
|
||||
|
||||
part 'capabilities_state.freezed.dart';
|
||||
part 'capabilities_state.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class CapabilitiesState with _$CapabilitiesState {
|
||||
const CapabilitiesState._();
|
||||
|
||||
const factory CapabilitiesState({
|
||||
@Default(false) bool viewForeignTimetables,
|
||||
@Default(false) bool pushNotifications,
|
||||
@@ -12,8 +17,10 @@ abstract class CapabilitiesState with _$CapabilitiesState {
|
||||
// client-side clamp; the (server-narrowed) school year alone governs.
|
||||
int? timetablePastDays,
|
||||
int? timetableFutureDays,
|
||||
// LDAP user type ('TEACHER' | 'STUDENT' | 'STAFF'); null = unknown.
|
||||
// Wire value of the user type; read it through [role].
|
||||
String? userType,
|
||||
// Students a guardian may see; empty for all other accounts.
|
||||
@Default(<GuardianChild>[]) List<GuardianChild> children,
|
||||
// Whether a capability response (or a definitive failure) has been
|
||||
// observed at least once this session. Lets the UI distinguish "still
|
||||
// unknown" from "confirmed not allowed".
|
||||
@@ -22,4 +29,6 @@ abstract class CapabilitiesState with _$CapabilitiesState {
|
||||
|
||||
factory CapabilitiesState.fromJson(Map<String, Object?> json) =>
|
||||
_$CapabilitiesStateFromJson(json);
|
||||
|
||||
UserRole get role => UserRole.parse(userType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user