This repository has been archived on 2026-02-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
swift-duct-calc/Sources/ManualDCore/EquipmentInfo.swift

53 lines
1.3 KiB
Swift

import Foundation
public struct EquipmentInfo: Codable, Equatable, Identifiable, Sendable {
public let id: UUID
public let projectID: Project.ID
public let staticPressure: Double
public let heatingCFM: Int
public let coolingCFM: Int
public let createdAt: Date
public let updatedAt: Date
public init(
id: UUID,
projectID: Project.ID,
staticPressure: Double = 0.5,
heatingCFM: Int,
coolingCFM: Int,
createdAt: Date,
updatedAt: Date
) {
self.id = id
self.projectID = projectID
self.staticPressure = staticPressure
self.heatingCFM = heatingCFM
self.coolingCFM = coolingCFM
self.createdAt = createdAt
self.updatedAt = updatedAt
}
}
extension EquipmentInfo {
// TODO: Remove projectID and use dependency to lookup current project ??
public struct Create: Codable, Equatable, Sendable {
public let projectID: Project.ID
public let staticPressure: Double
public let heatingCFM: Int
public let coolingCFM: Int
public init(
projectID: Project.ID,
staticPressure: Double = 0.5,
heatingCFM: Int,
coolingCFM: Int
) {
self.projectID = projectID
self.staticPressure = staticPressure
self.heatingCFM = heatingCFM
self.coolingCFM = coolingCFM
}
}
}