55 lines
1.0 KiB
Swift
55 lines
1.0 KiB
Swift
import Dependencies
|
|
import Foundation
|
|
|
|
public struct Vendor: Codable, Equatable, Identifiable, Sendable {
|
|
public var id: UUID
|
|
public var name: String
|
|
public var branches: [VendorBranch]?
|
|
public var createdAt: Date?
|
|
public var updatedAt: Date?
|
|
|
|
public init(
|
|
id: UUID,
|
|
name: String,
|
|
branches: [VendorBranch]? = nil,
|
|
createdAt: Date? = nil,
|
|
updatedAt: Date? = nil
|
|
) {
|
|
self.id = id
|
|
self.name = name
|
|
self.branches = branches
|
|
self.createdAt = createdAt
|
|
self.updatedAt = updatedAt
|
|
}
|
|
}
|
|
|
|
public extension Vendor {
|
|
|
|
struct Create: Codable, Sendable {
|
|
public let name: String
|
|
|
|
public init(name: String) {
|
|
self.name = name
|
|
}
|
|
}
|
|
|
|
struct Update: Codable, Sendable {
|
|
public let name: String?
|
|
|
|
public init(name: String?) {
|
|
self.name = name
|
|
}
|
|
}
|
|
}
|
|
|
|
// public extension Vendor {
|
|
//
|
|
// static var mocks: [Self] {
|
|
// [
|
|
// .init(name: "Corken"),
|
|
// .init(name: "Johnstone"),
|
|
// .init(name: "Winstel Controls")
|
|
// ]
|
|
// }
|
|
// }
|