Problem
No validation exists for workspace opening hours configuration. Workspaces can be saved with contradictory schedules (e.g., close time before open time, duplicate days) without any error.
Proposed Solution
Create backend/cntr/opening-hours.validator.ts exporting OpeningHoursEntry interface ({ dayOfWeek: 0|1|2|3|4|5|6, openTime: string, closeTime: string, isClosed: boolean }), ValidationResult interface ({ isValid: boolean, errors: string[] }), and validateOpeningHours(hours: OpeningHoursEntry[]): ValidationResult. Checks: valid HH:MM format, closeTime > openTime (unless isClosed), no duplicate dayOfWeek. All implementation must live inside backend/cntr/.
Acceptance Criteria
Problem
No validation exists for workspace opening hours configuration. Workspaces can be saved with contradictory schedules (e.g., close time before open time, duplicate days) without any error.
Proposed Solution
Create
backend/cntr/opening-hours.validator.tsexportingOpeningHoursEntryinterface ({ dayOfWeek: 0|1|2|3|4|5|6, openTime: string, closeTime: string, isClosed: boolean }),ValidationResultinterface ({ isValid: boolean, errors: string[] }), andvalidateOpeningHours(hours: OpeningHoursEntry[]): ValidationResult. Checks: validHH:MMformat,closeTime > openTime(unlessisClosed), no duplicatedayOfWeek. All implementation must live insidebackend/cntr/.Acceptance Criteria
backend/cntr/opening-hours.validator.tsHH:MMformat with a regexcloseTime <= openTimewhenisClosed = falsedayOfWeekentriesbackend/cntr/opening-hours.validator.spec.ts