WIP: Working on friction rate worksheet views.
This commit is contained in:
@@ -59,4 +59,51 @@ public typealias ComponentPressureLosses = [String: Double]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
extension ComponentPressureLoss {
|
||||
public static var mock: [Self] {
|
||||
[
|
||||
.init(
|
||||
id: UUID(0),
|
||||
projectID: UUID(0),
|
||||
name: "evaporator-coil",
|
||||
value: 0.2,
|
||||
createdAt: Date(),
|
||||
updatedAt: Date()
|
||||
),
|
||||
.init(
|
||||
id: UUID(1),
|
||||
projectID: UUID(0),
|
||||
name: "filter",
|
||||
value: 0.1,
|
||||
createdAt: Date(),
|
||||
updatedAt: Date()
|
||||
),
|
||||
.init(
|
||||
id: UUID(2),
|
||||
projectID: UUID(0),
|
||||
name: "supply-outlet",
|
||||
value: 0.03,
|
||||
createdAt: Date(),
|
||||
updatedAt: Date()
|
||||
),
|
||||
.init(
|
||||
id: UUID(3),
|
||||
projectID: UUID(0),
|
||||
name: "return-grille",
|
||||
value: 0.03,
|
||||
createdAt: Date(),
|
||||
updatedAt: Date()
|
||||
),
|
||||
.init(
|
||||
id: UUID(4),
|
||||
projectID: UUID(0),
|
||||
name: "balance-damper",
|
||||
value: 0.03,
|
||||
createdAt: Date(),
|
||||
updatedAt: Date()
|
||||
),
|
||||
]
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import Dependencies
|
||||
import Foundation
|
||||
|
||||
public struct EquipmentInfo: Codable, Equatable, Identifiable, Sendable {
|
||||
@@ -50,3 +51,16 @@ extension EquipmentInfo {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
extension EquipmentInfo {
|
||||
public static let mock = Self(
|
||||
id: UUID(0),
|
||||
projectID: UUID(0),
|
||||
heatingCFM: 1000,
|
||||
coolingCFM: 1000,
|
||||
createdAt: Date(),
|
||||
updatedAt: Date()
|
||||
)
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -89,7 +89,7 @@ extension SiteRoute.View {
|
||||
extension SiteRoute.View {
|
||||
public enum FrictionRateRoute: Equatable, Sendable {
|
||||
case index
|
||||
case form
|
||||
case form(FormType, dismiss: Bool = false)
|
||||
|
||||
static let rootPath = "friction-rate"
|
||||
|
||||
@@ -104,7 +104,18 @@ extension SiteRoute.View {
|
||||
"create"
|
||||
}
|
||||
Method.get
|
||||
Query {
|
||||
Field("type") { FormType.parser() }
|
||||
Field("dismiss", default: false) { Bool.parser() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension SiteRoute.View.FrictionRateRoute {
|
||||
public enum FormType: String, CaseIterable, Codable, Equatable, Sendable {
|
||||
case equipmentInfo
|
||||
case componentPressureLoss
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user