const PT = require("./ParseTools"); const Teacher = require("./Teacher"); class Homework { #data; constructor(data) { this.#data = data; this.id = data.ID; this.date = PT.parseDateTime(this.rawDate, "dd.MM.yyyy"); this.hour = PT.isFilled(data.Stunde) ? Number(data.Stunde): null; this.class = PT.isFilled(data.Klasse, true); this.course = PT.isFilled(data.Kurs, true); this.course = PT.isFilled(data.Kursschiene, true); this.teacher = PT.isFilled(data.LK, true); //data.Vertretung - value in testing always "" or "0" this.subject = PT.isFilled(data.Fach, true); this.room = PT.isFilled(data.Raum, true); this.note = PT.isFilled(data.Bemerkung, true); this.homework = PT.isFilled(data.Hausaufgaben, true); } get rawDate() { return this.#data.Datum; } get raw() { return this.#data; } } module.exports = Homework