fix(employee-appointment): keep omitted buffer and break minutes null instead of NaN

Merged
CE
7d ago
+67-2

Problem

EmployeeAppointmentCreateHandler converts the optional bufferTimeInMins / breakTimeInMins with a bare unary +. When a client leaves either out, +undefined is NaN, which Postgres rejects for the integer column, so creating an appointment without buffer / break minutes fails.

Fix

Convert each field only when present (!= null), null otherwise. Given values, 0 included, are still numbers.

Tests

New employee-appointment.create.handler.spec.ts: both fields omitted → null; '15' and 0 → 15 and 0.

Notes

Not built or run locally.


Summary by cubic

Fixes creating employee appointments without buffer or break time minutes, which previously failed because +undefined coerced missing values to NaN and Postgres rejects NaN for integer columns.

  • Omitted bufferTimeInMins and breakTimeInMins now save as null instead of NaN.
  • Provided values, including 0, are still saved as numbers.
  • Adds a test file covering both omitted and provided minutes.