EmployeeDirectory-SwiftUI/EmployeeDirectory/Models/Employee.swift
2025-03-04 14:54:57 -06:00

51 lines
1.5 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// Employee.swift
// EmployeeDirectory
//
// Created by Matt Bruce on 3/3/25.
//
import Foundation
/// Employee Object
/// JSON Object defintion
/// - https://square.github.io/microsite/mobile-interview-project/
public struct Employee: Identifiable, Hashable, Codable {
public var id: UUID { uuid }
/// The unique identifier for the employee. Represented as a UUID.
public let uuid: UUID
/// The first name of the employee.
public let firstName: String
/// The last name of the employee.
public let lastName: String
/// The phone number of the employee, sent as an unformatted string (eg, 5556661234).
public let phoneNumber: String?
/// The email address of the employee.
public let emailAddress: String
/// A short, tweet-length (~300 chars) string that the employee provided to describe themselves.
public let biography: String?
/// The URL of the employees small photo. Useful for list view.
public let photoURLSmall: String?
/// The URL of the employees full-size photo.
public let photoURLLarge: String?
private enum CodingKeys: String, CodingKey {
case uuid
case firstName = "first_name"
case lastName = "last_name"
case phoneNumber = "phone_number"
case emailAddress = "email_address"
case biography
case photoURLSmall = "photo_url_small"
case photoURLLarge = "photo_url_large"
}
}