/** * The `attendance` object represents the attendance information * for a booked session, such as: * * + Did anyone attend the session? * + How many people attended the session? * * The number of session `attendance` objects available depends on the booking type: * + Appointment bookings have 1 `attendance` object per appointment session. * + Class bookings have 1 `attendance` object for each session of the class. The number of sessions for a class is defined in Schedule and Sessions `schedule.capacity` property. * + Course bookings have an `attendance` object for each session of the course. For example, if there are 12 sessions in a course, there are 12 `attendance` objects. The number of sessions for a class is defined in Schedule and Sessions `schedule.capacity` property. */ export interface Attendance { /** * ID of the `attendance` object. * @readonly */ _id?: string | null; /** Corresponding booking ID. */ bookingId?: string | null; /** Corresponding session ID. */ sessionId?: string | null; /** Status indicating if any participants attended the session. */ status?: AttendanceStatus; /** * Total number of participants that attended the session. By default, the number * of attendees is set to `1`, but you can set a number to greater than `1` if multiple * participants attended. * * Do not set to `0` to indicate that no one attended the session. Instead, set the `status` field to `NOT_ATTENDED`. * * Default: 1 */ numberOfAttendees?: number; } export declare enum AttendanceStatus { /** There is no available attendance information. */ NOT_SET = "NOT_SET", /** At least a single participant attended the session. */ ATTENDED = "ATTENDED", /** No participants attended the session. */ NOT_ATTENDED = "NOT_ATTENDED" } export interface GetAttendanceRequest { /** ID of the attendance object to retrieve. */ attendanceId: string; } export interface GetAttendanceResponse { /** Retrieved attendance. */ attendance?: Attendance; } export interface SetAttendanceRequest { /** Attendance to create or update. */ attendance: Attendance; /** Information about whether to send a message to a customer after their attendance was set. */ participantNotification?: ParticipantNotification; } export interface ParticipantNotification { /** * Specify whether to send the message about the changes to the customer. * * Default: `false` */ notifyParticipants?: boolean | null; /** Optional custom message to send to the participants about the changes to the booking. */ message?: string | null; } export interface SetAttendanceResponse { /** Created or updated attendance. */ attendance?: Attendance; } export interface AttendanceMarkedAsNotAttended { /** The attendance information for a booked session that you want to create or update. */ attendance?: Attendance; /** Information about whether to send a message to a customer after their attendance was set. */ participantNotification?: ParticipantNotification; } export interface BulkSetAttendanceRequest { returnFullEntity?: boolean; /** List of attendance details for booking sessions to create or update. */ attendanceDetails?: AttendanceDetails[]; } export interface AttendanceDetails { /** Created or updated attendance information for a booking session. */ attendance?: Attendance; /** Information about whether to send a message to the customer after their attendance was set. */ participantNotification?: ParticipantNotification; } export interface BulkSetAttendanceResponse { /** List of created or updated `attendance` objects. */ results?: BulkAttendanceResult[]; /** Information about the total number of successes and failures for the Bulk Set Attendance call. */ bulkActionMetadata?: BulkActionMetadata; } export interface BulkAttendanceResult { /** Created or updated `attendance` object. */ item?: Attendance; /** Metadata for the created or updated `attendance` object. */ itemMetadata?: ItemMetadata; } export interface ItemMetadata { /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */ _id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } export interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } export interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } export interface QueryAttendanceRequest { /** Query options. */ query: QueryV2; } export interface QueryV2 extends QueryV2PagingMethodOneOf { /** Cursors to navigate through the result pages using `next` and `prev`. */ cursorPaging?: CursorPaging; /** * Filter object. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) for more information. * * For a detailed list of supported fields and operators, see [Supported Filters and Sorting](https://dev.wix.com/api/rest/wix-bookings/attendance/supported-filters). * * Max: 1 filter */ filter?: Record | null; /** * Sort object in the following format: * `[ {"fieldName":"sortField1","order":"ASC"}, {"fieldName":"sortField2","order":"DESC"} ]` * * For details about sorting, see [Supported Filters and Sorting](https://dev.wix.com/api/rest/wix-bookings/attendance/supported-filters). */ sort?: Sorting[]; } /** @oneof */ export interface QueryV2PagingMethodOneOf { /** Cursors to navigate through the result pages using `next` and `prev`. */ cursorPaging?: CursorPaging; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } /** * Sort order. Use `ASC` for ascending order or `DESC` for descending order. * * Default: `ASC`. */ export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } export interface CursorPaging { /** * Number of `Attendance` objects to return. * * Default: `50` * Maximum: `1000` */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get the relevant cursor token * from the `pagingMetadata` object in the previous call's response. * * Not relevant for the first request. */ cursor?: string | null; } /** List of objects that contain attendance information. */ export interface QueryAttendanceResponse { /** List of `attendance` objects that contain attendance information for a booked session. */ attendances?: Attendance[]; /** Metadata for the paged set of results. */ pagingMetadata?: CursorPagingMetadata; } /** This is the preferred message for cursor-paging enabled services */ export interface CursorPagingMetadata { /** Use these cursors to paginate between results. [Read more](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_cursor-paging). */ cursors?: Cursors; /** * Indicates if there are more results after the current page. * If `true`, another page of results can be retrieved. * If `false`, this is the last page. */ hasNext?: boolean | null; } export interface Cursors { /** Cursor pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entity?: string; } export interface RestoreInfo { deletedDate?: Date | null; } export interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntity?: string | null; } export interface ActionEvent { body?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } export interface AttendanceNonNullableFields { status: AttendanceStatus; numberOfAttendees: number; } export interface GetAttendanceResponseNonNullableFields { attendance?: AttendanceNonNullableFields; } export interface SetAttendanceResponseNonNullableFields { attendance?: AttendanceNonNullableFields; } interface ApplicationErrorNonNullableFields { code: string; description: string; } interface ItemMetadataNonNullableFields { originalIndex: number; success: boolean; error?: ApplicationErrorNonNullableFields; } interface BulkAttendanceResultNonNullableFields { item?: AttendanceNonNullableFields; itemMetadata?: ItemMetadataNonNullableFields; } interface BulkActionMetadataNonNullableFields { totalSuccesses: number; totalFailures: number; undetailedFailures: number; } export interface BulkSetAttendanceResponseNonNullableFields { results: BulkAttendanceResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } interface CursorPagingMetadataNonNullableFields { totalCount: number; } export interface QueryAttendanceResponseNonNullableFields { attendances: AttendanceNonNullableFields[]; pagingMetadata?: CursorPagingMetadataNonNullableFields; } /** * Retrieves attendance information. * @param attendanceId - ID of the attendance object to retrieve. * @public * @documentationMaturity preview * @requiredField attendanceId * @permissionId BOOKINGS.ATTENDANCE_READ * @permissionScope Manage Bookings Services and Settings * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Read Bookings - Including Participants * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE * @permissionScope Read Bookings - all read permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @applicableIdentity VISITOR * @returns Retrieved attendance. * @fqn com.wixpress.bookings.attendance.v2.AttendanceService.GetAttendance */ export declare function getAttendance(attendanceId: string): Promise; /** * Sets or updates attendance information for a booking session. This * information is stored in an `attendance` object. * * If an `attendance` object already exists for the session, it's updated. * Otherwise, a new object is created. * * By default, `numberOfAttendees` is set to `1`, but you can specify a higher * number if multiple participants attended. Do not set `numberOfAttendees` to * `0` to indicate no attendance, instead specify `{"status": "NOT_ATTENDED"}`. * * Validation guidelines: * * + The call succeeds for mismatches between `numberOfAttendees` * and `status`. For example, make sure that your code doesn't specify * `{"status": "NOT_ATTENDED"}` with `{"numberOfAttendees": 5}`. * + The API also allows `numberOfAttendees` to exceed the booking's * `numberOfParticipants`. Use higher values only when scenarios like * walk-ins justify the exception. * @param attendance - Attendance to create or update. * @public * @documentationMaturity preview * @requiredField attendance * @requiredField attendance.bookingId * @requiredField attendance.status * @param options - Options to use when setting an attendance. * @permissionId BOOKINGS.ATTENDANCE_SET * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @fqn com.wixpress.bookings.attendance.v2.AttendanceService.SetAttendance */ export declare function setAttendance(attendance: Attendance, options?: SetAttendanceOptions): Promise; export interface SetAttendanceOptions { /** Information about whether to send a message to a customer after their attendance was set. */ participantNotification?: ParticipantNotification; } /** * Sets or updates attendance information for multiple booking sessions. * * * Refer to Set Attendance for detailed behavior of individual attendance * entries. * * The call fails entirely if any entry in `attendanceDetails` is missing a * required field. * * If attendance details are provided for a non-existent session, the call * succeeds for valid sessions while marking the unavailable session as a * failure in the response. * @public * @documentationMaturity preview * @param options - Options to use when setting multiple attendances in bulk. * @permissionId BOOKINGS.ATTENDANCE_SET * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @fqn com.wixpress.bookings.attendance.v2.AttendanceService.BulkSetAttendance */ export declare function bulkSetAttendance(options?: BulkSetAttendanceOptions): Promise; export interface BulkSetAttendanceOptions { returnFullEntity?: boolean; /** List of attendance details for booking sessions to create or update. */ attendanceDetails?: AttendanceDetails[]; } /** * Creates a query to retrieve a list of attendances. * * The `queryAttendances()` function builds a query to retrieve a list of attendances and returns a `AttendancesQueryBuilder` object. * * The returned object contains the query definition, which is typically used to call the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/bookings/attendance/attendances-query-builder/find) function. * * You can refine the query by chaining `AttendancesQueryBuilder` functions onto the query. `AttendancesQueryBuilder` functions enable you to sort, filter, and control the results that `queryAttendances()` returns. * * `queryAttendances()` uses the following `AttendancesQueryBuilder` default values that you can override: * * + `limit` is `50`. * + Sorted by `id` in ascending order. * * The functions that are chained to `queryAttendances()` are applied in the order they are called. For example, if you apply `ascending("status")` and then `ascending("numberOfAttendees")`, the results are sorted first by the `"status"`, and then, if there are multiple results with the same `"status"`, the items are sorted by `"numberOfAttendees"`. * * The following `AttendancesQueryBuilder` functions are supported for the `queryAttendances()` function. For a full description of the tip settings object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/bookings/attendance/attendances-query-result/items) property in `AttendancesQueryResult`. * @public * @documentationMaturity preview * @permissionScope Manage Bookings Services and Settings * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Read Bookings - Including Participants * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE * @permissionScope Read Bookings - all read permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @permissionId BOOKINGS.ATTENDANCE_READ * @applicableIdentity APP * @applicableIdentity VISITOR * @fqn com.wixpress.bookings.attendance.v2.AttendanceService.QueryAttendance */ export declare function queryAttendance(): AttendancesQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } export interface AttendancesQueryResult extends QueryCursorResult { items: Attendance[]; query: AttendancesQueryBuilder; next: () => Promise; prev: () => Promise; } export interface AttendancesQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: '_id' | 'bookingId' | 'sessionId' | 'status' | 'numberOfAttendees', value: any) => AttendancesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: '_id' | 'bookingId' | 'sessionId' | 'status' | 'numberOfAttendees', value: any) => AttendancesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ge: (propertyName: 'numberOfAttendees', value: any) => AttendancesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ gt: (propertyName: 'numberOfAttendees', value: any) => AttendancesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ le: (propertyName: 'numberOfAttendees', value: any) => AttendancesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ lt: (propertyName: 'numberOfAttendees', value: any) => AttendancesQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: '_id' | 'bookingId' | 'sessionId' | 'status' | 'numberOfAttendees', value: any) => AttendancesQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ ascending: (...propertyNames: Array<'_id' | 'bookingId' | 'sessionId' | 'status' | 'numberOfAttendees'>) => AttendancesQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ descending: (...propertyNames: Array<'numberOfAttendees'>) => AttendancesQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => AttendancesQueryBuilder; /** @param cursor - A pointer to specific record * @documentationMaturity preview */ skipTo: (cursor: string) => AttendancesQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } export {};