feat: update recording, transcript endpoint and add tests #43
Conversation
WalkthroughAPI endpoints for bookings are updated with modified authentication guards, response message fields are removed from recordings and transcripts outputs, and the mark-absent endpoint is restored. Authorization tests are activated to validate access control. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.ts (1)
214-232: AwaitgetRecordingsto resolve the Promise before returning.
CalVideoService.getRecordingsis an async method. Without await, the response will contain a Promise in thedatafield, which serializes to{}in JSON and hides any errors thrown by the service.🛠️ Proposed fix
- const recordings = this.calVideoService.getRecordings(bookingUid); + const recordings = await this.calVideoService.getRecordings(bookingUid);
🧹 Nitpick comments (1)
apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/booking-access-auth.e2e-spec.ts (1)
188-232: Assertdatain the success cases to catch response-shape regressions.Right now the tests only check
status. Adding adataassertion will guard against accidental Promise serialization or missing payloads.✅ Suggested test assertions
const response = await request(app.getHttpServer()) .get(`/v2/bookings/${testBooking.uid}/recordings`) .set("Authorization", `Bearer ${ownerApiKey}`) .set(CAL_API_VERSION_HEADER, VERSION_2024_08_13) .expect(200); expect(response.body.status).toEqual(SUCCESS_STATUS); + expect(response.body.data).toEqual([]); }); @@ const response = await request(app.getHttpServer()) .get(`/v2/bookings/${testBooking.uid}/transcripts`) .set("Authorization", `Bearer ${ownerApiKey}`) .set(CAL_API_VERSION_HEADER, VERSION_2024_08_13) .expect(200); expect(response.body.status).toEqual(SUCCESS_STATUS); + expect(response.body.data).toEqual([]); });
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.tsapps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/booking-access-auth.e2e-spec.tspackages/platform/types/bookings/2024-08-13/outputs/get-booking-recordings.output.tspackages/platform/types/bookings/2024-08-13/outputs/get-booking-transcripts.output.ts
💤 Files with no reviewable changes (1)
- packages/platform/types/bookings/2024-08-13/outputs/get-booking-transcripts.output.ts
🧰 Additional context used
🧬 Code graph analysis (2)
apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/booking-access-auth.e2e-spec.ts (1)
packages/platform/constants/api.ts (3)
CAL_API_VERSION_HEADER(72-72)VERSION_2024_08_13(59-59)SUCCESS_STATUS(9-9)
apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.ts (2)
packages/platform/constants/api.ts (1)
SUCCESS_STATUS(9-9)scripts/prepare-local-for-delegation-credentials-testing.js (1)
user(18-20)
🔇 Additional comments (3)
packages/platform/types/bookings/2024-08-13/outputs/get-booking-recordings.output.ts (1)
6-6: No review notes for this change.apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.ts (2)
235-239: Guards/permissions alignment looks good.
394-405: Mark-absent endpoint restoration looks good.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Benchmark PR from agentic-review-benchmarks#16
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests
API Changes
✏️ Tip: You can customize this high-level summary in your review settings.