Skip to content

Commit 056b821

Browse files
hariombalharadevin-ai-integration[bot]hariom@cal.comThyMinimalDev
authored
feat: Add routing-forms record response endpoint with available slots (calcom#22239)
* feat: Add routing-forms record response endpoint with available slots * fix: resolve TypeScript error in handleResponse.test.ts - Fix type mismatch where mockResponse was passed as identifierKeyedResponse - identifierKeyedResponse expects Record<string, string | string[]> structure - Updated test to pass correct data structure for type compatibility Co-Authored-By: hariom@cal.com <hariom@cal.com> * fix: correct POST endpoint parameter handling and request body parsing in routing forms responses controller - Change @query() to @Body() decorator for POST request data in controller - Update service method to accept parsed body data directly - Remove incorrect URLSearchParams parsing of request.body object - Fix getRoutingUrl method to use form response data parameter This resolves API v2 test failures by following proper NestJS patterns for POST request handling. Co-Authored-By: hariom@cal.com <hariom@cal.com> * Pass teamMemberEmail as well * Devin fixes reverted * Keep all routing related props together in both endpoints * Remove newly added slots props from Slots documentation as they are used through internal fn call only * fix test * Pass skipContactOwner * Pass crmAppSlug and crmOwnerRecordGType and add more tests * handle external redirect case and form not found case * hide props * chore: bump platform libs --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: hariom@cal.com <hariom@cal.com> Co-authored-by: cal.com <morgan@cal.com> Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
1 parent c90fded commit 056b821

23 files changed

Lines changed: 1559 additions & 34 deletions

File tree

apps/api/v2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@axiomhq/winston": "^1.2.0",
3939
"@calcom/platform-constants": "*",
4040
"@calcom/platform-enums": "*",
41-
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.236",
41+
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.239",
4242
"@calcom/platform-types": "*",
4343
"@calcom/platform-utils": "*",
4444
"@calcom/prisma": "*",

apps/api/v2/src/ee/bookings/2024-08-13/services/input.service.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,20 @@ export class InputBookingsService_2024_08_13 {
186186
guests,
187187
location,
188188
},
189+
...this.getRoutingFormData(inputBooking.routing),
190+
};
191+
}
192+
193+
private getRoutingFormData(routing: { teamMemberIds?: number[]; responseId?: number; teamMemberEmail?: string; skipContactOwner?: boolean; crmAppSlug?: string; crmOwnerRecordType?: string } | undefined) {
194+
if (!routing) return null;
195+
196+
return {
197+
routedTeamMemberIds: routing.teamMemberIds,
198+
routingFormResponseId: routing.responseId,
199+
teamMemberEmail: routing.teamMemberEmail,
200+
skipContactOwner: routing.skipContactOwner,
201+
crmAppSlug: routing.crmAppSlug,
202+
crmOwnerRecordType: routing.crmOwnerRecordType,
189203
};
190204
}
191205

@@ -453,6 +467,7 @@ export class InputBookingsService_2024_08_13 {
453467
location,
454468
},
455469
schedulingType: eventType.schedulingType,
470+
...this.getRoutingFormData(inputBooking.routing),
456471
});
457472

458473
switch (timeBetween) {

0 commit comments

Comments
 (0)