15 lines
399 B
Swift
15 lines
399 B
Swift
import Models
|
|
import Validations
|
|
|
|
extension HouseLoad: AsyncValidatable {
|
|
|
|
public var body: some AsyncValidation<Self> {
|
|
AsyncValidator.accumulating {
|
|
AsyncValidator.greaterThan(\.coolingTotal, 0)
|
|
AsyncValidator.greaterThan(\.coolingSensible, 0)
|
|
AsyncValidator.greaterThan(\.heating, 0)
|
|
AsyncValidator.greaterThanOrEquals(\.coolingTotal, \.coolingSensible)
|
|
}
|
|
}
|
|
}
|