Skip to content

Conversation

@chaoyi09
Copy link
Collaborator

@chaoyi09 chaoyi09 commented Feb 7, 2026

Summary

  • Fix Zod schema to handle empty string form inputs for optional setback fields using z.preprocess
  • Make setbackTemperature and setbackHoursPerDay nullable in Prisma schema (IntInt?)
  • Replace hardcoded defaults (|| 65 / || 0) with ?? null in createCase and updateCase
  • Handle null values in edit page (show empty field) and analysis display page (show "N/A")
  • Allow users to clear previously filled setback values (change from filled → empty)

Migration

  • Added database migration to allow NULL values for setback fields

Test

  • Leave Setback Temperature and Setback hours per day empty → form submits successfully
  • Fill in setback fields → values are saved and displayed correctly
  • View case details with empty setback fields → shows "N/A"
  • Edit case with empty setback fields → fields remain empty (not pre-filled with defaults)
  • Edit case with filled setback fields → user can clear the values and they become "N/A"
1 2

chaoyi09 and others added 3 commits February 7, 2026 03:10
Refactor setback_temperature and setback_hours_per_day to accept both number and string types, and transform input to number if valid.
@thadk thadk linked an issue Feb 8, 2026 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-make these optional in Rules & JS: Setback Temperature and Setback hours per day

1 participant