feat: Initial purchase order views, login seems to be broken though.

This commit is contained in:
2025-01-17 12:58:32 -05:00
parent e1d07008a1
commit be0b5a6033
18 changed files with 534 additions and 288 deletions

View File

@@ -34,6 +34,28 @@ public extension VendorBranch {
}
}
struct Detail: Codable, Equatable, Identifiable, Sendable {
public var id: UUID
public var name: String
public var vendor: Vendor
public var createdAt: Date?
public var updatedAt: Date?
public init(
id: UUID,
name: String,
vendor: Vendor,
createdAt: Date? = nil,
updatedAt: Date? = nil
) {
self.id = id
self.name = name
self.vendor = vendor
self.createdAt = createdAt
self.updatedAt = updatedAt
}
}
struct Update: Codable, Sendable {
public let name: String?
@@ -44,30 +66,6 @@ public extension VendorBranch {
}
#if DEBUG
// public extension VendorBranch {
//
// static func generateMocks(countPerVendor: Int = 3, vendors: [Vendor]) -> [Self] {
// @Dependency(\.date.now) var now
// @Dependency(\.uuid) var uuid
//
// var output = [Self]()
//
// for vendor in vendors {
// for _ in 0 ... countPerVendor {
// output.append(.init(
// id: uuid(),
// name: RandomNames.cityNames.randomElement()!,
// vendorID: vendor.id,
// createdAt: now,
// updatedAt: now
// ))
// }
// }
//
// return output
// }
// }
public extension VendorBranch.Create {
static func generateMocks(countPerVendor: Int = 3, vendors: [Vendor]) -> [Self] {