feat: Working on hummingbird app

This commit is contained in:
2025-01-14 07:51:13 -05:00
parent 6225c32007
commit 4f47f1aed8
10 changed files with 223 additions and 86 deletions

View File

@@ -4,35 +4,32 @@ import Foundation
public struct User: Codable, Equatable, Identifiable, Sendable {
public var id: UUID
public var createdAt: Date
public var email: String
public var updatedAt: Date
public var username: String
public var createdAt: Date?
public var updatedAt: Date?
public init(
id: UUID? = nil,
createdAt: Date? = nil,
id: UUID,
email: String,
updatedAt: Date? = nil,
username: String
username: String,
createdAt: Date? = nil,
updatedAt: Date? = nil
) {
@Dependency(\.date) var date
@Dependency(\.uuid) var uuid
self.id = id ?? uuid()
self.createdAt = createdAt ?? date.now
self.id = id
self.createdAt = createdAt
self.email = email
self.updatedAt = updatedAt ?? date.now
self.updatedAt = updatedAt
self.username = username
}
}
public extension User {
static var mocks: [Self] {
[
.init(email: "blob@test.com", username: "blob"),
.init(email: "blob-jr@test.com", username: "blob-jr"),
.init(email: "blob-sr@test.com", username: "blob-sr")
]
}
}
// public extension User {
// static var mocks: [Self] {
// [
// .init(email: "blob@test.com", username: "blob"),
// .init(email: "blob-jr@test.com", username: "blob-jr"),
// .init(email: "blob-sr@test.com", username: "blob-sr")
// ]
// }
// }