From 0a32eaf5d7a16f6e3e7c125cb870fcebaeab5d65 Mon Sep 17 00:00:00 2001 From: zypherift Date: Wed, 12 Mar 2025 21:34:11 +0100 Subject: [PATCH] add Guardian model class with JSON serialization --- firka/lib/helpers/api/model/guardian.dart | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 firka/lib/helpers/api/model/guardian.dart diff --git a/firka/lib/helpers/api/model/guardian.dart b/firka/lib/helpers/api/model/guardian.dart new file mode 100644 index 00000000..103e09e7 --- /dev/null +++ b/firka/lib/helpers/api/model/guardian.dart @@ -0,0 +1,45 @@ +/* + Firka, alternative e-Kréta client. + Copyright (C) 2025 QwIT Development + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + +class Guardian { + + final String email; + final bool isLegalRepresentative; + final String name; + final String phoneNumber; + final String uid; + + Guardian({ + required this.email, + required this.isLegalRepresentative, + required this.name, + required this.phoneNumber, + required this.uid + }); + + factory Guardian.fromJson(Map json) { + return Guardian( + email: json['EmailCim'], + isLegalRepresentative: json['IsTorvenyesKepviselo'], + name: json['Nev'], + phoneNumber: json['Telefonszam'], + uid: json['Uid'] + ); + } + +} \ No newline at end of file