@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>;
|
|
@@ -28,7 +28,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports._delete = exports.
|
|
31
|
+
exports._delete = exports.updateResourceSchedule = exports.updateResource = exports.createResource = exports.queryResourceCatalog = exports.list = exports.Event = exports.SortOrder = exports.ResourceStatus = exports.ConferenceType = exports.ScheduleStatus = exports.ApprovalStatus = exports.DayOfWeek = exports.LocationsLocationType = exports.LocationStatus = exports.LocationType = exports.RecurringIntervalType = exports.Transparency = exports.Day = exports.__debug = void 0;
|
|
32
32
|
const velo_1 = require("@wix/metro-runtime/velo");
|
|
33
33
|
const ambassadorWixBookingsCatalogV1Resource = __importStar(require("./bookings-catalog-v1-resource.http"));
|
|
34
34
|
let __verbose = false;
|
|
@@ -210,6 +210,9 @@ const _updateScheduleResponse = { schedule: '_schedule' };
|
|
|
210
210
|
* @permissionScope Read Bookings - Public Data
|
|
211
211
|
* @permissionScope Read bookings calendar - including participants
|
|
212
212
|
* @permissionScope Read Bookings Calendar
|
|
213
|
+
* @applicableIdentity APP
|
|
214
|
+
* @applicableIdentity MEMBER
|
|
215
|
+
* @applicableIdentity VISITOR
|
|
213
216
|
*/
|
|
214
217
|
function list(options) {
|
|
215
218
|
var _a, _b, _c;
|
|
@@ -264,31 +267,24 @@ exports.list = list;
|
|
|
264
267
|
/**
|
|
265
268
|
* Retrieves a list of the resources according to the specified filters and paging.
|
|
266
269
|
*
|
|
267
|
-
* The query parameter is optional. If no query is provided than all non-deleted resources are returned.
|
|
268
270
|
*
|
|
269
|
-
*
|
|
270
|
-
* |--|--|
|
|
271
|
-
* |filter | supported fields: `resource.id`, `resource.tags`, `resource.status`|
|
|
272
|
-
* |paging | supported |
|
|
273
|
-
* |fields | supported |
|
|
274
|
-
* |fieldsets | **not supported** |
|
|
275
|
-
* |sort | **not supported** |
|
|
271
|
+
* The query parameter is optional. If no query is provided, all non-deleted resources are returned.
|
|
276
272
|
*
|
|
273
|
+
* |Property|Is supported| |--|--| |filter | supported fields: resource.id, resource.tags, resource.status| |paging | supported | |fields | supported | |fieldsets | not supported | |sort | not supported |
|
|
277
274
|
*
|
|
278
|
-
*
|
|
279
|
-
* >
|
|
280
|
-
* >
|
|
281
|
-
* > - `fieldsets`
|
|
275
|
+
* > **Notes:** The following objects in the query parameter are not supported for this query:
|
|
276
|
+
* > - sort
|
|
277
|
+
* > - fieldsets
|
|
282
278
|
*
|
|
283
|
-
* > **Permissions**
|
|
284
|
-
* > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
|
|
285
279
|
* @public
|
|
286
|
-
* @documentationMaturity preview
|
|
287
280
|
* @permissionScope Read Bookings - Public Data
|
|
288
281
|
* @permissionScope Read bookings calendar - including participants
|
|
289
282
|
* @permissionScope Read Bookings Calendar
|
|
283
|
+
* @applicableIdentity APP
|
|
284
|
+
* @applicableIdentity MEMBER
|
|
285
|
+
* @applicableIdentity VISITOR
|
|
290
286
|
*/
|
|
291
|
-
function
|
|
287
|
+
function queryResourceCatalog(options) {
|
|
292
288
|
var _a, _b, _c;
|
|
293
289
|
return __awaiter(this, arguments, void 0, function* () {
|
|
294
290
|
const requestTransformation = { query: '$[0].query' };
|
|
@@ -337,58 +333,39 @@ function query(options) {
|
|
|
337
333
|
}
|
|
338
334
|
});
|
|
339
335
|
}
|
|
340
|
-
exports.
|
|
336
|
+
exports.queryResourceCatalog = queryResourceCatalog;
|
|
341
337
|
/**
|
|
342
338
|
* Creates a resource.
|
|
343
|
-
*
|
|
339
|
+
*
|
|
340
|
+
*
|
|
344
341
|
* The `createResource()` function returns a Promise that resolves to the created resource.
|
|
345
|
-
*
|
|
342
|
+
* 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.
|
|
346
343
|
*
|
|
347
|
-
* 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.
|
|
348
|
-
* 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.
|
|
349
|
-
* You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
|
|
350
344
|
*
|
|
351
|
-
* <!--ONLY:VELO
|
|
352
345
|
* When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* >
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
* <!--ONLY:REST-->
|
|
367
|
-
* Use the following steps to create resources:
|
|
368
|
-
* - Create the resource using including schedule information.
|
|
369
|
-
* - 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.
|
|
370
|
-
* - 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.
|
|
371
|
-
*
|
|
372
|
-
* >**Notes:**
|
|
373
|
-
* > + A resource can have one schedule only.
|
|
374
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
375
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
* >**Permissions:**
|
|
380
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
381
|
-
* <!--END:ONLY:REST-->
|
|
346
|
+
* - 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.
|
|
347
|
+
* - 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.
|
|
348
|
+
*
|
|
349
|
+
* You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
|
|
350
|
+
*
|
|
351
|
+
*
|
|
352
|
+
* > **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.
|
|
353
|
+
*
|
|
354
|
+
*
|
|
355
|
+
* 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.
|
|
356
|
+
*
|
|
357
|
+
*
|
|
358
|
+
* 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.
|
|
382
359
|
* @param resource - Resource details.
|
|
383
360
|
* @public
|
|
384
|
-
* @documentationMaturity preview
|
|
385
361
|
* @requiredField options.schedules.availability.start
|
|
386
362
|
* @requiredField options.schedules.intervals.start
|
|
387
363
|
* @requiredField resource
|
|
388
364
|
* @requiredField resource.name
|
|
389
365
|
* @permissionScope Manage Bookings
|
|
366
|
+
* @applicableIdentity APP
|
|
390
367
|
*/
|
|
391
|
-
function
|
|
368
|
+
function createResource(resource, options) {
|
|
392
369
|
var _a, _b, _c;
|
|
393
370
|
return __awaiter(this, arguments, void 0, function* () {
|
|
394
371
|
const requestTransformation = {
|
|
@@ -447,32 +424,17 @@ function create(resource, options) {
|
|
|
447
424
|
}
|
|
448
425
|
});
|
|
449
426
|
}
|
|
450
|
-
exports.
|
|
427
|
+
exports.createResource = createResource;
|
|
451
428
|
/**
|
|
452
429
|
* Updates a resource.
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
* Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
*
|
|
459
|
-
* > + 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`.
|
|
460
|
-
* <!--END:ONLY:VELO-->
|
|
461
|
-
* <!--ONLY:REST-->
|
|
462
|
-
* Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
|
|
463
|
-
* the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
|
|
464
|
-
*
|
|
465
|
-
* >**Notes:**
|
|
466
|
-
* > + 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"`.
|
|
467
|
-
* > + 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”`.
|
|
468
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
469
|
-
*
|
|
470
|
-
* >**Permissions:**
|
|
471
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
472
|
-
* <!--END:ONLY:REST-->
|
|
430
|
+
*
|
|
431
|
+
*
|
|
432
|
+
* 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).
|
|
433
|
+
*
|
|
434
|
+
*
|
|
435
|
+
* >**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.
|
|
473
436
|
* @param _id - Resource ID.
|
|
474
437
|
* @public
|
|
475
|
-
* @documentationMaturity preview
|
|
476
438
|
* @requiredField _id
|
|
477
439
|
* @requiredField scheduleActions.cancelRequests.scheduleId
|
|
478
440
|
* @requiredField scheduleActions.createRequests.schedule.availability.start
|
|
@@ -480,8 +442,9 @@ exports.create = create;
|
|
|
480
442
|
* @requiredField scheduleActions.createRequests.schedule.scheduleOwnerId
|
|
481
443
|
* @requiredField scheduleActions.updateRequests.schedule._id
|
|
482
444
|
* @permissionScope Manage Bookings
|
|
445
|
+
* @applicableIdentity APP
|
|
483
446
|
*/
|
|
484
|
-
function
|
|
447
|
+
function updateResource(_id, options) {
|
|
485
448
|
var _a, _b, _c;
|
|
486
449
|
return __awaiter(this, arguments, void 0, function* () {
|
|
487
450
|
const requestTransformation = {
|
|
@@ -544,67 +507,34 @@ function update(_id, options) {
|
|
|
544
507
|
}
|
|
545
508
|
});
|
|
546
509
|
}
|
|
547
|
-
exports.
|
|
510
|
+
exports.updateResource = updateResource;
|
|
548
511
|
/**
|
|
549
|
-
* Updates a resource's schedule
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
* Use this function to update the bookings resource's schedule. To update other resource details
|
|
553
|
-
*
|
|
554
|
-
* + `availability.start`
|
|
555
|
-
* + `availability.linkedSchedules`
|
|
556
|
-
* <!--END:ONLY:VELO-->
|
|
512
|
+
* Updates a resource's schedule.
|
|
513
|
+
*
|
|
514
|
+
*
|
|
515
|
+
* 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`
|
|
516
|
+
*
|
|
557
517
|
*
|
|
558
518
|
* To update a resource's schedule to remove business hours and add custom hours:
|
|
559
|
-
*
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
* <!--END:ONLY:REST-->
|
|
563
|
-
* <!--ONLY:VELO
|
|
564
|
-
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
|
|
565
|
-
* + 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.
|
|
566
|
-
* <!--END:ONLY:VELO-->
|
|
519
|
+
* - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
|
|
520
|
+
* - Use [`createSession()`](Sessions/createsession) to create a set of recurring sessions of type `WORKING_HOURS` to define the resource's new hours.
|
|
521
|
+
*
|
|
567
522
|
*
|
|
568
523
|
* To update a resource's schedule to add default business hours, and keep or remove custom hours:
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
575
|
-
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
576
|
-
* + 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.
|
|
577
|
-
*
|
|
578
|
-
* > **Notes:**
|
|
579
|
-
* > + 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.
|
|
580
|
-
* > + A resource can have one schedule only.
|
|
581
|
-
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
582
|
-
* > + 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”`.
|
|
583
|
-
* > + 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`.
|
|
584
|
-
* @snippet [updateResourceScheduleDefaultToCustom.es6=Update a resource's schedule from business to custom hours]
|
|
585
|
-
* Update a resource's schedule from the business's default working hours to 2 custom days per week.
|
|
586
|
-
* @snippet [updateResourceScheduleCustomToDefault.es6=Update a resource's schedule from custom to business hours]
|
|
587
|
-
* <!--END:ONLY:VELO-->
|
|
588
|
-
* <!--ONLY:REST-->
|
|
589
|
-
* >**Notes:**
|
|
590
|
-
* > + A resource can have one schedule only.
|
|
591
|
-
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
592
|
-
* > + 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”`.
|
|
593
|
-
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
* >**Permissions:**
|
|
598
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
599
|
-
* <!--END:ONLY:REST-->
|
|
524
|
+
*
|
|
525
|
+
* - Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
526
|
+
* - 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.
|
|
527
|
+
*
|
|
528
|
+
*
|
|
529
|
+
* > **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.
|
|
600
530
|
* @param resourceId - Resource id to update.
|
|
601
531
|
* @public
|
|
602
|
-
* @documentationMaturity preview
|
|
603
532
|
* @requiredField options.schedule._id
|
|
604
533
|
* @requiredField resourceId
|
|
605
534
|
* @permissionScope Manage Bookings
|
|
535
|
+
* @applicableIdentity APP
|
|
606
536
|
*/
|
|
607
|
-
function
|
|
537
|
+
function updateResourceSchedule(resourceId, options) {
|
|
608
538
|
var _a, _b, _c;
|
|
609
539
|
return __awaiter(this, arguments, void 0, function* () {
|
|
610
540
|
const requestTransformation = {
|
|
@@ -652,36 +582,25 @@ function updateSchedule(resourceId, options) {
|
|
|
652
582
|
}
|
|
653
583
|
});
|
|
654
584
|
}
|
|
655
|
-
exports.
|
|
585
|
+
exports.updateResourceSchedule = updateResourceSchedule;
|
|
656
586
|
/**
|
|
657
587
|
* Deletes a resource.
|
|
658
|
-
*
|
|
588
|
+
*
|
|
659
589
|
* The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
|
|
660
|
-
*
|
|
661
|
-
*
|
|
590
|
+
*
|
|
591
|
+
*
|
|
592
|
+
* Deleting a resource updates its status to `DELETED`.
|
|
662
593
|
*
|
|
663
594
|
* You cannot delete a resource if it has booked sessions.
|
|
664
595
|
*
|
|
665
|
-
*
|
|
666
|
-
* >**Notes:**
|
|
667
|
-
* > + 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.
|
|
668
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
669
|
-
* > + 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`.
|
|
670
|
-
* <!--END:ONLY:VELO-->
|
|
671
|
-
*
|
|
672
|
-
* <!--ONLY:REST-->
|
|
673
|
-
* >**Notes:**
|
|
674
|
-
* > + 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.
|
|
675
|
-
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
676
|
-
*
|
|
677
|
-
* >**Permissions:**
|
|
678
|
-
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
679
|
-
* <!--END:ONLY:REST-->
|
|
596
|
+
*
|
|
597
|
+
* >**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.
|
|
680
598
|
* @param _id - ID of the resource to delete.
|
|
681
599
|
* @public
|
|
682
600
|
* @documentationMaturity preview
|
|
683
601
|
* @requiredField _id
|
|
684
602
|
* @permissionScope Manage Bookings
|
|
603
|
+
* @applicableIdentity APP
|
|
685
604
|
*/
|
|
686
605
|
function _delete(_id) {
|
|
687
606
|
var _a, _b, _c;
|