-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CurrentHeatingSystem form checking (#158)
* WIP: explore abstract in zod types Co-authored-by: plocket <[email protected]> Co-authored-by: Clayton Schneider <[email protected]> Co-authored-by: Leopardfoot <[email protected]> Co-authored-by: Camden Blatchly <[email protected]> * Added zod types for CurrentHeatingSystem and change types/index.ts to zod. Co-authored-by: Camden Blatchly <[email protected]> Co-authored-by: plocket <[email protected]> * fix display analysis+charts to use zod --------- Co-authored-by: plocket <[email protected]> Co-authored-by: Clayton Schneider <[email protected]> Co-authored-by: Leopardfoot <[email protected]> Co-authored-by: Camden Blatchly <[email protected]>
- Loading branch information
1 parent
627ec5e
commit 5787b7d
Showing
9 changed files
with
140 additions
and
115 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
heat-stack/app/components/ui/heat/CaseSummaryComponents/AnalysisHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 8 additions & 5 deletions
13
heat-stack/app/components/ui/heat/CaseSummaryComponents/EnergyUseHistory.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { z } from 'zod'; | ||
|
||
// JS team wants to discuss this name | ||
export const Case = z.object({ | ||
name: z.string() | ||
}) | ||
|
||
export const HeatLoadAnalysis = z.object({ | ||
rulesEngineVersion: z.string(), | ||
estimatedBalancePoint: z.number(), | ||
otherFuelUsage: z.number(), | ||
averageIndoorTemperature: z.number(), | ||
differenceBetweenTiAndTbp: z.number(), | ||
/** | ||
* designTemperature in Fahrenheit | ||
*/ | ||
designTemperature: z.number().max(-10).min(50), | ||
wholeHomeHeatLossRate: z.number(), | ||
standardDeviationHeatLossRate: z.number(), | ||
averageHeatLoad: z.number(), | ||
maximumHeatLoad: z.number(), | ||
}); | ||
|
||
export const Home = z.object({ | ||
/** | ||
* unit: square feet | ||
*/ | ||
livingArea: z.number().min(500).max(10000), | ||
fuelType: z.enum(['Natural Gas','Oil','Propane']), | ||
designTemperatureOverride: z.number(), | ||
/** | ||
* unit: percentage in decimal numbers, but not 0 to 1 | ||
*/ | ||
heatingSystemEfficiency: z.number().min(60).max(100), | ||
thermostatSetPoint: z.number(), | ||
setbackTemperature: z.number(), | ||
setbackHoursPerDay: z.number(), | ||
numberOfOccupants: z.number(), | ||
estimatedWaterHeatingEfficiency: z.number(), | ||
standByLosses: z.number(), | ||
}); | ||
|
||
export const Location = z.object({ | ||
address: z.string(), | ||
}); | ||
|
||
export const NaturalGasBill = z.object({ | ||
provider: z.string(), | ||
}); | ||
|
||
export const NaturalGasBillRecord = z.object({ | ||
periodStartDate: z.date(), | ||
periodEndDate: z.date(), | ||
usageTherms: z.number(), | ||
inclusionOverride: z.enum(['Include', 'Do not include', 'Include in other analysis']), | ||
}); | ||
|
||
export const OilPropaneBill = z.object({ | ||
provider: z.string(), | ||
precedingDeliveryDate: z.date(), | ||
}); | ||
|
||
export const OilPropaneBillRecord = z.object({ | ||
periodStartDate: z.date(), | ||
periodEndDate: z.date(), | ||
gallons: z.number(), | ||
inclusionOverride: z.enum(['Include', 'Do not include', 'Include in other analysis']), | ||
}); |