fix(employee-appointment): save false and 0 buffer settings on update

Merged
CE
7d ago
+81-4

Problem

EmployeeAppointmentUpdateHandler only writes a field when isNotEmpty(value), which treats false and 0 as empty. Turning bufferTimeStart / bufferTimeEnd off, or setting bufferTimeInMins / breakTimeInMins to 0, was silently ignored and the old value stayed.

Fix

For these four fields, skip only a key left out of the request (!== undefined). Minutes are still converted to numbers; an explicit null stays null.

Tests

New employee-appointment.update.handler.spec.ts: false / 0 are written, string minutes become numbers, an agenda-only request updates only agenda.

Notes

Not built or run locally.


Summary by cubic

Fixes the employee appointment update handler so false and 0 buffer settings are saved instead of being silently ignored.

  • isNotEmpty treated false and 0 as empty, so disabling bufferTimeStart / bufferTimeEnd or setting bufferTimeInMins / breakTimeInMins to 0 left the old value in place.
  • These four fields now skip a value only when it's undefined or ''; string minutes are coerced to numbers while explicit null stays null.
  • Adds employee-appointment.update.handler.spec.ts covering false / 0 writes, string-to-number coercion, null / '' handling, and agenda-only updates.
  • Tests weren't run locally; the new spec may need verification in CI.