feat: Begins breaking database out into it's own module, using dependencies

This commit is contained in:
2025-01-13 14:39:37 -05:00
parent 540b3e771a
commit 217dc5fa56
20 changed files with 1372 additions and 16 deletions

View File

@@ -0,0 +1,27 @@
import Dependencies
import Foundation
public struct VendorBranch: Codable, Equatable, Identifiable, Sendable {
public var id: UUID
public var name: String
public var vendorID: Vendor.ID
public var createdAt: Date
public var updatedAt: Date
public init(
id: UUID? = nil,
name: String,
vendorID: Vendor.ID,
createdAt: Date? = nil,
updatedAt: Date? = nil
) {
@Dependency(\.date) var date
@Dependency(\.uuid) var uuid
self.id = id ?? uuid()
self.name = name
self.vendorID = vendorID
self.createdAt = createdAt ?? date.now
self.updatedAt = updatedAt ?? date.now
}
}