feat: Begins breaking database out into it's own module, using dependencies
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Dependencies
|
||||
import Foundation
|
||||
|
||||
public struct Employee: Equatable, Identifiable, Sendable {
|
||||
public struct Employee: Codable, Equatable, Identifiable, Sendable {
|
||||
public var id: UUID
|
||||
public var active: Bool
|
||||
public var createdAt: Date
|
||||
@@ -10,7 +10,7 @@ public struct Employee: Equatable, Identifiable, Sendable {
|
||||
public var updatedAt: Date
|
||||
|
||||
public init(
|
||||
id: UUID?,
|
||||
id: UUID? = nil,
|
||||
active: Bool = true,
|
||||
createdAt: Date? = nil,
|
||||
firstName: String,
|
||||
@@ -22,10 +22,20 @@ public struct Employee: Equatable, Identifiable, Sendable {
|
||||
|
||||
self.id = id ?? uuid()
|
||||
self.active = active
|
||||
self.createdAt = createdAt ?? date()
|
||||
self.createdAt = createdAt ?? date.now
|
||||
self.firstName = firstName
|
||||
self.lastName = lastName
|
||||
self.updatedAt = updatedAt ?? date()
|
||||
self.updatedAt = updatedAt ?? date.now
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public extension Employee {
|
||||
static var mocks: [Self] {
|
||||
[
|
||||
.init(firstName: "Michael", lastName: "Housh"),
|
||||
.init(firstName: "Blob", lastName: "Esquire"),
|
||||
.init(firstName: "Testy", lastName: "McTestface")
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user