@wix/auto_sdk_staff-pay_staff-pay 1.0.0 → 1.0.1
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/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +1 -2
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +1 -2
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +1 -2
- package/build/internal/cjs/meta.d.ts +1 -2
- package/build/internal/es/index.typings.d.mts +1 -2
- package/build/internal/es/meta.d.mts +1 -2
- package/package.json +2 -2
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/staff-pay-v1-staff-pay-staff-pay.universal.ts","../../src/staff-pay-v1-staff-pay-staff-pay.http.ts","../../src/staff-pay-v1-staff-pay-staff-pay.public.ts","../../src/staff-pay-v1-staff-pay-staff-pay.context.ts"],"sourcesContent":["export * from './src/staff-pay-v1-staff-pay-staff-pay.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixStaffPayV1StaffPay from './staff-pay-v1-staff-pay-staff-pay.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/**\n * A staff pay is one staff member's gross pay for one pay period.\n *\n * A site has at most 1 staff pay per staff member per period start date, and a staff member's staff pays can't\n * overlap. Pay periods aren't stored separately: a staff pay holds its own start and end dates, and clients derive the\n * periods from the pay schedule in the staff pay settings.\n *\n * A staff pay starts as a `DRAFT`. Calculating it reads the staff member's hours from Time Clock timecards, their\n * sessions with attendance and service revenue from Bookings, and their tips from Wix Tips. It then applies the pay\n * terms in effect on each day of the period and stores the result with a line per earning. Approving it locks the\n * result. When the data a staff pay depends on changes after a calculation, the staff pay is marked `stale` and must be\n * calculated again before it can be approved.\n *\n * To see a whole pay period, query staff pays by `periodStartDate`.\n *\n * Monetary amounts are decimal strings in the staff pay's `currency`.\n */\nexport interface StaffPay {\n /**\n * Staff pay ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the staff pay is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the staff pay.\n *\n * Ignored when creating a staff pay.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the staff pay was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the staff pay was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the Bookings staff member the staff pay is for.\n * @format GUID\n * @immutable\n */\n staffMemberId?: string;\n /**\n * First day of the pay period, in `YYYY-MM-DD` format, in the site's time zone.\n * @format LOCAL_DATE\n * @immutable\n */\n periodStartDate?: string;\n /**\n * Last day of the pay period (inclusive), in `YYYY-MM-DD` format, in the site's time zone.\n * @format LOCAL_DATE\n * @immutable\n */\n periodEndDate?: string;\n /**\n * Staff pay status.\n * @readonly\n */\n status?: StaffPayStatusWithLiterals;\n /**\n * Whether data the result depends on (timecards, bookings, attendance, orders, tips, adjustments, pay models, profiles\n * or settings) changed after the last calculation. A stale staff pay must be recalculated before it can be approved.\n *\n * An approved staff pay is marked stale too when such data changes after it was approved, but only in the open period\n * (the one that contains the day of the change) and the last period that ended before it. Approved staff pays of older\n * periods are never marked. Changes to sessions, bookings, attendance and orders are found when the period is\n * calculated again (Bulk Calculate Staff Pays), and those to timecards, tips, pay models, profiles and settings when they\n * happen. An approved staff pay is never calculated again automatically: its approved result stays until it's reopened\n * and calculated again. `staleReasons` lists what changed.\n *\n * Default: `false`\n * @readonly\n */\n stale?: boolean;\n /**\n * Three-letter currency code of all amounts, in [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) alphabetic\n * format. Taken from the staff pay settings when the staff pay is calculated.\n * @format CURRENCY\n * @readonly\n */\n currency?: string;\n /**\n * Date and time the staff pay was last calculated.\n * @readonly\n */\n calculatedDate?: Date | null;\n /**\n * Date and time the staff pay was approved.\n * @readonly\n */\n approvedDate?: Date | null;\n /**\n * Totals from the last calculation.\n * @readonly\n */\n totals?: StaffPayTotals;\n /**\n * Pay lines from the last calculation, 1 per earning, including a line per adjustment.\n * @readonly\n * @maxSize 2000\n */\n lines?: PayLine[];\n /**\n * Manual adjustments: bonuses, deductions and reimbursements.\n *\n * Can be changed with Update Staff Pay while the staff pay isn't approved. Each adjustment becomes a\n * pay line the next time the staff pay is calculated.\n * @maxSize 100\n */\n adjustments?: Adjustment[];\n /**\n * Issues found during the last calculation, for example days without pay terms or a timecard that's still open.\n * @readonly\n * @maxSize 100\n */\n alerts?: StaffPayAlert[];\n /**\n * Hash of the data the last calculation used, after its format version. For example, `2:` followed by the hash.\n *\n * Used when an approved staff pay is reopened, to find out whether the data changed while it was approved. Hashes of\n * different format versions aren't compared: the gross amount, pay lines and alerts are compared instead.\n * @readonly\n * @maxLength 128\n */\n factsHash?: string;\n /**\n * IDs of the pay terms from the staff member's pay profile that the last calculation applied.\n * @readonly\n * @maxSize 50\n * @format GUID\n */\n payTermsIds?: string[];\n /**\n * What changed since the last calculation, or since approval for an approved staff pay, 1 entry per changed record.\n *\n * Empty when the staff pay isn't stale. Calculating the staff pay clears it.\n * @internal\n * @readonly\n * @maxSize 50\n */\n staleReasons?: StaleReason[];\n /**\n * Date and time the staff pay was last included in an export file from Export Staff Pays.\n *\n * Returned only when the staff pay was exported at least once. Kept when the staff pay is reopened, so a period still\n * shows that it was downloaded before.\n * @internal\n * @readonly\n */\n lastExportedDate?: Date | null;\n /**\n * Name of the staff member. Saved when the staff pay is calculated, and updated on all the staff member's staff pays,\n * approved ones too, when their name changes. Kept after the staff member is deleted, so past pay still shows a name.\n * @internal\n * @readonly\n * @maxLength 200\n */\n staffMemberName?: string | null;\n /**\n * Whether the period is a bridge period: the days between the last staff pay of an earlier pay schedule and the first\n * period of the site's current pay schedule, paid as 1 extra period. A bridge period pays no salary components.\n *\n * Set when the staff pay is created: `true` when the period ends the day before the pay schedule's first period and\n * starts the day after the site's last staff pay that ends before it. A staff pay created for a period that already\n * has staff pays takes their value. Not returned for staff pays created before this field existed: they aren't bridge\n * periods.\n * @internal\n * @readonly\n */\n bridgePeriod?: boolean | null;\n /**\n * Custom field data for the staff pay object.\n *\n * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n}\n\n/** Staff pay status. */\nexport enum StaffPayStatus {\n /** Created and not calculated yet. */\n DRAFT = 'DRAFT',\n /** Calculated. Can be calculated again, have its adjustments changed, and be approved. */\n CALCULATED = 'CALCULATED',\n /** Approved. The result is locked until the staff pay is reopened. */\n APPROVED = 'APPROVED',\n}\n\n/** @enumType */\nexport type StaffPayStatusWithLiterals =\n | StaffPayStatus\n | 'DRAFT'\n | 'CALCULATED'\n | 'APPROVED';\n\n/** Totals of a staff pay. */\nexport interface StaffPayTotals {\n /**\n * Gross pay, including adjustments.\n * @decimalValue options { maxScale:2 }\n */\n grossAmount?: string;\n /**\n * Paid hours worked, from Time Clock timecards.\n *\n * Counts only the days this staff pay pays. Hours on days without pay terms, with unpaid pay terms, or with a pay\n * model that doesn't exist aren't counted. An alert or note in `alerts` names those days.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n paidHours?: string;\n /**\n * Paid hours above the overtime thresholds, included in `paidHours`. Counts the same days as `paidHours`.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n overtimeHours?: string;\n /**\n * Number of sessions the staff member taught, not cancelled, on the days this staff pay pays. Counts the same days\n * as `paidHours`.\n */\n sessionsCount?: number;\n /**\n * Revenue from the sessions the staff member taught, after discounts and refunds.\n * @decimalValue options { maxScale:2 }\n */\n serviceRevenueAmount?: string;\n /**\n * Total commission.\n *\n * Currently supports commission on services. Product and pricing plan sales aren't calculated yet.\n * @decimalValue options { maxScale:2 }\n */\n commissionAmount?: string;\n /**\n * Total tips.\n * @decimalValue options { maxScale:2 }\n */\n tipsAmount?: string;\n /**\n * Total of all adjustments. Deductions count as negative.\n * @decimalValue options { maxScale:2 }\n */\n adjustmentsAmount?: string;\n /**\n * Product revenue credited to the staff member.\n *\n * Not calculated yet: `0` until product sales are read.\n * @decimalValue options { maxScale:2 }\n */\n productRevenueAmount?: string;\n /**\n * Pricing plan sales credited to the staff member.\n *\n * Not calculated yet: `0` until pricing plan sales are read.\n * @decimalValue options { maxScale:2 }\n */\n planRevenueAmount?: string;\n /**\n * Number of sessions of the period that the staff member teaches, not cancelled, that hadn't started when the staff pay\n * was calculated (`calculatedDate`).\n *\n * Set only by a calculation while the period is in progress. A session is paid only once it starts, so these aren't in\n * `sessionsCount` or `grossAmount`. It is a snapshot of that calculation: calculating the staff pay again after the\n * period ends sets it to `0`.\n */\n upcomingSessionsCount?: number;\n /**\n * An estimate of what the upcoming sessions will pay with their bookings at the time of the calculation, from the\n * session rates and service commission of the pay model. Not included in `grossAmount`: the pay changes when the\n * sessions take place, or when they are cancelled or booked. Like `upcomingSessionsCount`, a snapshot of the\n * calculation while the period was in progress; not returned by a calculation after the period ends.\n * @internal\n * @decimalValue options { maxScale:2 }\n */\n upcomingSessionPayAmount?: string | null;\n}\n\n/** A single earning, with the source it was calculated from. */\nexport interface PayLine {\n /**\n * Pay line ID.\n * @format GUID\n */\n _id?: string;\n /**\n * ID of the pay model component that produced the line. Empty for adjustment lines.\n * @format GUID\n */\n componentId?: string | null;\n /**\n * Name of the pay model component when the staff pay was calculated.\n * @maxLength 100\n */\n componentName?: string;\n /** Kind of earning. */\n type?: PayLineTypeWithLiterals;\n /** Record the line was calculated from. */\n source?: PayLineSource;\n /**\n * Day the earning applies to, in `YYYY-MM-DD` format: the workday, session date or order date.\n * @format LOCAL_DATE\n */\n date?: string;\n /**\n * Quantity the rate was applied to. For example, a number of hours, attendees or a revenue amount.\n * @decimalValue options { maxScale:4 }\n */\n quantity?: string;\n /** Unit of `quantity`. */\n quantityUnit?: QuantityUnitWithLiterals;\n /**\n * Rate applied: an amount per unit, or a percentage when `quantityUnit` is `REVENUE`.\n * @decimalValue options { maxScale:4 }\n */\n rate?: string;\n /**\n * Line amount. Negative for deductions and refund clawbacks.\n * @decimalValue options { maxScale:2 }\n */\n amount?: string;\n /** Whether the line counts towards gross pay. `false` for lines of a component that lost a `GREATER_OF` comparison. */\n included?: boolean;\n /**\n * Explanation of the line, in English. For example, `7.5 h x 18`. Amounts are plain decimals in the staff pay's\n * currency, without a currency symbol.\n * @maxLength 500\n */\n explanation?: string;\n /**\n * Part of the tip (`quantity`) paid by card, which the card fee applies to. The rest was paid offline, for example\n * in cash.\n *\n * Available only for tip share lines, and only when it's known how the tip was paid. When it isn't known, the card fee\n * applies to the whole tip.\n * @internal\n * @decimalValue options { gte:0, maxScale:2 }\n */\n cardPaidAmount?: string | null;\n /**\n * Card fee taken off the card-paid part of the tip before the share is paid.\n *\n * Available only for tip share lines that have a card fee.\n * @internal\n * @decimalValue options { gte:0, maxScale:2 }\n */\n cardFeeAmount?: string | null;\n /**\n * ID of the Bookings service the line was earned on.\n *\n * Available only for session pay lines (`SESSION_FEE`) and service commission lines (`COMMISSION`), and only for pay\n * calculated after this field was added.\n * @internal\n * @format GUID\n */\n serviceId?: string | null;\n}\n\n/** Kind of earning. */\nexport enum PayLineType {\n /** Fixed salary. */\n BASE_SALARY = 'BASE_SALARY',\n /** Regular paid hours. */\n REGULAR_HOURS = 'REGULAR_HOURS',\n /** Overtime hours. */\n OVERTIME_HOURS = 'OVERTIME_HOURS',\n /** Pay for a session taught. */\n SESSION_FEE = 'SESSION_FEE',\n /** Commission on service revenue. */\n COMMISSION = 'COMMISSION',\n /** Share of tips. */\n TIP_SHARE = 'TIP_SHARE',\n /** Manual adjustment. */\n ADJUSTMENT = 'ADJUSTMENT',\n /** Commission on a product sale. Not calculated yet. */\n PRODUCT_SALE_COMMISSION = 'PRODUCT_SALE_COMMISSION',\n /** Commission on a pricing plan sale. Not calculated yet. */\n PLAN_COMMISSION = 'PLAN_COMMISSION',\n}\n\n/** @enumType */\nexport type PayLineTypeWithLiterals =\n | PayLineType\n | 'BASE_SALARY'\n | 'REGULAR_HOURS'\n | 'OVERTIME_HOURS'\n | 'SESSION_FEE'\n | 'COMMISSION'\n | 'TIP_SHARE'\n | 'ADJUSTMENT'\n | 'PRODUCT_SALE_COMMISSION'\n | 'PLAN_COMMISSION';\n\n/** The record a pay line was calculated from. */\nexport interface PayLineSource {\n /** Source type. */\n type?: PayLineSourceTypeWithLiterals;\n /**\n * ID of the source record. For example, a timecard ID, booking ID, calendar event ID, order ID or adjustment ID.\n * @maxLength 100\n */\n _id?: string;\n /**\n * ID of the line item inside the source record.\n *\n * Available only for order line items.\n * @maxLength 100\n */\n lineItemId?: string | null;\n}\n\n/** Type of the record a pay line was calculated from. */\nexport enum PayLineSourceType {\n /** No single source, for example a salary. */\n NO_SOURCE = 'NO_SOURCE',\n /** Time Clock timecard. */\n TIMECARD = 'TIMECARD',\n /** Bookings booking. */\n BOOKING = 'BOOKING',\n /** Calendar event (session). */\n SESSION_EVENT = 'SESSION_EVENT',\n /** eCommerce order line item. */\n ORDER_LINE_ITEM = 'ORDER_LINE_ITEM',\n /** Tip distribution. */\n TIP = 'TIP',\n /** Pricing plan order. */\n PLAN_ORDER = 'PLAN_ORDER',\n /** Manual adjustment on this staff pay. */\n MANUAL_ADJUSTMENT = 'MANUAL_ADJUSTMENT',\n}\n\n/** @enumType */\nexport type PayLineSourceTypeWithLiterals =\n | PayLineSourceType\n | 'NO_SOURCE'\n | 'TIMECARD'\n | 'BOOKING'\n | 'SESSION_EVENT'\n | 'ORDER_LINE_ITEM'\n | 'TIP'\n | 'PLAN_ORDER'\n | 'MANUAL_ADJUSTMENT';\n\n/** Unit of a pay line quantity. */\nexport enum QuantityUnit {\n /** A single item, for example a salary or an adjustment. */\n ITEM = 'ITEM',\n /** Hours. */\n HOURS = 'HOURS',\n /** Sessions. */\n SESSIONS = 'SESSIONS',\n /** Attendees. */\n ATTENDEES = 'ATTENDEES',\n /** An amount of revenue. The rate is a percentage. */\n REVENUE = 'REVENUE',\n}\n\n/** @enumType */\nexport type QuantityUnitWithLiterals =\n | QuantityUnit\n | 'ITEM'\n | 'HOURS'\n | 'SESSIONS'\n | 'ATTENDEES'\n | 'REVENUE';\n\n/** A manual adjustment. */\nexport interface Adjustment {\n /**\n * Adjustment ID. Assigned when the adjustment is first saved.\n * @format GUID\n */\n _id?: string | null;\n /** Adjustment type. */\n type?: AdjustmentTypeWithLiterals;\n /**\n * Adjustment amount, `0` or more. A deduction is subtracted from gross pay. A bonus or reimbursement is added to it.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amount?: string;\n /**\n * Note explaining the adjustment, entered by the business.\n * @maxLength 500\n */\n note?: string;\n}\n\n/** Adjustment type. */\nexport enum AdjustmentType {\n /** Added to gross pay. */\n BONUS = 'BONUS',\n /** Subtracted from gross pay. */\n DEDUCTION = 'DEDUCTION',\n /** Added to gross pay as a reimbursement of expenses. */\n REIMBURSEMENT = 'REIMBURSEMENT',\n}\n\n/** @enumType */\nexport type AdjustmentTypeWithLiterals =\n | AdjustmentType\n | 'BONUS'\n | 'DEDUCTION'\n | 'REIMBURSEMENT';\n\n/** An issue found during calculation. */\nexport interface StaffPayAlert {\n /** Alert type. */\n type?: StaffPayAlertTypeWithLiterals;\n /**\n * ID of the record the alert is about. For example, an open timecard or a pay model.\n *\n * Returned only when the alert is about a single record.\n * @maxLength 100\n */\n sourceId?: string | null;\n /**\n * Description of the issue, in English.\n * @maxLength 500\n */\n message?: string;\n}\n\n/** Type of calculation issue. */\nexport enum StaffPayAlertType {\n /**\n * The staff member had timecards, sessions or tips on days without pay terms in effect, so those days aren't paid.\n * Days whose pay terms are unpaid get `UNPAID_TERMS_ACTIVITY` instead.\n */\n NO_PAY_TERMS = 'NO_PAY_TERMS',\n /** The pay terms point to a pay model that doesn't exist. */\n PAY_MODEL_NOT_FOUND = 'PAY_MODEL_NOT_FOUND',\n /** A timecard in the period is still open, so its hours aren't included. */\n OPEN_TIMECARD = 'OPEN_TIMECARD',\n /**\n * A data source couldn't be read, so what it pays is missing. The other sources were still calculated. `sourceId`\n * names the source: `HOURS`, `SESSIONS` or `TIPS`. Calculating again once the source can be read clears it.\n */\n SOURCE_UNAVAILABLE = 'SOURCE_UNAVAILABLE',\n /**\n * Time Clock clocked a timecard out automatically, so its hours are capped rather than punched. `sourceId` is the\n * timecard ID. The staff pay can't be approved until the timecard is fixed in Timecards and the pay is calculated again.\n */\n AUTO_CLOCKED_OUT_TIMECARD = 'AUTO_CLOCKED_OUT_TIMECARD',\n /**\n * The caller isn't allowed to read a data source, so what it pays is missing. A calculation a user starts reads the\n * sources as that user, so a role without a source's read permission gets this instead of that source's pay.\n * `sourceId` names the source: `HOURS`, `SESSIONS` or `TIPS`. The staff pay can't be approved until someone allowed\n * to read the source calculates it again.\n * @documentationMaturity preview\n * @internal\n */\n SOURCE_NOT_PERMITTED = 'SOURCE_NOT_PERMITTED',\n /**\n * Visits paid with an unlimited pricing plan count as `0` for a \"% of the price\" session rate, because the site's\n * staff pay settings have no unlimited plan visit value. The message names their dates. Only visits a \"% of the price\" rate of\n * the staff member's pay model covers are flagged. A warning: the staff pay can still be approved. Setting the value and\n * calculating again clears it.\n * @documentationMaturity preview\n * @internal\n */\n UNLIMITED_PLAN_VISIT_WITHOUT_VALUE = 'UNLIMITED_PLAN_VISIT_WITHOUT_VALUE',\n /**\n * A note, not a problem: the staff member had timecards, sessions or tips on days whose pay terms are unpaid (the\n * business stopped paying them with Staff Pay), so those aren't counted. The message says from when, what wasn't\n * counted and on which days. The staff pay can still be approved, and nothing needs fixing.\n * @documentationMaturity preview\n * @internal\n */\n UNPAID_TERMS_ACTIVITY = 'UNPAID_TERMS_ACTIVITY',\n /**\n * The staff member had timecards, sessions or tips after their last day of work (the employment end date of their staff\n * pay profile). They're paid, since the work was done. The message names the days. A warning: the staff pay can still\n * be approved. If the last day or the activity is wrong, fixing it and calculating again clears it.\n * @documentationMaturity preview\n * @internal\n */\n ACTIVITY_AFTER_LAST_DAY = 'ACTIVITY_AFTER_LAST_DAY',\n}\n\n/** @enumType */\nexport type StaffPayAlertTypeWithLiterals =\n | StaffPayAlertType\n | 'NO_PAY_TERMS'\n | 'PAY_MODEL_NOT_FOUND'\n | 'OPEN_TIMECARD'\n | 'SOURCE_UNAVAILABLE'\n | 'AUTO_CLOCKED_OUT_TIMECARD';\n\n/** A change to data a staff pay depends on, made after it was calculated or approved. */\nexport interface StaleReason {\n /** What changed. */\n type?: StaleReasonTypeWithLiterals;\n /**\n * ID of the record that changed: the timecard for `TIMECARD_CHANGED`, and the pay model for `PAY_MODEL_CHANGED`.\n *\n * Returned only for those 2 types.\n * @maxLength 100\n */\n sourceId?: string | null;\n /** Date and time of the change. */\n changedDate?: Date | null;\n}\n\n/** Kind of change that made a staff pay stale. */\nexport enum StaleReasonType {\n /** A timecard of the staff member in the period was created, changed or deleted. */\n TIMECARD_CHANGED = 'TIMECARD_CHANGED',\n /** A pay model in the staff member's pay terms was changed or deleted. */\n PAY_MODEL_CHANGED = 'PAY_MODEL_CHANGED',\n /** The staff member's pay profile changed, for example their pay terms, rate overrides or employment dates. */\n PAY_PROFILE_CHANGED = 'PAY_PROFILE_CHANGED',\n /** The site's staff pay settings changed, for example overtime rules or rounding. */\n SETTINGS_CHANGED = 'SETTINGS_CHANGED',\n /** The staff pay was reopened after approval. */\n REOPENED = 'REOPENED',\n /** The staff pay's adjustments were edited. */\n ADJUSTMENTS_CHANGED = 'ADJUSTMENTS_CHANGED',\n /** A tip for the staff member in the period was added or changed in Wix Tips. */\n TIP_CHANGED = 'TIP_CHANGED',\n /**\n * Sessions, bookings, attendance, orders or other data the approved staff pay is calculated from changed after it was\n * approved. Found when its period is calculated again, so the change date is the date of that calculation.\n * @documentationMaturity preview\n * @internal\n */\n SOURCE_DATA_CHANGED = 'SOURCE_DATA_CHANGED',\n}\n\n/** @enumType */\nexport type StaleReasonTypeWithLiterals =\n | StaleReasonType\n | 'TIMECARD_CHANGED'\n | 'PAY_MODEL_CHANGED'\n | 'PAY_PROFILE_CHANGED'\n | 'SETTINGS_CHANGED'\n | 'REOPENED'\n | 'ADJUSTMENTS_CHANGED'\n | 'TIP_CHANGED';\n\nexport interface ExtendedFields {\n /**\n * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n * The value of each key is structured according to the schema defined when the extended fields were configured.\n *\n * You can only access fields for which you have the appropriate permissions.\n *\n * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n */\n namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface CreateStaffPayRequest {\n /** Staff pay to create. */\n staffPay: StaffPay;\n}\n\nexport interface CreateStaffPayResponse {\n /** Created staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface GetStaffPayRequest {\n /**\n * ID of the staff pay to retrieve.\n * @format GUID\n */\n staffPayId: string;\n}\n\nexport interface GetStaffPayResponse {\n /** Retrieved staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface UpdateStaffPayRequest {\n /** Staff pay to update. May be partial. */\n staffPay: StaffPay;\n /**\n * Set of fields to update.\n *\n * Supported properties: `adjustments`, `extendedFields`. Fields that aren't included in `fieldMask.paths` are ignored.\n * @internal\n */\n fieldMask?: string[];\n}\n\nexport interface UpdateStaffPayResponse {\n /** Updated staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface DeleteStaffPayRequest {\n /**\n * ID of the staff pay to delete.\n * @format GUID\n */\n staffPayId: string;\n}\n\nexport interface DeleteStaffPayResponse {}\n\nexport interface QueryStaffPaysRequest {\n /** Query options. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryStaffPaysResponse {\n /** List of staff pays. */\n staffPays?: StaffPay[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface BulkDeleteStaffPaysRequest {\n /**\n * IDs of the staff pays to delete.\n * @minSize 1\n * @maxSize 100\n * @format GUID\n */\n staffPayIds: string[];\n}\n\nexport interface BulkDeleteStaffPaysResponse {\n /**\n * Results, 1 per requested staff pay.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkDeleteStaffPaysResponseBulkStaffPayResult[];\n /** Metadata about the bulk delete operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.\n * @format GUID\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkDeleteStaffPaysResponseBulkStaffPayResult {\n /** Metadata about the deletion of this staff pay. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface CalculateStaffPayRequest {\n /**\n * ID of the staff pay to calculate.\n * @format GUID\n */\n staffPayId: string;\n}\n\nexport interface CalculateStaffPayResponse {\n /** Calculated staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface PreviewStaffPayCalculationRequest {\n /**\n * ID of the staff pay to calculate again.\n * @format GUID\n */\n staffPayId: string;\n /**\n * Clock-outs to calculate open timecards with, as if they were saved. They aren't saved: clock the timecards out in\n * Time Clock to keep them.\n *\n * Each must name an open timecard of the staff pay's staff member that clocked in within the period, at most once,\n * with a time after its clock-in. Otherwise, the request fails with `INVALID_PROPOSED_CLOCK_OUT`.\n *\n * Default: The timecards as they are.\n * @maxSize 50\n */\n proposedClockOuts?: ProposedClockOut[];\n}\n\n/** A clock-out for an open timecard, to preview the pay with. Not saved. */\nexport interface ProposedClockOut {\n /**\n * ID of the open timecard.\n * @format GUID\n */\n timecardId?: string;\n /**\n * When the timecard clocks out, as a date and time in the site's time zone, in `YYYY-MM-DDThh:mm:ss` format. For\n * example, `2026-10-02T17:30:00`. The timecard is paid from its clock-in to this time, less its unpaid breaks, on the\n * workday of its clock-in.\n * @format LOCAL_DATE_TIME\n */\n clockOut?: string;\n}\n\nexport interface PreviewStaffPayCalculationResponse {\n /** Staff pay as calculating it now would make it. Not saved. */\n staffPay?: StaffPay;\n}\n\nexport interface BulkCalculateStaffPaysRequest {\n /**\n * First day of the pay period, in `YYYY-MM-DD` format.\n * @format LOCAL_DATE\n */\n periodStartDate: string;\n /**\n * Last day of the pay period (inclusive), in `YYYY-MM-DD` format.\n * @format LOCAL_DATE\n */\n periodEndDate: string;\n /**\n * IDs of the staff members to calculate.\n *\n * Default: The staff members whose pay terms are in effect on at least 1 day of the period.\n * @maxSize 500\n * @format GUID\n */\n staffMemberIds?: string[];\n}\n\nexport interface BulkCalculateStaffPaysResponse {\n /**\n * Results, 1 per staff pay.\n * @maxSize 500\n */\n results?: BulkCalculateStaffPaysResponseBulkStaffPayResult[];\n /** Metadata about the bulk calculate operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkCalculateStaffPaysResponseBulkStaffPayResult {\n /** Metadata about the calculation of this staff pay. */\n itemMetadata?: ItemMetadata;\n /**\n * Calculated staff pay.\n *\n * Returned only when the calculation succeeded.\n */\n item?: StaffPay;\n}\n\nexport interface ApproveStaffPayRequest {\n /**\n * ID of the staff pay to approve.\n * @format GUID\n */\n staffPayId: string;\n /** Current revision of the staff pay. */\n revision: string | null;\n}\n\nexport interface ApproveStaffPayResponse {\n /** Approved staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface BulkApproveStaffPaysRequest {\n /**\n * IDs of the staff pays to approve.\n * @minSize 1\n * @maxSize 500\n * @format GUID\n */\n staffPayIds: string[];\n}\n\nexport interface BulkApproveStaffPaysResponse {\n /**\n * Results, 1 per requested staff pay.\n * @maxSize 500\n */\n results?: BulkStaffPayResult[];\n /** Metadata about the bulk approve operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkStaffPayResult {\n /** Metadata about the approval of this staff pay. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface ReopenStaffPayRequest {\n /**\n * ID of the staff pay to reopen.\n * @format GUID\n */\n staffPayId: string;\n}\n\nexport interface ReopenStaffPayResponse {\n /** Reopened staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface ExportStaffPaysRequest {\n /**\n * First day of the pay period to export, in `YYYY-MM-DD` format.\n * @format LOCAL_DATE\n */\n periodStartDate: string;\n /**\n * Export format.\n *\n * Default: The format in the site's export settings.\n */\n format?: ExportFormatWithLiterals;\n}\n\n/** Export format. */\nexport enum ExportFormat {\n /** One row per staff member with the period's totals, for a spreadsheet. */\n GENERIC_CSV = 'GENERIC_CSV',\n /**\n * One row per staff member per earning code, for importing into a payroll system.\n * @documentationMaturity preview\n * @internal\n */\n PAY_DATA_CSV = 'PAY_DATA_CSV',\n /**\n * ADP Workforce Now paydata batch, with the company code from the site's export settings.\n * @documentationMaturity preview\n * @internal\n */\n ADP_WORKFORCE_NOW_CSV = 'ADP_WORKFORCE_NOW_CSV',\n /**\n * Paychex Flex standard payroll import, with the client ID from the site's export settings.\n * @documentationMaturity preview\n * @internal\n */\n PAYCHEX_FLEX_CSV = 'PAYCHEX_FLEX_CSV',\n /**\n * Gusto hours and earnings upload, one row per staff member.\n * @documentationMaturity preview\n * @internal\n */\n GUSTO_CSV = 'GUSTO_CSV',\n}\n\n/** @enumType */\nexport type ExportFormatWithLiterals = ExportFormat | 'GENERIC_CSV';\n\nexport interface ExportStaffPaysResponse {\n /**\n * Suggested file name. For example, `staff-pay-2026-10-01.csv`.\n * @maxLength 200\n */\n fileName?: string;\n /**\n * File content, as CSV text.\n * @maxLength 10000000\n */\n content?: string;\n /** Number of staff pays in the period that weren't exported because they aren't approved. */\n skippedCount?: number;\n /**\n * IDs of the staff members exported without a payroll ID in their pay profile. Their rows use their email, or else\n * their name, which a payroll system may not match.\n *\n * Returned only for the `PAY_DATA_CSV`, `ADP_WORKFORCE_NOW_CSV` and `PAYCHEX_FLEX_CSV` formats.\n * @internal\n * @maxSize 1000\n * @format GUID\n */\n staffMemberIdsWithoutPayrollId?: string[];\n}\n\nexport interface PreviewStaffPayRequest {\n /** Pay model to preview. May be unsaved. */\n payModel: PayModel;\n /** Sample data for 1 staff member over 1 pay period. */\n sampleFacts: SampleFacts;\n}\n\n/**\n * A pay model is a reusable way to pay staff: a list of pay components, such as an hourly wage, session rates and a\n * tip share, whose results are combined into a staff member's gross pay for a pay period. A pay model holds no people\n * and no dates: staff members are paid with it through the pay terms in their staff pay profile.\n *\n * Monetary amounts are decimal strings in the site's pay currency, set in the staff pay settings. Percentages are\n * decimal strings between `0` and `100`.\n */\nexport interface PayModel {\n /**\n * Pay model ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the pay model is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the pay model.\n *\n * Ignored when creating a pay model.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the pay model was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the pay model was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Pay model name. For example, `Group fitness instructor`.\n * @maxLength 100\n */\n name?: string;\n /**\n * Description of the pay model.\n * @maxLength 500\n */\n description?: string | null;\n /**\n * Pay components. Each component produces pay lines for a pay period.\n *\n * The session rates are the `FLAT_PER_SESSION`, `BASE_PLUS_PER_HEAD`, `ATTENDANCE_TIERS`, `PER_COURSE` and\n * `SERVICE_COMMISSION` components. Each service is paid by 1 session rate at most, so a session or a sale is never\n * paid twice. A rate with `serviceIds` pays only those services. At most 1 rate has no `serviceIds`: it pays every\n * service that no other rate lists, including services added later.\n *\n * A `PER_COURSE` rate pays course sessions only, and has its own default: at most 1 `PER_COURSE` rate has no\n * `serviceIds`, and it pays every course that no rate lists. A course is paid by the rate that lists it, else by that\n * per-course rate, else by the rate without `serviceIds`.\n *\n * Components get an ID when they're first saved. Send each component's `id` back when updating, so personal rates and\n * pay lines stay linked to it.\n * @maxSize 20\n */\n components?: PayComponent[];\n /**\n * How the component results are combined into gross pay.\n *\n * Default: `SUM`\n */\n combinator?: Combinator;\n /**\n * Date and time the pay model was archived.\n *\n * Returned only when the pay model is archived. An archived pay model can't be updated and isn't offered for new pay\n * terms, but pay terms that already use it keep it, so it can still be retrieved. Set by Archive Pay Model and cleared\n * by Unarchive Pay Model.\n * @readonly\n */\n archivedDate?: Date | null;\n /**\n * Custom field data for the pay model object.\n *\n * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n}\n\n/** A single pay component of a pay model. */\nexport interface PayComponent extends PayComponentOptionsOneOf {\n /** Fixed amount per pay period. */\n salaryOptions?: SalaryOptions;\n /** Rate per paid hour worked, from Time Clock timecards. */\n hourlyOptions?: HourlyOptions;\n /** Flat amount per session taught. */\n flatPerSessionOptions?: FlatPerSessionOptions;\n /** Amount per attendee, with an optional base amount that covers the first attendees. */\n basePlusPerHeadOptions?: BasePlusPerHeadOptions;\n /** Flat amount per session, by attendance tier. */\n attendanceTiersOptions?: AttendanceTiersOptions;\n /** Percentage of service revenue. */\n serviceCommissionOptions?: ServiceCommissionOptions;\n /** Share of tips. */\n tipsOptions?: TipsOptions;\n /** Percentage of product sales. Not calculated yet. */\n productCommissionOptions?: ProductCommissionOptions;\n /** Commission on pricing plan sales, such as memberships and packages. Not calculated yet. */\n planSaleCommissionOptions?: PlanSaleCommissionOptions;\n /**\n * Flat amount per course taught, spread evenly across the course's sessions.\n * @internal\n */\n perCourseOptions?: PerCourseOptions;\n /**\n * Component ID. Assigned when the component is first saved. Send it back when updating, to keep the same component\n * so personal rates and pay lines stay linked to it.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Component name. For example, `Class pay`.\n * @maxLength 100\n */\n name?: string;\n /** Component type. Must match the options that are specified. */\n type?: ComponentTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface PayComponentOptionsOneOf {\n /** Fixed amount per pay period. */\n salaryOptions?: SalaryOptions;\n /** Rate per paid hour worked, from Time Clock timecards. */\n hourlyOptions?: HourlyOptions;\n /** Flat amount per session taught. */\n flatPerSessionOptions?: FlatPerSessionOptions;\n /** Amount per attendee, with an optional base amount that covers the first attendees. */\n basePlusPerHeadOptions?: BasePlusPerHeadOptions;\n /** Flat amount per session, by attendance tier. */\n attendanceTiersOptions?: AttendanceTiersOptions;\n /** Percentage of service revenue. */\n serviceCommissionOptions?: ServiceCommissionOptions;\n /** Share of tips. */\n tipsOptions?: TipsOptions;\n /** Percentage of product sales. Not calculated yet. */\n productCommissionOptions?: ProductCommissionOptions;\n /** Commission on pricing plan sales, such as memberships and packages. Not calculated yet. */\n planSaleCommissionOptions?: PlanSaleCommissionOptions;\n /**\n * Flat amount per course taught, spread evenly across the course's sessions.\n * @internal\n */\n perCourseOptions?: PerCourseOptions;\n}\n\n/** Pay component type. */\nexport enum ComponentType {\n /** Fixed amount per pay period. */\n SALARY = 'SALARY',\n /** Rate per paid hour worked, from Time Clock timecards. */\n HOURLY = 'HOURLY',\n /** Flat amount per session taught. */\n FLAT_PER_SESSION = 'FLAT_PER_SESSION',\n /** Amount per attendee, with an optional base amount that covers the first attendees. */\n BASE_PLUS_PER_HEAD = 'BASE_PLUS_PER_HEAD',\n /** Flat amount per session, by attendance tier. */\n ATTENDANCE_TIERS = 'ATTENDANCE_TIERS',\n /** Percentage of service revenue. */\n SERVICE_COMMISSION = 'SERVICE_COMMISSION',\n /** Share of tips. */\n TIPS = 'TIPS',\n /** Percentage of product sales. Not calculated yet: pays nothing until product sales are read. */\n PRODUCT_COMMISSION = 'PRODUCT_COMMISSION',\n /**\n * Commission on pricing plan sales, such as memberships and packages. Not calculated yet: pays nothing until\n * pricing plan sales are read.\n */\n PLAN_SALE_COMMISSION = 'PLAN_SALE_COMMISSION',\n /**\n * Flat amount per course taught, spread evenly across the course's sessions.\n * @documentationMaturity preview\n * @internal\n */\n PER_COURSE = 'PER_COURSE',\n}\n\n/** @enumType */\nexport type ComponentTypeWithLiterals =\n | ComponentType\n | 'SALARY'\n | 'HOURLY'\n | 'FLAT_PER_SESSION'\n | 'BASE_PLUS_PER_HEAD'\n | 'ATTENDANCE_TIERS'\n | 'SERVICE_COMMISSION'\n | 'TIPS'\n | 'PRODUCT_COMMISSION'\n | 'PLAN_SALE_COMMISSION';\n\nexport interface SalaryOptions {\n /**\n * Amount per pay period.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerPeriod?: string;\n /**\n * Deprecated: ignored. A salary is always prorated by the days employed in the period, based on the profile's\n * employment dates, so no salary is paid after the last day of work.\n */\n prorateByDaysEmployed?: boolean;\n}\n\nexport interface HourlyOptions {\n /**\n * Rate per paid hour. Unpaid breaks aren't paid.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n rate?: string;\n /**\n * Whether the overtime rules in the staff pay settings apply to the hours of this component.\n *\n * Default: `false`\n */\n overtimeEligible?: boolean;\n /**\n * Whether to pay only for clocked time outside sessions the staff member taught that a session rate of the pay model\n * covers, so a session isn't paid twice by an hourly component and a session rate. Time in a session no session rate\n * covers is still paid hourly.\n *\n * Default: `false`\n */\n excludeSessionTime?: boolean;\n}\n\nexport interface FlatPerSessionOptions {\n /**\n * Amount per session taught.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amount?: string;\n /**\n * Services this rate pays. See `payModel.components` for how session rates share the services.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n /**\n * Not used: a session that the business cancelled is never paid, whatever this says. Kept so existing clients\n * still work.\n *\n * Default: `false`\n */\n zeroWhenCancelled?: boolean;\n}\n\n/**\n * Pay per attendee of a session. A session pays `baseAmount`, plus `amountPerAdditionalAttendee` for each attendee\n * above `includedAttendees`. Without a base amount and with `0` included attendees, every attendee is paid.\n */\nexport interface BasePlusPerHeadOptions {\n /**\n * Amount paid for each session, which covers its first `includedAttendees` attendees. When not set or `0`, there's no\n * base amount.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n baseAmount?: string | null;\n /**\n * Number of attendees who aren't paid per attendee: the ones the base amount covers. `0` pays every attendee.\n * @max 10000\n */\n includedAttendees?: number;\n /**\n * Amount per attendee above `includedAttendees`.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerAdditionalAttendee?: string;\n /**\n * Which attendees are counted.\n *\n * Default: `CHECKED_IN`\n */\n countBasis?: AttendeeCountBasisWithLiterals;\n /**\n * Services this rate pays. See `payModel.components` for how session rates share the services.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n /**\n * Not used: a session that the business cancelled is never paid, whatever this says. Kept so existing clients\n * still work.\n *\n * Default: `false`\n */\n zeroWhenCancelled?: boolean;\n /**\n * Whether free visits are left out of the attendees counted. A free visit is a booking nothing was paid for, such as\n * a free service or a complimentary visit.\n *\n * Default: `false`\n */\n excludeFreeVisits?: boolean;\n /**\n * More amounts per additional attendee, for bigger sessions. Each attendee above `includedAttendees` is paid the\n * amount of the highest tier whose `fromAttendee` they reach, and `amountPerAdditionalAttendee` below the first tier.\n * Every `fromAttendee` must be above `includedAttendees`, and 2 tiers can't share one.\n * @internal\n * @maxSize 20\n */\n extraAttendeeTiers?: ExtraAttendeeTier[];\n /**\n * Most a session can pay under this rate, whatever its attendance. A staff member's personal rate applies first.\n * Must be at least `baseAmount`, when there's one. When not set, there's no maximum.\n * @internal\n * @decimalValue options { gte:0, maxScale:2 }\n */\n maxAmountPerSession?: string | null;\n}\n\n/** Which attendees of a session are counted. */\nexport enum AttendeeCountBasis {\n /** All booked attendees. */\n BOOKED = 'BOOKED',\n /** Only checked-in attendees. */\n CHECKED_IN = 'CHECKED_IN',\n /** Checked-in attendees and no-shows (bookings that weren't cancelled). */\n CHECKED_IN_AND_NO_SHOWS = 'CHECKED_IN_AND_NO_SHOWS',\n}\n\n/** @enumType */\nexport type AttendeeCountBasisWithLiterals =\n | AttendeeCountBasis\n | 'BOOKED'\n | 'CHECKED_IN'\n | 'CHECKED_IN_AND_NO_SHOWS';\n\n/** An amount per attendee, from 1 attendee number on. Attendees are numbered from 1 in each session. */\nexport interface ExtraAttendeeTier {\n /**\n * Attendee number the tier starts at. Attendees from this number on are paid `amountPerAttendee`.\n * @min 1\n * @max 10000\n */\n fromAttendee?: number;\n /**\n * Amount per attendee in this tier.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerAttendee?: string;\n}\n\nexport interface AttendanceTiersOptions {\n /**\n * Tiers, sorted by `minAttendees` when saved. A session is paid at the highest tier whose `minAttendees` it reaches.\n * 2 tiers can't share a `minAttendees`.\n * @maxSize 20\n */\n tiers?: AttendanceTier[];\n /**\n * Which attendees are counted.\n *\n * Default: `CHECKED_IN`\n */\n countBasis?: AttendeeCountBasisWithLiterals;\n /**\n * Services this rate pays. See `payModel.components` for how session rates share the services.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n /**\n * Not used: a session that the business cancelled is never paid, whatever this says. Kept so existing clients\n * still work.\n *\n * Default: `false`\n */\n zeroWhenCancelled?: boolean;\n /**\n * Whether free visits are left out of the attendees counted. A free visit is a booking nothing was paid for, such as\n * a free service or a complimentary visit.\n *\n * Default: `false`\n */\n excludeFreeVisits?: boolean;\n}\n\nexport interface AttendanceTier {\n /**\n * Minimum number of attendees for this tier.\n * @max 10000\n */\n minAttendees?: number;\n /**\n * Flat amount per session.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n value?: string;\n}\n\nexport interface ServiceCommissionOptions {\n /**\n * Commission percentage of service revenue. With `tiers`, the percentage paid below the first tier.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n /**\n * Services this rate pays. See `payModel.components` for how session rates share the services.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n /**\n * Sliding-scale tiers on the period's service sales, sorted by `minSales`. A higher tier raises the percentage once\n * the period's sales reach its `minSales`. When empty, every sale is paid at `percent`.\n * @maxSize 20\n */\n tiers?: CommissionTier[];\n /**\n * How `tiers` apply to the period's sales.\n *\n * Default: `ENTIRE_AMOUNT`\n */\n tierMode?: CommissionTierModeWithLiterals;\n /** How service sales are counted. */\n revenueRules?: RevenueRules;\n /**\n * Cost taken off each sale's price before the commission percentage applies. When not set, nothing is taken off.\n * @internal\n */\n costDeduction?: CostDeduction;\n}\n\n/** A sliding-scale commission tier. */\nexport interface CommissionTier {\n /**\n * Period sales from which this tier applies.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n minSales?: string;\n /**\n * Commission percentage of this tier.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n}\n\n/** How sliding-scale tiers apply to a period's sales. */\nexport enum CommissionTierMode {\n /** All of the period's sales are paid at the percentage of the highest tier reached. */\n ENTIRE_AMOUNT = 'ENTIRE_AMOUNT',\n /** Each part of the period's sales is paid at the percentage of the tier it falls in. */\n PORTION_IN_TIER = 'PORTION_IN_TIER',\n}\n\n/** @enumType */\nexport type CommissionTierModeWithLiterals =\n | CommissionTierMode\n | 'ENTIRE_AMOUNT'\n | 'PORTION_IN_TIER';\n\n/**\n * How revenue is counted by a component that pays on revenue. A session's revenue adds up what each of its bookings is\n * worth: the price of a booking paid in money, the price per session of a pricing plan with a set number of sessions, or\n * the site's value of a visit on an unlimited plan. A free visit adds nothing. Refunds completed by the end of the pay\n * period are subtracted (a later refund doesn't change an earlier period's pay), and a course booking's price is split\n * evenly across the course sessions it covers.\n */\nexport interface RevenueRules {\n /**\n * Whether a booking paid in money counts at its price before or after discounts.\n *\n * Default: `AFTER_DISCOUNTS`\n */\n discountBasis?: DiscountBasisWithLiterals;\n /**\n * Whether a booking's tax counts in its revenue. Applies to prices that include tax, as on sites that show prices with\n * VAT: `BEFORE_TAX` takes the booking's tax off its price, and its discounts and refunds in the same proportion. A price\n * that doesn't include tax counts as it is either way.\n *\n * Default: `BEFORE_TAX`\n */\n taxBasis?: TaxBasisWithLiterals;\n}\n\n/** Whether revenue is taken before or after discounts. */\nexport enum DiscountBasis {\n /** Price before discounts. */\n BEFORE_DISCOUNTS = 'BEFORE_DISCOUNTS',\n /** Price paid, after discounts. */\n AFTER_DISCOUNTS = 'AFTER_DISCOUNTS',\n}\n\n/** @enumType */\nexport type DiscountBasisWithLiterals =\n | DiscountBasis\n | 'BEFORE_DISCOUNTS'\n | 'AFTER_DISCOUNTS';\n\n/** Whether revenue includes the tax in a price. */\nexport enum TaxBasis {\n /** Price without tax. */\n BEFORE_TAX = 'BEFORE_TAX',\n /** Price with the tax it includes. */\n WITH_TAX = 'WITH_TAX',\n}\n\n/** @enumType */\nexport type TaxBasisWithLiterals = TaxBasis | 'BEFORE_TAX' | 'WITH_TAX';\n\n/**\n * A cost taken off each sale's price before commission, such as the products a service uses or a fee. A sale is never\n * counted below 0. Sliding-scale tiers measure the period's sales after the cost is taken off.\n */\nexport interface CostDeduction extends CostDeductionKindOneOf {\n /**\n * Fixed amount taken off each sale.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerSale?: string;\n /**\n * Percentage of each sale's price taken off.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n}\n\n/** @oneof */\nexport interface CostDeductionKindOneOf {\n /**\n * Fixed amount taken off each sale.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerSale?: string;\n /**\n * Percentage of each sale's price taken off.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n}\n\nexport interface TipsOptions {\n /**\n * Percentage of the staff member's tip distributions that's passed on to them.\n *\n * Default: `100`\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n sharePercent?: string | null;\n /**\n * Card processing fee percentage deducted from tips paid by card before they're shared. Tips paid offline, for\n * example in cash, have no fee taken off. A tip whose payment method isn't known has the fee taken off all of it.\n *\n * Default: `0`\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n cardFeePercent?: string | null;\n}\n\nexport interface ProductCommissionOptions {\n /**\n * Commission percentage of product sales, after discounts.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n /**\n * Products this component applies to. When empty, applies to all products.\n * @maxSize 1000\n * @format GUID\n */\n productIds?: string[];\n}\n\nexport interface PlanSaleCommissionOptions {\n /**\n * Commission percentage of each plan order's price.\n *\n * Default: `0`\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string | null;\n /**\n * Flat amount per plan order, added to the percentage.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerOrder?: string | null;\n /**\n * Plans this component applies to. When empty, applies to all plans.\n * @maxSize 1000\n * @format GUID\n */\n planIds?: string[];\n}\n\n/**\n * A flat amount per Bookings course. Each session of the course pays the amount divided by the course's sessions, to\n * whoever taught that session, so a substitute is paid for the sessions they taught. Cancelled sessions don't count\n * towards the course's sessions and pay nothing.\n */\nexport interface PerCourseOptions {\n /**\n * Amount per course.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amount?: string;\n /**\n * Course services this rate pays. When empty, pays every course no other rate lists. See `payModel.components` for\n * how session rates share the services. Service IDs aren't checked to be courses: a listed service that isn't a\n * course is paid nothing by this rate.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n}\n\n/** How component results are combined into gross pay. */\nexport interface Combinator extends CombinatorOptionsOneOf {\n /** Pay the greater of a set of components. */\n greaterOfOptions?: GreaterOfOptions;\n /** Combinator type. Must match the options that are specified. */\n type?: CombinatorTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface CombinatorOptionsOneOf {\n /** Pay the greater of a set of components. */\n greaterOfOptions?: GreaterOfOptions;\n}\n\n/** Combinator type. */\nexport enum CombinatorType {\n /** Add all component results together. */\n SUM = 'SUM',\n /** Pay only the greatest result among `greaterOfOptions.componentIds`. All other components are added. */\n GREATER_OF = 'GREATER_OF',\n}\n\n/** @enumType */\nexport type CombinatorTypeWithLiterals = CombinatorType | 'SUM' | 'GREATER_OF';\n\nexport interface GreaterOfOptions {\n /**\n * IDs of the components that compete, for example a salary component and a commission component.\n * @minSize 2\n * @maxSize 20\n * @format GUID\n */\n componentIds?: string[];\n}\n\n/** Sample data for 1 staff member over 1 pay period. */\nexport interface SampleFacts {\n /**\n * Paid hours worked.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n paidHours?: string | null;\n /**\n * Paid hours above the site's overtime thresholds, included in `paidHours`.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n overtimeHours?: string | null;\n /**\n * Sessions taught.\n * @maxSize 100\n */\n sessions?: SampleSession[];\n /**\n * Tips distributed to the staff member.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n tipsAmount?: string | null;\n /**\n * Fraction of the period the staff member was employed, between `0` and `1`. Used to prorate salaries.\n *\n * Default: `1`\n * @decimalValue options { gte:0, lte:1, maxScale:4 }\n */\n employedFraction?: string | null;\n /**\n * Product sales credited to the staff member.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n productSalesAmount?: string | null;\n /**\n * Pricing plan orders credited to the staff member.\n * @maxSize 100\n */\n planOrders?: SamplePlanOrder[];\n}\n\n/** A sample session. */\nexport interface SampleSession {\n /**\n * Bookings service ID. Used to match personal per-service rates and the session rate that pays the session.\n * @format GUID\n */\n serviceId?: string | null;\n /**\n * Number of attendees counted for the session.\n * @max 10000\n */\n attendees?: number;\n /**\n * Session revenue, used by `SERVICE_COMMISSION` rates: the sale of the session's service.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n revenue?: string | null;\n /**\n * Whether the session was cancelled.\n *\n * Default: `false`\n */\n cancelled?: boolean;\n /**\n * Key of the course the session belongs to, any text. The sample sessions with the same `courseId` are that course's\n * sessions in this period, numbered in request order. Used with `courseSessions`.\n * @internal\n * @maxLength 100\n */\n courseId?: string | null;\n /**\n * Number of sessions the course has in all, not counting cancelled ones. More than `0` makes this a course session\n * and its sale a course sale. When no sample session sets it, all the sample sessions make up 1 course.\n * @internal\n * @max 1000\n */\n courseSessions?: number;\n}\n\n/** A sample pricing plan order. */\nexport interface SamplePlanOrder {\n /**\n * Pricing plan ID. Used to match the plans a component applies to.\n * @format GUID\n */\n planId?: string | null;\n /**\n * Order price.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amount?: string | null;\n}\n\nexport interface PreviewStaffPayResponse {\n /**\n * What each component would pay.\n * @maxSize 20\n */\n components?: ComponentPreview[];\n /**\n * Gross pay after the combinator is applied.\n * @decimalValue options { maxScale:2 }\n */\n grossAmount?: string;\n}\n\n/** What one component would pay. */\nexport interface ComponentPreview {\n /**\n * Component ID, when the component has one.\n * @format GUID\n */\n componentId?: string | null;\n /**\n * Component name.\n * @maxLength 100\n */\n componentName?: string;\n /**\n * Amount the component would pay.\n * @decimalValue options { maxScale:2 }\n */\n amount?: string;\n /**\n * Whether the amount counts towards gross pay after the combinator is applied. `false` for components that lost a\n * `GREATER_OF` comparison.\n */\n included?: boolean;\n /**\n * Explanation of the calculation, in English. For example, `1 session x 40`, or `2 lines: 1 session x 40; 1 session\n * x 40` for several pay lines. Amounts are plain decimals in the site's pay currency, without a currency symbol. When\n * the lines don't all fit in 10,000 characters, the ones that fit are given whole and the rest are counted, as in\n * `100 lines: 1 session x 40; 1 session x 40; … and 70 more`. The lines of a full sample fit.\n * @maxLength 10000\n */\n explanation?: string;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateStaffPayApplicationErrors =\n | {\n code?: 'INVALID_PERIOD';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'OVERLAPPING_STAFF_PAY';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_ADJUSTMENT';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type UpdateStaffPayApplicationErrors =\n | {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_ADJUSTMENT';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type DeleteStaffPayApplicationErrors = {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type BulkDeleteStaffPaysApplicationErrors = {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type CalculateStaffPayApplicationErrors = {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type PreviewStaffPayCalculationApplicationErrors = {\n code?: 'INVALID_PROPOSED_CLOCK_OUT';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type BulkCalculateStaffPaysApplicationErrors = {\n code?: 'INVALID_PERIOD';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type ApproveStaffPayApplicationErrors =\n | {\n code?: 'STAFF_PAY_NOT_CALCULATED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'STAFF_PAY_STALE';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'TIMECARD_NEEDS_FIX';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SOURCE_NOT_PERMITTED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type ReopenStaffPayApplicationErrors = {\n code?: 'STAFF_PAY_NOT_APPROVED';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Creates a `DRAFT` staff pay for a staff member and pay period.\n *\n * A pay period is at most 62 days long, and a staff member's staff pays can't overlap. When the site has a pay schedule,\n * a period that has no staff pay yet must be one of the schedule's periods, from its first period on, or the days\n * between the last staff pay and the first period. To calculate the staff pay, call Calculate Staff Pay. To create and calculate a whole period at once, call\n * Bulk Calculate Staff Pays.\n * @param staffPay - Staff pay to create.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPay\n * @requiredField staffPay.periodEndDate\n * @requiredField staffPay.periodStartDate\n * @requiredField staffPay.staffMemberId\n * @permissionId staff:pay:v1:staff_pay:create_staff_pay\n * @returns Created staff pay.\n * @fqn wix.staff.pay.v1.StaffPayService.CreateStaffPay\n */\nexport async function createStaffPay(\n staffPay: NonNullablePaths<\n StaffPay,\n `periodEndDate` | `periodStartDate` | `staffMemberId`,\n 0\n >\n): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n > & {\n __applicationErrorsType?: CreateStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ staffPay: staffPay });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.createStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.staffPay!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPay: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPay']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a staff pay, including its pay lines.\n * @param staffPayId - ID of the staff pay to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:get_staff_pay\n * @returns Retrieved staff pay.\n * @fqn wix.staff.pay.v1.StaffPayService.GetStaffPay\n */\nexport async function getStaffPay(\n staffPayId: string\n): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.getStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.staffPay!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a staff pay's adjustments and extended fields.\n *\n * Each time the staff pay is updated, `revision` increments by 1. The current `revision` must be passed when updating\n * the staff pay. This ensures you're working with the latest staff pay and prevents unintended overwrites.\n *\n * Supported properties: `adjustments`, `extendedFields`. Other paths in `fieldMask` are ignored.\n *\n * Adjustments are bonuses, deductions and reimbursements, and each becomes a pay line. A wrong calculated amount isn't\n * corrected here: fix its source, such as the timecard or booking, and calculate the staff pay again. Changing the\n * adjustments of a calculated staff pay marks it stale. An approved staff pay can't be updated until it's reopened with\n * Reopen Staff Pay.\n * @param _id - Staff pay ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField staffPay\n * @requiredField staffPay.revision\n * @permissionId staff:pay:v1:staff_pay:update_staff_pay\n * @returns Updated staff pay.\n * @fqn wix.staff.pay.v1.StaffPayService.UpdateStaffPay\n */\nexport async function updateStaffPay(\n _id: string,\n staffPay: NonNullablePaths<UpdateStaffPay, `revision`, 0>\n): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n > & {\n __applicationErrorsType?: UpdateStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPay: { ...staffPay, id: _id },\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.updateStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.staffPay!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { staffPay: '$[1]' },\n explicitPathsToArguments: { 'staffPay.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'staffPay']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateStaffPay {\n /**\n * Staff pay ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the staff pay is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the staff pay.\n *\n * Ignored when creating a staff pay.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the staff pay was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the staff pay was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the Bookings staff member the staff pay is for.\n * @format GUID\n * @immutable\n */\n staffMemberId?: string;\n /**\n * First day of the pay period, in `YYYY-MM-DD` format, in the site's time zone.\n * @format LOCAL_DATE\n * @immutable\n */\n periodStartDate?: string;\n /**\n * Last day of the pay period (inclusive), in `YYYY-MM-DD` format, in the site's time zone.\n * @format LOCAL_DATE\n * @immutable\n */\n periodEndDate?: string;\n /**\n * Staff pay status.\n * @readonly\n */\n status?: StaffPayStatusWithLiterals;\n /**\n * Whether data the result depends on (timecards, bookings, attendance, orders, tips, adjustments, pay models, profiles\n * or settings) changed after the last calculation. A stale staff pay must be recalculated before it can be approved.\n *\n * An approved staff pay is marked stale too when such data changes after it was approved, but only in the open period\n * (the one that contains the day of the change) and the last period that ended before it. Approved staff pays of older\n * periods are never marked. Changes to sessions, bookings, attendance and orders are found when the period is\n * calculated again (Bulk Calculate Staff Pays), and those to timecards, tips, pay models, profiles and settings when they\n * happen. An approved staff pay is never calculated again automatically: its approved result stays until it's reopened\n * and calculated again. `staleReasons` lists what changed.\n *\n * Default: `false`\n * @readonly\n */\n stale?: boolean;\n /**\n * Three-letter currency code of all amounts, in [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) alphabetic\n * format. Taken from the staff pay settings when the staff pay is calculated.\n * @format CURRENCY\n * @readonly\n */\n currency?: string;\n /**\n * Date and time the staff pay was last calculated.\n * @readonly\n */\n calculatedDate?: Date | null;\n /**\n * Date and time the staff pay was approved.\n * @readonly\n */\n approvedDate?: Date | null;\n /**\n * Totals from the last calculation.\n * @readonly\n */\n totals?: StaffPayTotals;\n /**\n * Pay lines from the last calculation, 1 per earning, including a line per adjustment.\n * @readonly\n * @maxSize 2000\n */\n lines?: PayLine[];\n /**\n * Manual adjustments: bonuses, deductions and reimbursements.\n *\n * Can be changed with Update Staff Pay while the staff pay isn't approved. Each adjustment becomes a\n * pay line the next time the staff pay is calculated.\n * @maxSize 100\n */\n adjustments?: Adjustment[];\n /**\n * Issues found during the last calculation, for example days without pay terms or a timecard that's still open.\n * @readonly\n * @maxSize 100\n */\n alerts?: StaffPayAlert[];\n /**\n * Hash of the data the last calculation used, after its format version. For example, `2:` followed by the hash.\n *\n * Used when an approved staff pay is reopened, to find out whether the data changed while it was approved. Hashes of\n * different format versions aren't compared: the gross amount, pay lines and alerts are compared instead.\n * @readonly\n * @maxLength 128\n */\n factsHash?: string;\n /**\n * IDs of the pay terms from the staff member's pay profile that the last calculation applied.\n * @readonly\n * @maxSize 50\n * @format GUID\n */\n payTermsIds?: string[];\n /**\n * What changed since the last calculation, or since approval for an approved staff pay, 1 entry per changed record.\n *\n * Empty when the staff pay isn't stale. Calculating the staff pay clears it.\n * @internal\n * @readonly\n * @maxSize 50\n */\n staleReasons?: StaleReason[];\n /**\n * Date and time the staff pay was last included in an export file from Export Staff Pays.\n *\n * Returned only when the staff pay was exported at least once. Kept when the staff pay is reopened, so a period still\n * shows that it was downloaded before.\n * @internal\n * @readonly\n */\n lastExportedDate?: Date | null;\n /**\n * Name of the staff member. Saved when the staff pay is calculated, and updated on all the staff member's staff pays,\n * approved ones too, when their name changes. Kept after the staff member is deleted, so past pay still shows a name.\n * @internal\n * @readonly\n * @maxLength 200\n */\n staffMemberName?: string | null;\n /**\n * Whether the period is a bridge period: the days between the last staff pay of an earlier pay schedule and the first\n * period of the site's current pay schedule, paid as 1 extra period. A bridge period pays no salary components.\n *\n * Set when the staff pay is created: `true` when the period ends the day before the pay schedule's first period and\n * starts the day after the site's last staff pay that ends before it. A staff pay created for a period that already\n * has staff pays takes their value. Not returned for staff pays created before this field existed: they aren't bridge\n * periods.\n * @internal\n * @readonly\n */\n bridgePeriod?: boolean | null;\n /**\n * Custom field data for the staff pay object.\n *\n * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n}\n\n/**\n * Deletes a staff pay.\n *\n * An approved staff pay can't be deleted until it's reopened with Reopen Staff Pay.\n *\n * To delete multiple staff pays in a single API call, call Bulk Delete Staff Pays.\n * @param staffPayId - ID of the staff pay to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:delete_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.DeleteStaffPay\n */\nexport async function deleteStaffPay(staffPayId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.deleteStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 staff pays, given the provided paging, filtering, and sorting.\n *\n * Query Staff Pays runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * To list a pay period, filter by `periodStartDate`. To list a staff member's pay history, filter by `staffMemberId`\n * and sort by `periodStartDate`.\n *\n * To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection).\n * @public\n * @documentationMaturity preview\n * @permissionId staff:pay:v1:staff_pay:query_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.QueryStaffPays\n */\nexport function queryStaffPays(): StaffPaysQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n StaffPay,\n 'CURSOR',\n QueryStaffPaysRequest,\n QueryStaffPaysResponse\n >({\n func: async (payload: QueryStaffPaysRequest) => {\n const reqOpts = ambassadorWixStaffPayV1StaffPay.queryStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryStaffPaysRequest['query']) => {\n const args = [query, {}] as [QueryStaffPaysRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryStaffPaysResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.staffPays,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface StaffPaysQueryResult extends QueryCursorResult {\n items: StaffPay[];\n query: StaffPaysQueryBuilder;\n next: () => Promise<StaffPaysQueryResult>;\n prev: () => Promise<StaffPaysQueryResult>;\n}\n\nexport interface StaffPaysQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ge: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n gt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n le: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n lt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n * @documentationMaturity preview\n */\n startsWith: (\n propertyName: '_id' | 'staffMemberId' | 'periodStartDate' | 'periodEndDate',\n value: string\n ) => StaffPaysQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale',\n value: boolean\n ) => StaffPaysQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n ascending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale'\n >\n ) => StaffPaysQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n descending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale'\n >\n ) => StaffPaysQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => StaffPaysQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => StaffPaysQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<StaffPaysQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.staff.pay.v1.StaffPayService.QueryStaffPays\n * @requiredField query\n */\nexport async function typedQueryStaffPays(\n query: StaffPayQuery\n): Promise<\n NonNullablePaths<\n QueryStaffPaysResponse,\n | `staffPays`\n | `staffPays.${number}.staffMemberId`\n | `staffPays.${number}.periodStartDate`\n | `staffPays.${number}.periodEndDate`\n | `staffPays.${number}.status`\n | `staffPays.${number}.stale`\n | `staffPays.${number}.currency`\n | `staffPays.${number}.totals.grossAmount`\n | `staffPays.${number}.totals.paidHours`\n | `staffPays.${number}.totals.overtimeHours`\n | `staffPays.${number}.totals.sessionsCount`\n | `staffPays.${number}.totals.serviceRevenueAmount`\n | `staffPays.${number}.totals.commissionAmount`\n | `staffPays.${number}.totals.tipsAmount`\n | `staffPays.${number}.totals.adjustmentsAmount`\n | `staffPays.${number}.totals.productRevenueAmount`\n | `staffPays.${number}.totals.planRevenueAmount`\n | `staffPays.${number}.totals.upcomingSessionsCount`\n | `staffPays.${number}.factsHash`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.queryStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface StaffPayQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: [\n '_createdDate',\n '_id',\n '_updatedDate',\n 'periodEndDate',\n 'periodStartDate',\n 'staffMemberId',\n 'stale',\n 'status'\n ];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n StaffPay,\n StaffPayQuerySpec\n>;\nexport type StaffPayQuery = {\n /** \n Cursor paging options.\n\n Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). \n */\n cursorPaging?: {\n /** \n Maximum number of items to return in the results. \n @max: 100 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n @maxLength: 16000 \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object.\n\n Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section). \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object.\n\n Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). \n @maxSize: 5 \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\nexport const utils = {\n query: /*#__PURE__*/ createQueryUtils<\n StaffPay,\n StaffPayQuerySpec,\n StaffPayQuery\n >(),\n};\n\n/**\n * Deletes multiple staff pays.\n *\n * Each staff pay is deleted on its own: an approved one isn't deleted and its result fails with `STAFF_PAY_APPROVED`,\n * while the others are still deleted.\n *\n * To delete a single staff pay, call Delete Staff Pay.\n * @param staffPayIds - IDs of the staff pays to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayIds\n * @permissionId staff:pay:v1:staff_pay:bulk_delete_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.BulkDeleteStaffPays\n */\nexport async function bulkDeleteStaffPays(staffPayIds: string[]): Promise<\n NonNullablePaths<\n BulkDeleteStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkDeleteStaffPaysApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayIds: staffPayIds,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.bulkDeleteStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Calculates a staff pay.\n *\n * Reads the staff member's data for the period: hours from Time Clock timecards, sessions with their attendance and\n * service revenue from Bookings, and tips from Wix Tips. Applies the pay terms in effect on each day and replaces the\n * staff pay's lines, totals and alerts. Moves a `DRAFT` staff pay to `CALCULATED` and clears `stale` and\n * `staleReasons`.\n *\n * The data is read with the caller's permissions. A source the caller isn't allowed to read pays nothing and adds a\n * `SOURCE_NOT_PERMITTED` alert, which blocks approval until someone allowed to read it calculates again.\n *\n * Currently supports commission on services. Product and pricing plan sales aren't read yet, so components paid on\n * them pay nothing.\n *\n * An approved staff pay can't be calculated until it's reopened with Reopen Staff Pay. To preview\n * a calculation without saving it, call Preview Staff Pay Calculation.\n * @param staffPayId - ID of the staff pay to calculate.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:calculate_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.CalculateStaffPay\n */\nexport async function calculateStaffPay(staffPayId: string): Promise<\n NonNullablePaths<\n CalculateStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: CalculateStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.calculateStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Calculates a staff pay again without saving anything, and returns it as it would be.\n *\n * The saved staff pay, its status and `stale` stay as they are. Compare the returned `totals` and `lines` with the\n * saved ones to see what calculating again would change. Works for an approved staff pay too, to show what changed\n * since approval. To apply the changes, call Reopen Staff Pay and then\n * Calculate Staff Pay.\n *\n * With `proposedClockOuts`, also shows what clocking out open timecards would pay, before the clock-outs are saved in\n * Time Clock. Each timecard is calculated as clocked out at its proposed time, and its open timecard alert is\n * removed.\n * @param staffPayId - ID of the staff pay to calculate again.\n * @public\n * @documentationMaturity preview\n * @requiredField options.proposedClockOuts.clockOut\n * @requiredField options.proposedClockOuts.timecardId\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:preview_staff_pay_calculation\n * @fqn wix.staff.pay.v1.StaffPayService.PreviewStaffPayCalculation\n */\nexport async function previewStaffPayCalculation(\n staffPayId: string,\n options?: NonNullablePaths<\n PreviewStaffPayCalculationOptions,\n | `proposedClockOuts.${number}.clockOut`\n | `proposedClockOuts.${number}.timecardId`,\n 2\n >\n): Promise<\n NonNullablePaths<\n PreviewStaffPayCalculationResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: PreviewStaffPayCalculationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n proposedClockOuts: options?.proposedClockOuts,\n });\n\n const reqOpts =\n ambassadorWixStaffPayV1StaffPay.previewStaffPayCalculation(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n staffPayId: '$[0]',\n proposedClockOuts: '$[1].proposedClockOuts',\n },\n singleArgumentUnchanged: false,\n },\n ['staffPayId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PreviewStaffPayCalculationOptions {\n /**\n * Clock-outs to calculate open timecards with, as if they were saved. They aren't saved: clock the timecards out in\n * Time Clock to keep them.\n *\n * Each must name an open timecard of the staff pay's staff member that clocked in within the period, at most once,\n * with a time after its clock-in. Otherwise, the request fails with `INVALID_PROPOSED_CLOCK_OUT`.\n *\n * Default: The timecards as they are.\n * @maxSize 50\n */\n proposedClockOuts?: ProposedClockOut[];\n}\n\n/**\n * Calculates a pay period for multiple staff members.\n *\n * Creates a `DRAFT` staff pay for each staff member who doesn't have one for the period yet, then calculates every\n * staff pay of the period that isn't approved. Approved staff pays keep their result. In the open period and the last\n * period that ended before it, an approved staff pay whose sessions, bookings, attendance or orders changed since\n * approval is marked `stale`, with the `SOURCE_DATA_CHANGED` reason. Without `staffMemberIds`, the staff members whose\n * pay terms are in effect on at least 1 day of the period are calculated.\n *\n * A period that has no staff pay yet must be one of the site's pay schedule's periods, as in Create Staff Pay.\n *\n * Each staff pay is calculated on its own, so one that fails doesn't affect the others.\n *\n * To calculate a single staff pay, call Calculate Staff Pay.\n * @param periodStartDate - First day of the pay period, in `YYYY-MM-DD` format.\n * @public\n * @documentationMaturity preview\n * @requiredField options.periodEndDate\n * @requiredField periodStartDate\n * @permissionId staff:pay:v1:staff_pay:bulk_calculate_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.BulkCalculateStaffPays\n */\nexport async function bulkCalculateStaffPays(\n periodStartDate: string,\n options?: NonNullablePaths<BulkCalculateStaffPaysOptions, `periodEndDate`, 0>\n): Promise<\n NonNullablePaths<\n BulkCalculateStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `results.${number}.item.staffMemberId`\n | `results.${number}.item.periodStartDate`\n | `results.${number}.item.periodEndDate`\n | `results.${number}.item.status`\n | `results.${number}.item.stale`\n | `results.${number}.item.currency`\n | `results.${number}.item.totals.grossAmount`\n | `results.${number}.item.totals.paidHours`\n | `results.${number}.item.totals.overtimeHours`\n | `results.${number}.item.totals.sessionsCount`\n | `results.${number}.item.totals.serviceRevenueAmount`\n | `results.${number}.item.totals.commissionAmount`\n | `results.${number}.item.totals.tipsAmount`\n | `results.${number}.item.totals.adjustmentsAmount`\n | `results.${number}.item.totals.productRevenueAmount`\n | `results.${number}.item.totals.planRevenueAmount`\n | `results.${number}.item.totals.upcomingSessionsCount`\n | `results.${number}.item.factsHash`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkCalculateStaffPaysApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n periodStartDate: periodStartDate,\n periodEndDate: options?.periodEndDate,\n staffMemberIds: options?.staffMemberIds,\n });\n\n const reqOpts =\n ambassadorWixStaffPayV1StaffPay.bulkCalculateStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n periodStartDate: '$[0]',\n periodEndDate: '$[1].periodEndDate',\n staffMemberIds: '$[1].staffMemberIds',\n },\n singleArgumentUnchanged: false,\n },\n ['periodStartDate', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkCalculateStaffPaysOptions {\n /**\n * Last day of the pay period (inclusive), in `YYYY-MM-DD` format.\n * @format LOCAL_DATE\n */\n periodEndDate: string;\n /**\n * IDs of the staff members to calculate.\n *\n * Default: The staff members whose pay terms are in effect on at least 1 day of the period.\n * @maxSize 500\n * @format GUID\n */\n staffMemberIds?: string[];\n}\n\n/**\n * Approves a calculated staff pay and locks its result.\n *\n * The current `revision` must be passed, so the approved result is the one that was reviewed.\n *\n * A staff pay can't be approved while it's stale, while a timecard it pays was clocked out automatically, or while a\n * source its last calculation couldn't read is missing. Calculate it again first. To change an approved staff pay,\n * call Reopen Staff Pay.\n *\n * To approve multiple staff pays in a single API call, call Bulk Approve Staff Pays.\n * @param staffPayId - ID of the staff pay to approve.\n * @param revision - Current revision of the staff pay.\n * @public\n * @documentationMaturity preview\n * @requiredField revision\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:approve_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.ApproveStaffPay\n */\nexport async function approveStaffPay(\n staffPayId: string,\n revision: string\n): Promise<\n NonNullablePaths<\n ApproveStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: ApproveStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n revision: revision,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.approveStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]', revision: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId', 'revision']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Approves multiple calculated staff pays.\n *\n * Each staff pay is approved on its own at its current revision: one that can't be approved fails without affecting\n * the others.\n *\n * To approve a single staff pay, call Approve Staff Pay.\n * @param staffPayIds - IDs of the staff pays to approve.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayIds\n * @permissionId staff:pay:v1:staff_pay:bulk_approve_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.BulkApproveStaffPays\n */\nexport async function bulkApproveStaffPays(\n staffPayIds: string[]\n): Promise<\n NonNullablePaths<\n BulkApproveStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayIds: staffPayIds,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.bulkApproveStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Reopens an approved staff pay so it can be changed and calculated again.\n *\n * Moves the staff pay back to `CALCULATED`. Its approved result stays until it's calculated again. The staff pay is\n * stale when its data changed while it was approved, and it keeps its `staleReasons`.\n * @param staffPayId - ID of the staff pay to reopen.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:reopen_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.ReopenStaffPay\n */\nexport async function reopenStaffPay(staffPayId: string): Promise<\n NonNullablePaths<\n ReopenStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: ReopenStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.reopenStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Exports the approved staff pays of a pay period as a CSV file.\n *\n * Uses the requested `format`, or the format in the site's export settings when none is specified. Staff pays of the\n * period that aren't approved are left out and counted in `skippedCount`. Sets `lastExportedDate` on each exported\n * staff pay.\n * @param periodStartDate - First day of the pay period to export, in `YYYY-MM-DD` format.\n * @public\n * @documentationMaturity preview\n * @requiredField periodStartDate\n * @permissionId staff:pay:v1:staff_pay:export_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.ExportStaffPays\n */\nexport async function exportStaffPays(\n periodStartDate: string,\n options?: ExportStaffPaysOptions\n): Promise<\n NonNullablePaths<\n ExportStaffPaysResponse,\n `fileName` | `content` | `skippedCount`,\n 0\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n periodStartDate: periodStartDate,\n format: options?.format,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.exportStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n periodStartDate: '$[0]',\n format: '$[1].format',\n },\n singleArgumentUnchanged: false,\n },\n ['periodStartDate', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ExportStaffPaysOptions {\n /**\n * Export format.\n *\n * Default: The format in the site's export settings.\n */\n format?: ExportFormatWithLiterals;\n}\n\n/**\n * Calculates what a pay model would pay for a set of sample data, without saving anything.\n *\n * The pay model doesn't need to be saved first. Use it to show what a pay model pays while it's being edited.\n * @param payModel - Pay model to preview. May be unsaved.\n * @public\n * @documentationMaturity preview\n * @requiredField options\n * @requiredField options.sampleFacts\n * @requiredField payModel\n * @permissionId staff:pay:v1:staff_pay:preview_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.PreviewStaffPay\n */\nexport async function previewStaffPay(\n payModel: PayModel,\n options: NonNullablePaths<PreviewStaffPayOptions, `sampleFacts`, 0>\n): Promise<\n NonNullablePaths<\n PreviewStaffPayResponse,\n | `components`\n | `components.${number}.componentName`\n | `components.${number}.amount`\n | `components.${number}.included`\n | `components.${number}.explanation`\n | `grossAmount`,\n 2\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n payModel: payModel,\n sampleFacts: options?.sampleFacts,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.previewStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n payModel: '$[0]',\n sampleFacts: '$[1].sampleFacts',\n },\n singleArgumentUnchanged: false,\n },\n ['payModel', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PreviewStaffPayOptions {\n /** Sample data for 1 staff member over 1 pay period. */\n sampleFacts: SampleFacts;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nconst TRANSFORM_PATHS_0 = [\n { path: 'staffPay.createdDate' },\n { path: 'staffPay.updatedDate' },\n { path: 'staffPay.calculatedDate' },\n { path: 'staffPay.approvedDate' },\n { path: 'staffPay.lastExportedDate' },\n { path: 'staffPay.staleReasons.changedDate' },\n];\nconst TRANSFORM_PATHS_1 = [{ path: 'fieldMask' }];\nconst TRANSFORM_PATHS_2 = [\n { path: 'staffPays.createdDate' },\n { path: 'staffPays.updatedDate' },\n { path: 'staffPays.calculatedDate' },\n { path: 'staffPays.approvedDate' },\n { path: 'staffPays.lastExportedDate' },\n { path: 'staffPays.staleReasons.changedDate' },\n];\nconst TRANSFORM_PATHS_3 = [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n { path: 'results.item.calculatedDate' },\n { path: 'results.item.approvedDate' },\n { path: 'results.item.lastExportedDate' },\n { path: 'results.item.staleReasons.changedDate' },\n];\nconst TRANSFORM_PATHS_4 = [\n { path: 'payModel.createdDate' },\n { path: 'payModel.updatedDate' },\n { path: 'payModel.archivedDate' },\n];\n\nfunction resolveWixStaffPayV1StaffPayServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/staff-pay',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_staff-pay_staff-pay';\n\n/**\n * Creates a `DRAFT` staff pay for a staff member and pay period.\n *\n * A pay period is at most 62 days long, and a staff member's staff pays can't overlap. When the site has a pay schedule,\n * a period that has no staff pay yet must be one of the schedule's periods, from its first period on, or the days\n * between the last staff pay and the first period. To calculate the staff pay, call Calculate Staff Pay. To create and calculate a whole period at once, call\n * Bulk Calculate Staff Pays.\n */\nexport function createStaffPay(payload: object): RequestOptionsFactory<any> {\n function __createStaffPay({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.CreateStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createStaffPay;\n}\n\n/** Retrieves a staff pay, including its pay lines. */\nexport function getStaffPay(payload: object): RequestOptionsFactory<any> {\n function __getStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'GET' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.GetStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getStaffPay;\n}\n\n/**\n * Updates a staff pay's adjustments and extended fields.\n *\n * Each time the staff pay is updated, `revision` increments by 1. The current `revision` must be passed when updating\n * the staff pay. This ensures you're working with the latest staff pay and prevents unintended overwrites.\n *\n * Supported properties: `adjustments`, `extendedFields`. Other paths in `fieldMask` are ignored.\n *\n * Adjustments are bonuses, deductions and reimbursements, and each becomes a pay line. A wrong calculated amount isn't\n * corrected here: fix its source, such as the timecard or booking, and calculate the staff pay again. Changing the\n * adjustments of a calculated staff pay marks it stale. An approved staff pay can't be updated until it's reopened with\n * Reopen Staff Pay.\n */\nexport function updateStaffPay(payload: object): RequestOptionsFactory<any> {\n function __updateStaffPay({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: TRANSFORM_PATHS_1,\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'PATCH' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.UpdateStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPay.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateStaffPay;\n}\n\n/**\n * Deletes a staff pay.\n *\n * An approved staff pay can't be deleted until it's reopened with Reopen Staff Pay.\n *\n * To delete multiple staff pays in a single API call, call Bulk Delete Staff Pays.\n */\nexport function deleteStaffPay(payload: object): RequestOptionsFactory<any> {\n function __deleteStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'DELETE' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.DeleteStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteStaffPay;\n}\n\n/**\n * Retrieves a list of up to 100 staff pays, given the provided paging, filtering, and sorting.\n *\n * Query Staff Pays runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * To list a pay period, filter by `periodStartDate`. To list a staff member's pay history, filter by `staffMemberId`\n * and sort by `periodStartDate`.\n *\n * To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection).\n */\nexport function queryStaffPays(payload: object): RequestOptionsFactory<any> {\n function __queryStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'GET' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.QueryStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/query',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload, true),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_2,\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryStaffPays;\n}\n\n/**\n * Deletes multiple staff pays.\n *\n * Each staff pay is deleted on its own: an approved one isn't deleted and its result fails with `STAFF_PAY_APPROVED`,\n * while the others are still deleted.\n *\n * To delete a single staff pay, call Delete Staff Pay.\n */\nexport function bulkDeleteStaffPays(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkDeleteStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.BulkDeleteStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/bulk/staff-pays/delete',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkDeleteStaffPays;\n}\n\n/**\n * Calculates a staff pay.\n *\n * Reads the staff member's data for the period: hours from Time Clock timecards, sessions with their attendance and\n * service revenue from Bookings, and tips from Wix Tips. Applies the pay terms in effect on each day and replaces the\n * staff pay's lines, totals and alerts. Moves a `DRAFT` staff pay to `CALCULATED` and clears `stale` and\n * `staleReasons`.\n *\n * The data is read with the caller's permissions. A source the caller isn't allowed to read pays nothing and adds a\n * `SOURCE_NOT_PERMITTED` alert, which blocks approval until someone allowed to read it calculates again.\n *\n * Currently supports commission on services. Product and pricing plan sales aren't read yet, so components paid on\n * them pay nothing.\n *\n * An approved staff pay can't be calculated until it's reopened with Reopen Staff Pay. To preview\n * a calculation without saving it, call Preview Staff Pay Calculation.\n */\nexport function calculateStaffPay(payload: object): RequestOptionsFactory<any> {\n function __calculateStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.CalculateStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}/calculate',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __calculateStaffPay;\n}\n\n/**\n * Calculates a staff pay again without saving anything, and returns it as it would be.\n *\n * The saved staff pay, its status and `stale` stay as they are. Compare the returned `totals` and `lines` with the\n * saved ones to see what calculating again would change. Works for an approved staff pay too, to show what changed\n * since approval. To apply the changes, call Reopen Staff Pay and then\n * Calculate Staff Pay.\n *\n * With `proposedClockOuts`, also shows what clocking out open timecards would pay, before the clock-outs are saved in\n * Time Clock. Each timecard is calculated as clocked out at its proposed time, and its open timecard alert is\n * removed.\n */\nexport function previewStaffPayCalculation(\n payload: object\n): RequestOptionsFactory<any> {\n function __previewStaffPayCalculation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.PreviewStaffPayCalculation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}/preview-calculation',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __previewStaffPayCalculation;\n}\n\n/**\n * Calculates a pay period for multiple staff members.\n *\n * Creates a `DRAFT` staff pay for each staff member who doesn't have one for the period yet, then calculates every\n * staff pay of the period that isn't approved. Approved staff pays keep their result. In the open period and the last\n * period that ended before it, an approved staff pay whose sessions, bookings, attendance or orders changed since\n * approval is marked `stale`, with the `SOURCE_DATA_CHANGED` reason. Without `staffMemberIds`, the staff members whose\n * pay terms are in effect on at least 1 day of the period are calculated.\n *\n * A period that has no staff pay yet must be one of the site's pay schedule's periods, as in Create Staff Pay.\n *\n * Each staff pay is calculated on its own, so one that fails doesn't affect the others.\n *\n * To calculate a single staff pay, call Calculate Staff Pay.\n */\nexport function bulkCalculateStaffPays(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkCalculateStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.BulkCalculateStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/bulk/staff-pays/calculate',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_3,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCalculateStaffPays;\n}\n\n/**\n * Approves a calculated staff pay and locks its result.\n *\n * The current `revision` must be passed, so the approved result is the one that was reviewed.\n *\n * A staff pay can't be approved while it's stale, while a timecard it pays was clocked out automatically, or while a\n * source its last calculation couldn't read is missing. Calculate it again first. To change an approved staff pay,\n * call Reopen Staff Pay.\n *\n * To approve multiple staff pays in a single API call, call Bulk Approve Staff Pays.\n */\nexport function approveStaffPay(payload: object): RequestOptionsFactory<any> {\n function __approveStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.ApproveStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}/approve',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __approveStaffPay;\n}\n\n/**\n * Approves multiple calculated staff pays.\n *\n * Each staff pay is approved on its own at its current revision: one that can't be approved fails without affecting\n * the others.\n *\n * To approve a single staff pay, call Approve Staff Pay.\n */\nexport function bulkApproveStaffPays(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkApproveStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.BulkApproveStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/bulk/staff-pays/approve',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkApproveStaffPays;\n}\n\n/**\n * Reopens an approved staff pay so it can be changed and calculated again.\n *\n * Moves the staff pay back to `CALCULATED`. Its approved result stays until it's calculated again. The staff pay is\n * stale when its data changed while it was approved, and it keeps its `staleReasons`.\n */\nexport function reopenStaffPay(payload: object): RequestOptionsFactory<any> {\n function __reopenStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.ReopenStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}/reopen',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __reopenStaffPay;\n}\n\n/**\n * Exports the approved staff pays of a pay period as a CSV file.\n *\n * Uses the requested `format`, or the format in the site's export settings when none is specified. Staff pays of the\n * period that aren't approved are left out and counted in `skippedCount`. Sets `lastExportedDate` on each exported\n * staff pay.\n */\nexport function exportStaffPays(payload: object): RequestOptionsFactory<any> {\n function __exportStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.ExportStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/export',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __exportStaffPays;\n}\n\n/**\n * Calculates what a pay model would pay for a set of sample data, without saving anything.\n *\n * The pay model doesn't need to be saved first. Use it to show what a pay model pays while it's being edited.\n */\nexport function previewStaffPay(payload: object): RequestOptionsFactory<any> {\n function __previewStaffPay({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: TRANSFORM_PATHS_4,\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.PreviewStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/preview',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __previewStaffPay;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ApproveStaffPayApplicationErrors,\n ApproveStaffPayResponse,\n BulkApproveStaffPaysResponse,\n BulkCalculateStaffPaysApplicationErrors,\n BulkCalculateStaffPaysOptions,\n BulkCalculateStaffPaysResponse,\n BulkDeleteStaffPaysApplicationErrors,\n BulkDeleteStaffPaysResponse,\n CalculateStaffPayApplicationErrors,\n CalculateStaffPayResponse,\n CreateStaffPayApplicationErrors,\n DeleteStaffPayApplicationErrors,\n ExportStaffPaysOptions,\n ExportStaffPaysResponse,\n PayModel,\n PreviewStaffPayCalculationApplicationErrors,\n PreviewStaffPayCalculationOptions,\n PreviewStaffPayCalculationResponse,\n PreviewStaffPayOptions,\n PreviewStaffPayResponse,\n QueryStaffPaysResponse,\n ReopenStaffPayApplicationErrors,\n ReopenStaffPayResponse,\n StaffPay,\n StaffPayQuery,\n StaffPaysQueryBuilder,\n UpdateStaffPay,\n UpdateStaffPayApplicationErrors,\n approveStaffPay as universalApproveStaffPay,\n bulkApproveStaffPays as universalBulkApproveStaffPays,\n bulkCalculateStaffPays as universalBulkCalculateStaffPays,\n bulkDeleteStaffPays as universalBulkDeleteStaffPays,\n calculateStaffPay as universalCalculateStaffPay,\n createStaffPay as universalCreateStaffPay,\n deleteStaffPay as universalDeleteStaffPay,\n exportStaffPays as universalExportStaffPays,\n getStaffPay as universalGetStaffPay,\n previewStaffPay as universalPreviewStaffPay,\n previewStaffPayCalculation as universalPreviewStaffPayCalculation,\n queryStaffPays as universalQueryStaffPays,\n reopenStaffPay as universalReopenStaffPay,\n typedQueryStaffPays as universalTypedQueryStaffPays,\n updateStaffPay as universalUpdateStaffPay,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/staff-pay' };\n\nexport function createStaffPay(\n httpClient: HttpClient\n): CreateStaffPaySignature {\n return (\n staffPay: NonNullablePaths<\n StaffPay,\n `periodEndDate` | `periodStartDate` | `staffMemberId`,\n 0\n >\n ) =>\n universalCreateStaffPay(\n staffPay,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateStaffPaySignature {\n /**\n * Creates a `DRAFT` staff pay for a staff member and pay period.\n *\n * A pay period is at most 62 days long, and a staff member's staff pays can't overlap. When the site has a pay schedule,\n * a period that has no staff pay yet must be one of the schedule's periods, from its first period on, or the days\n * between the last staff pay and the first period. To calculate the staff pay, call Calculate Staff Pay. To create and calculate a whole period at once, call\n * Bulk Calculate Staff Pays.\n * @param - Staff pay to create.\n * @returns Created staff pay.\n */\n (\n staffPay: NonNullablePaths<\n StaffPay,\n `periodEndDate` | `periodStartDate` | `staffMemberId`,\n 0\n >\n ): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n > & {\n __applicationErrorsType?: CreateStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function getStaffPay(httpClient: HttpClient): GetStaffPaySignature {\n return (staffPayId: string) =>\n universalGetStaffPay(\n staffPayId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetStaffPaySignature {\n /**\n * Retrieves a staff pay, including its pay lines.\n * @param - ID of the staff pay to retrieve.\n * @returns Retrieved staff pay.\n */\n (staffPayId: string): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n >\n >;\n}\n\nexport function updateStaffPay(\n httpClient: HttpClient\n): UpdateStaffPaySignature {\n return (\n _id: string,\n staffPay: NonNullablePaths<UpdateStaffPay, `revision`, 0>\n ) =>\n universalUpdateStaffPay(\n _id,\n staffPay,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateStaffPaySignature {\n /**\n * Updates a staff pay's adjustments and extended fields.\n *\n * Each time the staff pay is updated, `revision` increments by 1. The current `revision` must be passed when updating\n * the staff pay. This ensures you're working with the latest staff pay and prevents unintended overwrites.\n *\n * Supported properties: `adjustments`, `extendedFields`. Other paths in `fieldMask` are ignored.\n *\n * Adjustments are bonuses, deductions and reimbursements, and each becomes a pay line. A wrong calculated amount isn't\n * corrected here: fix its source, such as the timecard or booking, and calculate the staff pay again. Changing the\n * adjustments of a calculated staff pay marks it stale. An approved staff pay can't be updated until it's reopened with\n * Reopen Staff Pay.\n * @param - Staff pay ID.\n * @returns Updated staff pay.\n */\n (\n _id: string,\n staffPay: NonNullablePaths<UpdateStaffPay, `revision`, 0>\n ): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n > & {\n __applicationErrorsType?: UpdateStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function deleteStaffPay(\n httpClient: HttpClient\n): DeleteStaffPaySignature {\n return (staffPayId: string) =>\n universalDeleteStaffPay(\n staffPayId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteStaffPaySignature {\n /**\n * Deletes a staff pay.\n *\n * An approved staff pay can't be deleted until it's reopened with Reopen Staff Pay.\n *\n * To delete multiple staff pays in a single API call, call Bulk Delete Staff Pays.\n * @param - ID of the staff pay to delete.\n */\n (staffPayId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function queryStaffPays(\n httpClient: HttpClient\n): QueryStaffPaysSignature {\n return () =>\n universalQueryStaffPays(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryStaffPaysSignature {\n /**\n * Retrieves a list of up to 100 staff pays, given the provided paging, filtering, and sorting.\n *\n * Query Staff Pays runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * To list a pay period, filter by `periodStartDate`. To list a staff member's pay history, filter by `staffMemberId`\n * and sort by `periodStartDate`.\n *\n * To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection).\n */\n (): StaffPaysQueryBuilder;\n}\n\nexport function typedQueryStaffPays(\n httpClient: HttpClient\n): TypedQueryStaffPaysSignature {\n return (query: StaffPayQuery) =>\n universalTypedQueryStaffPays(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryStaffPaysSignature {\n /** */\n (query: StaffPayQuery): Promise<\n NonNullablePaths<\n QueryStaffPaysResponse,\n | `staffPays`\n | `staffPays.${number}.staffMemberId`\n | `staffPays.${number}.periodStartDate`\n | `staffPays.${number}.periodEndDate`\n | `staffPays.${number}.status`\n | `staffPays.${number}.stale`\n | `staffPays.${number}.currency`\n | `staffPays.${number}.totals.grossAmount`\n | `staffPays.${number}.totals.paidHours`\n | `staffPays.${number}.totals.overtimeHours`\n | `staffPays.${number}.totals.sessionsCount`\n | `staffPays.${number}.totals.serviceRevenueAmount`\n | `staffPays.${number}.totals.commissionAmount`\n | `staffPays.${number}.totals.tipsAmount`\n | `staffPays.${number}.totals.adjustmentsAmount`\n | `staffPays.${number}.totals.productRevenueAmount`\n | `staffPays.${number}.totals.planRevenueAmount`\n | `staffPays.${number}.totals.upcomingSessionsCount`\n | `staffPays.${number}.factsHash`,\n 3\n >\n >;\n}\n\nexport function bulkDeleteStaffPays(\n httpClient: HttpClient\n): BulkDeleteStaffPaysSignature {\n return (staffPayIds: string[]) =>\n universalBulkDeleteStaffPays(\n staffPayIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkDeleteStaffPaysSignature {\n /**\n * Deletes multiple staff pays.\n *\n * Each staff pay is deleted on its own: an approved one isn't deleted and its result fails with `STAFF_PAY_APPROVED`,\n * while the others are still deleted.\n *\n * To delete a single staff pay, call Delete Staff Pay.\n * @param - IDs of the staff pays to delete.\n */\n (staffPayIds: string[]): Promise<\n NonNullablePaths<\n BulkDeleteStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkDeleteStaffPaysApplicationErrors;\n }\n >;\n}\n\nexport function calculateStaffPay(\n httpClient: HttpClient\n): CalculateStaffPaySignature {\n return (staffPayId: string) =>\n universalCalculateStaffPay(\n staffPayId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CalculateStaffPaySignature {\n /**\n * Calculates a staff pay.\n *\n * Reads the staff member's data for the period: hours from Time Clock timecards, sessions with their attendance and\n * service revenue from Bookings, and tips from Wix Tips. Applies the pay terms in effect on each day and replaces the\n * staff pay's lines, totals and alerts. Moves a `DRAFT` staff pay to `CALCULATED` and clears `stale` and\n * `staleReasons`.\n *\n * The data is read with the caller's permissions. A source the caller isn't allowed to read pays nothing and adds a\n * `SOURCE_NOT_PERMITTED` alert, which blocks approval until someone allowed to read it calculates again.\n *\n * Currently supports commission on services. Product and pricing plan sales aren't read yet, so components paid on\n * them pay nothing.\n *\n * An approved staff pay can't be calculated until it's reopened with Reopen Staff Pay. To preview\n * a calculation without saving it, call Preview Staff Pay Calculation.\n * @param - ID of the staff pay to calculate.\n */\n (staffPayId: string): Promise<\n NonNullablePaths<\n CalculateStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: CalculateStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function previewStaffPayCalculation(\n httpClient: HttpClient\n): PreviewStaffPayCalculationSignature {\n return (\n staffPayId: string,\n options?: NonNullablePaths<\n PreviewStaffPayCalculationOptions,\n | `proposedClockOuts.${number}.clockOut`\n | `proposedClockOuts.${number}.timecardId`,\n 2\n >\n ) =>\n universalPreviewStaffPayCalculation(\n staffPayId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PreviewStaffPayCalculationSignature {\n /**\n * Calculates a staff pay again without saving anything, and returns it as it would be.\n *\n * The saved staff pay, its status and `stale` stay as they are. Compare the returned `totals` and `lines` with the\n * saved ones to see what calculating again would change. Works for an approved staff pay too, to show what changed\n * since approval. To apply the changes, call Reopen Staff Pay and then\n * Calculate Staff Pay.\n *\n * With `proposedClockOuts`, also shows what clocking out open timecards would pay, before the clock-outs are saved in\n * Time Clock. Each timecard is calculated as clocked out at its proposed time, and its open timecard alert is\n * removed.\n * @param - ID of the staff pay to calculate again.\n */\n (\n staffPayId: string,\n options?: NonNullablePaths<\n PreviewStaffPayCalculationOptions,\n | `proposedClockOuts.${number}.clockOut`\n | `proposedClockOuts.${number}.timecardId`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n PreviewStaffPayCalculationResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: PreviewStaffPayCalculationApplicationErrors;\n }\n >;\n}\n\nexport function bulkCalculateStaffPays(\n httpClient: HttpClient\n): BulkCalculateStaffPaysSignature {\n return (\n periodStartDate: string,\n options?: NonNullablePaths<\n BulkCalculateStaffPaysOptions,\n `periodEndDate`,\n 0\n >\n ) =>\n universalBulkCalculateStaffPays(\n periodStartDate,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkCalculateStaffPaysSignature {\n /**\n * Calculates a pay period for multiple staff members.\n *\n * Creates a `DRAFT` staff pay for each staff member who doesn't have one for the period yet, then calculates every\n * staff pay of the period that isn't approved. Approved staff pays keep their result. In the open period and the last\n * period that ended before it, an approved staff pay whose sessions, bookings, attendance or orders changed since\n * approval is marked `stale`, with the `SOURCE_DATA_CHANGED` reason. Without `staffMemberIds`, the staff members whose\n * pay terms are in effect on at least 1 day of the period are calculated.\n *\n * A period that has no staff pay yet must be one of the site's pay schedule's periods, as in Create Staff Pay.\n *\n * Each staff pay is calculated on its own, so one that fails doesn't affect the others.\n *\n * To calculate a single staff pay, call Calculate Staff Pay.\n * @param - First day of the pay period, in `YYYY-MM-DD` format.\n */\n (\n periodStartDate: string,\n options?: NonNullablePaths<\n BulkCalculateStaffPaysOptions,\n `periodEndDate`,\n 0\n >\n ): Promise<\n NonNullablePaths<\n BulkCalculateStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `results.${number}.item.staffMemberId`\n | `results.${number}.item.periodStartDate`\n | `results.${number}.item.periodEndDate`\n | `results.${number}.item.status`\n | `results.${number}.item.stale`\n | `results.${number}.item.currency`\n | `results.${number}.item.totals.grossAmount`\n | `results.${number}.item.totals.paidHours`\n | `results.${number}.item.totals.overtimeHours`\n | `results.${number}.item.totals.sessionsCount`\n | `results.${number}.item.totals.serviceRevenueAmount`\n | `results.${number}.item.totals.commissionAmount`\n | `results.${number}.item.totals.tipsAmount`\n | `results.${number}.item.totals.adjustmentsAmount`\n | `results.${number}.item.totals.productRevenueAmount`\n | `results.${number}.item.totals.planRevenueAmount`\n | `results.${number}.item.totals.upcomingSessionsCount`\n | `results.${number}.item.factsHash`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkCalculateStaffPaysApplicationErrors;\n }\n >;\n}\n\nexport function approveStaffPay(\n httpClient: HttpClient\n): ApproveStaffPaySignature {\n return (staffPayId: string, revision: string) =>\n universalApproveStaffPay(\n staffPayId,\n revision,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ApproveStaffPaySignature {\n /**\n * Approves a calculated staff pay and locks its result.\n *\n * The current `revision` must be passed, so the approved result is the one that was reviewed.\n *\n * A staff pay can't be approved while it's stale, while a timecard it pays was clocked out automatically, or while a\n * source its last calculation couldn't read is missing. Calculate it again first. To change an approved staff pay,\n * call Reopen Staff Pay.\n *\n * To approve multiple staff pays in a single API call, call Bulk Approve Staff Pays.\n * @param - ID of the staff pay to approve.\n * @param - Current revision of the staff pay.\n */\n (staffPayId: string, revision: string): Promise<\n NonNullablePaths<\n ApproveStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: ApproveStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function bulkApproveStaffPays(\n httpClient: HttpClient\n): BulkApproveStaffPaysSignature {\n return (staffPayIds: string[]) =>\n universalBulkApproveStaffPays(\n staffPayIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkApproveStaffPaysSignature {\n /**\n * Approves multiple calculated staff pays.\n *\n * Each staff pay is approved on its own at its current revision: one that can't be approved fails without affecting\n * the others.\n *\n * To approve a single staff pay, call Approve Staff Pay.\n * @param - IDs of the staff pays to approve.\n */\n (staffPayIds: string[]): Promise<\n NonNullablePaths<\n BulkApproveStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n >\n >;\n}\n\nexport function reopenStaffPay(\n httpClient: HttpClient\n): ReopenStaffPaySignature {\n return (staffPayId: string) =>\n universalReopenStaffPay(\n staffPayId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ReopenStaffPaySignature {\n /**\n * Reopens an approved staff pay so it can be changed and calculated again.\n *\n * Moves the staff pay back to `CALCULATED`. Its approved result stays until it's calculated again. The staff pay is\n * stale when its data changed while it was approved, and it keeps its `staleReasons`.\n * @param - ID of the staff pay to reopen.\n */\n (staffPayId: string): Promise<\n NonNullablePaths<\n ReopenStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: ReopenStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function exportStaffPays(\n httpClient: HttpClient\n): ExportStaffPaysSignature {\n return (periodStartDate: string, options?: ExportStaffPaysOptions) =>\n universalExportStaffPays(\n periodStartDate,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ExportStaffPaysSignature {\n /**\n * Exports the approved staff pays of a pay period as a CSV file.\n *\n * Uses the requested `format`, or the format in the site's export settings when none is specified. Staff pays of the\n * period that aren't approved are left out and counted in `skippedCount`. Sets `lastExportedDate` on each exported\n * staff pay.\n * @param - First day of the pay period to export, in `YYYY-MM-DD` format.\n */\n (periodStartDate: string, options?: ExportStaffPaysOptions): Promise<\n NonNullablePaths<\n ExportStaffPaysResponse,\n `fileName` | `content` | `skippedCount`,\n 0\n >\n >;\n}\n\nexport function previewStaffPay(\n httpClient: HttpClient\n): PreviewStaffPaySignature {\n return (\n payModel: PayModel,\n options: NonNullablePaths<PreviewStaffPayOptions, `sampleFacts`, 0>\n ) =>\n universalPreviewStaffPay(\n payModel,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PreviewStaffPaySignature {\n /**\n * Calculates what a pay model would pay for a set of sample data, without saving anything.\n *\n * The pay model doesn't need to be saved first. Use it to show what a pay model pays while it's being edited.\n * @param - Pay model to preview. May be unsaved.\n */\n (\n payModel: PayModel,\n options: NonNullablePaths<PreviewStaffPayOptions, `sampleFacts`, 0>\n ): Promise<\n NonNullablePaths<\n PreviewStaffPayResponse,\n | `components`\n | `components.${number}.componentName`\n | `components.${number}.amount`\n | `components.${number}.included`\n | `components.${number}.explanation`\n | `grossAmount`,\n 2\n >\n >;\n}\n\nexport {\n AccountInfo,\n ActionEvent,\n Adjustment,\n AdjustmentType,\n ApplicationError,\n ApproveStaffPayRequest,\n ApproveStaffPayResponse,\n AttendanceTier,\n AttendanceTiersOptions,\n AttendeeCountBasis,\n BasePlusPerHeadOptions,\n BulkActionMetadata,\n BulkApproveStaffPaysRequest,\n BulkApproveStaffPaysResponse,\n BulkCalculateStaffPaysOptions,\n BulkCalculateStaffPaysRequest,\n BulkCalculateStaffPaysResponse,\n BulkCalculateStaffPaysResponseBulkStaffPayResult,\n BulkDeleteStaffPaysRequest,\n BulkDeleteStaffPaysResponse,\n BulkDeleteStaffPaysResponseBulkStaffPayResult,\n BulkStaffPayResult,\n CalculateStaffPayRequest,\n CalculateStaffPayResponse,\n Combinator,\n CombinatorOptionsOneOf,\n CombinatorType,\n CommissionTier,\n CommissionTierMode,\n ComponentPreview,\n ComponentType,\n CostDeduction,\n CostDeductionKindOneOf,\n CreateStaffPayRequest,\n CreateStaffPayResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DeleteStaffPayRequest,\n DeleteStaffPayResponse,\n DiscountBasis,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n ExportFormat,\n ExportStaffPaysOptions,\n ExportStaffPaysRequest,\n ExportStaffPaysResponse,\n ExtendedFields,\n ExtraAttendeeTier,\n FlatPerSessionOptions,\n GetStaffPayRequest,\n GetStaffPayResponse,\n GreaterOfOptions,\n HourlyOptions,\n IdentificationData,\n IdentificationDataIdOneOf,\n ItemMetadata,\n MessageEnvelope,\n PayComponent,\n PayComponentOptionsOneOf,\n PayLine,\n PayLineSource,\n PayLineSourceType,\n PayLineType,\n PayModel,\n PerCourseOptions,\n PlanSaleCommissionOptions,\n PreviewStaffPayCalculationOptions,\n PreviewStaffPayCalculationRequest,\n PreviewStaffPayCalculationResponse,\n PreviewStaffPayOptions,\n PreviewStaffPayRequest,\n PreviewStaffPayResponse,\n ProductCommissionOptions,\n ProposedClockOut,\n QuantityUnit,\n QueryStaffPaysRequest,\n QueryStaffPaysResponse,\n ReopenStaffPayRequest,\n ReopenStaffPayResponse,\n RestoreInfo,\n RevenueRules,\n SalaryOptions,\n SampleFacts,\n SamplePlanOrder,\n SampleSession,\n ServiceCommissionOptions,\n SortOrder,\n Sorting,\n StaffPay,\n StaffPayAlert,\n StaffPayAlertType,\n StaffPayQuerySpec,\n StaffPayStatus,\n StaffPayTotals,\n StaffPaysQueryBuilder,\n StaffPaysQueryResult,\n StaleReason,\n StaleReasonType,\n TaxBasis,\n TipsOptions,\n UpdateStaffPay,\n UpdateStaffPayRequest,\n UpdateStaffPayResponse,\n WebhookIdentityType,\n utils,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\n","import {\n createStaffPay as publicCreateStaffPay,\n getStaffPay as publicGetStaffPay,\n updateStaffPay as publicUpdateStaffPay,\n deleteStaffPay as publicDeleteStaffPay,\n queryStaffPays as publicQueryStaffPays,\n typedQueryStaffPays as publicTypedQueryStaffPays,\n bulkDeleteStaffPays as publicBulkDeleteStaffPays,\n calculateStaffPay as publicCalculateStaffPay,\n previewStaffPayCalculation as publicPreviewStaffPayCalculation,\n bulkCalculateStaffPays as publicBulkCalculateStaffPays,\n approveStaffPay as publicApproveStaffPay,\n bulkApproveStaffPays as publicBulkApproveStaffPays,\n reopenStaffPay as publicReopenStaffPay,\n exportStaffPays as publicExportStaffPays,\n previewStaffPay as publicPreviewStaffPay,\n} from './staff-pay-v1-staff-pay-staff-pay.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n StaffPayQuery,\n StaffPaysQueryBuilder,\n typedQueryStaffPays as universalTypedQueryStaffPays,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\n\nfunction customQueryStaffPays(httpClient: HttpClient) {\n const router = /*#__PURE__*/ createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryStaffPays(httpClient)(),\n typedQueryFunction: (query: StaffPayQuery) =>\n publicTypedQueryStaffPays(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): StaffPaysQueryBuilder;\n function overloadedQuery(\n query: StaffPayQuery\n ): ReturnType<typeof universalTypedQueryStaffPays>;\n function overloadedQuery(query?: StaffPayQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const createStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicCreateStaffPay> & typeof publicCreateStaffPay\n> = /*#__PURE__*/ createRESTModule(publicCreateStaffPay);\nexport const getStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicGetStaffPay> & typeof publicGetStaffPay\n> = /*#__PURE__*/ createRESTModule(publicGetStaffPay);\nexport const updateStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicUpdateStaffPay> & typeof publicUpdateStaffPay\n> = /*#__PURE__*/ createRESTModule(publicUpdateStaffPay);\nexport const deleteStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicDeleteStaffPay> & typeof publicDeleteStaffPay\n> = /*#__PURE__*/ createRESTModule(publicDeleteStaffPay);\nexport const bulkDeleteStaffPays: MaybeContext<\n BuildRESTFunction<typeof publicBulkDeleteStaffPays> &\n typeof publicBulkDeleteStaffPays\n> = /*#__PURE__*/ createRESTModule(publicBulkDeleteStaffPays);\nexport const calculateStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicCalculateStaffPay> &\n typeof publicCalculateStaffPay\n> = /*#__PURE__*/ createRESTModule(publicCalculateStaffPay);\nexport const previewStaffPayCalculation: MaybeContext<\n BuildRESTFunction<typeof publicPreviewStaffPayCalculation> &\n typeof publicPreviewStaffPayCalculation\n> = /*#__PURE__*/ createRESTModule(publicPreviewStaffPayCalculation);\nexport const bulkCalculateStaffPays: MaybeContext<\n BuildRESTFunction<typeof publicBulkCalculateStaffPays> &\n typeof publicBulkCalculateStaffPays\n> = /*#__PURE__*/ createRESTModule(publicBulkCalculateStaffPays);\nexport const approveStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicApproveStaffPay> & typeof publicApproveStaffPay\n> = /*#__PURE__*/ createRESTModule(publicApproveStaffPay);\nexport const bulkApproveStaffPays: MaybeContext<\n BuildRESTFunction<typeof publicBulkApproveStaffPays> &\n typeof publicBulkApproveStaffPays\n> = /*#__PURE__*/ createRESTModule(publicBulkApproveStaffPays);\nexport const reopenStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicReopenStaffPay> & typeof publicReopenStaffPay\n> = /*#__PURE__*/ createRESTModule(publicReopenStaffPay);\nexport const exportStaffPays: MaybeContext<\n BuildRESTFunction<typeof publicExportStaffPays> & typeof publicExportStaffPays\n> = /*#__PURE__*/ createRESTModule(publicExportStaffPays);\nexport const previewStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicPreviewStaffPay> & typeof publicPreviewStaffPay\n> = /*#__PURE__*/ createRESTModule(publicPreviewStaffPay);\nexport const queryStaffPays: MaybeContext<\n BuildRESTFunction<typeof customQueryStaffPays> & typeof customQueryStaffPays\n> = /*#__PURE__*/ createRESTModule(customQueryStaffPays);\n\nexport {\n StaffPayStatus,\n PayLineType,\n PayLineSourceType,\n QuantityUnit,\n AdjustmentType,\n StaffPayAlertType,\n StaleReasonType,\n SortOrder,\n ExportFormat,\n ComponentType,\n AttendeeCountBasis,\n CommissionTierMode,\n DiscountBasis,\n TaxBasis,\n CombinatorType,\n WebhookIdentityType,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\nexport {\n StaffPay,\n StaffPayTotals,\n PayLine,\n PayLineSource,\n Adjustment,\n StaffPayAlert,\n StaleReason,\n ExtendedFields,\n CreateStaffPayRequest,\n CreateStaffPayResponse,\n GetStaffPayRequest,\n GetStaffPayResponse,\n UpdateStaffPayRequest,\n UpdateStaffPayResponse,\n DeleteStaffPayRequest,\n DeleteStaffPayResponse,\n QueryStaffPaysRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryStaffPaysResponse,\n CursorPagingMetadata,\n Cursors,\n BulkDeleteStaffPaysRequest,\n BulkDeleteStaffPaysResponse,\n ItemMetadata,\n ApplicationError,\n BulkDeleteStaffPaysResponseBulkStaffPayResult,\n BulkActionMetadata,\n CalculateStaffPayRequest,\n CalculateStaffPayResponse,\n PreviewStaffPayCalculationRequest,\n ProposedClockOut,\n PreviewStaffPayCalculationResponse,\n BulkCalculateStaffPaysRequest,\n BulkCalculateStaffPaysResponse,\n BulkCalculateStaffPaysResponseBulkStaffPayResult,\n ApproveStaffPayRequest,\n ApproveStaffPayResponse,\n BulkApproveStaffPaysRequest,\n BulkApproveStaffPaysResponse,\n BulkStaffPayResult,\n ReopenStaffPayRequest,\n ReopenStaffPayResponse,\n ExportStaffPaysRequest,\n ExportStaffPaysResponse,\n PreviewStaffPayRequest,\n PayModel,\n PayComponent,\n PayComponentOptionsOneOf,\n SalaryOptions,\n HourlyOptions,\n FlatPerSessionOptions,\n BasePlusPerHeadOptions,\n ExtraAttendeeTier,\n AttendanceTiersOptions,\n AttendanceTier,\n ServiceCommissionOptions,\n CommissionTier,\n RevenueRules,\n CostDeduction,\n CostDeductionKindOneOf,\n TipsOptions,\n ProductCommissionOptions,\n PlanSaleCommissionOptions,\n PerCourseOptions,\n Combinator,\n CombinatorOptionsOneOf,\n GreaterOfOptions,\n SampleFacts,\n SampleSession,\n SamplePlanOrder,\n PreviewStaffPayResponse,\n ComponentPreview,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n UpdateStaffPay,\n StaffPaysQueryResult,\n StaffPaysQueryBuilder,\n StaffPayQuerySpec,\n PreviewStaffPayCalculationOptions,\n BulkCalculateStaffPaysOptions,\n ExportStaffPaysOptions,\n PreviewStaffPayOptions,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\nexport { utils } from './staff-pay-v1-staff-pay-staff-pay.universal.js';\nexport {\n StaffPayStatusWithLiterals,\n PayLineTypeWithLiterals,\n PayLineSourceTypeWithLiterals,\n QuantityUnitWithLiterals,\n AdjustmentTypeWithLiterals,\n StaffPayAlertTypeWithLiterals,\n StaleReasonTypeWithLiterals,\n SortOrderWithLiterals,\n ExportFormatWithLiterals,\n ComponentTypeWithLiterals,\n AttendeeCountBasisWithLiterals,\n CommissionTierModeWithLiterals,\n DiscountBasisWithLiterals,\n TaxBasisWithLiterals,\n CombinatorTypeWithLiterals,\n WebhookIdentityTypeWithLiterals,\n CreateStaffPayApplicationErrors,\n UpdateStaffPayApplicationErrors,\n DeleteStaffPayApplicationErrors,\n BulkDeleteStaffPaysApplicationErrors,\n CalculateStaffPayApplicationErrors,\n PreviewStaffPayCalculationApplicationErrors,\n BulkCalculateStaffPaysApplicationErrors,\n ApproveStaffPayApplicationErrors,\n ReopenStaffPayApplicationErrors,\n CommonQueryWithEntityContext,\n Staff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MC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,wBAGK,2DAAiBA,qBAA0B;AACtD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMd,kBAEK,2DAAiB,oBAAoB;","names":["approveStaffPay","bulkApproveStaffPays","bulkCalculateStaffPays","bulkDeleteStaffPays","calculateStaffPay","createStaffPay","deleteStaffPay","exportStaffPays","getStaffPay","previewStaffPay","previewStaffPayCalculation","queryStaffPays","reopenStaffPay","updateStaffPay","import_timestamp","import_rest_modules","payload","import_transform_paths","StaffPayStatus","PayLineType","PayLineSourceType","QuantityUnit","AdjustmentType","StaffPayAlertType","StaleReasonType","SortOrder","ExportFormat","ComponentType","AttendeeCountBasis","CommissionTierMode","DiscountBasis","TaxBasis","CombinatorType","WebhookIdentityType","createStaffPay","sdkTransformError","getStaffPay","updateStaffPay","deleteStaffPay","queryStaffPays","bulkDeleteStaffPays","calculateStaffPay","previewStaffPayCalculation","bulkCalculateStaffPays","approveStaffPay","bulkApproveStaffPays","reopenStaffPay","exportStaffPays","previewStaffPay","createStaffPay","getStaffPay","updateStaffPay","deleteStaffPay","queryStaffPays","typedQueryStaffPays","bulkDeleteStaffPays","calculateStaffPay","previewStaffPayCalculation","bulkCalculateStaffPays","approveStaffPay","bulkApproveStaffPays","reopenStaffPay","exportStaffPays","previewStaffPay","import_rest_modules","queryStaffPays","typedQueryStaffPays","createStaffPay","getStaffPay","updateStaffPay","deleteStaffPay","bulkDeleteStaffPays","calculateStaffPay","previewStaffPayCalculation","bulkCalculateStaffPays","approveStaffPay","bulkApproveStaffPays","reopenStaffPay","exportStaffPays","previewStaffPay"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/staff-pay-v1-staff-pay-staff-pay.universal.ts","../../src/staff-pay-v1-staff-pay-staff-pay.http.ts","../../src/staff-pay-v1-staff-pay-staff-pay.public.ts","../../src/staff-pay-v1-staff-pay-staff-pay.context.ts"],"sourcesContent":["export * from './src/staff-pay-v1-staff-pay-staff-pay.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixStaffPayV1StaffPay from './staff-pay-v1-staff-pay-staff-pay.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/**\n * A staff pay is one staff member's gross pay for one pay period.\n *\n * A site has at most 1 staff pay per staff member per period start date, and a staff member's staff pays can't\n * overlap. Pay periods aren't stored separately: a staff pay holds its own start and end dates, and clients derive the\n * periods from the pay schedule in the staff pay settings.\n *\n * A staff pay starts as a `DRAFT`. Calculating it reads the staff member's hours from Time Clock timecards, their\n * sessions with attendance and service revenue from Bookings, and their tips from Wix Tips. It then applies the pay\n * terms in effect on each day of the period and stores the result with a line per earning. Approving it locks the\n * result. When the data a staff pay depends on changes after a calculation, the staff pay is marked `stale` and must be\n * calculated again before it can be approved.\n *\n * To see a whole pay period, query staff pays by `periodStartDate`.\n *\n * Monetary amounts are decimal strings in the staff pay's `currency`.\n */\nexport interface StaffPay {\n /**\n * Staff pay ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the staff pay is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the staff pay.\n *\n * Ignored when creating a staff pay.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the staff pay was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the staff pay was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the Bookings staff member the staff pay is for.\n * @format GUID\n * @immutable\n */\n staffMemberId?: string;\n /**\n * First day of the pay period, in `YYYY-MM-DD` format, in the site's time zone.\n * @format LOCAL_DATE\n * @immutable\n */\n periodStartDate?: string;\n /**\n * Last day of the pay period (inclusive), in `YYYY-MM-DD` format, in the site's time zone.\n * @format LOCAL_DATE\n * @immutable\n */\n periodEndDate?: string;\n /**\n * Staff pay status.\n * @readonly\n */\n status?: StaffPayStatusWithLiterals;\n /**\n * Whether data the result depends on (timecards, bookings, attendance, orders, tips, adjustments, pay models, profiles\n * or settings) changed after the last calculation. A stale staff pay must be recalculated before it can be approved.\n *\n * An approved staff pay is marked stale too when such data changes after it was approved, but only in the open period\n * (the one that contains the day of the change) and the last period that ended before it. Approved staff pays of older\n * periods are never marked. Changes to sessions, bookings, attendance and orders are found when the period is\n * calculated again (Bulk Calculate Staff Pays), and those to timecards, tips, pay models, profiles and settings when they\n * happen. An approved staff pay is never calculated again automatically: its approved result stays until it's reopened\n * and calculated again. `staleReasons` lists what changed.\n *\n * Default: `false`\n * @readonly\n */\n stale?: boolean;\n /**\n * Three-letter currency code of all amounts, in [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) alphabetic\n * format. Taken from the staff pay settings when the staff pay is calculated.\n * @format CURRENCY\n * @readonly\n */\n currency?: string;\n /**\n * Date and time the staff pay was last calculated.\n * @readonly\n */\n calculatedDate?: Date | null;\n /**\n * Date and time the staff pay was approved.\n * @readonly\n */\n approvedDate?: Date | null;\n /**\n * Totals from the last calculation.\n * @readonly\n */\n totals?: StaffPayTotals;\n /**\n * Pay lines from the last calculation, 1 per earning, including a line per adjustment.\n * @readonly\n * @maxSize 2000\n */\n lines?: PayLine[];\n /**\n * Manual adjustments: bonuses, deductions and reimbursements.\n *\n * Can be changed with Update Staff Pay while the staff pay isn't approved. Each adjustment becomes a\n * pay line the next time the staff pay is calculated.\n * @maxSize 100\n */\n adjustments?: Adjustment[];\n /**\n * Issues found during the last calculation, for example days without pay terms or a timecard that's still open.\n * @readonly\n * @maxSize 100\n */\n alerts?: StaffPayAlert[];\n /**\n * Hash of the data the last calculation used, after its format version. For example, `2:` followed by the hash.\n *\n * Used when an approved staff pay is reopened, to find out whether the data changed while it was approved. Hashes of\n * different format versions aren't compared: the gross amount, pay lines and alerts are compared instead.\n * @readonly\n * @maxLength 128\n */\n factsHash?: string;\n /**\n * IDs of the pay terms from the staff member's pay profile that the last calculation applied.\n * @readonly\n * @maxSize 50\n * @format GUID\n */\n payTermsIds?: string[];\n /**\n * What changed since the last calculation, or since approval for an approved staff pay, 1 entry per changed record.\n *\n * Empty when the staff pay isn't stale. Calculating the staff pay clears it.\n * @internal\n * @readonly\n * @maxSize 50\n */\n staleReasons?: StaleReason[];\n /**\n * Date and time the staff pay was last included in an export file from Export Staff Pays.\n *\n * Returned only when the staff pay was exported at least once. Kept when the staff pay is reopened, so a period still\n * shows that it was downloaded before.\n * @internal\n * @readonly\n */\n lastExportedDate?: Date | null;\n /**\n * Name of the staff member. Saved when the staff pay is calculated, and updated on all the staff member's staff pays,\n * approved ones too, when their name changes. Kept after the staff member is deleted, so past pay still shows a name.\n * @internal\n * @readonly\n * @maxLength 200\n */\n staffMemberName?: string | null;\n /**\n * Whether the period is a bridge period: the days between the last staff pay of an earlier pay schedule and the first\n * period of the site's current pay schedule, paid as 1 extra period. A bridge period pays no salary components.\n *\n * Set when the staff pay is created: `true` when the period ends the day before the pay schedule's first period and\n * starts the day after the site's last staff pay that ends before it. A staff pay created for a period that already\n * has staff pays takes their value. Not returned for staff pays created before this field existed: they aren't bridge\n * periods.\n * @internal\n * @readonly\n */\n bridgePeriod?: boolean | null;\n /**\n * Custom field data for the staff pay object.\n *\n * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n}\n\n/** Staff pay status. */\nexport enum StaffPayStatus {\n /** Created and not calculated yet. */\n DRAFT = 'DRAFT',\n /** Calculated. Can be calculated again, have its adjustments changed, and be approved. */\n CALCULATED = 'CALCULATED',\n /** Approved. The result is locked until the staff pay is reopened. */\n APPROVED = 'APPROVED',\n}\n\n/** @enumType */\nexport type StaffPayStatusWithLiterals =\n | StaffPayStatus\n | 'DRAFT'\n | 'CALCULATED'\n | 'APPROVED';\n\n/** Totals of a staff pay. */\nexport interface StaffPayTotals {\n /**\n * Gross pay, including adjustments.\n * @decimalValue options { maxScale:2 }\n */\n grossAmount?: string;\n /**\n * Paid hours worked, from Time Clock timecards.\n *\n * Counts only the days this staff pay pays. Hours on days without pay terms, with unpaid pay terms, or with a pay\n * model that doesn't exist aren't counted. An alert or note in `alerts` names those days.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n paidHours?: string;\n /**\n * Paid hours above the overtime thresholds, included in `paidHours`. Counts the same days as `paidHours`.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n overtimeHours?: string;\n /**\n * Number of sessions the staff member taught, not cancelled, on the days this staff pay pays. Counts the same days\n * as `paidHours`.\n */\n sessionsCount?: number;\n /**\n * Revenue from the sessions the staff member taught, after discounts and refunds.\n * @decimalValue options { maxScale:2 }\n */\n serviceRevenueAmount?: string;\n /**\n * Total commission.\n *\n * Currently supports commission on services. Product and pricing plan sales aren't calculated yet.\n * @decimalValue options { maxScale:2 }\n */\n commissionAmount?: string;\n /**\n * Total tips.\n * @decimalValue options { maxScale:2 }\n */\n tipsAmount?: string;\n /**\n * Total of all adjustments. Deductions count as negative.\n * @decimalValue options { maxScale:2 }\n */\n adjustmentsAmount?: string;\n /**\n * Product revenue credited to the staff member.\n *\n * Not calculated yet: `0` until product sales are read.\n * @decimalValue options { maxScale:2 }\n */\n productRevenueAmount?: string;\n /**\n * Pricing plan sales credited to the staff member.\n *\n * Not calculated yet: `0` until pricing plan sales are read.\n * @decimalValue options { maxScale:2 }\n */\n planRevenueAmount?: string;\n /**\n * Number of sessions of the period that the staff member teaches, not cancelled, that hadn't started when the staff pay\n * was calculated (`calculatedDate`).\n *\n * Set only by a calculation while the period is in progress. A session is paid only once it starts, so these aren't in\n * `sessionsCount` or `grossAmount`. It is a snapshot of that calculation: calculating the staff pay again after the\n * period ends sets it to `0`.\n */\n upcomingSessionsCount?: number;\n /**\n * An estimate of what the upcoming sessions will pay with their bookings at the time of the calculation, from the\n * session rates and service commission of the pay model. Not included in `grossAmount`: the pay changes when the\n * sessions take place, or when they are cancelled or booked. Like `upcomingSessionsCount`, a snapshot of the\n * calculation while the period was in progress; not returned by a calculation after the period ends.\n * @internal\n * @decimalValue options { maxScale:2 }\n */\n upcomingSessionPayAmount?: string | null;\n}\n\n/** A single earning, with the source it was calculated from. */\nexport interface PayLine {\n /**\n * Pay line ID.\n * @format GUID\n */\n _id?: string;\n /**\n * ID of the pay model component that produced the line. Empty for adjustment lines.\n * @format GUID\n */\n componentId?: string | null;\n /**\n * Name of the pay model component when the staff pay was calculated.\n * @maxLength 100\n */\n componentName?: string;\n /** Kind of earning. */\n type?: PayLineTypeWithLiterals;\n /** Record the line was calculated from. */\n source?: PayLineSource;\n /**\n * Day the earning applies to, in `YYYY-MM-DD` format: the workday, session date or order date.\n * @format LOCAL_DATE\n */\n date?: string;\n /**\n * Quantity the rate was applied to. For example, a number of hours, attendees or a revenue amount.\n * @decimalValue options { maxScale:4 }\n */\n quantity?: string;\n /** Unit of `quantity`. */\n quantityUnit?: QuantityUnitWithLiterals;\n /**\n * Rate applied: an amount per unit, or a percentage when `quantityUnit` is `REVENUE`.\n * @decimalValue options { maxScale:4 }\n */\n rate?: string;\n /**\n * Line amount. Negative for deductions and refund clawbacks.\n * @decimalValue options { maxScale:2 }\n */\n amount?: string;\n /** Whether the line counts towards gross pay. `false` for lines of a component that lost a `GREATER_OF` comparison. */\n included?: boolean;\n /**\n * Explanation of the line, in English. For example, `7.5 h x 18`. Amounts are plain decimals in the staff pay's\n * currency, without a currency symbol.\n * @maxLength 500\n */\n explanation?: string;\n /**\n * Part of the tip (`quantity`) paid by card, which the card fee applies to. The rest was paid offline, for example\n * in cash.\n *\n * Available only for tip share lines, and only when it's known how the tip was paid. When it isn't known, the card fee\n * applies to the whole tip.\n * @internal\n * @decimalValue options { gte:0, maxScale:2 }\n */\n cardPaidAmount?: string | null;\n /**\n * Card fee taken off the card-paid part of the tip before the share is paid.\n *\n * Available only for tip share lines that have a card fee.\n * @internal\n * @decimalValue options { gte:0, maxScale:2 }\n */\n cardFeeAmount?: string | null;\n /**\n * ID of the Bookings service the line was earned on.\n *\n * Available only for session pay lines (`SESSION_FEE`) and service commission lines (`COMMISSION`), and only for pay\n * calculated after this field was added.\n * @internal\n * @format GUID\n */\n serviceId?: string | null;\n}\n\n/** Kind of earning. */\nexport enum PayLineType {\n /** Fixed salary. */\n BASE_SALARY = 'BASE_SALARY',\n /** Regular paid hours. */\n REGULAR_HOURS = 'REGULAR_HOURS',\n /** Overtime hours. */\n OVERTIME_HOURS = 'OVERTIME_HOURS',\n /** Pay for a session taught. */\n SESSION_FEE = 'SESSION_FEE',\n /** Commission on service revenue. */\n COMMISSION = 'COMMISSION',\n /** Share of tips. */\n TIP_SHARE = 'TIP_SHARE',\n /** Manual adjustment. */\n ADJUSTMENT = 'ADJUSTMENT',\n /** Commission on a product sale. Not calculated yet. */\n PRODUCT_SALE_COMMISSION = 'PRODUCT_SALE_COMMISSION',\n /** Commission on a pricing plan sale. Not calculated yet. */\n PLAN_COMMISSION = 'PLAN_COMMISSION',\n}\n\n/** @enumType */\nexport type PayLineTypeWithLiterals =\n | PayLineType\n | 'BASE_SALARY'\n | 'REGULAR_HOURS'\n | 'OVERTIME_HOURS'\n | 'SESSION_FEE'\n | 'COMMISSION'\n | 'TIP_SHARE'\n | 'ADJUSTMENT'\n | 'PRODUCT_SALE_COMMISSION'\n | 'PLAN_COMMISSION';\n\n/** The record a pay line was calculated from. */\nexport interface PayLineSource {\n /** Source type. */\n type?: PayLineSourceTypeWithLiterals;\n /**\n * ID of the source record. For example, a timecard ID, booking ID, calendar event ID, order ID or adjustment ID.\n * @maxLength 100\n */\n _id?: string;\n /**\n * ID of the line item inside the source record.\n *\n * Available only for order line items.\n * @maxLength 100\n */\n lineItemId?: string | null;\n}\n\n/** Type of the record a pay line was calculated from. */\nexport enum PayLineSourceType {\n /** No single source, for example a salary. */\n NO_SOURCE = 'NO_SOURCE',\n /** Time Clock timecard. */\n TIMECARD = 'TIMECARD',\n /** Bookings booking. */\n BOOKING = 'BOOKING',\n /** Calendar event (session). */\n SESSION_EVENT = 'SESSION_EVENT',\n /** eCommerce order line item. */\n ORDER_LINE_ITEM = 'ORDER_LINE_ITEM',\n /** Tip distribution. */\n TIP = 'TIP',\n /** Pricing plan order. */\n PLAN_ORDER = 'PLAN_ORDER',\n /** Manual adjustment on this staff pay. */\n MANUAL_ADJUSTMENT = 'MANUAL_ADJUSTMENT',\n}\n\n/** @enumType */\nexport type PayLineSourceTypeWithLiterals =\n | PayLineSourceType\n | 'NO_SOURCE'\n | 'TIMECARD'\n | 'BOOKING'\n | 'SESSION_EVENT'\n | 'ORDER_LINE_ITEM'\n | 'TIP'\n | 'PLAN_ORDER'\n | 'MANUAL_ADJUSTMENT';\n\n/** Unit of a pay line quantity. */\nexport enum QuantityUnit {\n /** A single item, for example a salary or an adjustment. */\n ITEM = 'ITEM',\n /** Hours. */\n HOURS = 'HOURS',\n /** Sessions. */\n SESSIONS = 'SESSIONS',\n /** Attendees. */\n ATTENDEES = 'ATTENDEES',\n /** An amount of revenue. The rate is a percentage. */\n REVENUE = 'REVENUE',\n}\n\n/** @enumType */\nexport type QuantityUnitWithLiterals =\n | QuantityUnit\n | 'ITEM'\n | 'HOURS'\n | 'SESSIONS'\n | 'ATTENDEES'\n | 'REVENUE';\n\n/** A manual adjustment. */\nexport interface Adjustment {\n /**\n * Adjustment ID. Assigned when the adjustment is first saved.\n * @format GUID\n */\n _id?: string | null;\n /** Adjustment type. */\n type?: AdjustmentTypeWithLiterals;\n /**\n * Adjustment amount, `0` or more. A deduction is subtracted from gross pay. A bonus or reimbursement is added to it.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amount?: string;\n /**\n * Note explaining the adjustment, entered by the business.\n * @maxLength 500\n */\n note?: string;\n}\n\n/** Adjustment type. */\nexport enum AdjustmentType {\n /** Added to gross pay. */\n BONUS = 'BONUS',\n /** Subtracted from gross pay. */\n DEDUCTION = 'DEDUCTION',\n /** Added to gross pay as a reimbursement of expenses. */\n REIMBURSEMENT = 'REIMBURSEMENT',\n}\n\n/** @enumType */\nexport type AdjustmentTypeWithLiterals =\n | AdjustmentType\n | 'BONUS'\n | 'DEDUCTION'\n | 'REIMBURSEMENT';\n\n/** An issue found during calculation. */\nexport interface StaffPayAlert {\n /** Alert type. */\n type?: StaffPayAlertTypeWithLiterals;\n /**\n * ID of the record the alert is about. For example, an open timecard or a pay model.\n *\n * Returned only when the alert is about a single record.\n * @maxLength 100\n */\n sourceId?: string | null;\n /**\n * Description of the issue, in English.\n * @maxLength 500\n */\n message?: string;\n}\n\n/** Type of calculation issue. */\nexport enum StaffPayAlertType {\n /**\n * The staff member had timecards, sessions or tips on days without pay terms in effect, so those days aren't paid.\n * Days whose pay terms are unpaid get `UNPAID_TERMS_ACTIVITY` instead.\n */\n NO_PAY_TERMS = 'NO_PAY_TERMS',\n /** The pay terms point to a pay model that doesn't exist. */\n PAY_MODEL_NOT_FOUND = 'PAY_MODEL_NOT_FOUND',\n /** A timecard in the period is still open, so its hours aren't included. */\n OPEN_TIMECARD = 'OPEN_TIMECARD',\n /**\n * A data source couldn't be read, so what it pays is missing. The other sources were still calculated. `sourceId`\n * names the source: `HOURS`, `SESSIONS` or `TIPS`. Calculating again once the source can be read clears it.\n */\n SOURCE_UNAVAILABLE = 'SOURCE_UNAVAILABLE',\n /**\n * Time Clock clocked a timecard out automatically, so its hours are capped rather than punched. `sourceId` is the\n * timecard ID. The staff pay can't be approved until the timecard is fixed in Timecards and the pay is calculated again.\n */\n AUTO_CLOCKED_OUT_TIMECARD = 'AUTO_CLOCKED_OUT_TIMECARD',\n /**\n * The caller isn't allowed to read a data source, so what it pays is missing. A calculation a user starts reads the\n * sources as that user, so a role without a source's read permission gets this instead of that source's pay.\n * `sourceId` names the source: `HOURS`, `SESSIONS` or `TIPS`. The staff pay can't be approved until someone allowed\n * to read the source calculates it again.\n * @documentationMaturity preview\n * @internal\n */\n SOURCE_NOT_PERMITTED = 'SOURCE_NOT_PERMITTED',\n /**\n * Visits paid with an unlimited pricing plan count as `0` for a \"% of the price\" session rate, because the site's\n * staff pay settings have no unlimited plan visit value. The message names their dates. Only visits a \"% of the price\" rate of\n * the staff member's pay model covers are flagged. A warning: the staff pay can still be approved. Setting the value and\n * calculating again clears it.\n * @documentationMaturity preview\n * @internal\n */\n UNLIMITED_PLAN_VISIT_WITHOUT_VALUE = 'UNLIMITED_PLAN_VISIT_WITHOUT_VALUE',\n /**\n * A note, not a problem: the staff member had timecards, sessions or tips on days whose pay terms are unpaid (the\n * business stopped paying them with Staff Pay), so those aren't counted. The message says from when, what wasn't\n * counted and on which days. The staff pay can still be approved, and nothing needs fixing.\n * @documentationMaturity preview\n * @internal\n */\n UNPAID_TERMS_ACTIVITY = 'UNPAID_TERMS_ACTIVITY',\n /**\n * The staff member had timecards, sessions or tips after their last day of work (the employment end date of their staff\n * pay profile). They're paid, since the work was done. The message names the days. A warning: the staff pay can still\n * be approved. If the last day or the activity is wrong, fixing it and calculating again clears it.\n * @documentationMaturity preview\n * @internal\n */\n ACTIVITY_AFTER_LAST_DAY = 'ACTIVITY_AFTER_LAST_DAY',\n}\n\n/** @enumType */\nexport type StaffPayAlertTypeWithLiterals =\n | StaffPayAlertType\n | 'NO_PAY_TERMS'\n | 'PAY_MODEL_NOT_FOUND'\n | 'OPEN_TIMECARD'\n | 'SOURCE_UNAVAILABLE'\n | 'AUTO_CLOCKED_OUT_TIMECARD';\n\n/** A change to data a staff pay depends on, made after it was calculated or approved. */\nexport interface StaleReason {\n /** What changed. */\n type?: StaleReasonTypeWithLiterals;\n /**\n * ID of the record that changed: the timecard for `TIMECARD_CHANGED`, and the pay model for `PAY_MODEL_CHANGED`.\n *\n * Returned only for those 2 types.\n * @maxLength 100\n */\n sourceId?: string | null;\n /** Date and time of the change. */\n changedDate?: Date | null;\n}\n\n/** Kind of change that made a staff pay stale. */\nexport enum StaleReasonType {\n /** A timecard of the staff member in the period was created, changed or deleted. */\n TIMECARD_CHANGED = 'TIMECARD_CHANGED',\n /** A pay model in the staff member's pay terms was changed or deleted. */\n PAY_MODEL_CHANGED = 'PAY_MODEL_CHANGED',\n /** The staff member's pay profile changed, for example their pay terms, rate overrides or employment dates. */\n PAY_PROFILE_CHANGED = 'PAY_PROFILE_CHANGED',\n /** The site's staff pay settings changed, for example overtime rules or rounding. */\n SETTINGS_CHANGED = 'SETTINGS_CHANGED',\n /** The staff pay was reopened after approval. */\n REOPENED = 'REOPENED',\n /** The staff pay's adjustments were edited. */\n ADJUSTMENTS_CHANGED = 'ADJUSTMENTS_CHANGED',\n /** A tip for the staff member in the period was added or changed in Wix Tips. */\n TIP_CHANGED = 'TIP_CHANGED',\n /**\n * Sessions, bookings, attendance, orders or other data the approved staff pay is calculated from changed after it was\n * approved. Found when its period is calculated again, so the change date is the date of that calculation.\n * @documentationMaturity preview\n * @internal\n */\n SOURCE_DATA_CHANGED = 'SOURCE_DATA_CHANGED',\n}\n\n/** @enumType */\nexport type StaleReasonTypeWithLiterals =\n | StaleReasonType\n | 'TIMECARD_CHANGED'\n | 'PAY_MODEL_CHANGED'\n | 'PAY_PROFILE_CHANGED'\n | 'SETTINGS_CHANGED'\n | 'REOPENED'\n | 'ADJUSTMENTS_CHANGED'\n | 'TIP_CHANGED';\n\nexport interface ExtendedFields {\n /**\n * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n * The value of each key is structured according to the schema defined when the extended fields were configured.\n *\n * You can only access fields for which you have the appropriate permissions.\n *\n * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n */\n namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface CreateStaffPayRequest {\n /** Staff pay to create. */\n staffPay: StaffPay;\n}\n\nexport interface CreateStaffPayResponse {\n /** Created staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface GetStaffPayRequest {\n /**\n * ID of the staff pay to retrieve.\n * @format GUID\n */\n staffPayId: string;\n}\n\nexport interface GetStaffPayResponse {\n /** Retrieved staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface UpdateStaffPayRequest {\n /** Staff pay to update. May be partial. */\n staffPay: StaffPay;\n /**\n * Set of fields to update.\n *\n * Supported properties: `adjustments`, `extendedFields`. Fields that aren't included in `fieldMask.paths` are ignored.\n * @internal\n */\n fieldMask?: string[];\n}\n\nexport interface UpdateStaffPayResponse {\n /** Updated staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface DeleteStaffPayRequest {\n /**\n * ID of the staff pay to delete.\n * @format GUID\n */\n staffPayId: string;\n}\n\nexport interface DeleteStaffPayResponse {}\n\nexport interface QueryStaffPaysRequest {\n /** Query options. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryStaffPaysResponse {\n /** List of staff pays. */\n staffPays?: StaffPay[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface BulkDeleteStaffPaysRequest {\n /**\n * IDs of the staff pays to delete.\n * @minSize 1\n * @maxSize 100\n * @format GUID\n */\n staffPayIds: string[];\n}\n\nexport interface BulkDeleteStaffPaysResponse {\n /**\n * Results, 1 per requested staff pay.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkDeleteStaffPaysResponseBulkStaffPayResult[];\n /** Metadata about the bulk delete operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.\n * @format GUID\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkDeleteStaffPaysResponseBulkStaffPayResult {\n /** Metadata about the deletion of this staff pay. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface CalculateStaffPayRequest {\n /**\n * ID of the staff pay to calculate.\n * @format GUID\n */\n staffPayId: string;\n}\n\nexport interface CalculateStaffPayResponse {\n /** Calculated staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface PreviewStaffPayCalculationRequest {\n /**\n * ID of the staff pay to calculate again.\n * @format GUID\n */\n staffPayId: string;\n /**\n * Clock-outs to calculate open timecards with, as if they were saved. They aren't saved: clock the timecards out in\n * Time Clock to keep them.\n *\n * Each must name an open timecard of the staff pay's staff member that clocked in within the period, at most once,\n * with a time after its clock-in. Otherwise, the request fails with `INVALID_PROPOSED_CLOCK_OUT`.\n *\n * Default: The timecards as they are.\n * @maxSize 50\n */\n proposedClockOuts?: ProposedClockOut[];\n}\n\n/** A clock-out for an open timecard, to preview the pay with. Not saved. */\nexport interface ProposedClockOut {\n /**\n * ID of the open timecard.\n * @format GUID\n */\n timecardId?: string;\n /**\n * When the timecard clocks out, as a date and time in the site's time zone, in `YYYY-MM-DDThh:mm:ss` format. For\n * example, `2026-10-02T17:30:00`. The timecard is paid from its clock-in to this time, less its unpaid breaks, on the\n * workday of its clock-in.\n * @format LOCAL_DATE_TIME\n */\n clockOut?: string;\n}\n\nexport interface PreviewStaffPayCalculationResponse {\n /** Staff pay as calculating it now would make it. Not saved. */\n staffPay?: StaffPay;\n}\n\nexport interface BulkCalculateStaffPaysRequest {\n /**\n * First day of the pay period, in `YYYY-MM-DD` format.\n * @format LOCAL_DATE\n */\n periodStartDate: string;\n /**\n * Last day of the pay period (inclusive), in `YYYY-MM-DD` format.\n * @format LOCAL_DATE\n */\n periodEndDate: string;\n /**\n * IDs of the staff members to calculate.\n *\n * Default: The staff members whose pay terms are in effect on at least 1 day of the period.\n * @maxSize 500\n * @format GUID\n */\n staffMemberIds?: string[];\n}\n\nexport interface BulkCalculateStaffPaysResponse {\n /**\n * Results, 1 per staff pay.\n * @maxSize 500\n */\n results?: BulkCalculateStaffPaysResponseBulkStaffPayResult[];\n /** Metadata about the bulk calculate operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkCalculateStaffPaysResponseBulkStaffPayResult {\n /** Metadata about the calculation of this staff pay. */\n itemMetadata?: ItemMetadata;\n /**\n * Calculated staff pay.\n *\n * Returned only when the calculation succeeded.\n */\n item?: StaffPay;\n}\n\nexport interface ApproveStaffPayRequest {\n /**\n * ID of the staff pay to approve.\n * @format GUID\n */\n staffPayId: string;\n /** Current revision of the staff pay. */\n revision: string | null;\n}\n\nexport interface ApproveStaffPayResponse {\n /** Approved staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface BulkApproveStaffPaysRequest {\n /**\n * IDs of the staff pays to approve.\n * @minSize 1\n * @maxSize 500\n * @format GUID\n */\n staffPayIds: string[];\n}\n\nexport interface BulkApproveStaffPaysResponse {\n /**\n * Results, 1 per requested staff pay.\n * @maxSize 500\n */\n results?: BulkStaffPayResult[];\n /** Metadata about the bulk approve operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkStaffPayResult {\n /** Metadata about the approval of this staff pay. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface ReopenStaffPayRequest {\n /**\n * ID of the staff pay to reopen.\n * @format GUID\n */\n staffPayId: string;\n}\n\nexport interface ReopenStaffPayResponse {\n /** Reopened staff pay. */\n staffPay?: StaffPay;\n}\n\nexport interface ExportStaffPaysRequest {\n /**\n * First day of the pay period to export, in `YYYY-MM-DD` format.\n * @format LOCAL_DATE\n */\n periodStartDate: string;\n /**\n * Export format.\n *\n * Default: The format in the site's export settings.\n */\n format?: ExportFormatWithLiterals;\n}\n\n/** Export format. */\nexport enum ExportFormat {\n /** One row per staff member with the period's totals, for a spreadsheet. */\n GENERIC_CSV = 'GENERIC_CSV',\n /**\n * One row per staff member per earning code, for importing into a payroll system.\n * @documentationMaturity preview\n * @internal\n */\n PAY_DATA_CSV = 'PAY_DATA_CSV',\n /**\n * ADP Workforce Now paydata batch, with the company code from the site's export settings.\n * @documentationMaturity preview\n * @internal\n */\n ADP_WORKFORCE_NOW_CSV = 'ADP_WORKFORCE_NOW_CSV',\n /**\n * Paychex Flex standard payroll import, with the client ID from the site's export settings.\n * @documentationMaturity preview\n * @internal\n */\n PAYCHEX_FLEX_CSV = 'PAYCHEX_FLEX_CSV',\n /**\n * Gusto hours and earnings upload, one row per staff member.\n * @documentationMaturity preview\n * @internal\n */\n GUSTO_CSV = 'GUSTO_CSV',\n}\n\n/** @enumType */\nexport type ExportFormatWithLiterals = ExportFormat | 'GENERIC_CSV';\n\nexport interface ExportStaffPaysResponse {\n /**\n * Suggested file name. For example, `staff-pay-2026-10-01.csv`.\n * @maxLength 200\n */\n fileName?: string;\n /**\n * File content, as CSV text.\n * @maxLength 10000000\n */\n content?: string;\n /** Number of staff pays in the period that weren't exported because they aren't approved. */\n skippedCount?: number;\n /**\n * IDs of the staff members exported without a payroll ID in their pay profile. Their rows use their email, or else\n * their name, which a payroll system may not match.\n *\n * Returned only for the `PAY_DATA_CSV`, `ADP_WORKFORCE_NOW_CSV` and `PAYCHEX_FLEX_CSV` formats.\n * @internal\n * @maxSize 1000\n * @format GUID\n */\n staffMemberIdsWithoutPayrollId?: string[];\n}\n\nexport interface PreviewStaffPayRequest {\n /** Pay model to preview. May be unsaved. */\n payModel: PayModel;\n /** Sample data for 1 staff member over 1 pay period. */\n sampleFacts: SampleFacts;\n}\n\n/**\n * A pay model is a reusable way to pay staff: a list of pay components, such as an hourly wage, session rates and a\n * tip share, whose results are combined into a staff member's gross pay for a pay period. A pay model holds no people\n * and no dates: staff members are paid with it through the pay terms in their staff pay profile.\n *\n * Monetary amounts are decimal strings in the site's pay currency, set in the staff pay settings. Percentages are\n * decimal strings between `0` and `100`.\n */\nexport interface PayModel {\n /**\n * Pay model ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the pay model is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the pay model.\n *\n * Ignored when creating a pay model.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the pay model was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the pay model was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Pay model name. For example, `Group fitness instructor`.\n * @maxLength 100\n */\n name?: string;\n /**\n * Description of the pay model.\n * @maxLength 500\n */\n description?: string | null;\n /**\n * Pay components. Each component produces pay lines for a pay period.\n *\n * The session rates are the `FLAT_PER_SESSION`, `BASE_PLUS_PER_HEAD`, `ATTENDANCE_TIERS`, `PER_COURSE` and\n * `SERVICE_COMMISSION` components. Each service is paid by 1 session rate at most, so a session or a sale is never\n * paid twice. A rate with `serviceIds` pays only those services. At most 1 rate has no `serviceIds`: it pays every\n * service that no other rate lists, including services added later.\n *\n * A `PER_COURSE` rate pays course sessions only, and has its own default: at most 1 `PER_COURSE` rate has no\n * `serviceIds`, and it pays every course that no rate lists. A course is paid by the rate that lists it, else by that\n * per-course rate, else by the rate without `serviceIds`.\n *\n * Components get an ID when they're first saved. Send each component's `id` back when updating, so personal rates and\n * pay lines stay linked to it.\n * @maxSize 20\n */\n components?: PayComponent[];\n /**\n * How the component results are combined into gross pay.\n *\n * Default: `SUM`\n */\n combinator?: Combinator;\n /**\n * Date and time the pay model was archived.\n *\n * Returned only when the pay model is archived. An archived pay model can't be updated and isn't offered for new pay\n * terms, but pay terms that already use it keep it, so it can still be retrieved. Set by Archive Pay Model.\n * @readonly\n */\n archivedDate?: Date | null;\n /**\n * Custom field data for the pay model object.\n *\n * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n}\n\n/** A single pay component of a pay model. */\nexport interface PayComponent extends PayComponentOptionsOneOf {\n /** Fixed amount per pay period. */\n salaryOptions?: SalaryOptions;\n /** Rate per paid hour worked, from Time Clock timecards. */\n hourlyOptions?: HourlyOptions;\n /** Flat amount per session taught. */\n flatPerSessionOptions?: FlatPerSessionOptions;\n /** Amount per attendee, with an optional base amount that covers the first attendees. */\n basePlusPerHeadOptions?: BasePlusPerHeadOptions;\n /** Flat amount per session, by attendance tier. */\n attendanceTiersOptions?: AttendanceTiersOptions;\n /** Percentage of service revenue. */\n serviceCommissionOptions?: ServiceCommissionOptions;\n /** Share of tips. */\n tipsOptions?: TipsOptions;\n /** Percentage of product sales. Not calculated yet. */\n productCommissionOptions?: ProductCommissionOptions;\n /** Commission on pricing plan sales, such as memberships and packages. Not calculated yet. */\n planSaleCommissionOptions?: PlanSaleCommissionOptions;\n /**\n * Flat amount per course taught, spread evenly across the course's sessions.\n * @internal\n */\n perCourseOptions?: PerCourseOptions;\n /**\n * Component ID. Assigned when the component is first saved. Send it back when updating, to keep the same component\n * so personal rates and pay lines stay linked to it.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Component name. For example, `Class pay`.\n * @maxLength 100\n */\n name?: string;\n /** Component type. Must match the options that are specified. */\n type?: ComponentTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface PayComponentOptionsOneOf {\n /** Fixed amount per pay period. */\n salaryOptions?: SalaryOptions;\n /** Rate per paid hour worked, from Time Clock timecards. */\n hourlyOptions?: HourlyOptions;\n /** Flat amount per session taught. */\n flatPerSessionOptions?: FlatPerSessionOptions;\n /** Amount per attendee, with an optional base amount that covers the first attendees. */\n basePlusPerHeadOptions?: BasePlusPerHeadOptions;\n /** Flat amount per session, by attendance tier. */\n attendanceTiersOptions?: AttendanceTiersOptions;\n /** Percentage of service revenue. */\n serviceCommissionOptions?: ServiceCommissionOptions;\n /** Share of tips. */\n tipsOptions?: TipsOptions;\n /** Percentage of product sales. Not calculated yet. */\n productCommissionOptions?: ProductCommissionOptions;\n /** Commission on pricing plan sales, such as memberships and packages. Not calculated yet. */\n planSaleCommissionOptions?: PlanSaleCommissionOptions;\n /**\n * Flat amount per course taught, spread evenly across the course's sessions.\n * @internal\n */\n perCourseOptions?: PerCourseOptions;\n}\n\n/** Pay component type. */\nexport enum ComponentType {\n /** Fixed amount per pay period. */\n SALARY = 'SALARY',\n /** Rate per paid hour worked, from Time Clock timecards. */\n HOURLY = 'HOURLY',\n /** Flat amount per session taught. */\n FLAT_PER_SESSION = 'FLAT_PER_SESSION',\n /** Amount per attendee, with an optional base amount that covers the first attendees. */\n BASE_PLUS_PER_HEAD = 'BASE_PLUS_PER_HEAD',\n /** Flat amount per session, by attendance tier. */\n ATTENDANCE_TIERS = 'ATTENDANCE_TIERS',\n /** Percentage of service revenue. */\n SERVICE_COMMISSION = 'SERVICE_COMMISSION',\n /** Share of tips. */\n TIPS = 'TIPS',\n /** Percentage of product sales. Not calculated yet: pays nothing until product sales are read. */\n PRODUCT_COMMISSION = 'PRODUCT_COMMISSION',\n /**\n * Commission on pricing plan sales, such as memberships and packages. Not calculated yet: pays nothing until\n * pricing plan sales are read.\n */\n PLAN_SALE_COMMISSION = 'PLAN_SALE_COMMISSION',\n /**\n * Flat amount per course taught, spread evenly across the course's sessions.\n * @documentationMaturity preview\n * @internal\n */\n PER_COURSE = 'PER_COURSE',\n}\n\n/** @enumType */\nexport type ComponentTypeWithLiterals =\n | ComponentType\n | 'SALARY'\n | 'HOURLY'\n | 'FLAT_PER_SESSION'\n | 'BASE_PLUS_PER_HEAD'\n | 'ATTENDANCE_TIERS'\n | 'SERVICE_COMMISSION'\n | 'TIPS'\n | 'PRODUCT_COMMISSION'\n | 'PLAN_SALE_COMMISSION';\n\nexport interface SalaryOptions {\n /**\n * Amount per pay period.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerPeriod?: string;\n /**\n * Deprecated: ignored. A salary is always prorated by the days employed in the period, based on the profile's\n * employment dates, so no salary is paid after the last day of work.\n */\n prorateByDaysEmployed?: boolean;\n}\n\nexport interface HourlyOptions {\n /**\n * Rate per paid hour. Unpaid breaks aren't paid.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n rate?: string;\n /**\n * Whether the overtime rules in the staff pay settings apply to the hours of this component.\n *\n * Default: `false`\n */\n overtimeEligible?: boolean;\n /**\n * Whether to pay only for clocked time outside sessions the staff member taught that a session rate of the pay model\n * covers, so a session isn't paid twice by an hourly component and a session rate. Time in a session no session rate\n * covers is still paid hourly.\n *\n * Default: `false`\n */\n excludeSessionTime?: boolean;\n}\n\nexport interface FlatPerSessionOptions {\n /**\n * Amount per session taught.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amount?: string;\n /**\n * Services this rate pays. See `payModel.components` for how session rates share the services.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n /**\n * Not used: a session that the business cancelled is never paid, whatever this says. Kept so existing clients\n * still work.\n *\n * Default: `false`\n */\n zeroWhenCancelled?: boolean;\n}\n\n/**\n * Pay per attendee of a session. A session pays `baseAmount`, plus `amountPerAdditionalAttendee` for each attendee\n * above `includedAttendees`. Without a base amount and with `0` included attendees, every attendee is paid.\n */\nexport interface BasePlusPerHeadOptions {\n /**\n * Amount paid for each session, which covers its first `includedAttendees` attendees. When not set or `0`, there's no\n * base amount.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n baseAmount?: string | null;\n /**\n * Number of attendees who aren't paid per attendee: the ones the base amount covers. `0` pays every attendee.\n * @max 10000\n */\n includedAttendees?: number;\n /**\n * Amount per attendee above `includedAttendees`.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerAdditionalAttendee?: string;\n /**\n * Which attendees are counted.\n *\n * Default: `CHECKED_IN`\n */\n countBasis?: AttendeeCountBasisWithLiterals;\n /**\n * Services this rate pays. See `payModel.components` for how session rates share the services.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n /**\n * Not used: a session that the business cancelled is never paid, whatever this says. Kept so existing clients\n * still work.\n *\n * Default: `false`\n */\n zeroWhenCancelled?: boolean;\n /**\n * Whether free visits are left out of the attendees counted. A free visit is a booking nothing was paid for, such as\n * a free service or a complimentary visit.\n *\n * Default: `false`\n */\n excludeFreeVisits?: boolean;\n /**\n * More amounts per additional attendee, for bigger sessions. Each attendee above `includedAttendees` is paid the\n * amount of the highest tier whose `fromAttendee` they reach, and `amountPerAdditionalAttendee` below the first tier.\n * Every `fromAttendee` must be above `includedAttendees`, and 2 tiers can't share one.\n * @internal\n * @maxSize 20\n */\n extraAttendeeTiers?: ExtraAttendeeTier[];\n /**\n * Most a session can pay under this rate, whatever its attendance. A staff member's personal rate applies first.\n * Must be at least `baseAmount`, when there's one. When not set, there's no maximum.\n * @internal\n * @decimalValue options { gte:0, maxScale:2 }\n */\n maxAmountPerSession?: string | null;\n}\n\n/** Which attendees of a session are counted. */\nexport enum AttendeeCountBasis {\n /** All booked attendees. */\n BOOKED = 'BOOKED',\n /** Only checked-in attendees. */\n CHECKED_IN = 'CHECKED_IN',\n /** Checked-in attendees and no-shows (bookings that weren't cancelled). */\n CHECKED_IN_AND_NO_SHOWS = 'CHECKED_IN_AND_NO_SHOWS',\n}\n\n/** @enumType */\nexport type AttendeeCountBasisWithLiterals =\n | AttendeeCountBasis\n | 'BOOKED'\n | 'CHECKED_IN'\n | 'CHECKED_IN_AND_NO_SHOWS';\n\n/** An amount per attendee, from 1 attendee number on. Attendees are numbered from 1 in each session. */\nexport interface ExtraAttendeeTier {\n /**\n * Attendee number the tier starts at. Attendees from this number on are paid `amountPerAttendee`.\n * @min 1\n * @max 10000\n */\n fromAttendee?: number;\n /**\n * Amount per attendee in this tier.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerAttendee?: string;\n}\n\nexport interface AttendanceTiersOptions {\n /**\n * Tiers, sorted by `minAttendees` when saved. A session is paid at the highest tier whose `minAttendees` it reaches.\n * 2 tiers can't share a `minAttendees`.\n * @maxSize 20\n */\n tiers?: AttendanceTier[];\n /**\n * Which attendees are counted.\n *\n * Default: `CHECKED_IN`\n */\n countBasis?: AttendeeCountBasisWithLiterals;\n /**\n * Services this rate pays. See `payModel.components` for how session rates share the services.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n /**\n * Not used: a session that the business cancelled is never paid, whatever this says. Kept so existing clients\n * still work.\n *\n * Default: `false`\n */\n zeroWhenCancelled?: boolean;\n /**\n * Whether free visits are left out of the attendees counted. A free visit is a booking nothing was paid for, such as\n * a free service or a complimentary visit.\n *\n * Default: `false`\n */\n excludeFreeVisits?: boolean;\n}\n\nexport interface AttendanceTier {\n /**\n * Minimum number of attendees for this tier.\n * @max 10000\n */\n minAttendees?: number;\n /**\n * Flat amount per session.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n value?: string;\n}\n\nexport interface ServiceCommissionOptions {\n /**\n * Commission percentage of service revenue. With `tiers`, the percentage paid below the first tier.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n /**\n * Services this rate pays. See `payModel.components` for how session rates share the services.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n /**\n * Sliding-scale tiers on the period's service sales, sorted by `minSales`. A higher tier raises the percentage once\n * the period's sales reach its `minSales`. When empty, every sale is paid at `percent`.\n * @maxSize 20\n */\n tiers?: CommissionTier[];\n /**\n * How `tiers` apply to the period's sales.\n *\n * Default: `ENTIRE_AMOUNT`\n */\n tierMode?: CommissionTierModeWithLiterals;\n /** How service sales are counted. */\n revenueRules?: RevenueRules;\n /**\n * Cost taken off each sale's price before the commission percentage applies. When not set, nothing is taken off.\n * @internal\n */\n costDeduction?: CostDeduction;\n}\n\n/** A sliding-scale commission tier. */\nexport interface CommissionTier {\n /**\n * Period sales from which this tier applies.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n minSales?: string;\n /**\n * Commission percentage of this tier.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n}\n\n/** How sliding-scale tiers apply to a period's sales. */\nexport enum CommissionTierMode {\n /** All of the period's sales are paid at the percentage of the highest tier reached. */\n ENTIRE_AMOUNT = 'ENTIRE_AMOUNT',\n /** Each part of the period's sales is paid at the percentage of the tier it falls in. */\n PORTION_IN_TIER = 'PORTION_IN_TIER',\n}\n\n/** @enumType */\nexport type CommissionTierModeWithLiterals =\n | CommissionTierMode\n | 'ENTIRE_AMOUNT'\n | 'PORTION_IN_TIER';\n\n/**\n * How revenue is counted by a component that pays on revenue. A session's revenue adds up what each of its bookings is\n * worth: the price of a booking paid in money, the price per session of a pricing plan with a set number of sessions, or\n * the site's value of a visit on an unlimited plan. A free visit adds nothing. Refunds completed by the end of the pay\n * period are subtracted (a later refund doesn't change an earlier period's pay), and a course booking's price is split\n * evenly across the course sessions it covers.\n */\nexport interface RevenueRules {\n /**\n * Whether a booking paid in money counts at its price before or after discounts.\n *\n * Default: `AFTER_DISCOUNTS`\n */\n discountBasis?: DiscountBasisWithLiterals;\n /**\n * Whether a booking's tax counts in its revenue. Applies to prices that include tax, as on sites that show prices with\n * VAT: `BEFORE_TAX` takes the booking's tax off its price, and its discounts and refunds in the same proportion. A price\n * that doesn't include tax counts as it is either way.\n *\n * Default: `BEFORE_TAX`\n */\n taxBasis?: TaxBasisWithLiterals;\n}\n\n/** Whether revenue is taken before or after discounts. */\nexport enum DiscountBasis {\n /** Price before discounts. */\n BEFORE_DISCOUNTS = 'BEFORE_DISCOUNTS',\n /** Price paid, after discounts. */\n AFTER_DISCOUNTS = 'AFTER_DISCOUNTS',\n}\n\n/** @enumType */\nexport type DiscountBasisWithLiterals =\n | DiscountBasis\n | 'BEFORE_DISCOUNTS'\n | 'AFTER_DISCOUNTS';\n\n/** Whether revenue includes the tax in a price. */\nexport enum TaxBasis {\n /** Price without tax. */\n BEFORE_TAX = 'BEFORE_TAX',\n /** Price with the tax it includes. */\n WITH_TAX = 'WITH_TAX',\n}\n\n/** @enumType */\nexport type TaxBasisWithLiterals = TaxBasis | 'BEFORE_TAX' | 'WITH_TAX';\n\n/**\n * A cost taken off each sale's price before commission, such as the products a service uses or a fee. A sale is never\n * counted below 0. Sliding-scale tiers measure the period's sales after the cost is taken off.\n */\nexport interface CostDeduction extends CostDeductionKindOneOf {\n /**\n * Fixed amount taken off each sale.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerSale?: string;\n /**\n * Percentage of each sale's price taken off.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n}\n\n/** @oneof */\nexport interface CostDeductionKindOneOf {\n /**\n * Fixed amount taken off each sale.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerSale?: string;\n /**\n * Percentage of each sale's price taken off.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n}\n\nexport interface TipsOptions {\n /**\n * Percentage of the staff member's tip distributions that's passed on to them.\n *\n * Default: `100`\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n sharePercent?: string | null;\n /**\n * Card processing fee percentage deducted from tips paid by card before they're shared. Tips paid offline, for\n * example in cash, have no fee taken off. A tip whose payment method isn't known has the fee taken off all of it.\n *\n * Default: `0`\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n cardFeePercent?: string | null;\n}\n\nexport interface ProductCommissionOptions {\n /**\n * Commission percentage of product sales, after discounts.\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string;\n /**\n * Products this component applies to. When empty, applies to all products.\n * @maxSize 1000\n * @format GUID\n */\n productIds?: string[];\n}\n\nexport interface PlanSaleCommissionOptions {\n /**\n * Commission percentage of each plan order's price.\n *\n * Default: `0`\n * @decimalValue options { gte:0, lte:100, maxScale:2 }\n */\n percent?: string | null;\n /**\n * Flat amount per plan order, added to the percentage.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amountPerOrder?: string | null;\n /**\n * Plans this component applies to. When empty, applies to all plans.\n * @maxSize 1000\n * @format GUID\n */\n planIds?: string[];\n}\n\n/**\n * A flat amount per Bookings course. Each session of the course pays the amount divided by the course's sessions, to\n * whoever taught that session, so a substitute is paid for the sessions they taught. Cancelled sessions don't count\n * towards the course's sessions and pay nothing.\n */\nexport interface PerCourseOptions {\n /**\n * Amount per course.\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amount?: string;\n /**\n * Course services this rate pays. When empty, pays every course no other rate lists. See `payModel.components` for\n * how session rates share the services. Service IDs aren't checked to be courses: a listed service that isn't a\n * course is paid nothing by this rate.\n * @maxSize 1000\n * @format GUID\n */\n serviceIds?: string[];\n}\n\n/** How component results are combined into gross pay. */\nexport interface Combinator extends CombinatorOptionsOneOf {\n /** Pay the greater of a set of components. */\n greaterOfOptions?: GreaterOfOptions;\n /** Combinator type. Must match the options that are specified. */\n type?: CombinatorTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface CombinatorOptionsOneOf {\n /** Pay the greater of a set of components. */\n greaterOfOptions?: GreaterOfOptions;\n}\n\n/** Combinator type. */\nexport enum CombinatorType {\n /** Add all component results together. */\n SUM = 'SUM',\n /** Pay only the greatest result among `greaterOfOptions.componentIds`. All other components are added. */\n GREATER_OF = 'GREATER_OF',\n}\n\n/** @enumType */\nexport type CombinatorTypeWithLiterals = CombinatorType | 'SUM' | 'GREATER_OF';\n\nexport interface GreaterOfOptions {\n /**\n * IDs of the components that compete, for example a salary component and a commission component.\n * @minSize 2\n * @maxSize 20\n * @format GUID\n */\n componentIds?: string[];\n}\n\n/** Sample data for 1 staff member over 1 pay period. */\nexport interface SampleFacts {\n /**\n * Paid hours worked.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n paidHours?: string | null;\n /**\n * Paid hours above the site's overtime thresholds, included in `paidHours`.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n overtimeHours?: string | null;\n /**\n * Sessions taught.\n * @maxSize 100\n */\n sessions?: SampleSession[];\n /**\n * Tips distributed to the staff member.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n tipsAmount?: string | null;\n /**\n * Fraction of the period the staff member was employed, between `0` and `1`. Used to prorate salaries.\n *\n * Default: `1`\n * @decimalValue options { gte:0, lte:1, maxScale:4 }\n */\n employedFraction?: string | null;\n /**\n * Product sales credited to the staff member.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n productSalesAmount?: string | null;\n /**\n * Pricing plan orders credited to the staff member.\n * @maxSize 100\n */\n planOrders?: SamplePlanOrder[];\n}\n\n/** A sample session. */\nexport interface SampleSession {\n /**\n * Bookings service ID. Used to match personal per-service rates and the session rate that pays the session.\n * @format GUID\n */\n serviceId?: string | null;\n /**\n * Number of attendees counted for the session.\n * @max 10000\n */\n attendees?: number;\n /**\n * Session revenue, used by `SERVICE_COMMISSION` rates: the sale of the session's service.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n revenue?: string | null;\n /**\n * Whether the session was cancelled.\n *\n * Default: `false`\n */\n cancelled?: boolean;\n /**\n * Key of the course the session belongs to, any text. The sample sessions with the same `courseId` are that course's\n * sessions in this period, numbered in request order. Used with `courseSessions`.\n * @internal\n * @maxLength 100\n */\n courseId?: string | null;\n /**\n * Number of sessions the course has in all, not counting cancelled ones. More than `0` makes this a course session\n * and its sale a course sale. When no sample session sets it, all the sample sessions make up 1 course.\n * @internal\n * @max 1000\n */\n courseSessions?: number;\n}\n\n/** A sample pricing plan order. */\nexport interface SamplePlanOrder {\n /**\n * Pricing plan ID. Used to match the plans a component applies to.\n * @format GUID\n */\n planId?: string | null;\n /**\n * Order price.\n *\n * Default: `0`\n * @decimalValue options { gte:0, maxScale:2 }\n */\n amount?: string | null;\n}\n\nexport interface PreviewStaffPayResponse {\n /**\n * What each component would pay.\n * @maxSize 20\n */\n components?: ComponentPreview[];\n /**\n * Gross pay after the combinator is applied.\n * @decimalValue options { maxScale:2 }\n */\n grossAmount?: string;\n}\n\n/** What one component would pay. */\nexport interface ComponentPreview {\n /**\n * Component ID, when the component has one.\n * @format GUID\n */\n componentId?: string | null;\n /**\n * Component name.\n * @maxLength 100\n */\n componentName?: string;\n /**\n * Amount the component would pay.\n * @decimalValue options { maxScale:2 }\n */\n amount?: string;\n /**\n * Whether the amount counts towards gross pay after the combinator is applied. `false` for components that lost a\n * `GREATER_OF` comparison.\n */\n included?: boolean;\n /**\n * Explanation of the calculation, in English. For example, `1 session x 40`, or `2 lines: 1 session x 40; 1 session\n * x 40` for several pay lines. Amounts are plain decimals in the site's pay currency, without a currency symbol. When\n * the lines don't all fit in 10,000 characters, the ones that fit are given whole and the rest are counted, as in\n * `100 lines: 1 session x 40; 1 session x 40; … and 70 more`. The lines of a full sample fit.\n * @maxLength 10000\n */\n explanation?: string;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateStaffPayApplicationErrors =\n | {\n code?: 'INVALID_PERIOD';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'OVERLAPPING_STAFF_PAY';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_ADJUSTMENT';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type UpdateStaffPayApplicationErrors =\n | {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_ADJUSTMENT';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type DeleteStaffPayApplicationErrors = {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type BulkDeleteStaffPaysApplicationErrors = {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type CalculateStaffPayApplicationErrors = {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type PreviewStaffPayCalculationApplicationErrors = {\n code?: 'INVALID_PROPOSED_CLOCK_OUT';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type BulkCalculateStaffPaysApplicationErrors = {\n code?: 'INVALID_PERIOD';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type ApproveStaffPayApplicationErrors =\n | {\n code?: 'STAFF_PAY_NOT_CALCULATED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'STAFF_PAY_STALE';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'STAFF_PAY_APPROVED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'TIMECARD_NEEDS_FIX';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SOURCE_NOT_PERMITTED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type ReopenStaffPayApplicationErrors = {\n code?: 'STAFF_PAY_NOT_APPROVED';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Creates a `DRAFT` staff pay for a staff member and pay period.\n *\n * A pay period is at most 62 days long, and a staff member's staff pays can't overlap. When the site has a pay schedule,\n * a period that has no staff pay yet must be one of the schedule's periods, from its first period on, or the days\n * between the last staff pay and the first period. To calculate the staff pay, call Calculate Staff Pay. To create and calculate a whole period at once, call\n * Bulk Calculate Staff Pays.\n * @param staffPay - Staff pay to create.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPay\n * @requiredField staffPay.periodEndDate\n * @requiredField staffPay.periodStartDate\n * @requiredField staffPay.staffMemberId\n * @permissionId staff:pay:v1:staff_pay:create_staff_pay\n * @returns Created staff pay.\n * @fqn wix.staff.pay.v1.StaffPayService.CreateStaffPay\n */\nexport async function createStaffPay(\n staffPay: NonNullablePaths<\n StaffPay,\n `periodEndDate` | `periodStartDate` | `staffMemberId`,\n 0\n >\n): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n > & {\n __applicationErrorsType?: CreateStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ staffPay: staffPay });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.createStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.staffPay!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPay: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPay']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a staff pay, including its pay lines.\n * @param staffPayId - ID of the staff pay to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:get_staff_pay\n * @returns Retrieved staff pay.\n * @fqn wix.staff.pay.v1.StaffPayService.GetStaffPay\n */\nexport async function getStaffPay(\n staffPayId: string\n): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.getStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.staffPay!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a staff pay's adjustments and extended fields.\n *\n * Each time the staff pay is updated, `revision` increments by 1. The current `revision` must be passed when updating\n * the staff pay. This ensures you're working with the latest staff pay and prevents unintended overwrites.\n *\n * Supported properties: `adjustments`, `extendedFields`. Other paths in `fieldMask` are ignored.\n *\n * Adjustments are bonuses, deductions and reimbursements, and each becomes a pay line. A wrong calculated amount isn't\n * corrected here: fix its source, such as the timecard or booking, and calculate the staff pay again. Changing the\n * adjustments of a calculated staff pay marks it stale. An approved staff pay can't be updated until it's reopened with\n * Reopen Staff Pay.\n * @param _id - Staff pay ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField staffPay\n * @requiredField staffPay.revision\n * @permissionId staff:pay:v1:staff_pay:update_staff_pay\n * @returns Updated staff pay.\n * @fqn wix.staff.pay.v1.StaffPayService.UpdateStaffPay\n */\nexport async function updateStaffPay(\n _id: string,\n staffPay: NonNullablePaths<UpdateStaffPay, `revision`, 0>\n): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n > & {\n __applicationErrorsType?: UpdateStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPay: { ...staffPay, id: _id },\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.updateStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.staffPay!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { staffPay: '$[1]' },\n explicitPathsToArguments: { 'staffPay.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'staffPay']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateStaffPay {\n /**\n * Staff pay ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the staff pay is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the staff pay.\n *\n * Ignored when creating a staff pay.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the staff pay was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the staff pay was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the Bookings staff member the staff pay is for.\n * @format GUID\n * @immutable\n */\n staffMemberId?: string;\n /**\n * First day of the pay period, in `YYYY-MM-DD` format, in the site's time zone.\n * @format LOCAL_DATE\n * @immutable\n */\n periodStartDate?: string;\n /**\n * Last day of the pay period (inclusive), in `YYYY-MM-DD` format, in the site's time zone.\n * @format LOCAL_DATE\n * @immutable\n */\n periodEndDate?: string;\n /**\n * Staff pay status.\n * @readonly\n */\n status?: StaffPayStatusWithLiterals;\n /**\n * Whether data the result depends on (timecards, bookings, attendance, orders, tips, adjustments, pay models, profiles\n * or settings) changed after the last calculation. A stale staff pay must be recalculated before it can be approved.\n *\n * An approved staff pay is marked stale too when such data changes after it was approved, but only in the open period\n * (the one that contains the day of the change) and the last period that ended before it. Approved staff pays of older\n * periods are never marked. Changes to sessions, bookings, attendance and orders are found when the period is\n * calculated again (Bulk Calculate Staff Pays), and those to timecards, tips, pay models, profiles and settings when they\n * happen. An approved staff pay is never calculated again automatically: its approved result stays until it's reopened\n * and calculated again. `staleReasons` lists what changed.\n *\n * Default: `false`\n * @readonly\n */\n stale?: boolean;\n /**\n * Three-letter currency code of all amounts, in [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) alphabetic\n * format. Taken from the staff pay settings when the staff pay is calculated.\n * @format CURRENCY\n * @readonly\n */\n currency?: string;\n /**\n * Date and time the staff pay was last calculated.\n * @readonly\n */\n calculatedDate?: Date | null;\n /**\n * Date and time the staff pay was approved.\n * @readonly\n */\n approvedDate?: Date | null;\n /**\n * Totals from the last calculation.\n * @readonly\n */\n totals?: StaffPayTotals;\n /**\n * Pay lines from the last calculation, 1 per earning, including a line per adjustment.\n * @readonly\n * @maxSize 2000\n */\n lines?: PayLine[];\n /**\n * Manual adjustments: bonuses, deductions and reimbursements.\n *\n * Can be changed with Update Staff Pay while the staff pay isn't approved. Each adjustment becomes a\n * pay line the next time the staff pay is calculated.\n * @maxSize 100\n */\n adjustments?: Adjustment[];\n /**\n * Issues found during the last calculation, for example days without pay terms or a timecard that's still open.\n * @readonly\n * @maxSize 100\n */\n alerts?: StaffPayAlert[];\n /**\n * Hash of the data the last calculation used, after its format version. For example, `2:` followed by the hash.\n *\n * Used when an approved staff pay is reopened, to find out whether the data changed while it was approved. Hashes of\n * different format versions aren't compared: the gross amount, pay lines and alerts are compared instead.\n * @readonly\n * @maxLength 128\n */\n factsHash?: string;\n /**\n * IDs of the pay terms from the staff member's pay profile that the last calculation applied.\n * @readonly\n * @maxSize 50\n * @format GUID\n */\n payTermsIds?: string[];\n /**\n * What changed since the last calculation, or since approval for an approved staff pay, 1 entry per changed record.\n *\n * Empty when the staff pay isn't stale. Calculating the staff pay clears it.\n * @internal\n * @readonly\n * @maxSize 50\n */\n staleReasons?: StaleReason[];\n /**\n * Date and time the staff pay was last included in an export file from Export Staff Pays.\n *\n * Returned only when the staff pay was exported at least once. Kept when the staff pay is reopened, so a period still\n * shows that it was downloaded before.\n * @internal\n * @readonly\n */\n lastExportedDate?: Date | null;\n /**\n * Name of the staff member. Saved when the staff pay is calculated, and updated on all the staff member's staff pays,\n * approved ones too, when their name changes. Kept after the staff member is deleted, so past pay still shows a name.\n * @internal\n * @readonly\n * @maxLength 200\n */\n staffMemberName?: string | null;\n /**\n * Whether the period is a bridge period: the days between the last staff pay of an earlier pay schedule and the first\n * period of the site's current pay schedule, paid as 1 extra period. A bridge period pays no salary components.\n *\n * Set when the staff pay is created: `true` when the period ends the day before the pay schedule's first period and\n * starts the day after the site's last staff pay that ends before it. A staff pay created for a period that already\n * has staff pays takes their value. Not returned for staff pays created before this field existed: they aren't bridge\n * periods.\n * @internal\n * @readonly\n */\n bridgePeriod?: boolean | null;\n /**\n * Custom field data for the staff pay object.\n *\n * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n}\n\n/**\n * Deletes a staff pay.\n *\n * An approved staff pay can't be deleted until it's reopened with Reopen Staff Pay.\n *\n * To delete multiple staff pays in a single API call, call Bulk Delete Staff Pays.\n * @param staffPayId - ID of the staff pay to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:delete_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.DeleteStaffPay\n */\nexport async function deleteStaffPay(staffPayId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.deleteStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 staff pays, given the provided paging, filtering, and sorting.\n *\n * Query Staff Pays runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * To list a pay period, filter by `periodStartDate`. To list a staff member's pay history, filter by `staffMemberId`\n * and sort by `periodStartDate`.\n *\n * To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection).\n * @public\n * @documentationMaturity preview\n * @permissionId staff:pay:v1:staff_pay:query_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.QueryStaffPays\n */\nexport function queryStaffPays(): StaffPaysQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n StaffPay,\n 'CURSOR',\n QueryStaffPaysRequest,\n QueryStaffPaysResponse\n >({\n func: async (payload: QueryStaffPaysRequest) => {\n const reqOpts = ambassadorWixStaffPayV1StaffPay.queryStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryStaffPaysRequest['query']) => {\n const args = [query, {}] as [QueryStaffPaysRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryStaffPaysResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.staffPays,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface StaffPaysQueryResult extends QueryCursorResult {\n items: StaffPay[];\n query: StaffPaysQueryBuilder;\n next: () => Promise<StaffPaysQueryResult>;\n prev: () => Promise<StaffPaysQueryResult>;\n}\n\nexport interface StaffPaysQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ge: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n gt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n le: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n lt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n * @documentationMaturity preview\n */\n startsWith: (\n propertyName: '_id' | 'staffMemberId' | 'periodStartDate' | 'periodEndDate',\n value: string\n ) => StaffPaysQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale',\n value: any\n ) => StaffPaysQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale',\n value: boolean\n ) => StaffPaysQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n ascending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale'\n >\n ) => StaffPaysQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n descending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'staffMemberId'\n | 'periodStartDate'\n | 'periodEndDate'\n | 'status'\n | 'stale'\n >\n ) => StaffPaysQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => StaffPaysQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => StaffPaysQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<StaffPaysQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.staff.pay.v1.StaffPayService.QueryStaffPays\n * @requiredField query\n */\nexport async function typedQueryStaffPays(\n query: StaffPayQuery\n): Promise<\n NonNullablePaths<\n QueryStaffPaysResponse,\n | `staffPays`\n | `staffPays.${number}.staffMemberId`\n | `staffPays.${number}.periodStartDate`\n | `staffPays.${number}.periodEndDate`\n | `staffPays.${number}.status`\n | `staffPays.${number}.stale`\n | `staffPays.${number}.currency`\n | `staffPays.${number}.totals.grossAmount`\n | `staffPays.${number}.totals.paidHours`\n | `staffPays.${number}.totals.overtimeHours`\n | `staffPays.${number}.totals.sessionsCount`\n | `staffPays.${number}.totals.serviceRevenueAmount`\n | `staffPays.${number}.totals.commissionAmount`\n | `staffPays.${number}.totals.tipsAmount`\n | `staffPays.${number}.totals.adjustmentsAmount`\n | `staffPays.${number}.totals.productRevenueAmount`\n | `staffPays.${number}.totals.planRevenueAmount`\n | `staffPays.${number}.totals.upcomingSessionsCount`\n | `staffPays.${number}.factsHash`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.queryStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface StaffPayQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: [\n '_createdDate',\n '_id',\n '_updatedDate',\n 'periodEndDate',\n 'periodStartDate',\n 'staffMemberId',\n 'stale',\n 'status'\n ];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n StaffPay,\n StaffPayQuerySpec\n>;\nexport type StaffPayQuery = {\n /** \n Cursor paging options.\n\n Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). \n */\n cursorPaging?: {\n /** \n Maximum number of items to return in the results. \n @max: 100 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n @maxLength: 16000 \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object.\n\n Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section). \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object.\n\n Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). \n @maxSize: 5 \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\nexport const utils = {\n query: /*#__PURE__*/ createQueryUtils<\n StaffPay,\n StaffPayQuerySpec,\n StaffPayQuery\n >(),\n};\n\n/**\n * Deletes multiple staff pays.\n *\n * Each staff pay is deleted on its own: an approved one isn't deleted and its result fails with `STAFF_PAY_APPROVED`,\n * while the others are still deleted.\n *\n * To delete a single staff pay, call Delete Staff Pay.\n * @param staffPayIds - IDs of the staff pays to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayIds\n * @permissionId staff:pay:v1:staff_pay:bulk_delete_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.BulkDeleteStaffPays\n */\nexport async function bulkDeleteStaffPays(staffPayIds: string[]): Promise<\n NonNullablePaths<\n BulkDeleteStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkDeleteStaffPaysApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayIds: staffPayIds,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.bulkDeleteStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Calculates a staff pay.\n *\n * Reads the staff member's data for the period: hours from Time Clock timecards, sessions with their attendance and\n * service revenue from Bookings, and tips from Wix Tips. Applies the pay terms in effect on each day and replaces the\n * staff pay's lines, totals and alerts. Moves a `DRAFT` staff pay to `CALCULATED` and clears `stale` and\n * `staleReasons`.\n *\n * The data is read with the caller's permissions. A source the caller isn't allowed to read pays nothing and adds a\n * `SOURCE_NOT_PERMITTED` alert, which blocks approval until someone allowed to read it calculates again.\n *\n * Currently supports commission on services. Product and pricing plan sales aren't read yet, so components paid on\n * them pay nothing.\n *\n * An approved staff pay can't be calculated until it's reopened with Reopen Staff Pay. To preview\n * a calculation without saving it, call Preview Staff Pay Calculation.\n * @param staffPayId - ID of the staff pay to calculate.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:calculate_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.CalculateStaffPay\n */\nexport async function calculateStaffPay(staffPayId: string): Promise<\n NonNullablePaths<\n CalculateStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: CalculateStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.calculateStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Calculates a staff pay again without saving anything, and returns it as it would be.\n *\n * The saved staff pay, its status and `stale` stay as they are. Compare the returned `totals` and `lines` with the\n * saved ones to see what calculating again would change. Works for an approved staff pay too, to show what changed\n * since approval. To apply the changes, call Reopen Staff Pay and then\n * Calculate Staff Pay.\n *\n * With `proposedClockOuts`, also shows what clocking out open timecards would pay, before the clock-outs are saved in\n * Time Clock. Each timecard is calculated as clocked out at its proposed time, and its open timecard alert is\n * removed.\n * @param staffPayId - ID of the staff pay to calculate again.\n * @public\n * @documentationMaturity preview\n * @requiredField options.proposedClockOuts.clockOut\n * @requiredField options.proposedClockOuts.timecardId\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:preview_staff_pay_calculation\n * @fqn wix.staff.pay.v1.StaffPayService.PreviewStaffPayCalculation\n */\nexport async function previewStaffPayCalculation(\n staffPayId: string,\n options?: NonNullablePaths<\n PreviewStaffPayCalculationOptions,\n | `proposedClockOuts.${number}.clockOut`\n | `proposedClockOuts.${number}.timecardId`,\n 2\n >\n): Promise<\n NonNullablePaths<\n PreviewStaffPayCalculationResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: PreviewStaffPayCalculationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n proposedClockOuts: options?.proposedClockOuts,\n });\n\n const reqOpts =\n ambassadorWixStaffPayV1StaffPay.previewStaffPayCalculation(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n staffPayId: '$[0]',\n proposedClockOuts: '$[1].proposedClockOuts',\n },\n singleArgumentUnchanged: false,\n },\n ['staffPayId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PreviewStaffPayCalculationOptions {\n /**\n * Clock-outs to calculate open timecards with, as if they were saved. They aren't saved: clock the timecards out in\n * Time Clock to keep them.\n *\n * Each must name an open timecard of the staff pay's staff member that clocked in within the period, at most once,\n * with a time after its clock-in. Otherwise, the request fails with `INVALID_PROPOSED_CLOCK_OUT`.\n *\n * Default: The timecards as they are.\n * @maxSize 50\n */\n proposedClockOuts?: ProposedClockOut[];\n}\n\n/**\n * Calculates a pay period for multiple staff members.\n *\n * Creates a `DRAFT` staff pay for each staff member who doesn't have one for the period yet, then calculates every\n * staff pay of the period that isn't approved. Approved staff pays keep their result. In the open period and the last\n * period that ended before it, an approved staff pay whose sessions, bookings, attendance or orders changed since\n * approval is marked `stale`, with the `SOURCE_DATA_CHANGED` reason. Without `staffMemberIds`, the staff members whose\n * pay terms are in effect on at least 1 day of the period are calculated.\n *\n * A period that has no staff pay yet must be one of the site's pay schedule's periods, as in Create Staff Pay.\n *\n * Each staff pay is calculated on its own, so one that fails doesn't affect the others.\n *\n * To calculate a single staff pay, call Calculate Staff Pay.\n * @param periodStartDate - First day of the pay period, in `YYYY-MM-DD` format.\n * @public\n * @documentationMaturity preview\n * @requiredField options.periodEndDate\n * @requiredField periodStartDate\n * @permissionId staff:pay:v1:staff_pay:bulk_calculate_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.BulkCalculateStaffPays\n */\nexport async function bulkCalculateStaffPays(\n periodStartDate: string,\n options?: NonNullablePaths<BulkCalculateStaffPaysOptions, `periodEndDate`, 0>\n): Promise<\n NonNullablePaths<\n BulkCalculateStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `results.${number}.item.staffMemberId`\n | `results.${number}.item.periodStartDate`\n | `results.${number}.item.periodEndDate`\n | `results.${number}.item.status`\n | `results.${number}.item.stale`\n | `results.${number}.item.currency`\n | `results.${number}.item.totals.grossAmount`\n | `results.${number}.item.totals.paidHours`\n | `results.${number}.item.totals.overtimeHours`\n | `results.${number}.item.totals.sessionsCount`\n | `results.${number}.item.totals.serviceRevenueAmount`\n | `results.${number}.item.totals.commissionAmount`\n | `results.${number}.item.totals.tipsAmount`\n | `results.${number}.item.totals.adjustmentsAmount`\n | `results.${number}.item.totals.productRevenueAmount`\n | `results.${number}.item.totals.planRevenueAmount`\n | `results.${number}.item.totals.upcomingSessionsCount`\n | `results.${number}.item.factsHash`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkCalculateStaffPaysApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n periodStartDate: periodStartDate,\n periodEndDate: options?.periodEndDate,\n staffMemberIds: options?.staffMemberIds,\n });\n\n const reqOpts =\n ambassadorWixStaffPayV1StaffPay.bulkCalculateStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n periodStartDate: '$[0]',\n periodEndDate: '$[1].periodEndDate',\n staffMemberIds: '$[1].staffMemberIds',\n },\n singleArgumentUnchanged: false,\n },\n ['periodStartDate', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkCalculateStaffPaysOptions {\n /**\n * Last day of the pay period (inclusive), in `YYYY-MM-DD` format.\n * @format LOCAL_DATE\n */\n periodEndDate: string;\n /**\n * IDs of the staff members to calculate.\n *\n * Default: The staff members whose pay terms are in effect on at least 1 day of the period.\n * @maxSize 500\n * @format GUID\n */\n staffMemberIds?: string[];\n}\n\n/**\n * Approves a calculated staff pay and locks its result.\n *\n * The current `revision` must be passed, so the approved result is the one that was reviewed.\n *\n * A staff pay can't be approved while it's stale, while a timecard it pays was clocked out automatically, or while a\n * source its last calculation couldn't read is missing. Calculate it again first. To change an approved staff pay,\n * call Reopen Staff Pay.\n *\n * To approve multiple staff pays in a single API call, call Bulk Approve Staff Pays.\n * @param staffPayId - ID of the staff pay to approve.\n * @param revision - Current revision of the staff pay.\n * @public\n * @documentationMaturity preview\n * @requiredField revision\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:approve_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.ApproveStaffPay\n */\nexport async function approveStaffPay(\n staffPayId: string,\n revision: string\n): Promise<\n NonNullablePaths<\n ApproveStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: ApproveStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n revision: revision,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.approveStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]', revision: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId', 'revision']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Approves multiple calculated staff pays.\n *\n * Each staff pay is approved on its own at its current revision: one that can't be approved fails without affecting\n * the others.\n *\n * To approve a single staff pay, call Approve Staff Pay.\n * @param staffPayIds - IDs of the staff pays to approve.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayIds\n * @permissionId staff:pay:v1:staff_pay:bulk_approve_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.BulkApproveStaffPays\n */\nexport async function bulkApproveStaffPays(\n staffPayIds: string[]\n): Promise<\n NonNullablePaths<\n BulkApproveStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayIds: staffPayIds,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.bulkApproveStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Reopens an approved staff pay so it can be changed and calculated again.\n *\n * Moves the staff pay back to `CALCULATED`. Its approved result stays until it's calculated again. The staff pay is\n * stale when its data changed while it was approved, and it keeps its `staleReasons`.\n * @param staffPayId - ID of the staff pay to reopen.\n * @public\n * @documentationMaturity preview\n * @requiredField staffPayId\n * @permissionId staff:pay:v1:staff_pay:reopen_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.ReopenStaffPay\n */\nexport async function reopenStaffPay(staffPayId: string): Promise<\n NonNullablePaths<\n ReopenStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: ReopenStaffPayApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n staffPayId: staffPayId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.reopenStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { staffPayId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['staffPayId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Exports the approved staff pays of a pay period as a CSV file.\n *\n * Uses the requested `format`, or the format in the site's export settings when none is specified. Staff pays of the\n * period that aren't approved are left out and counted in `skippedCount`. Sets `lastExportedDate` on each exported\n * staff pay.\n * @param periodStartDate - First day of the pay period to export, in `YYYY-MM-DD` format.\n * @public\n * @documentationMaturity preview\n * @requiredField periodStartDate\n * @permissionId staff:pay:v1:staff_pay:export_staff_pays\n * @fqn wix.staff.pay.v1.StaffPayService.ExportStaffPays\n */\nexport async function exportStaffPays(\n periodStartDate: string,\n options?: ExportStaffPaysOptions\n): Promise<\n NonNullablePaths<\n ExportStaffPaysResponse,\n `fileName` | `content` | `skippedCount`,\n 0\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n periodStartDate: periodStartDate,\n format: options?.format,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.exportStaffPays(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n periodStartDate: '$[0]',\n format: '$[1].format',\n },\n singleArgumentUnchanged: false,\n },\n ['periodStartDate', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ExportStaffPaysOptions {\n /**\n * Export format.\n *\n * Default: The format in the site's export settings.\n */\n format?: ExportFormatWithLiterals;\n}\n\n/**\n * Calculates what a pay model would pay for a set of sample data, without saving anything.\n *\n * The pay model doesn't need to be saved first. Use it to show what a pay model pays while it's being edited.\n * @param payModel - Pay model to preview. May be unsaved.\n * @public\n * @documentationMaturity preview\n * @requiredField options\n * @requiredField options.sampleFacts\n * @requiredField payModel\n * @permissionId staff:pay:v1:staff_pay:preview_staff_pay\n * @fqn wix.staff.pay.v1.StaffPayService.PreviewStaffPay\n */\nexport async function previewStaffPay(\n payModel: PayModel,\n options: NonNullablePaths<PreviewStaffPayOptions, `sampleFacts`, 0>\n): Promise<\n NonNullablePaths<\n PreviewStaffPayResponse,\n | `components`\n | `components.${number}.componentName`\n | `components.${number}.amount`\n | `components.${number}.included`\n | `components.${number}.explanation`\n | `grossAmount`,\n 2\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n payModel: payModel,\n sampleFacts: options?.sampleFacts,\n });\n\n const reqOpts = ambassadorWixStaffPayV1StaffPay.previewStaffPay(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n payModel: '$[0]',\n sampleFacts: '$[1].sampleFacts',\n },\n singleArgumentUnchanged: false,\n },\n ['payModel', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PreviewStaffPayOptions {\n /** Sample data for 1 staff member over 1 pay period. */\n sampleFacts: SampleFacts;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nconst TRANSFORM_PATHS_0 = [\n { path: 'staffPay.createdDate' },\n { path: 'staffPay.updatedDate' },\n { path: 'staffPay.calculatedDate' },\n { path: 'staffPay.approvedDate' },\n { path: 'staffPay.lastExportedDate' },\n { path: 'staffPay.staleReasons.changedDate' },\n];\nconst TRANSFORM_PATHS_1 = [{ path: 'fieldMask' }];\nconst TRANSFORM_PATHS_2 = [\n { path: 'staffPays.createdDate' },\n { path: 'staffPays.updatedDate' },\n { path: 'staffPays.calculatedDate' },\n { path: 'staffPays.approvedDate' },\n { path: 'staffPays.lastExportedDate' },\n { path: 'staffPays.staleReasons.changedDate' },\n];\nconst TRANSFORM_PATHS_3 = [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n { path: 'results.item.calculatedDate' },\n { path: 'results.item.approvedDate' },\n { path: 'results.item.lastExportedDate' },\n { path: 'results.item.staleReasons.changedDate' },\n];\nconst TRANSFORM_PATHS_4 = [\n { path: 'payModel.createdDate' },\n { path: 'payModel.updatedDate' },\n { path: 'payModel.archivedDate' },\n];\n\nfunction resolveWixStaffPayV1StaffPayServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/staff-pay',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_staff-pay_staff-pay';\n\n/**\n * Creates a `DRAFT` staff pay for a staff member and pay period.\n *\n * A pay period is at most 62 days long, and a staff member's staff pays can't overlap. When the site has a pay schedule,\n * a period that has no staff pay yet must be one of the schedule's periods, from its first period on, or the days\n * between the last staff pay and the first period. To calculate the staff pay, call Calculate Staff Pay. To create and calculate a whole period at once, call\n * Bulk Calculate Staff Pays.\n */\nexport function createStaffPay(payload: object): RequestOptionsFactory<any> {\n function __createStaffPay({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.CreateStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createStaffPay;\n}\n\n/** Retrieves a staff pay, including its pay lines. */\nexport function getStaffPay(payload: object): RequestOptionsFactory<any> {\n function __getStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'GET' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.GetStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getStaffPay;\n}\n\n/**\n * Updates a staff pay's adjustments and extended fields.\n *\n * Each time the staff pay is updated, `revision` increments by 1. The current `revision` must be passed when updating\n * the staff pay. This ensures you're working with the latest staff pay and prevents unintended overwrites.\n *\n * Supported properties: `adjustments`, `extendedFields`. Other paths in `fieldMask` are ignored.\n *\n * Adjustments are bonuses, deductions and reimbursements, and each becomes a pay line. A wrong calculated amount isn't\n * corrected here: fix its source, such as the timecard or booking, and calculate the staff pay again. Changing the\n * adjustments of a calculated staff pay marks it stale. An approved staff pay can't be updated until it's reopened with\n * Reopen Staff Pay.\n */\nexport function updateStaffPay(payload: object): RequestOptionsFactory<any> {\n function __updateStaffPay({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: TRANSFORM_PATHS_1,\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'PATCH' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.UpdateStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPay.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateStaffPay;\n}\n\n/**\n * Deletes a staff pay.\n *\n * An approved staff pay can't be deleted until it's reopened with Reopen Staff Pay.\n *\n * To delete multiple staff pays in a single API call, call Bulk Delete Staff Pays.\n */\nexport function deleteStaffPay(payload: object): RequestOptionsFactory<any> {\n function __deleteStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'DELETE' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.DeleteStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteStaffPay;\n}\n\n/**\n * Retrieves a list of up to 100 staff pays, given the provided paging, filtering, and sorting.\n *\n * Query Staff Pays runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * To list a pay period, filter by `periodStartDate`. To list a staff member's pay history, filter by `staffMemberId`\n * and sort by `periodStartDate`.\n *\n * To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection).\n */\nexport function queryStaffPays(payload: object): RequestOptionsFactory<any> {\n function __queryStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'GET' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.QueryStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/query',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload, true),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_2,\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryStaffPays;\n}\n\n/**\n * Deletes multiple staff pays.\n *\n * Each staff pay is deleted on its own: an approved one isn't deleted and its result fails with `STAFF_PAY_APPROVED`,\n * while the others are still deleted.\n *\n * To delete a single staff pay, call Delete Staff Pay.\n */\nexport function bulkDeleteStaffPays(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkDeleteStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.BulkDeleteStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/bulk/staff-pays/delete',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkDeleteStaffPays;\n}\n\n/**\n * Calculates a staff pay.\n *\n * Reads the staff member's data for the period: hours from Time Clock timecards, sessions with their attendance and\n * service revenue from Bookings, and tips from Wix Tips. Applies the pay terms in effect on each day and replaces the\n * staff pay's lines, totals and alerts. Moves a `DRAFT` staff pay to `CALCULATED` and clears `stale` and\n * `staleReasons`.\n *\n * The data is read with the caller's permissions. A source the caller isn't allowed to read pays nothing and adds a\n * `SOURCE_NOT_PERMITTED` alert, which blocks approval until someone allowed to read it calculates again.\n *\n * Currently supports commission on services. Product and pricing plan sales aren't read yet, so components paid on\n * them pay nothing.\n *\n * An approved staff pay can't be calculated until it's reopened with Reopen Staff Pay. To preview\n * a calculation without saving it, call Preview Staff Pay Calculation.\n */\nexport function calculateStaffPay(payload: object): RequestOptionsFactory<any> {\n function __calculateStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.CalculateStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}/calculate',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __calculateStaffPay;\n}\n\n/**\n * Calculates a staff pay again without saving anything, and returns it as it would be.\n *\n * The saved staff pay, its status and `stale` stay as they are. Compare the returned `totals` and `lines` with the\n * saved ones to see what calculating again would change. Works for an approved staff pay too, to show what changed\n * since approval. To apply the changes, call Reopen Staff Pay and then\n * Calculate Staff Pay.\n *\n * With `proposedClockOuts`, also shows what clocking out open timecards would pay, before the clock-outs are saved in\n * Time Clock. Each timecard is calculated as clocked out at its proposed time, and its open timecard alert is\n * removed.\n */\nexport function previewStaffPayCalculation(\n payload: object\n): RequestOptionsFactory<any> {\n function __previewStaffPayCalculation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.PreviewStaffPayCalculation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}/preview-calculation',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __previewStaffPayCalculation;\n}\n\n/**\n * Calculates a pay period for multiple staff members.\n *\n * Creates a `DRAFT` staff pay for each staff member who doesn't have one for the period yet, then calculates every\n * staff pay of the period that isn't approved. Approved staff pays keep their result. In the open period and the last\n * period that ended before it, an approved staff pay whose sessions, bookings, attendance or orders changed since\n * approval is marked `stale`, with the `SOURCE_DATA_CHANGED` reason. Without `staffMemberIds`, the staff members whose\n * pay terms are in effect on at least 1 day of the period are calculated.\n *\n * A period that has no staff pay yet must be one of the site's pay schedule's periods, as in Create Staff Pay.\n *\n * Each staff pay is calculated on its own, so one that fails doesn't affect the others.\n *\n * To calculate a single staff pay, call Calculate Staff Pay.\n */\nexport function bulkCalculateStaffPays(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkCalculateStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.BulkCalculateStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/bulk/staff-pays/calculate',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_3,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCalculateStaffPays;\n}\n\n/**\n * Approves a calculated staff pay and locks its result.\n *\n * The current `revision` must be passed, so the approved result is the one that was reviewed.\n *\n * A staff pay can't be approved while it's stale, while a timecard it pays was clocked out automatically, or while a\n * source its last calculation couldn't read is missing. Calculate it again first. To change an approved staff pay,\n * call Reopen Staff Pay.\n *\n * To approve multiple staff pays in a single API call, call Bulk Approve Staff Pays.\n */\nexport function approveStaffPay(payload: object): RequestOptionsFactory<any> {\n function __approveStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.ApproveStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}/approve',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __approveStaffPay;\n}\n\n/**\n * Approves multiple calculated staff pays.\n *\n * Each staff pay is approved on its own at its current revision: one that can't be approved fails without affecting\n * the others.\n *\n * To approve a single staff pay, call Approve Staff Pay.\n */\nexport function bulkApproveStaffPays(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkApproveStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.BulkApproveStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/bulk/staff-pays/approve',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkApproveStaffPays;\n}\n\n/**\n * Reopens an approved staff pay so it can be changed and calculated again.\n *\n * Moves the staff pay back to `CALCULATED`. Its approved result stays until it's calculated again. The staff pay is\n * stale when its data changed while it was approved, and it keeps its `staleReasons`.\n */\nexport function reopenStaffPay(payload: object): RequestOptionsFactory<any> {\n function __reopenStaffPay({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.ReopenStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/{staffPayId}/reopen',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __reopenStaffPay;\n}\n\n/**\n * Exports the approved staff pays of a pay period as a CSV file.\n *\n * Uses the requested `format`, or the format in the site's export settings when none is specified. Staff pays of the\n * period that aren't approved are left out and counted in `skippedCount`. Sets `lastExportedDate` on each exported\n * staff pay.\n */\nexport function exportStaffPays(payload: object): RequestOptionsFactory<any> {\n function __exportStaffPays({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.ExportStaffPays',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/export',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __exportStaffPays;\n}\n\n/**\n * Calculates what a pay model would pay for a set of sample data, without saving anything.\n *\n * The pay model doesn't need to be saved first. Use it to show what a pay model pays while it's being edited.\n */\nexport function previewStaffPay(payload: object): RequestOptionsFactory<any> {\n function __previewStaffPay({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: TRANSFORM_PATHS_4,\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.staff_pay',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.StaffPayService.PreviewStaffPay',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1StaffPayServiceUrl({\n protoPath: '/v1/staff-pays/preview',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __previewStaffPay;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ApproveStaffPayApplicationErrors,\n ApproveStaffPayResponse,\n BulkApproveStaffPaysResponse,\n BulkCalculateStaffPaysApplicationErrors,\n BulkCalculateStaffPaysOptions,\n BulkCalculateStaffPaysResponse,\n BulkDeleteStaffPaysApplicationErrors,\n BulkDeleteStaffPaysResponse,\n CalculateStaffPayApplicationErrors,\n CalculateStaffPayResponse,\n CreateStaffPayApplicationErrors,\n DeleteStaffPayApplicationErrors,\n ExportStaffPaysOptions,\n ExportStaffPaysResponse,\n PayModel,\n PreviewStaffPayCalculationApplicationErrors,\n PreviewStaffPayCalculationOptions,\n PreviewStaffPayCalculationResponse,\n PreviewStaffPayOptions,\n PreviewStaffPayResponse,\n QueryStaffPaysResponse,\n ReopenStaffPayApplicationErrors,\n ReopenStaffPayResponse,\n StaffPay,\n StaffPayQuery,\n StaffPaysQueryBuilder,\n UpdateStaffPay,\n UpdateStaffPayApplicationErrors,\n approveStaffPay as universalApproveStaffPay,\n bulkApproveStaffPays as universalBulkApproveStaffPays,\n bulkCalculateStaffPays as universalBulkCalculateStaffPays,\n bulkDeleteStaffPays as universalBulkDeleteStaffPays,\n calculateStaffPay as universalCalculateStaffPay,\n createStaffPay as universalCreateStaffPay,\n deleteStaffPay as universalDeleteStaffPay,\n exportStaffPays as universalExportStaffPays,\n getStaffPay as universalGetStaffPay,\n previewStaffPay as universalPreviewStaffPay,\n previewStaffPayCalculation as universalPreviewStaffPayCalculation,\n queryStaffPays as universalQueryStaffPays,\n reopenStaffPay as universalReopenStaffPay,\n typedQueryStaffPays as universalTypedQueryStaffPays,\n updateStaffPay as universalUpdateStaffPay,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/staff-pay' };\n\nexport function createStaffPay(\n httpClient: HttpClient\n): CreateStaffPaySignature {\n return (\n staffPay: NonNullablePaths<\n StaffPay,\n `periodEndDate` | `periodStartDate` | `staffMemberId`,\n 0\n >\n ) =>\n universalCreateStaffPay(\n staffPay,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateStaffPaySignature {\n /**\n * Creates a `DRAFT` staff pay for a staff member and pay period.\n *\n * A pay period is at most 62 days long, and a staff member's staff pays can't overlap. When the site has a pay schedule,\n * a period that has no staff pay yet must be one of the schedule's periods, from its first period on, or the days\n * between the last staff pay and the first period. To calculate the staff pay, call Calculate Staff Pay. To create and calculate a whole period at once, call\n * Bulk Calculate Staff Pays.\n * @param - Staff pay to create.\n * @returns Created staff pay.\n */\n (\n staffPay: NonNullablePaths<\n StaffPay,\n `periodEndDate` | `periodStartDate` | `staffMemberId`,\n 0\n >\n ): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n > & {\n __applicationErrorsType?: CreateStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function getStaffPay(httpClient: HttpClient): GetStaffPaySignature {\n return (staffPayId: string) =>\n universalGetStaffPay(\n staffPayId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetStaffPaySignature {\n /**\n * Retrieves a staff pay, including its pay lines.\n * @param - ID of the staff pay to retrieve.\n * @returns Retrieved staff pay.\n */\n (staffPayId: string): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n >\n >;\n}\n\nexport function updateStaffPay(\n httpClient: HttpClient\n): UpdateStaffPaySignature {\n return (\n _id: string,\n staffPay: NonNullablePaths<UpdateStaffPay, `revision`, 0>\n ) =>\n universalUpdateStaffPay(\n _id,\n staffPay,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateStaffPaySignature {\n /**\n * Updates a staff pay's adjustments and extended fields.\n *\n * Each time the staff pay is updated, `revision` increments by 1. The current `revision` must be passed when updating\n * the staff pay. This ensures you're working with the latest staff pay and prevents unintended overwrites.\n *\n * Supported properties: `adjustments`, `extendedFields`. Other paths in `fieldMask` are ignored.\n *\n * Adjustments are bonuses, deductions and reimbursements, and each becomes a pay line. A wrong calculated amount isn't\n * corrected here: fix its source, such as the timecard or booking, and calculate the staff pay again. Changing the\n * adjustments of a calculated staff pay marks it stale. An approved staff pay can't be updated until it's reopened with\n * Reopen Staff Pay.\n * @param - Staff pay ID.\n * @returns Updated staff pay.\n */\n (\n _id: string,\n staffPay: NonNullablePaths<UpdateStaffPay, `revision`, 0>\n ): Promise<\n NonNullablePaths<\n StaffPay,\n | `staffMemberId`\n | `periodStartDate`\n | `periodEndDate`\n | `status`\n | `stale`\n | `currency`\n | `totals.grossAmount`\n | `totals.paidHours`\n | `totals.overtimeHours`\n | `totals.sessionsCount`\n | `totals.serviceRevenueAmount`\n | `totals.commissionAmount`\n | `totals.tipsAmount`\n | `totals.adjustmentsAmount`\n | `totals.productRevenueAmount`\n | `totals.planRevenueAmount`\n | `totals.upcomingSessionsCount`\n | `lines`\n | `lines.${number}._id`\n | `lines.${number}.componentName`\n | `lines.${number}.type`\n | `lines.${number}.source.type`\n | `lines.${number}.source._id`\n | `lines.${number}.date`\n | `lines.${number}.quantity`\n | `lines.${number}.quantityUnit`\n | `lines.${number}.rate`\n | `lines.${number}.amount`\n | `lines.${number}.included`\n | `lines.${number}.explanation`\n | `adjustments`\n | `adjustments.${number}.type`\n | `adjustments.${number}.amount`\n | `adjustments.${number}.note`\n | `alerts`\n | `alerts.${number}.type`\n | `alerts.${number}.message`\n | `factsHash`\n | `payTermsIds`,\n 3\n > & {\n __applicationErrorsType?: UpdateStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function deleteStaffPay(\n httpClient: HttpClient\n): DeleteStaffPaySignature {\n return (staffPayId: string) =>\n universalDeleteStaffPay(\n staffPayId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteStaffPaySignature {\n /**\n * Deletes a staff pay.\n *\n * An approved staff pay can't be deleted until it's reopened with Reopen Staff Pay.\n *\n * To delete multiple staff pays in a single API call, call Bulk Delete Staff Pays.\n * @param - ID of the staff pay to delete.\n */\n (staffPayId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function queryStaffPays(\n httpClient: HttpClient\n): QueryStaffPaysSignature {\n return () =>\n universalQueryStaffPays(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryStaffPaysSignature {\n /**\n * Retrieves a list of up to 100 staff pays, given the provided paging, filtering, and sorting.\n *\n * Query Staff Pays runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * To list a pay period, filter by `periodStartDate`. To list a staff member's pay history, filter by `staffMemberId`\n * and sort by `periodStartDate`.\n *\n * To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection).\n */\n (): StaffPaysQueryBuilder;\n}\n\nexport function typedQueryStaffPays(\n httpClient: HttpClient\n): TypedQueryStaffPaysSignature {\n return (query: StaffPayQuery) =>\n universalTypedQueryStaffPays(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryStaffPaysSignature {\n /** */\n (query: StaffPayQuery): Promise<\n NonNullablePaths<\n QueryStaffPaysResponse,\n | `staffPays`\n | `staffPays.${number}.staffMemberId`\n | `staffPays.${number}.periodStartDate`\n | `staffPays.${number}.periodEndDate`\n | `staffPays.${number}.status`\n | `staffPays.${number}.stale`\n | `staffPays.${number}.currency`\n | `staffPays.${number}.totals.grossAmount`\n | `staffPays.${number}.totals.paidHours`\n | `staffPays.${number}.totals.overtimeHours`\n | `staffPays.${number}.totals.sessionsCount`\n | `staffPays.${number}.totals.serviceRevenueAmount`\n | `staffPays.${number}.totals.commissionAmount`\n | `staffPays.${number}.totals.tipsAmount`\n | `staffPays.${number}.totals.adjustmentsAmount`\n | `staffPays.${number}.totals.productRevenueAmount`\n | `staffPays.${number}.totals.planRevenueAmount`\n | `staffPays.${number}.totals.upcomingSessionsCount`\n | `staffPays.${number}.factsHash`,\n 3\n >\n >;\n}\n\nexport function bulkDeleteStaffPays(\n httpClient: HttpClient\n): BulkDeleteStaffPaysSignature {\n return (staffPayIds: string[]) =>\n universalBulkDeleteStaffPays(\n staffPayIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkDeleteStaffPaysSignature {\n /**\n * Deletes multiple staff pays.\n *\n * Each staff pay is deleted on its own: an approved one isn't deleted and its result fails with `STAFF_PAY_APPROVED`,\n * while the others are still deleted.\n *\n * To delete a single staff pay, call Delete Staff Pay.\n * @param - IDs of the staff pays to delete.\n */\n (staffPayIds: string[]): Promise<\n NonNullablePaths<\n BulkDeleteStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkDeleteStaffPaysApplicationErrors;\n }\n >;\n}\n\nexport function calculateStaffPay(\n httpClient: HttpClient\n): CalculateStaffPaySignature {\n return (staffPayId: string) =>\n universalCalculateStaffPay(\n staffPayId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CalculateStaffPaySignature {\n /**\n * Calculates a staff pay.\n *\n * Reads the staff member's data for the period: hours from Time Clock timecards, sessions with their attendance and\n * service revenue from Bookings, and tips from Wix Tips. Applies the pay terms in effect on each day and replaces the\n * staff pay's lines, totals and alerts. Moves a `DRAFT` staff pay to `CALCULATED` and clears `stale` and\n * `staleReasons`.\n *\n * The data is read with the caller's permissions. A source the caller isn't allowed to read pays nothing and adds a\n * `SOURCE_NOT_PERMITTED` alert, which blocks approval until someone allowed to read it calculates again.\n *\n * Currently supports commission on services. Product and pricing plan sales aren't read yet, so components paid on\n * them pay nothing.\n *\n * An approved staff pay can't be calculated until it's reopened with Reopen Staff Pay. To preview\n * a calculation without saving it, call Preview Staff Pay Calculation.\n * @param - ID of the staff pay to calculate.\n */\n (staffPayId: string): Promise<\n NonNullablePaths<\n CalculateStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: CalculateStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function previewStaffPayCalculation(\n httpClient: HttpClient\n): PreviewStaffPayCalculationSignature {\n return (\n staffPayId: string,\n options?: NonNullablePaths<\n PreviewStaffPayCalculationOptions,\n | `proposedClockOuts.${number}.clockOut`\n | `proposedClockOuts.${number}.timecardId`,\n 2\n >\n ) =>\n universalPreviewStaffPayCalculation(\n staffPayId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PreviewStaffPayCalculationSignature {\n /**\n * Calculates a staff pay again without saving anything, and returns it as it would be.\n *\n * The saved staff pay, its status and `stale` stay as they are. Compare the returned `totals` and `lines` with the\n * saved ones to see what calculating again would change. Works for an approved staff pay too, to show what changed\n * since approval. To apply the changes, call Reopen Staff Pay and then\n * Calculate Staff Pay.\n *\n * With `proposedClockOuts`, also shows what clocking out open timecards would pay, before the clock-outs are saved in\n * Time Clock. Each timecard is calculated as clocked out at its proposed time, and its open timecard alert is\n * removed.\n * @param - ID of the staff pay to calculate again.\n */\n (\n staffPayId: string,\n options?: NonNullablePaths<\n PreviewStaffPayCalculationOptions,\n | `proposedClockOuts.${number}.clockOut`\n | `proposedClockOuts.${number}.timecardId`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n PreviewStaffPayCalculationResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: PreviewStaffPayCalculationApplicationErrors;\n }\n >;\n}\n\nexport function bulkCalculateStaffPays(\n httpClient: HttpClient\n): BulkCalculateStaffPaysSignature {\n return (\n periodStartDate: string,\n options?: NonNullablePaths<\n BulkCalculateStaffPaysOptions,\n `periodEndDate`,\n 0\n >\n ) =>\n universalBulkCalculateStaffPays(\n periodStartDate,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkCalculateStaffPaysSignature {\n /**\n * Calculates a pay period for multiple staff members.\n *\n * Creates a `DRAFT` staff pay for each staff member who doesn't have one for the period yet, then calculates every\n * staff pay of the period that isn't approved. Approved staff pays keep their result. In the open period and the last\n * period that ended before it, an approved staff pay whose sessions, bookings, attendance or orders changed since\n * approval is marked `stale`, with the `SOURCE_DATA_CHANGED` reason. Without `staffMemberIds`, the staff members whose\n * pay terms are in effect on at least 1 day of the period are calculated.\n *\n * A period that has no staff pay yet must be one of the site's pay schedule's periods, as in Create Staff Pay.\n *\n * Each staff pay is calculated on its own, so one that fails doesn't affect the others.\n *\n * To calculate a single staff pay, call Calculate Staff Pay.\n * @param - First day of the pay period, in `YYYY-MM-DD` format.\n */\n (\n periodStartDate: string,\n options?: NonNullablePaths<\n BulkCalculateStaffPaysOptions,\n `periodEndDate`,\n 0\n >\n ): Promise<\n NonNullablePaths<\n BulkCalculateStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `results.${number}.item.staffMemberId`\n | `results.${number}.item.periodStartDate`\n | `results.${number}.item.periodEndDate`\n | `results.${number}.item.status`\n | `results.${number}.item.stale`\n | `results.${number}.item.currency`\n | `results.${number}.item.totals.grossAmount`\n | `results.${number}.item.totals.paidHours`\n | `results.${number}.item.totals.overtimeHours`\n | `results.${number}.item.totals.sessionsCount`\n | `results.${number}.item.totals.serviceRevenueAmount`\n | `results.${number}.item.totals.commissionAmount`\n | `results.${number}.item.totals.tipsAmount`\n | `results.${number}.item.totals.adjustmentsAmount`\n | `results.${number}.item.totals.productRevenueAmount`\n | `results.${number}.item.totals.planRevenueAmount`\n | `results.${number}.item.totals.upcomingSessionsCount`\n | `results.${number}.item.factsHash`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkCalculateStaffPaysApplicationErrors;\n }\n >;\n}\n\nexport function approveStaffPay(\n httpClient: HttpClient\n): ApproveStaffPaySignature {\n return (staffPayId: string, revision: string) =>\n universalApproveStaffPay(\n staffPayId,\n revision,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ApproveStaffPaySignature {\n /**\n * Approves a calculated staff pay and locks its result.\n *\n * The current `revision` must be passed, so the approved result is the one that was reviewed.\n *\n * A staff pay can't be approved while it's stale, while a timecard it pays was clocked out automatically, or while a\n * source its last calculation couldn't read is missing. Calculate it again first. To change an approved staff pay,\n * call Reopen Staff Pay.\n *\n * To approve multiple staff pays in a single API call, call Bulk Approve Staff Pays.\n * @param - ID of the staff pay to approve.\n * @param - Current revision of the staff pay.\n */\n (staffPayId: string, revision: string): Promise<\n NonNullablePaths<\n ApproveStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: ApproveStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function bulkApproveStaffPays(\n httpClient: HttpClient\n): BulkApproveStaffPaysSignature {\n return (staffPayIds: string[]) =>\n universalBulkApproveStaffPays(\n staffPayIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkApproveStaffPaysSignature {\n /**\n * Approves multiple calculated staff pays.\n *\n * Each staff pay is approved on its own at its current revision: one that can't be approved fails without affecting\n * the others.\n *\n * To approve a single staff pay, call Approve Staff Pay.\n * @param - IDs of the staff pays to approve.\n */\n (staffPayIds: string[]): Promise<\n NonNullablePaths<\n BulkApproveStaffPaysResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n >\n >;\n}\n\nexport function reopenStaffPay(\n httpClient: HttpClient\n): ReopenStaffPaySignature {\n return (staffPayId: string) =>\n universalReopenStaffPay(\n staffPayId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ReopenStaffPaySignature {\n /**\n * Reopens an approved staff pay so it can be changed and calculated again.\n *\n * Moves the staff pay back to `CALCULATED`. Its approved result stays until it's calculated again. The staff pay is\n * stale when its data changed while it was approved, and it keeps its `staleReasons`.\n * @param - ID of the staff pay to reopen.\n */\n (staffPayId: string): Promise<\n NonNullablePaths<\n ReopenStaffPayResponse,\n | `staffPay.staffMemberId`\n | `staffPay.periodStartDate`\n | `staffPay.periodEndDate`\n | `staffPay.status`\n | `staffPay.stale`\n | `staffPay.currency`\n | `staffPay.totals.grossAmount`\n | `staffPay.totals.paidHours`\n | `staffPay.totals.overtimeHours`\n | `staffPay.totals.sessionsCount`\n | `staffPay.totals.serviceRevenueAmount`\n | `staffPay.totals.commissionAmount`\n | `staffPay.totals.tipsAmount`\n | `staffPay.totals.adjustmentsAmount`\n | `staffPay.totals.productRevenueAmount`\n | `staffPay.totals.planRevenueAmount`\n | `staffPay.totals.upcomingSessionsCount`\n | `staffPay.lines`\n | `staffPay.lines.${number}._id`\n | `staffPay.lines.${number}.componentName`\n | `staffPay.lines.${number}.type`\n | `staffPay.lines.${number}.source.type`\n | `staffPay.lines.${number}.source._id`\n | `staffPay.lines.${number}.date`\n | `staffPay.lines.${number}.quantity`\n | `staffPay.lines.${number}.quantityUnit`\n | `staffPay.lines.${number}.rate`\n | `staffPay.lines.${number}.amount`\n | `staffPay.lines.${number}.included`\n | `staffPay.lines.${number}.explanation`\n | `staffPay.adjustments`\n | `staffPay.adjustments.${number}.type`\n | `staffPay.adjustments.${number}.amount`\n | `staffPay.adjustments.${number}.note`\n | `staffPay.alerts`\n | `staffPay.alerts.${number}.type`\n | `staffPay.alerts.${number}.message`\n | `staffPay.factsHash`\n | `staffPay.payTermsIds`,\n 4\n > & {\n __applicationErrorsType?: ReopenStaffPayApplicationErrors;\n }\n >;\n}\n\nexport function exportStaffPays(\n httpClient: HttpClient\n): ExportStaffPaysSignature {\n return (periodStartDate: string, options?: ExportStaffPaysOptions) =>\n universalExportStaffPays(\n periodStartDate,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ExportStaffPaysSignature {\n /**\n * Exports the approved staff pays of a pay period as a CSV file.\n *\n * Uses the requested `format`, or the format in the site's export settings when none is specified. Staff pays of the\n * period that aren't approved are left out and counted in `skippedCount`. Sets `lastExportedDate` on each exported\n * staff pay.\n * @param - First day of the pay period to export, in `YYYY-MM-DD` format.\n */\n (periodStartDate: string, options?: ExportStaffPaysOptions): Promise<\n NonNullablePaths<\n ExportStaffPaysResponse,\n `fileName` | `content` | `skippedCount`,\n 0\n >\n >;\n}\n\nexport function previewStaffPay(\n httpClient: HttpClient\n): PreviewStaffPaySignature {\n return (\n payModel: PayModel,\n options: NonNullablePaths<PreviewStaffPayOptions, `sampleFacts`, 0>\n ) =>\n universalPreviewStaffPay(\n payModel,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PreviewStaffPaySignature {\n /**\n * Calculates what a pay model would pay for a set of sample data, without saving anything.\n *\n * The pay model doesn't need to be saved first. Use it to show what a pay model pays while it's being edited.\n * @param - Pay model to preview. May be unsaved.\n */\n (\n payModel: PayModel,\n options: NonNullablePaths<PreviewStaffPayOptions, `sampleFacts`, 0>\n ): Promise<\n NonNullablePaths<\n PreviewStaffPayResponse,\n | `components`\n | `components.${number}.componentName`\n | `components.${number}.amount`\n | `components.${number}.included`\n | `components.${number}.explanation`\n | `grossAmount`,\n 2\n >\n >;\n}\n\nexport {\n AccountInfo,\n ActionEvent,\n Adjustment,\n AdjustmentType,\n ApplicationError,\n ApproveStaffPayRequest,\n ApproveStaffPayResponse,\n AttendanceTier,\n AttendanceTiersOptions,\n AttendeeCountBasis,\n BasePlusPerHeadOptions,\n BulkActionMetadata,\n BulkApproveStaffPaysRequest,\n BulkApproveStaffPaysResponse,\n BulkCalculateStaffPaysOptions,\n BulkCalculateStaffPaysRequest,\n BulkCalculateStaffPaysResponse,\n BulkCalculateStaffPaysResponseBulkStaffPayResult,\n BulkDeleteStaffPaysRequest,\n BulkDeleteStaffPaysResponse,\n BulkDeleteStaffPaysResponseBulkStaffPayResult,\n BulkStaffPayResult,\n CalculateStaffPayRequest,\n CalculateStaffPayResponse,\n Combinator,\n CombinatorOptionsOneOf,\n CombinatorType,\n CommissionTier,\n CommissionTierMode,\n ComponentPreview,\n ComponentType,\n CostDeduction,\n CostDeductionKindOneOf,\n CreateStaffPayRequest,\n CreateStaffPayResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DeleteStaffPayRequest,\n DeleteStaffPayResponse,\n DiscountBasis,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n ExportFormat,\n ExportStaffPaysOptions,\n ExportStaffPaysRequest,\n ExportStaffPaysResponse,\n ExtendedFields,\n ExtraAttendeeTier,\n FlatPerSessionOptions,\n GetStaffPayRequest,\n GetStaffPayResponse,\n GreaterOfOptions,\n HourlyOptions,\n IdentificationData,\n IdentificationDataIdOneOf,\n ItemMetadata,\n MessageEnvelope,\n PayComponent,\n PayComponentOptionsOneOf,\n PayLine,\n PayLineSource,\n PayLineSourceType,\n PayLineType,\n PayModel,\n PerCourseOptions,\n PlanSaleCommissionOptions,\n PreviewStaffPayCalculationOptions,\n PreviewStaffPayCalculationRequest,\n PreviewStaffPayCalculationResponse,\n PreviewStaffPayOptions,\n PreviewStaffPayRequest,\n PreviewStaffPayResponse,\n ProductCommissionOptions,\n ProposedClockOut,\n QuantityUnit,\n QueryStaffPaysRequest,\n QueryStaffPaysResponse,\n ReopenStaffPayRequest,\n ReopenStaffPayResponse,\n RestoreInfo,\n RevenueRules,\n SalaryOptions,\n SampleFacts,\n SamplePlanOrder,\n SampleSession,\n ServiceCommissionOptions,\n SortOrder,\n Sorting,\n StaffPay,\n StaffPayAlert,\n StaffPayAlertType,\n StaffPayQuerySpec,\n StaffPayStatus,\n StaffPayTotals,\n StaffPaysQueryBuilder,\n StaffPaysQueryResult,\n StaleReason,\n StaleReasonType,\n TaxBasis,\n TipsOptions,\n UpdateStaffPay,\n UpdateStaffPayRequest,\n UpdateStaffPayResponse,\n WebhookIdentityType,\n utils,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\n","import {\n createStaffPay as publicCreateStaffPay,\n getStaffPay as publicGetStaffPay,\n updateStaffPay as publicUpdateStaffPay,\n deleteStaffPay as publicDeleteStaffPay,\n queryStaffPays as publicQueryStaffPays,\n typedQueryStaffPays as publicTypedQueryStaffPays,\n bulkDeleteStaffPays as publicBulkDeleteStaffPays,\n calculateStaffPay as publicCalculateStaffPay,\n previewStaffPayCalculation as publicPreviewStaffPayCalculation,\n bulkCalculateStaffPays as publicBulkCalculateStaffPays,\n approveStaffPay as publicApproveStaffPay,\n bulkApproveStaffPays as publicBulkApproveStaffPays,\n reopenStaffPay as publicReopenStaffPay,\n exportStaffPays as publicExportStaffPays,\n previewStaffPay as publicPreviewStaffPay,\n} from './staff-pay-v1-staff-pay-staff-pay.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n StaffPayQuery,\n StaffPaysQueryBuilder,\n typedQueryStaffPays as universalTypedQueryStaffPays,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\n\nfunction customQueryStaffPays(httpClient: HttpClient) {\n const router = /*#__PURE__*/ createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryStaffPays(httpClient)(),\n typedQueryFunction: (query: StaffPayQuery) =>\n publicTypedQueryStaffPays(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): StaffPaysQueryBuilder;\n function overloadedQuery(\n query: StaffPayQuery\n ): ReturnType<typeof universalTypedQueryStaffPays>;\n function overloadedQuery(query?: StaffPayQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const createStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicCreateStaffPay> & typeof publicCreateStaffPay\n> = /*#__PURE__*/ createRESTModule(publicCreateStaffPay);\nexport const getStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicGetStaffPay> & typeof publicGetStaffPay\n> = /*#__PURE__*/ createRESTModule(publicGetStaffPay);\nexport const updateStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicUpdateStaffPay> & typeof publicUpdateStaffPay\n> = /*#__PURE__*/ createRESTModule(publicUpdateStaffPay);\nexport const deleteStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicDeleteStaffPay> & typeof publicDeleteStaffPay\n> = /*#__PURE__*/ createRESTModule(publicDeleteStaffPay);\nexport const bulkDeleteStaffPays: MaybeContext<\n BuildRESTFunction<typeof publicBulkDeleteStaffPays> &\n typeof publicBulkDeleteStaffPays\n> = /*#__PURE__*/ createRESTModule(publicBulkDeleteStaffPays);\nexport const calculateStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicCalculateStaffPay> &\n typeof publicCalculateStaffPay\n> = /*#__PURE__*/ createRESTModule(publicCalculateStaffPay);\nexport const previewStaffPayCalculation: MaybeContext<\n BuildRESTFunction<typeof publicPreviewStaffPayCalculation> &\n typeof publicPreviewStaffPayCalculation\n> = /*#__PURE__*/ createRESTModule(publicPreviewStaffPayCalculation);\nexport const bulkCalculateStaffPays: MaybeContext<\n BuildRESTFunction<typeof publicBulkCalculateStaffPays> &\n typeof publicBulkCalculateStaffPays\n> = /*#__PURE__*/ createRESTModule(publicBulkCalculateStaffPays);\nexport const approveStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicApproveStaffPay> & typeof publicApproveStaffPay\n> = /*#__PURE__*/ createRESTModule(publicApproveStaffPay);\nexport const bulkApproveStaffPays: MaybeContext<\n BuildRESTFunction<typeof publicBulkApproveStaffPays> &\n typeof publicBulkApproveStaffPays\n> = /*#__PURE__*/ createRESTModule(publicBulkApproveStaffPays);\nexport const reopenStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicReopenStaffPay> & typeof publicReopenStaffPay\n> = /*#__PURE__*/ createRESTModule(publicReopenStaffPay);\nexport const exportStaffPays: MaybeContext<\n BuildRESTFunction<typeof publicExportStaffPays> & typeof publicExportStaffPays\n> = /*#__PURE__*/ createRESTModule(publicExportStaffPays);\nexport const previewStaffPay: MaybeContext<\n BuildRESTFunction<typeof publicPreviewStaffPay> & typeof publicPreviewStaffPay\n> = /*#__PURE__*/ createRESTModule(publicPreviewStaffPay);\nexport const queryStaffPays: MaybeContext<\n BuildRESTFunction<typeof customQueryStaffPays> & typeof customQueryStaffPays\n> = /*#__PURE__*/ createRESTModule(customQueryStaffPays);\n\nexport {\n StaffPayStatus,\n PayLineType,\n PayLineSourceType,\n QuantityUnit,\n AdjustmentType,\n StaffPayAlertType,\n StaleReasonType,\n SortOrder,\n ExportFormat,\n ComponentType,\n AttendeeCountBasis,\n CommissionTierMode,\n DiscountBasis,\n TaxBasis,\n CombinatorType,\n WebhookIdentityType,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\nexport {\n StaffPay,\n StaffPayTotals,\n PayLine,\n PayLineSource,\n Adjustment,\n StaffPayAlert,\n StaleReason,\n ExtendedFields,\n CreateStaffPayRequest,\n CreateStaffPayResponse,\n GetStaffPayRequest,\n GetStaffPayResponse,\n UpdateStaffPayRequest,\n UpdateStaffPayResponse,\n DeleteStaffPayRequest,\n DeleteStaffPayResponse,\n QueryStaffPaysRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryStaffPaysResponse,\n CursorPagingMetadata,\n Cursors,\n BulkDeleteStaffPaysRequest,\n BulkDeleteStaffPaysResponse,\n ItemMetadata,\n ApplicationError,\n BulkDeleteStaffPaysResponseBulkStaffPayResult,\n BulkActionMetadata,\n CalculateStaffPayRequest,\n CalculateStaffPayResponse,\n PreviewStaffPayCalculationRequest,\n ProposedClockOut,\n PreviewStaffPayCalculationResponse,\n BulkCalculateStaffPaysRequest,\n BulkCalculateStaffPaysResponse,\n BulkCalculateStaffPaysResponseBulkStaffPayResult,\n ApproveStaffPayRequest,\n ApproveStaffPayResponse,\n BulkApproveStaffPaysRequest,\n BulkApproveStaffPaysResponse,\n BulkStaffPayResult,\n ReopenStaffPayRequest,\n ReopenStaffPayResponse,\n ExportStaffPaysRequest,\n ExportStaffPaysResponse,\n PreviewStaffPayRequest,\n PayModel,\n PayComponent,\n PayComponentOptionsOneOf,\n SalaryOptions,\n HourlyOptions,\n FlatPerSessionOptions,\n BasePlusPerHeadOptions,\n ExtraAttendeeTier,\n AttendanceTiersOptions,\n AttendanceTier,\n ServiceCommissionOptions,\n CommissionTier,\n RevenueRules,\n CostDeduction,\n CostDeductionKindOneOf,\n TipsOptions,\n ProductCommissionOptions,\n PlanSaleCommissionOptions,\n PerCourseOptions,\n Combinator,\n CombinatorOptionsOneOf,\n GreaterOfOptions,\n SampleFacts,\n SampleSession,\n SamplePlanOrder,\n PreviewStaffPayResponse,\n ComponentPreview,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n UpdateStaffPay,\n StaffPaysQueryResult,\n StaffPaysQueryBuilder,\n StaffPayQuerySpec,\n PreviewStaffPayCalculationOptions,\n BulkCalculateStaffPaysOptions,\n ExportStaffPaysOptions,\n PreviewStaffPayOptions,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\nexport { utils } from './staff-pay-v1-staff-pay-staff-pay.universal.js';\nexport {\n StaffPayStatusWithLiterals,\n PayLineTypeWithLiterals,\n PayLineSourceTypeWithLiterals,\n QuantityUnitWithLiterals,\n AdjustmentTypeWithLiterals,\n StaffPayAlertTypeWithLiterals,\n StaleReasonTypeWithLiterals,\n SortOrderWithLiterals,\n ExportFormatWithLiterals,\n ComponentTypeWithLiterals,\n AttendeeCountBasisWithLiterals,\n CommissionTierModeWithLiterals,\n DiscountBasisWithLiterals,\n TaxBasisWithLiterals,\n CombinatorTypeWithLiterals,\n WebhookIdentityTypeWithLiterals,\n CreateStaffPayApplicationErrors,\n UpdateStaffPayApplicationErrors,\n DeleteStaffPayApplicationErrors,\n BulkDeleteStaffPaysApplicationErrors,\n CalculateStaffPayApplicationErrors,\n PreviewStaffPayCalculationApplicationErrors,\n BulkCalculateStaffPaysApplicationErrors,\n ApproveStaffPayApplicationErrors,\n ReopenStaffPayApplicationErrors,\n CommonQueryWithEntityContext,\n StaffPayQuery,\n} from './staff-pay-v1-staff-pay-staff-pay.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA,4BAAAC;AAAA,EAAA,8BAAAC;AAAA,EAAA,2BAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,kCAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,uBAAuB;AAAA,EAC/B,EAAE,MAAM,uBAAuB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AAA,IAC7D,oBAAoB,CAAC,UACnBC,qBAA0B,UAAU,EAAE,KAAK;AAAA,IAC7C,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAA4B;AACnD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,8BAGK,2DAAiBA,2BAAgC;AAC5D,IAAMC,0BAGK,2DAAiBA,uBAA4B;AACxD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,wBAGK,2DAAiBA,qBAA0B;AACtD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMd,kBAEK,2DAAiB,oBAAoB;","names":["approveStaffPay","bulkApproveStaffPays","bulkCalculateStaffPays","bulkDeleteStaffPays","calculateStaffPay","createStaffPay","deleteStaffPay","exportStaffPays","getStaffPay","previewStaffPay","previewStaffPayCalculation","queryStaffPays","reopenStaffPay","updateStaffPay","import_timestamp","import_rest_modules","payload","import_transform_paths","StaffPayStatus","PayLineType","PayLineSourceType","QuantityUnit","AdjustmentType","StaffPayAlertType","StaleReasonType","SortOrder","ExportFormat","ComponentType","AttendeeCountBasis","CommissionTierMode","DiscountBasis","TaxBasis","CombinatorType","WebhookIdentityType","createStaffPay","sdkTransformError","getStaffPay","updateStaffPay","deleteStaffPay","queryStaffPays","bulkDeleteStaffPays","calculateStaffPay","previewStaffPayCalculation","bulkCalculateStaffPays","approveStaffPay","bulkApproveStaffPays","reopenStaffPay","exportStaffPays","previewStaffPay","createStaffPay","getStaffPay","updateStaffPay","deleteStaffPay","queryStaffPays","typedQueryStaffPays","bulkDeleteStaffPays","calculateStaffPay","previewStaffPayCalculation","bulkCalculateStaffPays","approveStaffPay","bulkApproveStaffPays","reopenStaffPay","exportStaffPays","previewStaffPay","import_rest_modules","queryStaffPays","typedQueryStaffPays","createStaffPay","getStaffPay","updateStaffPay","deleteStaffPay","bulkDeleteStaffPays","calculateStaffPay","previewStaffPayCalculation","bulkCalculateStaffPays","approveStaffPay","bulkApproveStaffPays","reopenStaffPay","exportStaffPays","previewStaffPay"]}
|