feat: Begins moving models into their own module.
This commit is contained in:
31
Sources/SharedModels/Employee.swift
Normal file
31
Sources/SharedModels/Employee.swift
Normal file
@@ -0,0 +1,31 @@
|
||||
import Dependencies
|
||||
import Foundation
|
||||
|
||||
public struct Employee: Equatable, Identifiable, Sendable {
|
||||
public var id: UUID
|
||||
public var active: Bool
|
||||
public var createdAt: Date
|
||||
public var firstName: String
|
||||
public var lastName: String
|
||||
public var updatedAt: Date
|
||||
|
||||
public init(
|
||||
id: UUID?,
|
||||
active: Bool = true,
|
||||
createdAt: Date? = nil,
|
||||
firstName: String,
|
||||
lastName: String,
|
||||
updatedAt: Date? = nil
|
||||
) {
|
||||
@Dependency(\.date) var date
|
||||
@Dependency(\.uuid) var uuid
|
||||
|
||||
self.id = id ?? uuid()
|
||||
self.active = active
|
||||
self.createdAt = createdAt ?? date()
|
||||
self.firstName = firstName
|
||||
self.lastName = lastName
|
||||
self.updatedAt = updatedAt ?? date()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user