feat: v2 api hidden event types#22602
feat: v2 api hidden event types#22602RadheyMugdal wants to merge 39 commits intocalcom:mainfrom RadheyMugdal:feat/api-v2-hidden-event-types
Conversation
…ct and improve serialization
WalkthroughA new optional boolean property, Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were identified in this pull request. Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
apps/api/v2/src/ee/bookings/2024-08-13/bookings.repository.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin". (The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "/apps/api/v2".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in "apps/api/v2/.eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. apps/api/v2/src/ee/bookings/2024-08-13/outputs/update-booking-location.output.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin". (The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "/apps/api/v2".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in "apps/api/v2/.eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin". (The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "/apps/api/v2".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in "apps/api/v2/.eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@RadheyMugdal is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (07/17/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (07/17/25)1 label was added to this PR based on Keith Williams's automation. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
packages/platform/types/event-types/event-types_2024_06_14/outputs/event-type.output.ts (1)
443-446: Consider adding a description to the@DocsProperty()decorator.While the implementation is correct, adding a description would improve the API documentation and help developers understand the purpose of the
hiddenproperty.@IsOptional() @IsBoolean() - @DocsProperty() + @DocsProperty({ + description: "If true, the event type will be hidden from public view" + }) hidden?: boolean;packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts (1)
418-421: Consider adding a description to the@DocsPropertyOptional()decorator.The implementation is correct, but adding a description would improve the API documentation consistency and help developers understand the purpose of the
hiddenproperty.@IsOptional() @IsBoolean() - @DocsPropertyOptional() + @DocsPropertyOptional({ + description: "If true, the event type will be hidden from public view" + }) hidden?: boolean;packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts (1)
443-446: Consider adding a description to the@DocsPropertyOptional()decorator.The implementation is correct and consistent with the other files in this PR. Adding a description would improve the API documentation.
@IsOptional() @IsBoolean() - @DocsPropertyOptional() + @DocsPropertyOptional({ + description: "If true, the event type will be hidden from public view" + }) hidden?: boolean;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts(1 hunks)apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/output-event-types.service.ts(3 hunks)packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts(1 hunks)packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts(1 hunks)packages/platform/types/event-types/event-types_2024_06_14/outputs/event-type.output.ts(1 hunks)
⏰ 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). (20)
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Security Check
🔇 Additional comments (4)
packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts (1)
443-446: Excellent implementation consistency across the PR.The
hiddenproperty has been consistently implemented across all input and output types with proper validation decorators and optional typing. This demonstrates good attention to detail and maintains type safety throughout the API.apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/output-event-types.service.ts (3)
92-92: LGTM: Property added to Input type correctly.The addition of the "hidden" property to the Input type is properly implemented and follows the same pattern as other properties.
131-131: LGTM: Property destructuring implemented correctly.The destructuring of the "hidden" property follows the established pattern and is properly implemented.
208-208: LGTM: Property correctly included in response object.The inclusion of the "hidden" property in the response object completes the implementation correctly and maintains consistency with the existing code structure.
.../v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts
Show resolved
Hide resolved
kart1ka
left a comment
There was a problem hiding this comment.
Can you pls upload a loom video of the change?
Getting an error on running the api after the changes. I am not getting this error on main. Can you please fix it?
src/modules/organizations/event-types/services/output.service.ts:92:7 - error TS2345: Argument of type 'Input' is not assignable to parameter of type 'Input'.
Property 'hidden' is missing in type 'Input' but required in type 'Input'.
92 databaseEventType,
~~~~~~~~~~~~~~~~~
../../../node_modules/.prisma/client/index.d.ts:14553:7
14553 hidden: boolean
~~~~~~
'hidden' is declared here.
[10:59:41 am] Found 1 error. Watching for file changes.
Got it! I’ll upload the Loom video of the changes soon and will look into the issue and push a fix ASAP. |
…heyMugdal/cal.com into feat/api-v2-hidden-event-types
…adheyMugdal/cal.com into feat/api-v2-hidden-event-types
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/user-bookings.e2e-spec.ts (2)
31-31: Remove unused import.The
createBookingimport appears to be unused in this test file. Consider removing it to keep imports clean.-import { createBooking } from "@calcom/features/bookings/lib/handleNewBooking/createBooking";
2312-2348: LGTM! Well-structured test with proper setup and cleanup.This test effectively validates the PATCH endpoint for updating booking locations. The implementation follows existing patterns and includes comprehensive assertions.
Consider these minor enhancements:
- The test description could be more specific (e.g., "should update booking location to attendee phone via PATCH")
- Consider adding an assertion to verify the location was persisted in the database
- The phone number format follows E.164 standard, which is good
The test properly:
- Creates mock data with appropriate initial state
- Tests the specific location transformation (attendeePhone type → phone number string)
- Verifies all critical response fields
- Performs cleanup to prevent test pollution
packages/platform/types/bookings/2024-08-13/inputs/location.input.ts (1)
215-306: Fix typo and consider error handling improvementsThe
transformLocationfunction provides comprehensive location type handling with proper validation and mapping. However, there are a few issues to address:
- Fix typo in comment (line 222):
- // or whatever check that they are not providing a string for bookign location but one of the input objects. + // or whatever check that they are not providing a string for booking location but one of the input objects.
- Consider improving error message consistency:
The function throwsBadRequestExceptionin two places with different message formats. Consider standardizing the error messages for better consistency.The logic for handling different location types is comprehensive and the backward compatibility support is well-implemented.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
apps/api/v2/src/ee/bookings/2024-08-13/bookings.repository.ts(1 hunks)apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.ts(4 hunks)apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/user-bookings.e2e-spec.ts(4 hunks)apps/api/v2/src/ee/bookings/2024-08-13/outputs/update-booking-location.output.ts(1 hunks)apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts(2 hunks)packages/platform/types/bookings/2024-08-13/inputs/location.input.ts(2 hunks)packages/platform/types/bookings/2024-08-13/inputs/update-booking-location.input.ts(1 hunks)packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- apps/api/v2/src/ee/bookings/2024-08-13/bookings.repository.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Files:
packages/platform/types/bookings/2024-08-13/inputs/update-booking-location.input.tsapps/api/v2/src/ee/bookings/2024-08-13/outputs/update-booking-location.output.tsapps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.tsapps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.tspackages/platform/types/bookings/2024-08-13/inputs/location.input.tsapps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/user-bookings.e2e-spec.tspackages/platform/types/bookings/2024-08-13/outputs/booking.output.ts
🧠 Learnings (3)
apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts (1)
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.ts (1)
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/user-bookings.e2e-spec.ts (1)
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
🧬 Code Graph Analysis (5)
packages/platform/types/bookings/2024-08-13/inputs/update-booking-location.input.ts (1)
packages/platform/types/bookings/2024-08-13/inputs/location.input.ts (10)
ValidateBookingLocation_2024_08_13(202-213)BookingInputAddressLocation_2024_08_13(21-28)BookingInputAttendeeAddressLocation_2024_08_13(101-113)BookingInputAttendeeDefinedLocation_2024_08_13(124-136)BookingInputAttendeePhoneLocation_2024_08_13(114-122)BookingInputIntegrationLocation_2024_08_13(72-80)BookingInputLinkLocation_2024_08_13(30-37)BookingInputPhoneLocation_2024_08_13(82-89)BookingInputOrganizersDefaultAppLocation_2024_08_13(91-99)BookingInputLocation_2024_08_13(138-146)
apps/api/v2/src/ee/bookings/2024-08-13/outputs/update-booking-location.output.ts (2)
packages/platform/constants/api.ts (2)
SUCCESS_STATUS(9-9)ERROR_STATUS(10-10)packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts (1)
UpdateBookingLocationOutputData_2024_08_13(421-436)
apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.ts (5)
apps/api/v2/src/modules/auth/guards/api-auth/api-auth.guard.ts (1)
ApiAuthGuard(7-20)apps/api/v2/src/lib/docs/headers.ts (1)
API_KEY_OR_ACCESS_TOKEN_HEADER(42-47)packages/platform/types/bookings/2024-08-13/inputs/update-booking-location.input.ts (1)
UpdateBookingLocationInput_2024_08_13(17-36)apps/api/v2/src/ee/bookings/2024-08-13/outputs/update-booking-location.output.ts (1)
UpdateBookingLocationOutput_2024_08_13(8-20)packages/platform/constants/api.ts (1)
SUCCESS_STATUS(9-9)
packages/platform/types/bookings/2024-08-13/inputs/location.input.ts (2)
apps/api/v2/src/ee/bookings/2024-08-13/services/input.service.ts (1)
transformLocation(276-367)apps/api/v2/src/ee/event-types/event-types_2024_06_14/transformers/api-to-internal/locations.ts (1)
apiToInternalintegrationsMapping(14-44)
packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts (1)
packages/platform/types/bookings/2024-08-13/inputs/location.input.ts (1)
ValidateBookingLocation_2024_08_13(202-213)
⏰ 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). (1)
- GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (10)
apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts (2)
55-56: LGTM: Clean import additions for the new functionality.The imports are correctly structured and necessary for the new
updateBookingLocationmethod implementation.
1023-1030: LGTM: Well-implemented location update method with proper error handling.The method implementation follows good practices:
- Proper input validation by checking if booking exists
- Appropriate error handling with
NotFoundException- Clean separation of concerns by delegating location transformation to a utility function
- Consistent with the service's existing patterns
The method correctly retrieves the booking, validates its existence, transforms the location data using the imported
transformLocationfunction, and delegates the actual update to the repository layer.apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.ts (2)
10-10: LGTM: Imports are properly organizedThe new imports for
UpdateBookingLocationOutput_2024_08_13andUpdateBookingLocationInput_2024_08_13are correctly placed and follow the established import structure.Also applies to: 74-74
32-32: LGTM: Patch decorator import added correctlyThe
Patchdecorator import is properly added to support the new PATCH endpoint.packages/platform/types/bookings/2024-08-13/inputs/update-booking-location.input.ts (1)
17-36: LGTM: Well-structured input DTO with proper validationThe
UpdateBookingLocationInput_2024_08_13class is well-designed with:
- Appropriate custom validation using
ValidateBookingLocation_2024_08_13- Comprehensive Swagger documentation with
oneOfschema references- Backward compatibility support for string inputs
- Proper transformation decorator
@Type(() => Object)The implementation follows established patterns and provides good API documentation.
apps/api/v2/src/ee/bookings/2024-08-13/outputs/update-booking-location.output.ts (1)
8-20: LGTM: Standard and well-structured output DTOThe
UpdateBookingLocationOutput_2024_08_13class follows the established pattern for API responses with:
- Proper status field validation using enum constraints
- Nested data validation with
@ValidateNested()and@Type(() => Object)- Comprehensive Swagger documentation with schema references
- Consistent use of platform constants for status values
The implementation is clean and follows the codebase conventions.
packages/platform/types/bookings/2024-08-13/inputs/location.input.ts (1)
1-1: LGTM: Proper imports added for the new functionalityThe new imports for
BadRequestException, validation functions (isPhoneNumber,isURL), and the integrations mapping are correctly added to support thetransformLocationfunction.Also applies to: 4-4, 8-8
packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts (3)
20-20: LGTM: Import added for location validationThe import for
ValidateBookingLocation_2024_08_13is correctly added to support the enhanced location validation in the booking output classes.
240-249: LGTM: Enhanced location property with proper validationThe updates to the
locationproperty are well-implemented:
- Added custom validation decorator
ValidateBookingLocation_2024_08_13()- Updated API documentation to clarify the location string format
- Added
@Type(() => Object)decorator for proper transformation- Made the property optional which aligns with the update functionality
- Updated example to phone number format for better clarity
These changes enhance the validation and documentation of the location field.
421-436: LGTM: Well-structured output data classThe
UpdateBookingLocationOutputData_2024_08_13class is properly designed with:
- Consistent validation decorators matching the base booking output
- Proper Swagger documentation with clear descriptions
- Required
location!field with appropriate typing- Consistent use of the custom location validator
The implementation follows the established patterns and provides the necessary structure for the update location response.
| @Patch("/:bookingUid") | ||
| @UseGuards(ApiAuthGuard, BookingUidGuard) | ||
| @Permissions([BOOKING_WRITE]) | ||
| @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER) | ||
| @ApiOperation({ | ||
| summary: "Update the location of a booking", | ||
| description: | ||
| "Allows updating the location of an existing booking using one of the supported location types.", | ||
| }) | ||
| @HttpCode(HttpStatus.OK) | ||
| async updateBookingLocation( | ||
| @Body() body: UpdateBookingLocationInput_2024_08_13, | ||
| @Param("bookingUid") bookingUid: string | ||
| ): Promise<UpdateBookingLocationOutput_2024_08_13> { | ||
| const booking = await this.bookingsService.updateBookingLocation(bookingUid, body); | ||
| return { | ||
| status: SUCCESS_STATUS, | ||
| data: { | ||
| bookingUid: booking.uid, | ||
| location: booking.location!, | ||
| }, | ||
| }; | ||
| } |
There was a problem hiding this comment.
Review the non-null assertion on booking.location
The endpoint implementation looks good overall with proper guards, permissions, and structure. However, there's a potential issue with the non-null assertion on line 487.
- location: booking.location!,
+ location: booking.location ?? "",The non-null assertion (!) assumes that booking.location will always be defined after the update operation, but this might not be guaranteed. Consider using nullish coalescing or proper null checking to avoid potential runtime errors.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @Patch("/:bookingUid") | |
| @UseGuards(ApiAuthGuard, BookingUidGuard) | |
| @Permissions([BOOKING_WRITE]) | |
| @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER) | |
| @ApiOperation({ | |
| summary: "Update the location of a booking", | |
| description: | |
| "Allows updating the location of an existing booking using one of the supported location types.", | |
| }) | |
| @HttpCode(HttpStatus.OK) | |
| async updateBookingLocation( | |
| @Body() body: UpdateBookingLocationInput_2024_08_13, | |
| @Param("bookingUid") bookingUid: string | |
| ): Promise<UpdateBookingLocationOutput_2024_08_13> { | |
| const booking = await this.bookingsService.updateBookingLocation(bookingUid, body); | |
| return { | |
| status: SUCCESS_STATUS, | |
| data: { | |
| bookingUid: booking.uid, | |
| location: booking.location!, | |
| }, | |
| }; | |
| } | |
| @Patch("/:bookingUid") | |
| @UseGuards(ApiAuthGuard, BookingUidGuard) | |
| @Permissions([BOOKING_WRITE]) | |
| @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER) | |
| @ApiOperation({ | |
| summary: "Update the location of a booking", | |
| description: | |
| "Allows updating the location of an existing booking using one of the supported location types.", | |
| }) | |
| @HttpCode(HttpStatus.OK) | |
| async updateBookingLocation( | |
| @Body() body: UpdateBookingLocationInput_2024_08_13, | |
| @Param("bookingUid") bookingUid: string | |
| ): Promise<UpdateBookingLocationOutput_2024_08_13> { | |
| const booking = await this.bookingsService.updateBookingLocation(bookingUid, body); | |
| return { | |
| status: SUCCESS_STATUS, | |
| data: { | |
| bookingUid: booking.uid, | |
| location: booking.location ?? "", | |
| }, | |
| }; | |
| } |
🤖 Prompt for AI Agents
In apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.ts
around lines 468 to 490, the code uses a non-null assertion on booking.location
which may cause runtime errors if location is undefined. To fix this, replace
the non-null assertion with a null check or nullish coalescing operator to
safely handle cases where booking.location might be null or undefined, ensuring
the response does not throw an error.
What does this PR do?
This PR adds support for creating and updating hidden event types via API v2.
Summary of Changes
hidden?: booleanfield to:BaseCreateEventTypeInputBaseUpdateEventTypeInputhiddenfield in:BaseEventTypeOutput_2024_06_14getResponseEventType()serviceMandatory Tasks (DO NOT REMOVE)
How should this be tested?
E2E tests have been added to cover the functionality:
Location:
apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.tsWhat’s covered:
hidden: trueand verifying it in the response.hidden: falseand verifying the updated value.