@wix/bookings 1.0.157 → 1.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/src/bookings-availability-v1-slot-availability.universal.d.ts +3 -0
- package/build/cjs/src/bookings-availability-v1-slot-availability.universal.js +3 -0
- package/build/cjs/src/bookings-availability-v1-slot-availability.universal.js.map +1 -1
- package/build/cjs/src/bookings-calendar-v1-session.universal.d.ts +9 -0
- package/build/cjs/src/bookings-calendar-v1-session.universal.js +9 -0
- package/build/cjs/src/bookings-calendar-v1-session.universal.js.map +1 -1
- package/build/cjs/src/bookings-calendar-v2-external-calendar.universal.d.ts +9 -0
- package/build/cjs/src/bookings-calendar-v2-external-calendar.universal.js +9 -0
- package/build/cjs/src/bookings-calendar-v2-external-calendar.universal.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-resource.http.d.ts +47 -134
- package/build/cjs/src/bookings-catalog-v1-resource.http.js +47 -134
- package/build/cjs/src/bookings-catalog-v1-resource.http.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-resource.public.d.ts +6 -6
- package/build/cjs/src/bookings-catalog-v1-resource.public.js +13 -13
- package/build/cjs/src/bookings-catalog-v1-resource.public.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-resource.universal.d.ts +54 -139
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js +66 -147
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js.map +1 -1
- package/build/cjs/src/bookings-catalog-v1-service-options-and-variants.universal.d.ts +13 -0
- package/build/cjs/src/bookings-catalog-v1-service-options-and-variants.universal.js +13 -0
- package/build/cjs/src/bookings-catalog-v1-service-options-and-variants.universal.js.map +1 -1
- package/build/cjs/src/bookings-reader-v2-extended-booking.universal.d.ts +3 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.universal.js +3 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.universal.js.map +1 -1
- package/build/cjs/src/bookings-services-v2-service.universal.d.ts +6 -0
- package/build/cjs/src/bookings-services-v2-service.universal.js +6 -0
- package/build/cjs/src/bookings-services-v2-service.universal.js.map +1 -1
- package/build/cjs/src/bookings-v2-attendance.http.d.ts +13 -10
- package/build/cjs/src/bookings-v2-attendance.http.js +16 -9
- package/build/cjs/src/bookings-v2-attendance.http.js.map +1 -1
- package/build/cjs/src/bookings-v2-attendance.types.d.ts +13 -5
- package/build/cjs/src/bookings-v2-attendance.types.js.map +1 -1
- package/build/cjs/src/bookings-v2-attendance.universal.d.ts +32 -14
- package/build/cjs/src/bookings-v2-attendance.universal.js +19 -9
- package/build/cjs/src/bookings-v2-attendance.universal.js.map +1 -1
- package/build/cjs/src/bookings-v2-booking.universal.d.ts +14 -0
- package/build/cjs/src/bookings-v2-booking.universal.js +14 -0
- package/build/cjs/src/bookings-v2-booking.universal.js.map +1 -1
- package/build/cjs/src/bookings-v2-price-info.universal.d.ts +6 -0
- package/build/cjs/src/bookings-v2-price-info.universal.js +6 -0
- package/build/cjs/src/bookings-v2-price-info.universal.js.map +1 -1
- package/build/es/src/bookings-availability-v1-slot-availability.universal.d.ts +3 -0
- package/build/es/src/bookings-availability-v1-slot-availability.universal.js +3 -0
- package/build/es/src/bookings-availability-v1-slot-availability.universal.js.map +1 -1
- package/build/es/src/bookings-calendar-v1-session.universal.d.ts +9 -0
- package/build/es/src/bookings-calendar-v1-session.universal.js +9 -0
- package/build/es/src/bookings-calendar-v1-session.universal.js.map +1 -1
- package/build/es/src/bookings-calendar-v2-external-calendar.universal.d.ts +9 -0
- package/build/es/src/bookings-calendar-v2-external-calendar.universal.js +9 -0
- package/build/es/src/bookings-calendar-v2-external-calendar.universal.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.http.d.ts +47 -134
- package/build/es/src/bookings-catalog-v1-resource.http.js +47 -134
- package/build/es/src/bookings-catalog-v1-resource.http.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.public.d.ts +6 -6
- package/build/es/src/bookings-catalog-v1-resource.public.js +9 -9
- package/build/es/src/bookings-catalog-v1-resource.public.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-resource.universal.d.ts +54 -139
- package/build/es/src/bookings-catalog-v1-resource.universal.js +61 -142
- package/build/es/src/bookings-catalog-v1-resource.universal.js.map +1 -1
- package/build/es/src/bookings-catalog-v1-service-options-and-variants.universal.d.ts +13 -0
- package/build/es/src/bookings-catalog-v1-service-options-and-variants.universal.js +13 -0
- package/build/es/src/bookings-catalog-v1-service-options-and-variants.universal.js.map +1 -1
- package/build/es/src/bookings-reader-v2-extended-booking.universal.d.ts +3 -0
- package/build/es/src/bookings-reader-v2-extended-booking.universal.js +3 -0
- package/build/es/src/bookings-reader-v2-extended-booking.universal.js.map +1 -1
- package/build/es/src/bookings-services-v2-service.universal.d.ts +6 -0
- package/build/es/src/bookings-services-v2-service.universal.js +6 -0
- package/build/es/src/bookings-services-v2-service.universal.js.map +1 -1
- package/build/es/src/bookings-v2-attendance.http.d.ts +13 -10
- package/build/es/src/bookings-v2-attendance.http.js +16 -9
- package/build/es/src/bookings-v2-attendance.http.js.map +1 -1
- package/build/es/src/bookings-v2-attendance.types.d.ts +13 -5
- package/build/es/src/bookings-v2-attendance.types.js.map +1 -1
- package/build/es/src/bookings-v2-attendance.universal.d.ts +32 -14
- package/build/es/src/bookings-v2-attendance.universal.js +19 -9
- package/build/es/src/bookings-v2-attendance.universal.js.map +1 -1
- package/build/es/src/bookings-v2-booking.universal.d.ts +14 -0
- package/build/es/src/bookings-v2-booking.universal.js +14 -0
- package/build/es/src/bookings-v2-booking.universal.js.map +1 -1
- package/build/es/src/bookings-v2-price-info.universal.d.ts +6 -0
- package/build/es/src/bookings-v2-price-info.universal.js +6 -0
- package/build/es/src/bookings-v2-price-info.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -918,6 +918,9 @@ export interface UnLinkResourceFromOwnerResponse {
|
|
|
918
918
|
* @permissionScope Read Bookings - Public Data
|
|
919
919
|
* @permissionScope Read bookings calendar - including participants
|
|
920
920
|
* @permissionScope Read Bookings Calendar
|
|
921
|
+
* @applicableIdentity APP
|
|
922
|
+
* @applicableIdentity MEMBER
|
|
923
|
+
* @applicableIdentity VISITOR
|
|
921
924
|
*/
|
|
922
925
|
export declare function list(options?: ListOptions): Promise<ListResourcesResponse>;
|
|
923
926
|
export interface ListOptions {
|
|
@@ -926,86 +929,60 @@ export interface ListOptions {
|
|
|
926
929
|
/**
|
|
927
930
|
* Retrieves a list of the resources according to the specified filters and paging.
|
|
928
931
|
*
|
|
929
|
-
* The query parameter is optional. If no query is provided than all non-deleted resources are returned.
|
|
930
932
|
*
|
|
931
|
-
*
|
|
932
|
-
* |--|--|
|
|
933
|
-
* |filter | supported fields: `resource.id`, `resource.tags`, `resource.status`|
|
|
934
|
-
* |paging | supported |
|
|
935
|
-
* |fields | supported |
|
|
936
|
-
* |fieldsets | **not supported** |
|
|
937
|
-
* |sort | **not supported** |
|
|
933
|
+
* The query parameter is optional. If no query is provided, all non-deleted resources are returned.
|
|
938
934
|
*
|
|
935
|
+
* |Property|Is supported| |--|--| |filter | supported fields: resource.id, resource.tags, resource.status| |paging | supported | |fields | supported | |fieldsets | not supported | |sort | not supported |
|
|
939
936
|
*
|
|
940
|
-
*
|
|
941
|
-
* >
|
|
942
|
-
* >
|
|
943
|
-
* > - `fieldsets`
|
|
937
|
+
* > **Notes:** The following objects in the query parameter are not supported for this query:
|
|
938
|
+
* > - sort
|
|
939
|
+
* > - fieldsets
|
|
944
940
|
*
|
|
945
|
-
* > **Permissions**
|
|
946
|
-
* > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
|
|
947
941
|
* @public
|
|
948
|
-
* @documentationMaturity preview
|
|
949
942
|
* @permissionScope Read Bookings - Public Data
|
|
950
943
|
* @permissionScope Read bookings calendar - including participants
|
|
951
944
|
* @permissionScope Read Bookings Calendar
|
|
945
|
+
* @applicableIdentity APP
|
|
946
|
+
* @applicableIdentity MEMBER
|
|
947
|
+
* @applicableIdentity VISITOR
|
|
952
948
|
*/
|
|
953
|
-
export declare function
|
|
954
|
-
export interface
|
|
949
|
+
export declare function queryResourceCatalog(options?: QueryResourceCatalogOptions): Promise<QueryResourcesResponse>;
|
|
950
|
+
export interface QueryResourceCatalogOptions {
|
|
955
951
|
query?: QueryV2;
|
|
956
952
|
}
|
|
957
953
|
/**
|
|
958
954
|
* Creates a resource.
|
|
959
|
-
*
|
|
955
|
+
*
|
|
956
|
+
*
|
|
960
957
|
* The `createResource()` function returns a Promise that resolves to the created resource.
|
|
961
|
-
*
|
|
958
|
+
* Bookings resources are created with a schedule. The schedule and its sessions determine the resource's availability. Note that the schedule must contain a start date in the availability.start property. For resources that are available during the business's default hours, add the business's schedule as a linked schedule in the resource's schedule. For resources that have their own hours, create sessions with type "WORKING_HOURS" using the resource's schedule. You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
|
|
962
959
|
*
|
|
963
|
-
* Bookings resources are created with a schedule. The schedule and its sessions determine the resource's availability. Note that the schedule must contain a start date in the `availability.start` property.
|
|
964
|
-
* For resources that are available during the business's default hours, add the business's schedule as a linked schedule in the resource's schedule. For resources that have their own hours, create sessions with type `"WORKING_HOURS"` using the resource's schedule.
|
|
965
|
-
* You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
|
|
966
960
|
*
|
|
967
|
-
* <!--ONLY:VELO
|
|
968
961
|
* When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
|
|
969
|
-
*
|
|
970
|
-
*
|
|
971
|
-
* + You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
|
|
962
|
+
* - If the resource uses the default business hours, get the business resource's schedule ID and include it in the `scheduleInfo.availability.linkedSchedules` array in the `scheduleInfo` parameter. The default hours can bee found in the Dashboard under **Settings** in the **Bookings** section, on the **Appointment hours** page.
|
|
963
|
+
* - If the resource has its own custom working hours, create the resource, then create sessions of type `WORKING_HOURS` using the [`createSession()`](Sessions/createsession) function. Use the `scheduleId` returned from `createResource()` when creating the sessions. These session can be single sessions or recurring sessions.
|
|
972
964
|
*
|
|
973
|
-
*
|
|
974
|
-
* > + The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working.
|
|
975
|
-
* > + The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar.
|
|
976
|
-
* > + You can only add the business resource's schedule as a linked schedule for a resource.
|
|
977
|
-
* > + A resource can have one schedule only.
|
|
978
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
979
|
-
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can create a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
980
|
-
* <!--END:ONLY:VELO-->
|
|
965
|
+
* You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
|
|
981
966
|
*
|
|
982
|
-
* <!--ONLY:REST-->
|
|
983
|
-
* Use the following steps to create resources:
|
|
984
|
-
* - Create the resource using including schedule information.
|
|
985
|
-
* - If the resource uses the default business hours, get the business resource's schedule ID and include it in the `scheduleInfo.availability.linkedSchedules` array in the in the schedule parameters.
|
|
986
|
-
* - If the resource has its own custom working hours, create sessions of type `"WORKING_HOURS"`. Use the `scheduleId` of the new resource when creating the sessions. These session can be single sessions or recurring sessions. You can have both business hours and custom hours for the same resource schedule.
|
|
987
967
|
*
|
|
988
|
-
*
|
|
989
|
-
* > + A resource can have one schedule only.
|
|
990
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
991
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
968
|
+
* > **Notes:** The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working.
|
|
992
969
|
*
|
|
993
970
|
*
|
|
971
|
+
* The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar. You can only add the business resource's schedule as a linked schedule for a resource. A resource can have one schedule only.
|
|
994
972
|
*
|
|
995
|
-
*
|
|
996
|
-
*
|
|
997
|
-
* <!--END:ONLY:REST-->
|
|
973
|
+
*
|
|
974
|
+
* You can have up to 135 active resources and an additional 135 deleted resources. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can create a resource.
|
|
998
975
|
* @param resource - Resource details.
|
|
999
976
|
* @public
|
|
1000
|
-
* @documentationMaturity preview
|
|
1001
977
|
* @requiredField options.schedules.availability.start
|
|
1002
978
|
* @requiredField options.schedules.intervals.start
|
|
1003
979
|
* @requiredField resource
|
|
1004
980
|
* @requiredField resource.name
|
|
1005
981
|
* @permissionScope Manage Bookings
|
|
982
|
+
* @applicableIdentity APP
|
|
1006
983
|
*/
|
|
1007
|
-
export declare function
|
|
1008
|
-
export interface
|
|
984
|
+
export declare function createResource(resource: Resource, options?: CreateResourceOptions): Promise<CreateResourceResponse>;
|
|
985
|
+
export interface CreateResourceOptions {
|
|
1009
986
|
/**
|
|
1010
987
|
* List of schedules to be assigned for the created resource. Currently only a single schedule is allowed.
|
|
1011
988
|
* If provided, any schedules in the resource entity will be ignored.
|
|
@@ -1014,29 +991,14 @@ export interface CreateOptions {
|
|
|
1014
991
|
}
|
|
1015
992
|
/**
|
|
1016
993
|
* Updates a resource.
|
|
1017
|
-
* <!--ONLY:VELO
|
|
1018
|
-
* The `updateResource()` function returns a Promise that resolves when a resource is updated.
|
|
1019
|
-
* Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](wix-bookings-backend/resource/updateresourceschedule).
|
|
1020
994
|
*
|
|
1021
|
-
* >**Notes:**
|
|
1022
|
-
* > + When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`.
|
|
1023
|
-
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
1024
|
-
* <!--END:ONLY:VELO-->
|
|
1025
|
-
* <!--ONLY:REST-->
|
|
1026
|
-
* Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
|
|
1027
|
-
* the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
|
|
1028
995
|
*
|
|
1029
|
-
*
|
|
1030
|
-
* > + When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`.
|
|
1031
|
-
* > + When updating a resource's schedule you cannot change the resource tag used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
1032
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
996
|
+
* The `updateResource()` function returns a Promise that resolves when a resource is updated. Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](resources/updateresourceschedule).
|
|
1033
997
|
*
|
|
1034
|
-
*
|
|
1035
|
-
*
|
|
1036
|
-
* <!--END:ONLY:REST-->
|
|
998
|
+
*
|
|
999
|
+
* >**Notes:** When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource.
|
|
1037
1000
|
* @param _id - Resource ID.
|
|
1038
1001
|
* @public
|
|
1039
|
-
* @documentationMaturity preview
|
|
1040
1002
|
* @requiredField _id
|
|
1041
1003
|
* @requiredField scheduleActions.cancelRequests.scheduleId
|
|
1042
1004
|
* @requiredField scheduleActions.createRequests.schedule.availability.start
|
|
@@ -1044,9 +1006,10 @@ export interface CreateOptions {
|
|
|
1044
1006
|
* @requiredField scheduleActions.createRequests.schedule.scheduleOwnerId
|
|
1045
1007
|
* @requiredField scheduleActions.updateRequests.schedule._id
|
|
1046
1008
|
* @permissionScope Manage Bookings
|
|
1009
|
+
* @applicableIdentity APP
|
|
1047
1010
|
*/
|
|
1048
|
-
export declare function
|
|
1049
|
-
export interface
|
|
1011
|
+
export declare function updateResource(_id: string | null, options?: UpdateResourceOptions): Promise<UpdateResourceResponse>;
|
|
1012
|
+
export interface UpdateResourceOptions {
|
|
1050
1013
|
resource: {
|
|
1051
1014
|
/**
|
|
1052
1015
|
* Resource ID.
|
|
@@ -1061,17 +1024,13 @@ export interface UpdateOptions {
|
|
|
1061
1024
|
phone?: string | null;
|
|
1062
1025
|
/** Resource description. */
|
|
1063
1026
|
description?: string | null;
|
|
1064
|
-
/**
|
|
1065
|
-
* @internal
|
|
1066
|
-
* @internal */
|
|
1027
|
+
/** @internal */
|
|
1067
1028
|
tag?: string | null;
|
|
1068
1029
|
/** Resource tags. Tags are used to identify, group, and filter the different types of resources. For example, 'staff' or 'room'. */
|
|
1069
1030
|
tags?: string[] | null;
|
|
1070
1031
|
/** Resource images. */
|
|
1071
1032
|
images?: string[];
|
|
1072
|
-
/**
|
|
1073
|
-
* @internal
|
|
1074
|
-
* @internal */
|
|
1033
|
+
/** @internal */
|
|
1075
1034
|
schedules?: Schedule[];
|
|
1076
1035
|
/**
|
|
1077
1036
|
* List of IDs of schedules owned by this resource.
|
|
@@ -1103,66 +1062,33 @@ export interface UpdateOptions {
|
|
|
1103
1062
|
fieldMask?: string[];
|
|
1104
1063
|
}
|
|
1105
1064
|
/**
|
|
1106
|
-
* Updates a resource's schedule
|
|
1107
|
-
*
|
|
1108
|
-
*
|
|
1109
|
-
* Use this function to update the bookings resource's schedule. To update other resource details
|
|
1110
|
-
*
|
|
1111
|
-
* + `availability.start`
|
|
1112
|
-
* + `availability.linkedSchedules`
|
|
1113
|
-
* <!--END:ONLY:VELO-->
|
|
1065
|
+
* Updates a resource's schedule.
|
|
1066
|
+
*
|
|
1067
|
+
*
|
|
1068
|
+
* The `updateResourceSchedule()` function returns a Promise that resolves when a resource's schedule has been updated. Use this function to update the bookings resource's schedule. To update other resource details use [`updateResource()`] (resources/updateresource). The following schedule properties can be updated: + `availability.start` + `availability.linkedSchedules`
|
|
1069
|
+
*
|
|
1114
1070
|
*
|
|
1115
1071
|
* To update a resource's schedule to remove business hours and add custom hours:
|
|
1116
|
-
*
|
|
1117
|
-
*
|
|
1118
|
-
* + Create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
|
|
1119
|
-
* <!--END:ONLY:REST-->
|
|
1120
|
-
* <!--ONLY:VELO
|
|
1121
|
-
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
|
|
1122
|
-
* + Use [`createSession()`](wix-bookings-backend.Sessions/createsession) to create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
|
|
1123
|
-
* <!--END:ONLY:VELO-->
|
|
1072
|
+
* - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
|
|
1073
|
+
* - Use [`createSession()`](Sessions/createsession) to create a set of recurring sessions of type `WORKING_HOURS` to define the resource's new hours.
|
|
1124
1074
|
*
|
|
1125
|
-
* To update a resource's schedule to add default business hours, and keep or remove custom hours:
|
|
1126
|
-
* <!--ONLY:REST-->
|
|
1127
|
-
* + Update the resource's schedule to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
1128
|
-
* + If you want to remove the custom sessions, delete the resource's sessions of type `"WORKING_HOURS"`.
|
|
1129
|
-
* You do not have to delete exiting custom sessions. Custom session that are not deleted will continue to be included in availability calculations and can still be booked.
|
|
1130
|
-
* <!--END:ONLY:REST-->
|
|
1131
|
-
* <!--ONLY:VELO
|
|
1132
|
-
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
1133
|
-
* + If you want to remove the custom sessions, use [`deleteSession()`](wix-bookings-backend.Sessions/deletesession) to delete the resource's sessions of type `"WORKING_HOURS"`. You do not have to delete exiting custom sessions. You can have both default working hours and custom hours for the same schedule. Custom sessions that are not deleted will continue to be included in availability calculations and can still be booked.
|
|
1134
1075
|
*
|
|
1135
|
-
*
|
|
1136
|
-
* > + The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working.
|
|
1137
|
-
* > + A resource can have one schedule only.
|
|
1138
|
-
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
1139
|
-
* > + When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
1140
|
-
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource schedule. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
1141
|
-
* @snippet [updateResourceScheduleDefaultToCustom.es6=Update a resource's schedule from business to custom hours]
|
|
1142
|
-
* Update a resource's schedule from the business's default working hours to 2 custom days per week.
|
|
1143
|
-
* @snippet [updateResourceScheduleCustomToDefault.es6=Update a resource's schedule from custom to business hours]
|
|
1144
|
-
* <!--END:ONLY:VELO-->
|
|
1145
|
-
* <!--ONLY:REST-->
|
|
1146
|
-
* >**Notes:**
|
|
1147
|
-
* > + A resource can have one schedule only.
|
|
1148
|
-
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
1149
|
-
* > + When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
1150
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
1076
|
+
* To update a resource's schedule to add default business hours, and keep or remove custom hours:
|
|
1151
1077
|
*
|
|
1078
|
+
* - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
1079
|
+
* - If you want to remove the custom sessions, use [`deleteSession()`](wix-bookings-backend.Sessions/deletesession) to delete the resource's sessions of type `WORKING_HOURS`. You do not have to delete exiting custom sessions. You can have both default working hours and custom hours for the same schedule. Custom sessions that are not deleted will continue to be included in availability calculations and can still be booked.
|
|
1152
1080
|
*
|
|
1153
1081
|
*
|
|
1154
|
-
*
|
|
1155
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
1156
|
-
* <!--END:ONLY:REST-->
|
|
1082
|
+
* > **Notes:** The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working. A resource can have one schedule only. A resource can have both default business hours and custom hours in its schedule. When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `INDIVIDUAL`, `GROUP`, and `COURSE`. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource schedule.
|
|
1157
1083
|
* @param resourceId - Resource id to update.
|
|
1158
1084
|
* @public
|
|
1159
|
-
* @documentationMaturity preview
|
|
1160
1085
|
* @requiredField options.schedule._id
|
|
1161
1086
|
* @requiredField resourceId
|
|
1162
1087
|
* @permissionScope Manage Bookings
|
|
1088
|
+
* @applicableIdentity APP
|
|
1163
1089
|
*/
|
|
1164
|
-
export declare function
|
|
1165
|
-
export interface
|
|
1090
|
+
export declare function updateResourceSchedule(resourceId: string | null, options?: UpdateResourceScheduleOptions): Promise<UpdateScheduleResponse>;
|
|
1091
|
+
export interface UpdateResourceScheduleOptions {
|
|
1166
1092
|
/** Fieldmask for schedule */
|
|
1167
1093
|
fieldmask?: string[];
|
|
1168
1094
|
/** The schedule to update */
|
|
@@ -1170,32 +1096,21 @@ export interface UpdateScheduleOptions {
|
|
|
1170
1096
|
}
|
|
1171
1097
|
/**
|
|
1172
1098
|
* Deletes a resource.
|
|
1173
|
-
*
|
|
1099
|
+
*
|
|
1174
1100
|
* The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
|
|
1175
|
-
* <!--END:ONLY:VELO-->
|
|
1176
|
-
* Deleting a resource updates its `status` to `"DELETED"`.
|
|
1177
1101
|
*
|
|
1178
|
-
* You cannot delete a resource if it has booked sessions.
|
|
1179
1102
|
*
|
|
1180
|
-
*
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1183
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1184
|
-
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can delete a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
1185
|
-
* <!--END:ONLY:VELO-->
|
|
1103
|
+
* Deleting a resource updates its status to `DELETED`.
|
|
1104
|
+
*
|
|
1105
|
+
* You cannot delete a resource if it has booked sessions.
|
|
1186
1106
|
*
|
|
1187
|
-
* <!--ONLY:REST-->
|
|
1188
|
-
* >**Notes:**
|
|
1189
|
-
* > + The Bookings app creates a resource with `"business"` in name and tag values. This resource is used for the business's schedule and working hours and cannot be deleted.
|
|
1190
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
1191
1107
|
*
|
|
1192
|
-
* >**
|
|
1193
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
1194
|
-
* <!--END:ONLY:REST-->
|
|
1108
|
+
* >**Notes:** The Bookings app automatically creates a resource with a name and tag of value `business`. This resource is used for the business's schedule and working hours and cannot be deleted. You can have up to 135 active resources and an additional 135 deleted resources. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can delete a resource.
|
|
1195
1109
|
* @param _id - ID of the resource to delete.
|
|
1196
1110
|
* @public
|
|
1197
1111
|
* @documentationMaturity preview
|
|
1198
1112
|
* @requiredField _id
|
|
1199
1113
|
* @permissionScope Manage Bookings
|
|
1114
|
+
* @applicableIdentity APP
|
|
1200
1115
|
*/
|
|
1201
1116
|
export declare function _delete(_id: string): Promise<DeleteResourceResponse>;
|
|
@@ -188,6 +188,9 @@ const _updateScheduleResponse = { schedule: '_schedule' };
|
|
|
188
188
|
* @permissionScope Read Bookings - Public Data
|
|
189
189
|
* @permissionScope Read bookings calendar - including participants
|
|
190
190
|
* @permissionScope Read Bookings Calendar
|
|
191
|
+
* @applicableIdentity APP
|
|
192
|
+
* @applicableIdentity MEMBER
|
|
193
|
+
* @applicableIdentity VISITOR
|
|
191
194
|
*/
|
|
192
195
|
export function list(options) {
|
|
193
196
|
var _a, _b, _c;
|
|
@@ -241,31 +244,24 @@ export function list(options) {
|
|
|
241
244
|
/**
|
|
242
245
|
* Retrieves a list of the resources according to the specified filters and paging.
|
|
243
246
|
*
|
|
244
|
-
* The query parameter is optional. If no query is provided than all non-deleted resources are returned.
|
|
245
247
|
*
|
|
246
|
-
*
|
|
247
|
-
* |--|--|
|
|
248
|
-
* |filter | supported fields: `resource.id`, `resource.tags`, `resource.status`|
|
|
249
|
-
* |paging | supported |
|
|
250
|
-
* |fields | supported |
|
|
251
|
-
* |fieldsets | **not supported** |
|
|
252
|
-
* |sort | **not supported** |
|
|
248
|
+
* The query parameter is optional. If no query is provided, all non-deleted resources are returned.
|
|
253
249
|
*
|
|
250
|
+
* |Property|Is supported| |--|--| |filter | supported fields: resource.id, resource.tags, resource.status| |paging | supported | |fields | supported | |fieldsets | not supported | |sort | not supported |
|
|
254
251
|
*
|
|
255
|
-
*
|
|
256
|
-
* >
|
|
257
|
-
* >
|
|
258
|
-
* > - `fieldsets`
|
|
252
|
+
* > **Notes:** The following objects in the query parameter are not supported for this query:
|
|
253
|
+
* > - sort
|
|
254
|
+
* > - fieldsets
|
|
259
255
|
*
|
|
260
|
-
* > **Permissions**
|
|
261
|
-
* > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
|
|
262
256
|
* @public
|
|
263
|
-
* @documentationMaturity preview
|
|
264
257
|
* @permissionScope Read Bookings - Public Data
|
|
265
258
|
* @permissionScope Read bookings calendar - including participants
|
|
266
259
|
* @permissionScope Read Bookings Calendar
|
|
260
|
+
* @applicableIdentity APP
|
|
261
|
+
* @applicableIdentity MEMBER
|
|
262
|
+
* @applicableIdentity VISITOR
|
|
267
263
|
*/
|
|
268
|
-
export function
|
|
264
|
+
export function queryResourceCatalog(options) {
|
|
269
265
|
var _a, _b, _c;
|
|
270
266
|
return __awaiter(this, arguments, void 0, function* () {
|
|
271
267
|
const requestTransformation = { query: '$[0].query' };
|
|
@@ -316,55 +312,36 @@ export function query(options) {
|
|
|
316
312
|
}
|
|
317
313
|
/**
|
|
318
314
|
* Creates a resource.
|
|
319
|
-
*
|
|
315
|
+
*
|
|
316
|
+
*
|
|
320
317
|
* The `createResource()` function returns a Promise that resolves to the created resource.
|
|
321
|
-
*
|
|
318
|
+
* Bookings resources are created with a schedule. The schedule and its sessions determine the resource's availability. Note that the schedule must contain a start date in the availability.start property. For resources that are available during the business's default hours, add the business's schedule as a linked schedule in the resource's schedule. For resources that have their own hours, create sessions with type "WORKING_HOURS" using the resource's schedule. You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
|
|
322
319
|
*
|
|
323
|
-
* Bookings resources are created with a schedule. The schedule and its sessions determine the resource's availability. Note that the schedule must contain a start date in the `availability.start` property.
|
|
324
|
-
* For resources that are available during the business's default hours, add the business's schedule as a linked schedule in the resource's schedule. For resources that have their own hours, create sessions with type `"WORKING_HOURS"` using the resource's schedule.
|
|
325
|
-
* You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
|
|
326
320
|
*
|
|
327
|
-
* <!--ONLY:VELO
|
|
328
321
|
* When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
* >
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* <!--ONLY:REST-->
|
|
343
|
-
* Use the following steps to create resources:
|
|
344
|
-
* - Create the resource using including schedule information.
|
|
345
|
-
* - If the resource uses the default business hours, get the business resource's schedule ID and include it in the `scheduleInfo.availability.linkedSchedules` array in the in the schedule parameters.
|
|
346
|
-
* - If the resource has its own custom working hours, create sessions of type `"WORKING_HOURS"`. Use the `scheduleId` of the new resource when creating the sessions. These session can be single sessions or recurring sessions. You can have both business hours and custom hours for the same resource schedule.
|
|
347
|
-
*
|
|
348
|
-
* >**Notes:**
|
|
349
|
-
* > + A resource can have one schedule only.
|
|
350
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
351
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
* >**Permissions:**
|
|
356
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
357
|
-
* <!--END:ONLY:REST-->
|
|
322
|
+
* - If the resource uses the default business hours, get the business resource's schedule ID and include it in the `scheduleInfo.availability.linkedSchedules` array in the `scheduleInfo` parameter. The default hours can bee found in the Dashboard under **Settings** in the **Bookings** section, on the **Appointment hours** page.
|
|
323
|
+
* - If the resource has its own custom working hours, create the resource, then create sessions of type `WORKING_HOURS` using the [`createSession()`](Sessions/createsession) function. Use the `scheduleId` returned from `createResource()` when creating the sessions. These session can be single sessions or recurring sessions.
|
|
324
|
+
*
|
|
325
|
+
* You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
|
|
326
|
+
*
|
|
327
|
+
*
|
|
328
|
+
* > **Notes:** The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working.
|
|
329
|
+
*
|
|
330
|
+
*
|
|
331
|
+
* The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar. You can only add the business resource's schedule as a linked schedule for a resource. A resource can have one schedule only.
|
|
332
|
+
*
|
|
333
|
+
*
|
|
334
|
+
* You can have up to 135 active resources and an additional 135 deleted resources. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can create a resource.
|
|
358
335
|
* @param resource - Resource details.
|
|
359
336
|
* @public
|
|
360
|
-
* @documentationMaturity preview
|
|
361
337
|
* @requiredField options.schedules.availability.start
|
|
362
338
|
* @requiredField options.schedules.intervals.start
|
|
363
339
|
* @requiredField resource
|
|
364
340
|
* @requiredField resource.name
|
|
365
341
|
* @permissionScope Manage Bookings
|
|
342
|
+
* @applicableIdentity APP
|
|
366
343
|
*/
|
|
367
|
-
export function
|
|
344
|
+
export function createResource(resource, options) {
|
|
368
345
|
var _a, _b, _c;
|
|
369
346
|
return __awaiter(this, arguments, void 0, function* () {
|
|
370
347
|
const requestTransformation = {
|
|
@@ -425,29 +402,14 @@ export function create(resource, options) {
|
|
|
425
402
|
}
|
|
426
403
|
/**
|
|
427
404
|
* Updates a resource.
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
* Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](
|
|
431
|
-
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
435
|
-
* <!--END:ONLY:VELO-->
|
|
436
|
-
* <!--ONLY:REST-->
|
|
437
|
-
* Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
|
|
438
|
-
* the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
|
|
439
|
-
*
|
|
440
|
-
* >**Notes:**
|
|
441
|
-
* > + When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`.
|
|
442
|
-
* > + When updating a resource's schedule you cannot change the resource tag used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
443
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
444
|
-
*
|
|
445
|
-
* >**Permissions:**
|
|
446
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
447
|
-
* <!--END:ONLY:REST-->
|
|
405
|
+
*
|
|
406
|
+
*
|
|
407
|
+
* The `updateResource()` function returns a Promise that resolves when a resource is updated. Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](resources/updateresourceschedule).
|
|
408
|
+
*
|
|
409
|
+
*
|
|
410
|
+
* >**Notes:** When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource.
|
|
448
411
|
* @param _id - Resource ID.
|
|
449
412
|
* @public
|
|
450
|
-
* @documentationMaturity preview
|
|
451
413
|
* @requiredField _id
|
|
452
414
|
* @requiredField scheduleActions.cancelRequests.scheduleId
|
|
453
415
|
* @requiredField scheduleActions.createRequests.schedule.availability.start
|
|
@@ -455,8 +417,9 @@ export function create(resource, options) {
|
|
|
455
417
|
* @requiredField scheduleActions.createRequests.schedule.scheduleOwnerId
|
|
456
418
|
* @requiredField scheduleActions.updateRequests.schedule._id
|
|
457
419
|
* @permissionScope Manage Bookings
|
|
420
|
+
* @applicableIdentity APP
|
|
458
421
|
*/
|
|
459
|
-
export function
|
|
422
|
+
export function updateResource(_id, options) {
|
|
460
423
|
var _a, _b, _c;
|
|
461
424
|
return __awaiter(this, arguments, void 0, function* () {
|
|
462
425
|
const requestTransformation = {
|
|
@@ -520,65 +483,32 @@ export function update(_id, options) {
|
|
|
520
483
|
});
|
|
521
484
|
}
|
|
522
485
|
/**
|
|
523
|
-
* Updates a resource's schedule
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
* Use this function to update the bookings resource's schedule. To update other resource details
|
|
527
|
-
*
|
|
528
|
-
* + `availability.start`
|
|
529
|
-
* + `availability.linkedSchedules`
|
|
530
|
-
* <!--END:ONLY:VELO-->
|
|
486
|
+
* Updates a resource's schedule.
|
|
487
|
+
*
|
|
488
|
+
*
|
|
489
|
+
* The `updateResourceSchedule()` function returns a Promise that resolves when a resource's schedule has been updated. Use this function to update the bookings resource's schedule. To update other resource details use [`updateResource()`] (resources/updateresource). The following schedule properties can be updated: + `availability.start` + `availability.linkedSchedules`
|
|
490
|
+
*
|
|
531
491
|
*
|
|
532
492
|
* To update a resource's schedule to remove business hours and add custom hours:
|
|
533
|
-
*
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
* <!--END:ONLY:REST-->
|
|
537
|
-
* <!--ONLY:VELO
|
|
538
|
-
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
|
|
539
|
-
* + Use [`createSession()`](wix-bookings-backend.Sessions/createsession) to create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
|
|
540
|
-
* <!--END:ONLY:VELO-->
|
|
493
|
+
* - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
|
|
494
|
+
* - Use [`createSession()`](Sessions/createsession) to create a set of recurring sessions of type `WORKING_HOURS` to define the resource's new hours.
|
|
495
|
+
*
|
|
541
496
|
*
|
|
542
497
|
* To update a resource's schedule to add default business hours, and keep or remove custom hours:
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
550
|
-
* + If you want to remove the custom sessions, use [`deleteSession()`](wix-bookings-backend.Sessions/deletesession) to delete the resource's sessions of type `"WORKING_HOURS"`. You do not have to delete exiting custom sessions. You can have both default working hours and custom hours for the same schedule. Custom sessions that are not deleted will continue to be included in availability calculations and can still be booked.
|
|
551
|
-
*
|
|
552
|
-
* > **Notes:**
|
|
553
|
-
* > + The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working.
|
|
554
|
-
* > + A resource can have one schedule only.
|
|
555
|
-
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
556
|
-
* > + When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
557
|
-
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource schedule. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
558
|
-
* @snippet [updateResourceScheduleDefaultToCustom.es6=Update a resource's schedule from business to custom hours]
|
|
559
|
-
* Update a resource's schedule from the business's default working hours to 2 custom days per week.
|
|
560
|
-
* @snippet [updateResourceScheduleCustomToDefault.es6=Update a resource's schedule from custom to business hours]
|
|
561
|
-
* <!--END:ONLY:VELO-->
|
|
562
|
-
* <!--ONLY:REST-->
|
|
563
|
-
* >**Notes:**
|
|
564
|
-
* > + A resource can have one schedule only.
|
|
565
|
-
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
566
|
-
* > + When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
567
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
* >**Permissions:**
|
|
572
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
573
|
-
* <!--END:ONLY:REST-->
|
|
498
|
+
*
|
|
499
|
+
* - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
500
|
+
* - If you want to remove the custom sessions, use [`deleteSession()`](wix-bookings-backend.Sessions/deletesession) to delete the resource's sessions of type `WORKING_HOURS`. You do not have to delete exiting custom sessions. You can have both default working hours and custom hours for the same schedule. Custom sessions that are not deleted will continue to be included in availability calculations and can still be booked.
|
|
501
|
+
*
|
|
502
|
+
*
|
|
503
|
+
* > **Notes:** The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working. A resource can have one schedule only. A resource can have both default business hours and custom hours in its schedule. When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `INDIVIDUAL`, `GROUP`, and `COURSE`. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource schedule.
|
|
574
504
|
* @param resourceId - Resource id to update.
|
|
575
505
|
* @public
|
|
576
|
-
* @documentationMaturity preview
|
|
577
506
|
* @requiredField options.schedule._id
|
|
578
507
|
* @requiredField resourceId
|
|
579
508
|
* @permissionScope Manage Bookings
|
|
509
|
+
* @applicableIdentity APP
|
|
580
510
|
*/
|
|
581
|
-
export function
|
|
511
|
+
export function updateResourceSchedule(resourceId, options) {
|
|
582
512
|
var _a, _b, _c;
|
|
583
513
|
return __awaiter(this, arguments, void 0, function* () {
|
|
584
514
|
const requestTransformation = {
|
|
@@ -628,33 +558,22 @@ export function updateSchedule(resourceId, options) {
|
|
|
628
558
|
}
|
|
629
559
|
/**
|
|
630
560
|
* Deletes a resource.
|
|
631
|
-
*
|
|
561
|
+
*
|
|
632
562
|
* The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
|
|
633
|
-
*
|
|
634
|
-
*
|
|
563
|
+
*
|
|
564
|
+
*
|
|
565
|
+
* Deleting a resource updates its status to `DELETED`.
|
|
635
566
|
*
|
|
636
567
|
* You cannot delete a resource if it has booked sessions.
|
|
637
568
|
*
|
|
638
|
-
*
|
|
639
|
-
* >**Notes:**
|
|
640
|
-
* > + The Bookings app automatically creates a resource with a name and tag of value `"business"``. This resource is used for the business's schedule and working hours and cannot be deleted.
|
|
641
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
642
|
-
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can delete a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
643
|
-
* <!--END:ONLY:VELO-->
|
|
644
|
-
*
|
|
645
|
-
* <!--ONLY:REST-->
|
|
646
|
-
* >**Notes:**
|
|
647
|
-
* > + The Bookings app creates a resource with `"business"` in name and tag values. This resource is used for the business's schedule and working hours and cannot be deleted.
|
|
648
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
649
|
-
*
|
|
650
|
-
* >**Permissions:**
|
|
651
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
652
|
-
* <!--END:ONLY:REST-->
|
|
569
|
+
*
|
|
570
|
+
* >**Notes:** The Bookings app automatically creates a resource with a name and tag of value `business`. This resource is used for the business's schedule and working hours and cannot be deleted. You can have up to 135 active resources and an additional 135 deleted resources. Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can delete a resource.
|
|
653
571
|
* @param _id - ID of the resource to delete.
|
|
654
572
|
* @public
|
|
655
573
|
* @documentationMaturity preview
|
|
656
574
|
* @requiredField _id
|
|
657
575
|
* @permissionScope Manage Bookings
|
|
576
|
+
* @applicableIdentity APP
|
|
658
577
|
*/
|
|
659
578
|
export function _delete(_id) {
|
|
660
579
|
var _a, _b, _c;
|