// // LessonListModel.swift // LMS // // Created by Suraj Kumar Mandal on 06/09/22. // // let lessonListModel = try? newJSONDecoder().decode(LessonListModel.self, from: jsonData) import Foundation // MARK: - LessonListModel class LessonListModel: Codable { var createdBy, createdDate, lastModifiedBy, lastModifiedDate: String? var id, lessonId: Int? var name: String? var contentIndex: Int? var type, fileId: String? var teacherAccess, beneficiaryAccess: Bool? var status, comments: String? var lesson: Lesson? var source: String? init(createdBy: String?, createdDate: String?, lastModifiedBy: String?, lastModifiedDate: String?, id: Int?, lessonId: Int?, name: String?, contentIndex: Int?, type: String?, fileId: String?, teacherAccess: Bool?, beneficiaryAccess: Bool?, status: String?, comments: String?, lesson: Lesson?, source: String?) { self.createdBy = createdBy self.createdDate = createdDate self.lastModifiedBy = lastModifiedBy self.lastModifiedDate = lastModifiedDate self.id = id self.lessonId = lessonId self.name = name self.contentIndex = contentIndex self.type = type self.fileId = fileId self.teacherAccess = teacherAccess self.beneficiaryAccess = beneficiaryAccess self.status = status self.comments = comments self.lesson = lesson self.source = source } } // MARK: - Lesson class Lesson: Codable { var createdBy, createdDate, lastModifiedBy, lastModifiedDate: String? var id: Int? var name, status, comments: String? var unit: LessonListUnit? init(createdBy: String?, createdDate: String?, lastModifiedBy: String?, lastModifiedDate: String?, id: Int?, name: String?, status: String?, comments: String?, unit: LessonListUnit?) { self.createdBy = createdBy self.createdDate = createdDate self.lastModifiedBy = lastModifiedBy self.lastModifiedDate = lastModifiedDate self.id = id self.name = name self.status = status self.comments = comments self.unit = unit } } // MARK: - Unit class LessonListUnit: Codable { var createdBy, createdDate, lastModifiedBy, lastModifiedDate: String? var id: Int? var academicYear, name, status: String? var intervention: LessonListIntervention? var level: LessonListLevel? var comments: String? init(createdBy: String?, createdDate: String?, lastModifiedBy: String?, lastModifiedDate: String?, id: Int?, academicYear: String?, name: String?, status: String?, intervention: LessonListIntervention?, level: LessonListLevel?, comments: String?) { self.createdBy = createdBy self.createdDate = createdDate self.lastModifiedBy = lastModifiedBy self.lastModifiedDate = lastModifiedDate self.id = id self.academicYear = academicYear self.name = name self.status = status self.intervention = intervention self.level = level self.comments = comments } } // MARK: - Intervention class LessonListIntervention: Codable { var id, incrementor: Int? var interventionId, interventionName: String? var interventionLevels: [String]? var beneficiaryIds: [Int]? var deleted, active: Bool? var status: String? var interventionSchoolMappings, mappedProgramHeads: JSONNull? init(id: Int?, incrementor: Int?, interventionId: String?, interventionName: String?, interventionLevels: [String]?, beneficiaryIds: [Int]?, deleted: Bool?, active: Bool?, status: String?, interventionSchoolMappings: JSONNull?, mappedProgramHeads: JSONNull?) { self.id = id self.incrementor = incrementor self.interventionId = interventionId self.interventionName = interventionName self.interventionLevels = interventionLevels self.beneficiaryIds = beneficiaryIds self.deleted = deleted self.active = active self.status = status self.interventionSchoolMappings = interventionSchoolMappings self.mappedProgramHeads = mappedProgramHeads } } // MARK: - Level class LessonListLevel: Codable { var id, interventionTableId: Int? var interventionLevels: String? init(id: Int?, interventionTableId: Int?, interventionLevels: String?) { self.id = id self.interventionTableId = interventionTableId self.interventionLevels = interventionLevels } }