//
//  ___FILENAME___
//  ___PROJECTNAME___
//
//  Created by ___FULLUSERNAME___ on ___DATE___.
//
//  The template was designed by Hưng Nguyễn. 
//  Website, application (native/flutter), hosting, SEO.
//  Email: hungnguyen.it36@gmail.com
//  ___COPYRIGHT___
//

import Foundation

struct ___VARIABLE_ModuleName___Model: Identifiable, Hashable, Codable {
    var id = UUID()
    let uid: Int?
    let firstName: String?
    let lastName: String?
    let email: String?
    let avatarString: String?
    
    private enum CodingKeys: String, CodingKey {
        case uid, firstName, lastName, email, avatarString
    }

    init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        uid = try container.decodeIfPresent(Int.self, forKey: .uid)
        firstName = try container.decodeIfPresent(String.self, forKey: .firstName)
        lastName = try container.decodeIfPresent(String.self, forKey: .lastName)
        email = try container.decodeIfPresent(String.self, forKey: .email)
        avatarString = try container.decodeIfPresent(String.self, forKey: .avatarString)
    }
}
