feat: Begins hvac system performance
This commit is contained in:
@@ -24,6 +24,7 @@ public extension SiteRoute {
|
||||
enum Api: Equatable, Sendable {
|
||||
|
||||
case calculateDehumidifierSize(DehumidifierSize.Request)
|
||||
case calculateHVACSystemPerformance(HVACSystemPerformance.Request)
|
||||
case calculateMoldRisk(MoldRisk.Request)
|
||||
|
||||
static let rootPath = Path { "api"; "v1" }
|
||||
@@ -34,6 +35,11 @@ public extension SiteRoute {
|
||||
Method.post
|
||||
Body(.json(DehumidifierSize.Request.self))
|
||||
}
|
||||
Route(.case(Self.calculateHVACSystemPerformance)) {
|
||||
Path { "api"; "v1"; "calculateHVACSystemPerformance" }
|
||||
Method.post
|
||||
Body(.json(HVACSystemPerformance.Request.self))
|
||||
}
|
||||
Route(.case(Self.calculateMoldRisk)) {
|
||||
Path { "api"; "v1"; "calculateMoldRisk" }
|
||||
Method.post
|
||||
@@ -48,6 +54,7 @@ public extension SiteRoute {
|
||||
|
||||
case index
|
||||
case dehumidifierSize(DehumidifierSize)
|
||||
case hvacSystemPerformance(HVACSystemPerformance)
|
||||
case moldRisk(MoldRisk)
|
||||
|
||||
public static let router = OneOf {
|
||||
@@ -57,6 +64,9 @@ public extension SiteRoute {
|
||||
Route(.case(Self.dehumidifierSize)) {
|
||||
DehumidifierSize.router
|
||||
}
|
||||
Route(.case(Self.hvacSystemPerformance)) {
|
||||
HVACSystemPerformance.router
|
||||
}
|
||||
Route(.case(Self.moldRisk)) {
|
||||
MoldRisk.router
|
||||
}
|
||||
@@ -66,7 +76,7 @@ public extension SiteRoute {
|
||||
case index
|
||||
case submit(Routes.DehumidifierSize.Request)
|
||||
|
||||
static let rootPath = "dehumidifier-size"
|
||||
static let rootPath = "dehumidifier-sizing"
|
||||
|
||||
public static let router = OneOf {
|
||||
Route(.case(Self.index)) {
|
||||
@@ -88,6 +98,36 @@ public extension SiteRoute {
|
||||
}
|
||||
}
|
||||
|
||||
public enum HVACSystemPerformance: Equatable, Sendable {
|
||||
case index
|
||||
case submit(Routes.HVACSystemPerformance.Request)
|
||||
|
||||
static let rootPath = "hvac-system-performance"
|
||||
|
||||
public static let router = OneOf {
|
||||
Route(.case(Self.index)) {
|
||||
Path { rootPath }
|
||||
Method.get
|
||||
}
|
||||
Route(.case(Self.submit)) {
|
||||
Path { rootPath }
|
||||
Method.post
|
||||
Body {
|
||||
FormData {
|
||||
Optionally { Field("altitude") { Double.parser() } }
|
||||
Field("airflow") { Double.parser() }
|
||||
Field("returnAirTemperature") { Double.parser() }
|
||||
Field("returnAirHumidity") { Double.parser() }
|
||||
Field("supplyAirTemperature") { Double.parser() }
|
||||
Field("supplyAirHumidity") { Double.parser() }
|
||||
Field("systemSize") { Double.parser() }
|
||||
}
|
||||
.map(.memberwise(Routes.HVACSystemPerformance.Request.init))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum MoldRisk: Equatable, Sendable {
|
||||
case index
|
||||
case submit(Routes.MoldRisk.Request)
|
||||
|
||||
Reference in New Issue
Block a user