14 lines
398 B
Swift
14 lines
398 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)
|
|
}
|
|
}
|
|
}
|