Skip to content

Conversation

@lucas-a-pelegrino
Copy link
Contributor

@lucas-a-pelegrino lucas-a-pelegrino commented Dec 3, 2025

Proposed changes (including videos or screenshots)

This PR adds a deprecation warning for livechat:saveBusinessHour, as well as a new endpoint (livechat/business-hours.save) to replace the legacy method.

Issue(s)

CORE-1550
CORE-1551

Steps to test or reproduce

Further comments

  • I've added a few TODOs in this PR that will be addressed in the CORE-1552 task.

Summary by CodeRabbit

  • New Features

    • Added a REST endpoint to save Livechat business hours with a new payload shape (timezoneName, daysOpen, daysTime, workHours).
  • Deprecations

    • Legacy livechat:saveBusinessHour method deprecated in favor of the new REST endpoint.
  • Tests

    • E2E tests and helpers updated to use the new endpoint and payload format; IDs are now server-generated.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 3, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2025

🦋 Changeset detected

Latest commit: 05700ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/rest-typings Patch
@rocket.chat/api-client Patch
@rocket.chat/core-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/http-router Patch
@rocket.chat/models Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/livechat Patch
@rocket.chat/mock-providers Patch
@rocket.chat/cron Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/media-calls Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/core-typings Patch
@rocket.chat/apps Patch
@rocket.chat/freeswitch Patch
@rocket.chat/model-typings Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

Walkthrough

Deprecates the Meteor method livechat:saveBusinessHour (adds runtime deprecation log) and introduces POST /v1/livechat/business-hours.save with request/response schemas and typings; client code, tests, and helpers were migrated to call the new endpoint and to use the updated payload shape.

Changes

Cohort / File(s) Summary
Changeset
.changeset/brown-llamas-worry.md
Adds deprecation entry for livechat:saveBusinessHour, points to livechat/business-hours.save, marks @rocket.chat/meteor and @rocket.chat/rest-typings for patch updates.
Server: REST endpoint & typings
apps/meteor/app/livechat/imports/server/rest/businessHours.ts, packages/rest-typings/src/v1/omnichannel.ts
Adds POST /v1/livechat/business-hours.save handler with AJV validation and response schemas; defines POSTLivechatBusinessHoursSaveParams, BusinessHourDaysTime, BusinessHourWorkHours, compiled validators (isPOST...), success response schema, exports endpoint types and augments @rocket.chat/rest-typings Endpoints.
Server: Deprecation logging
apps/meteor/app/livechat/server/methods/saveBusinessHour.ts
Adds runtime deprecation logging via methodDeprecationLogger inside legacy livechat:saveBusinessHour before delegating to businessHourManager.saveBusinessHour.
Client migration
apps/meteor/client/views/omnichannel/businessHours/EditBusinessHours.tsx
Replaces useMethod('livechat:saveBusinessHour') with useEndpoint('POST', '/v1/livechat/business-hours.save'); removes casted payload, uses endpoint-inferred types and same success/error flows.
Tests & test helpers
apps/meteor/tests/data/livechat/businessHours.ts, apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts, apps/meteor/tests/e2e/omnichannel/omnichannel-business-hours.spec.ts, apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts
Migrate tests/helpers from Meteor method to REST endpoint; remove client-provided id; reshape payloads to include timezone, timezoneName, daysOpen, daysTime, and simplified workHours; clean _updatedAt/ts from payloads and align assertions to new shapes.

Sequence Diagram(s)

sequenceDiagram
    actor Client
    participant REST as POST /v1/livechat/business-hours.save
    participant Method as Meteor method livechat:saveBusinessHour
    participant Manager as businessHourManager
    participant DB as Database

    rect rgb(240,255,240)
    Note over Client,DB: New preferred flow
    Client->>REST: POST validated payload
    REST->>REST: AJV validate request
    REST->>Manager: saveBusinessHour(payload as ILivechatBusinessHour)
    Manager->>DB: persist business hour
    DB-->>Manager: OK
    Manager-->>REST: return saved business hour
    REST-->>Client: 200 + result
    end

    rect rgb(255,240,240)
    Note over Client,Method: Legacy (deprecated) flow
    Client->>Method: Call with payload
    Method->>Method: Log deprecation (methodDeprecationLogger)
    Method->>Manager: saveBusinessHour(payload)
    Manager->>DB: persist business hour
    DB-->>Manager: OK
    Manager-->>Method: return saved business hour
    Method-->>Client: return result
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review focus:
    • AJV schemas and nested types (daysTime, workHours) in packages/rest-typings/src/v1/omnichannel.ts.
    • Endpoint request/response wiring and type augmentation in apps/meteor/app/livechat/imports/server/rest/businessHours.ts.
    • Deprecation logging placement and metadata in apps/meteor/app/livechat/server/methods/saveBusinessHour.ts.
    • Client hook replacement and test helper payload shape changes in tests and E2E flows.

Possibly related PRs

Suggested reviewers

  • aleksandernsilva
  • dougfabris
  • KevLehman
  • tassoevan

Poem

🐰 Hopping from method to REST I go,
A gentle deprecation, a new route in tow,
Typings neat, payloads shaped just right,
Tests follow through the migration night,
I twitch my nose — the endpoint's bright.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding a deprecation warning for the livechat:saveBusinessHour Meteor method. It is concise, clear, and specific.
Linked Issues check ✅ Passed The PR implements both CORE-1550 (deprecation warning) and CORE-1551 (new endpoint), addressing all stated coding objectives; CORE-1552 is intentionally deferred.
Out of Scope Changes check ✅ Passed All changes are within scope: deprecation logging, new endpoint, client migration, and test updates all support the deprecation and endpoint replacement objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/CORE-1550

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 360MiB 349MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB +886B
queue-worker-service 132MiB 132MiB +1.3KiB
ddp-streamer-service 126MiB 126MiB +1.5KiB
account-service 113MiB 113MiB +563B
stream-hub-service 111MiB 111MiB +854B
presence-service 111MiB 111MiB +1.8KiB
authorization-service 111MiB 111MiB +1.2KiB

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 19:56", "12/10 20:18 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 17 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37690
  • Baseline: develop
  • Timestamp: 2025-12-10 20:18:37 UTC
  • Historical data points: 17

Updated: Wed, 10 Dec 2025 20:18:37 GMT

@lucas-a-pelegrino lucas-a-pelegrino added this to the 7.14.0 milestone Dec 8, 2025
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.70%. Comparing base (ddf6717) to head (05700ac).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #37690   +/-   ##
========================================
  Coverage    67.70%   67.70%           
========================================
  Files         3452     3452           
  Lines       113975   113975           
  Branches     20940    20940           
========================================
+ Hits         77168    77171    +3     
+ Misses       34678    34676    -2     
+ Partials      2129     2128    -1     
Flag Coverage Δ
e2e 57.30% <100.00%> (+0.04%) ⬆️
e2e-api 42.27% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lucas-a-pelegrino lucas-a-pelegrino marked this pull request as ready for review December 9, 2025 19:28
@lucas-a-pelegrino lucas-a-pelegrino requested review from a team as code owners December 9, 2025 19:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/rest-typings/src/v1/omnichannel.ts (1)

3214-3336: Business-hours save params/schemas look correct; consider exposing the new endpoint in OmnichannelEndpoints.

BusinessHourDaysTime, BusinessHourWorkHours, and POSTLivechatBusinessHoursSaveParams are consistent with POSTLivechatBusinessHoursSaveParamsSchema (field names, required flags, and nested object shapes all align), and the success schema follows existing patterns, so no blocking issues from a typing/validation standpoint. One thing to double-check is that the new livechat/business-hours.save route is actually represented in the OmnichannelEndpoints map in this file (similar to the existing /v1/livechat/business-hour GET entry); otherwise, hooks like useEndpoint('POST', '/v1/livechat/business-hours.save') will not be fully type-safe even though these validators exist. Not commenting on the TODO itself per maintainers’ guidance. Based on learnings.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dc51116 and 4d4dfb6.

📒 Files selected for processing (9)
  • .changeset/brown-llamas-worry.md (1 hunks)
  • apps/meteor/app/livechat/imports/server/rest/businessHours.ts (2 hunks)
  • apps/meteor/app/livechat/server/methods/saveBusinessHour.ts (2 hunks)
  • apps/meteor/client/views/omnichannel/businessHours/EditBusinessHours.tsx (3 hunks)
  • apps/meteor/tests/data/livechat/businessHours.ts (5 hunks)
  • apps/meteor/tests/e2e/omnichannel/omnichannel-business-hours.spec.ts (0 hunks)
  • apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts (1 hunks)
  • apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts (8 hunks)
  • packages/rest-typings/src/v1/omnichannel.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/meteor/tests/e2e/omnichannel/omnichannel-business-hours.spec.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/livechat/server/methods/saveBusinessHour.ts
  • apps/meteor/tests/data/livechat/businessHours.ts
  • apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts
  • apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts
  • packages/rest-typings/src/v1/omnichannel.ts
  • apps/meteor/app/livechat/imports/server/rest/businessHours.ts
  • apps/meteor/client/views/omnichannel/businessHours/EditBusinessHours.tsx
apps/meteor/tests/e2e/**/*.{ts,spec.ts}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.{ts,spec.ts}: Store commonly used locators in variables/constants for reuse
Follow Page Object Model pattern consistently in Playwright tests

Files:

  • apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts
🧠 Learnings (9)
📓 Common learnings
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37408
File: apps/meteor/client/views/admin/ABAC/useRoomAttributeOptions.tsx:53-69
Timestamp: 2025-11-10T19:06:20.146Z
Learning: In the Rocket.Chat repository, do not provide suggestions or recommendations about code sections marked with TODO comments. The maintainers have already identified these as future work and external reviewers lack the full context about implementation plans and timing.
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • apps/meteor/app/livechat/server/methods/saveBusinessHour.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`

Applied to files:

  • apps/meteor/tests/data/livechat/businessHours.ts
  • apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts
  • apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts
  • apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts
  • apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory

Applied to files:

  • apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests

Applied to files:

  • apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts
🧬 Code graph analysis (3)
apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts (1)
apps/meteor/tests/data/livechat/businessHours.ts (1)
  • saveBusinessHour (13-17)
apps/meteor/app/livechat/imports/server/rest/businessHours.ts (3)
packages/rest-typings/src/v1/omnichannel.ts (2)
  • POSTLivechatBusinessHoursSaveSuccessResponse (3336-3336)
  • isPOSTLivechatBusinessHoursSaveParams (3320-3322)
packages/rest-typings/src/v1/Ajv.ts (2)
  • validateBadRequestErrorResponse (47-47)
  • validateUnauthorizedErrorResponse (70-70)
apps/meteor/app/api/server/ApiClass.ts (1)
  • ExtractRoutesFromAPI (73-77)
apps/meteor/client/views/omnichannel/businessHours/EditBusinessHours.tsx (1)
apps/meteor/tests/data/livechat/businessHours.ts (1)
  • saveBusinessHour (13-17)
🔇 Additional comments (10)
apps/meteor/app/livechat/server/methods/saveBusinessHour.ts (1)

5-5: LGTM!

The deprecation warning is correctly added at the method entry point, providing the method name, target deprecation version, and the replacement endpoint path. This follows proper deprecation patterns.

Also applies to: 17-17

.changeset/brown-llamas-worry.md (1)

1-6: LGTM!

The changeset correctly identifies the affected packages (@rocket.chat/meteor and @rocket.chat/rest-typings) with patch-level changes and provides a clear description of the deprecation and new endpoint.

apps/meteor/client/views/omnichannel/businessHours/EditBusinessHours.tsx (1)

42-42: LGTM!

The migration from the deprecated Meteor method to the new REST endpoint is correctly implemented. The useEndpoint hook provides proper type inference for the payload, eliminating the need for as any casts.

Also applies to: 58-72

apps/meteor/tests/e2e/utils/omnichannel/businessHours.ts (1)

13-35: Payload structure aligns with the new endpoint schema.

The payload correctly includes both daysTime (with nested time objects) and workHours (with flat strings), matching the expected POSTLivechatBusinessHoursSaveParams structure.

apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts (2)

52-58: LGTM!

The test cleanup pattern correctly removes _updatedAt and ts properties before sending to the new endpoint, and the payload structure with timezone as a string and timezoneName is consistent across test cases.

Also applies to: 91-104


182-210: LGTM!

The custom business hour creation test correctly uses the new payload structure with daysOpen, daysTime, and workHours fields, matching the new endpoint schema.

apps/meteor/tests/data/livechat/businessHours.ts (3)

13-16: LGTM!

The saveBusinessHour function correctly uses the new POSTLivechatBusinessHoursSaveParams type and calls the new REST endpoint.


19-51: LGTM!

The createCustomBusinessHour function correctly constructs the payload with the new schema structure including daysOpen, daysTime, and workHours fields.


64-92: LGTM!

The cleanup pattern to remove _updatedAt and ts before constructing the payload is correctly applied, and the payload structure aligns with the new endpoint schema.

apps/meteor/app/livechat/imports/server/rest/businessHours.ts (1)

50-55: LGTM!

The type extraction using ExtractRoutesFromAPI and module augmentation to extend the Endpoints interface follows the established pattern in the codebase, ensuring the new endpoint is properly typed across the system.

dougfabris
dougfabris previously approved these changes Dec 9, 2025
Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frontend looks good to me!

@lucas-a-pelegrino lucas-a-pelegrino added stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider labels Dec 10, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c4433f6 and 49e9d71.

📒 Files selected for processing (1)
  • packages/rest-typings/src/v1/omnichannel.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • packages/rest-typings/src/v1/omnichannel.ts
🧠 Learnings (1)
📓 Common learnings
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37408
File: apps/meteor/client/views/admin/ABAC/useRoomAttributeOptions.tsx:53-69
Timestamp: 2025-11-10T19:06:20.146Z
Learning: In the Rocket.Chat repository, do not provide suggestions or recommendations about code sections marked with TODO comments. The maintainers have already identified these as future work and external reviewers lack the full context about implementation plans and timing.
🧬 Code graph analysis (1)
packages/rest-typings/src/v1/omnichannel.ts (1)
packages/rest-typings/src/v1/Ajv.ts (1)
  • ajv (24-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

Copy link
Member

@KevLehman KevLehman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hoping CI passes first try :trollface:

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/rest-typings/src/v1/omnichannel.ts (1)

3299-3301: Mark optional field as nullable in schema.

The timezone property is optional in the TypeScript type definition (line 3238: timezone?: string) but the schema doesn't mark it as nullable: true. This creates a mismatch between the type system and runtime validation.

Apply this diff to align the schema with the type definition:

 timezone: {
   type: 'string',
+  nullable: true,
 },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 49e9d71 and ab19df8.

📒 Files selected for processing (1)
  • packages/rest-typings/src/v1/omnichannel.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • packages/rest-typings/src/v1/omnichannel.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37408
File: apps/meteor/client/views/admin/ABAC/useRoomAttributeOptions.tsx:53-69
Timestamp: 2025-11-10T19:06:20.146Z
Learning: In the Rocket.Chat repository, do not provide suggestions or recommendations about code sections marked with TODO comments. The maintainers have already identified these as future work and external reviewers lack the full context about implementation plans and timing.
📚 Learning: 2025-10-06T20:32:23.658Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/utilities.ts:557-573
Timestamp: 2025-10-06T20:32:23.658Z
Learning: In packages/apps-engine/tests/test-data/utilities.ts, the field name `isSubscripbedViaBundle` in the `IMarketplaceSubscriptionInfo` type should not be flagged as a typo, as it may match the upstream API's field name.

Applied to files:

  • packages/rest-typings/src/v1/omnichannel.ts
🧬 Code graph analysis (1)
packages/rest-typings/src/v1/omnichannel.ts (1)
packages/rest-typings/src/v1/Ajv.ts (1)
  • ajv (24-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (2)
packages/rest-typings/src/v1/omnichannel.ts (2)

3229-3240: LGTM! Type definition is well-structured.

The type correctly defines optional and required fields for the business hour save operation, supporting both the legacy daysTime format and the new workHours format during the transition period.


3326-3338: LGTM! Success response schema follows established patterns.

The success response schema correctly defines a simple boolean success response and follows the same pattern used throughout this file for similar endpoints.

@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Dec 10, 2025
@lucas-a-pelegrino lucas-a-pelegrino added the stat: ready to merge PR tested and approved waiting for merge label Dec 10, 2025
@kodiakhq kodiakhq bot merged commit 872da49 into develop Dec 10, 2025
52 checks passed
@kodiakhq kodiakhq bot deleted the chore/CORE-1550 branch December 10, 2025 21:20
@dougfabris dougfabris modified the milestones: 7.14.0, 8.0.0 Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants