1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- //
- // UserDetailsModel.swift
- // LMS
- //
- // Created by Suraj Kumar Mandal on 01/09/22.
- //
- import Foundation
- import RealmSwift
- class UserDetailsModel: Object {
-
- @objc dynamic var id = 0
- @objc dynamic var name = ""
- @objc dynamic var lastName = ""
- @objc dynamic var username = ""
- @objc dynamic var email = ""
- @objc dynamic var mobile = ""
- @objc dynamic var keycloakUserId = ""
- @objc dynamic var enable = true
- //@objc dynamic var intervantions = [0]
- var userType = List<UserType>()
-
- override static func primaryKey() -> String? {
- return "id"
- }
-
- convenience init(id: Int,
- name :String,
- lastName :String,
- username: String,
- email: String,
- mobile : String,
- keycloakUserId : String ,
- enable : Bool,
- //intervantions : Array<Int>,
- userType : List<UserType>
- ) {
-
- self.init()
-
- self.id = id
- self.name = name
- self.lastName = lastName
- self.username = username
- self.email = email
- self.mobile = mobile
- self.keycloakUserId = keycloakUserId
- self.enable = enable
- //self.intervantions = intervantions
- self.userType = userType
-
- }
-
- }
- class UserType: Object {
- @objc dynamic var id = 0
- @objc dynamic var actor = ""
- @objc dynamic var parentActor = ""
- @objc dynamic var discription = ""
- @objc dynamic var defaultRealmRole = ""
- @objc dynamic var createAccess = ""
- @objc dynamic var deleteAccess = ""
- @objc dynamic var editAccess = ""
- @objc dynamic var viewAccess = ""
- @objc dynamic var appUrl = ""
- override static func primaryKey() -> String? {
- return "id"
- }
- convenience init(id:Int,
- actor:String,
- parentActor:String,
- discription:String,
- defaultRealmRole:String,
- createAccess:String,
- deleteAccess:String,
- editAccess:String,
- viewAccess:String,
- appUrl:String
- ) {
- self.init()
- self.id = id
- self.actor = actor
- self.parentActor = parentActor
- self.discription = discription
- self.defaultRealmRole = defaultRealmRole
- self.createAccess = createAccess
- self.deleteAccess = deleteAccess
- self.editAccess = editAccess
- self.viewAccess = viewAccess
- self.appUrl = appUrl
- }
- }
|