36 lines
1017 B
Swift
36 lines
1017 B
Swift
//
|
|
// EmployeeViewModel.swift
|
|
// EmployeeDirectory
|
|
//
|
|
// Created by Matt Bruce on 3/3/25.
|
|
//
|
|
import Foundation
|
|
import Combine
|
|
|
|
@MainActor
|
|
public class EmployeeViewModel {
|
|
// MARK: - Properties
|
|
|
|
private let employee: Employee
|
|
|
|
public private(set) var uuid: String
|
|
public private(set) var fullName: String
|
|
public private(set) var phoneNumber: String?
|
|
public private(set) var emailAddress: String
|
|
public private(set) var biography: String?
|
|
public private(set) var smallPhoto: String?
|
|
public private(set) var largePhoto: String?
|
|
|
|
// MARK: - Initializer
|
|
public init(employee: Employee) {
|
|
self.employee = employee
|
|
uuid = employee.uuid.uuidString
|
|
fullName = "\(employee.firstName) \(employee.lastName)"
|
|
phoneNumber = employee.phoneNumber?.formatUSNumber()
|
|
emailAddress = employee.emailAddress
|
|
biography = employee.biography
|
|
smallPhoto = employee.photoURLSmall
|
|
largePhoto = employee.photoURLLarge
|
|
}
|
|
}
|