@wix/auto_sdk_staff-pay_pay-models 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.d.ts +5 -34
- package/build/cjs/index.js +0 -118
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +7 -46
- package/build/cjs/index.typings.js +0 -102
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +5 -16
- package/build/cjs/meta.js +0 -88
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +5 -34
- package/build/es/index.mjs +0 -116
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +7 -46
- package/build/es/index.typings.mjs +0 -100
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +5 -16
- package/build/es/meta.mjs +0 -86
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +5 -34
- package/build/internal/cjs/index.typings.d.ts +7 -46
- package/build/internal/cjs/meta.d.ts +5 -16
- package/build/internal/es/index.d.mts +5 -34
- package/build/internal/es/index.typings.d.mts +7 -46
- package/build/internal/es/meta.d.mts +5 -16
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/staff-pay-v1-pay-model-pay-models.universal.ts","../../src/staff-pay-v1-pay-model-pay-models.http.ts"],"sourcesContent":["export * from './src/staff-pay-v1-pay-model-pay-models.universal.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 ambassadorWixStaffPayV1PayModel from './staff-pay-v1-pay-model-pay-models.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 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\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 CreatePayModelRequest {\n /** Pay model to create. */\n payModel: PayModel;\n}\n\nexport interface CreatePayModelResponse {\n /** Created pay model. */\n payModel?: PayModel;\n}\n\nexport interface GetPayModelRequest {\n /**\n * ID of the pay model to retrieve.\n * @format GUID\n */\n payModelId: string;\n}\n\nexport interface GetPayModelResponse {\n /** Retrieved pay model. */\n payModel?: PayModel;\n}\n\nexport interface UpdatePayModelRequest {\n /** Pay model to update. May be partial. */\n payModel: PayModel;\n /**\n * Set of fields to update.\n *\n * Fields that aren't included in `fieldMask.paths` are ignored.\n * @internal\n */\n fieldMask?: string[];\n}\n\nexport interface UpdatePayModelResponse {\n /** Updated pay model. */\n payModel?: PayModel;\n}\n\nexport interface DeletePayModelRequest {\n /**\n * ID of the pay model to delete.\n * @format GUID\n */\n payModelId: string;\n}\n\nexport interface DeletePayModelResponse {}\n\nexport interface QueryPayModelsRequest {\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 QueryPayModelsResponse {\n /** Retrieved pay models. */\n payModels?: PayModel[];\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 ArchivePayModelRequest {\n /**\n * ID of the pay model to archive.\n * @format GUID\n */\n payModelId: string;\n}\n\nexport interface ArchivePayModelResponse {\n /** Archived pay model. */\n payModel?: PayModel;\n}\n\nexport interface UnarchivePayModelRequest {\n /**\n * ID of the pay model to unarchive.\n * @format GUID\n */\n payModelId: string;\n}\n\nexport interface UnarchivePayModelResponse {\n /** Unarchived pay model. */\n payModel?: PayModel;\n}\n\nexport interface BulkDeletePayModelsRequest {\n /**\n * IDs of the pay models to delete.\n * @minSize 1\n * @maxSize 100\n * @format GUID\n */\n payModelIds: string[];\n}\n\nexport interface BulkDeletePayModelsResponse {\n /**\n * Results, 1 per requested pay model.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkPayModelResult[];\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 BulkPayModelResult {\n /** Metadata about the deletion of this pay model. */\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 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 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 CreatePayModelApplicationErrors =\n | {\n code?: 'INVALID_COMBINATOR';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_ATTENDEE_TIERS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'DUPLICATE_COMPONENT_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SERVICE_IN_TWO_RATES';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'TWO_DEFAULT_RATES';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MAX_BELOW_BASE';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type UpdatePayModelApplicationErrors =\n | {\n code?: 'INVALID_COMBINATOR';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_ATTENDEE_TIERS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'DUPLICATE_COMPONENT_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SERVICE_IN_TWO_RATES';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'TWO_DEFAULT_RATES';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MAX_BELOW_BASE';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PAY_MODEL_ARCHIVED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type DeletePayModelApplicationErrors = {\n code?: 'PAY_MODEL_IN_USE';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type BulkDeletePayModelsApplicationErrors = {\n code?: 'PAY_MODEL_IN_USE';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Creates a pay model.\n *\n * Components that don't have an ID get one, and tiers are sorted. A pay model is always created unarchived. To pay a\n * staff member with the pay model, add pay terms that point to it in their staff pay profile.\n * @param payModel - Pay model to create.\n * @public\n * @documentationMaturity preview\n * @requiredField payModel\n * @requiredField payModel.name\n * @permissionId staff:pay:v1:pay_model:create_pay_model\n * @returns Created pay model.\n * @fqn wix.staff.pay.v1.PayModelsService.CreatePayModel\n */\nexport async function createPayModel(\n payModel: NonNullablePaths<PayModel, `name`, 0>\n): Promise<\n NonNullablePaths<\n PayModel,\n | `name`\n | `components`\n | `components.${number}.salaryOptions.amountPerPeriod`\n | `components.${number}.salaryOptions.prorateByDaysEmployed`\n | `components.${number}.hourlyOptions.rate`\n | `components.${number}.hourlyOptions.overtimeEligible`\n | `components.${number}.hourlyOptions.excludeSessionTime`\n | `components.${number}.flatPerSessionOptions.amount`\n | `components.${number}.flatPerSessionOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.includedAttendees`\n | `components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee`\n | `components.${number}.basePlusPerHeadOptions.countBasis`\n | `components.${number}.basePlusPerHeadOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.excludeFreeVisits`\n | `components.${number}.attendanceTiersOptions.countBasis`\n | `components.${number}.attendanceTiersOptions.zeroWhenCancelled`\n | `components.${number}.attendanceTiersOptions.excludeFreeVisits`\n | `components.${number}.serviceCommissionOptions.percent`\n | `components.${number}.serviceCommissionOptions.tierMode`\n | `components.${number}.serviceCommissionOptions.revenueRules.discountBasis`\n | `components.${number}.serviceCommissionOptions.revenueRules.taxBasis`\n | `components.${number}.productCommissionOptions.percent`\n | `components.${number}.name`\n | `components.${number}.type`\n | `combinator.greaterOfOptions.componentIds`\n | `combinator.type`,\n 4\n > & {\n __applicationErrorsType?: CreatePayModelApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ payModel: payModel });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.createPayModel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.payModel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { payModel: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModel']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a pay model.\n * @param payModelId - ID of the pay model to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField payModelId\n * @permissionId staff:pay:v1:pay_model:get_pay_model\n * @returns Retrieved pay model.\n * @fqn wix.staff.pay.v1.PayModelsService.GetPayModel\n */\nexport async function getPayModel(\n payModelId: string\n): Promise<\n NonNullablePaths<\n PayModel,\n | `name`\n | `components`\n | `components.${number}.salaryOptions.amountPerPeriod`\n | `components.${number}.salaryOptions.prorateByDaysEmployed`\n | `components.${number}.hourlyOptions.rate`\n | `components.${number}.hourlyOptions.overtimeEligible`\n | `components.${number}.hourlyOptions.excludeSessionTime`\n | `components.${number}.flatPerSessionOptions.amount`\n | `components.${number}.flatPerSessionOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.includedAttendees`\n | `components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee`\n | `components.${number}.basePlusPerHeadOptions.countBasis`\n | `components.${number}.basePlusPerHeadOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.excludeFreeVisits`\n | `components.${number}.attendanceTiersOptions.countBasis`\n | `components.${number}.attendanceTiersOptions.zeroWhenCancelled`\n | `components.${number}.attendanceTiersOptions.excludeFreeVisits`\n | `components.${number}.serviceCommissionOptions.percent`\n | `components.${number}.serviceCommissionOptions.tierMode`\n | `components.${number}.serviceCommissionOptions.revenueRules.discountBasis`\n | `components.${number}.serviceCommissionOptions.revenueRules.taxBasis`\n | `components.${number}.productCommissionOptions.percent`\n | `components.${number}.name`\n | `components.${number}.type`\n | `combinator.greaterOfOptions.componentIds`\n | `combinator.type`,\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 payModelId: payModelId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.getPayModel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.payModel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { payModelId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModelId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a pay model.\n *\n * Each time the pay model is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the pay model.\n * This ensures you're working with the latest pay model and prevents unintended overwrites.\n *\n * Updating `components` replaces the whole list. Send each existing component's `id` back, so personal rates and pay\n * lines stay linked to it. Changes apply to staff pays calculated after the update, and the staff pays of the staff\n * members paid with the pay model are marked stale.\n *\n * An archived pay model can't be updated until it's unarchived with Unarchive Pay Model.\n * @param _id - Pay model ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField payModel\n * @requiredField payModel.revision\n * @permissionId staff:pay:v1:pay_model:update_pay_model\n * @returns Updated pay model.\n * @fqn wix.staff.pay.v1.PayModelsService.UpdatePayModel\n */\nexport async function updatePayModel(\n _id: string,\n payModel: NonNullablePaths<UpdatePayModel, `revision`, 0>\n): Promise<\n NonNullablePaths<\n PayModel,\n | `name`\n | `components`\n | `components.${number}.salaryOptions.amountPerPeriod`\n | `components.${number}.salaryOptions.prorateByDaysEmployed`\n | `components.${number}.hourlyOptions.rate`\n | `components.${number}.hourlyOptions.overtimeEligible`\n | `components.${number}.hourlyOptions.excludeSessionTime`\n | `components.${number}.flatPerSessionOptions.amount`\n | `components.${number}.flatPerSessionOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.includedAttendees`\n | `components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee`\n | `components.${number}.basePlusPerHeadOptions.countBasis`\n | `components.${number}.basePlusPerHeadOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.excludeFreeVisits`\n | `components.${number}.attendanceTiersOptions.countBasis`\n | `components.${number}.attendanceTiersOptions.zeroWhenCancelled`\n | `components.${number}.attendanceTiersOptions.excludeFreeVisits`\n | `components.${number}.serviceCommissionOptions.percent`\n | `components.${number}.serviceCommissionOptions.tierMode`\n | `components.${number}.serviceCommissionOptions.revenueRules.discountBasis`\n | `components.${number}.serviceCommissionOptions.revenueRules.taxBasis`\n | `components.${number}.productCommissionOptions.percent`\n | `components.${number}.name`\n | `components.${number}.type`\n | `combinator.greaterOfOptions.componentIds`\n | `combinator.type`,\n 4\n > & {\n __applicationErrorsType?: UpdatePayModelApplicationErrors;\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, id: _id },\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.updatePayModel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.payModel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { payModel: '$[1]' },\n explicitPathsToArguments: { 'payModel.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'payModel']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdatePayModel {\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/**\n * Deletes a pay model.\n *\n * A pay model that any pay terms use, past, current or upcoming, can't be deleted. Archive it instead, with Archive\n * Pay Model.\n *\n * To delete multiple pay models in a single API call, call Bulk Delete Pay Models.\n * @param payModelId - ID of the pay model to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField payModelId\n * @permissionId staff:pay:v1:pay_model:delete_pay_model\n * @fqn wix.staff.pay.v1.PayModelsService.DeletePayModel\n */\nexport async function deletePayModel(payModelId: string): Promise<\n void & {\n __applicationErrorsType?: DeletePayModelApplicationErrors;\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 payModelId: payModelId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.deletePayModel(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: { payModelId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModelId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 pay models, given the provided paging, filtering, and sorting.\n *\n * Query Pay Models runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * Archived pay models are returned too. To leave them out, for example in lists and pickers, filter on\n * `{\"archivedDate\": {\"$exists\": false}}`.\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:pay_model:query_pay_models\n * @fqn wix.staff.pay.v1.PayModelsService.QueryPayModels\n */\nexport function queryPayModels(): PayModelsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n PayModel,\n 'CURSOR',\n QueryPayModelsRequest,\n QueryPayModelsResponse\n >({\n func: async (payload: QueryPayModelsRequest) => {\n const reqOpts = ambassadorWixStaffPayV1PayModel.queryPayModels(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: QueryPayModelsRequest['query']) => {\n const args = [query, {}] as [QueryPayModelsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryPayModelsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.payModels,\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 PayModelsQueryResult extends QueryCursorResult {\n items: PayModel[];\n query: PayModelsQueryBuilder;\n next: () => Promise<PayModelsQueryResult>;\n prev: () => Promise<PayModelsQueryResult>;\n}\n\nexport interface PayModelsQueryBuilder {\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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' | 'name',\n value: string\n ) => PayModelsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'name'\n | 'archivedDate',\n value: boolean\n ) => PayModelsQueryBuilder;\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' | '_createdDate' | '_updatedDate' | 'name' | 'archivedDate'\n >\n ) => PayModelsQueryBuilder;\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' | '_createdDate' | '_updatedDate' | 'name' | 'archivedDate'\n >\n ) => PayModelsQueryBuilder;\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) => PayModelsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => PayModelsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<PayModelsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.staff.pay.v1.PayModelsService.QueryPayModels\n * @requiredField query\n */\nexport async function typedQueryPayModels(\n query: PayModelQuery\n): Promise<\n NonNullablePaths<\n QueryPayModelsResponse,\n | `payModels`\n | `payModels.${number}.name`\n | `payModels.${number}.combinator.type`,\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 = ambassadorWixStaffPayV1PayModel.queryPayModels(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 PayModelQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: ['_createdDate', '_id', '_updatedDate', 'archivedDate', 'name'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n PayModel,\n PayModelQuerySpec\n>;\nexport type PayModelQuery = {\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 PayModel,\n PayModelQuerySpec,\n PayModelQuery\n >(),\n};\n\n/**\n * Archives a pay model. Sets `archivedDate`.\n *\n * Use it for a pay model that's no longer offered but that pay terms used, so it can't be deleted. Pay terms that use\n * the pay model keep it, and it can still be retrieved. An archived pay model can't be updated.\n *\n * Archiving an archived pay model returns it unchanged. To make it available again, call Unarchive Pay Model.\n * @param payModelId - ID of the pay model to archive.\n * @public\n * @documentationMaturity preview\n * @requiredField payModelId\n * @permissionId staff:pay:v1:pay_model:archive_pay_model\n * @fqn wix.staff.pay.v1.PayModelsService.ArchivePayModel\n */\nexport async function archivePayModel(\n payModelId: string\n): Promise<\n NonNullablePaths<\n ArchivePayModelResponse,\n | `payModel.name`\n | `payModel.components`\n | `payModel.components.${number}.salaryOptions.amountPerPeriod`\n | `payModel.components.${number}.salaryOptions.prorateByDaysEmployed`\n | `payModel.components.${number}.hourlyOptions.rate`\n | `payModel.components.${number}.hourlyOptions.overtimeEligible`\n | `payModel.components.${number}.hourlyOptions.excludeSessionTime`\n | `payModel.components.${number}.flatPerSessionOptions.amount`\n | `payModel.components.${number}.flatPerSessionOptions.zeroWhenCancelled`\n | `payModel.components.${number}.basePlusPerHeadOptions.includedAttendees`\n | `payModel.components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee`\n | `payModel.components.${number}.basePlusPerHeadOptions.countBasis`\n | `payModel.components.${number}.basePlusPerHeadOptions.zeroWhenCancelled`\n | `payModel.components.${number}.basePlusPerHeadOptions.excludeFreeVisits`\n | `payModel.components.${number}.attendanceTiersOptions.countBasis`\n | `payModel.components.${number}.attendanceTiersOptions.zeroWhenCancelled`\n | `payModel.components.${number}.attendanceTiersOptions.excludeFreeVisits`\n | `payModel.components.${number}.serviceCommissionOptions.percent`\n | `payModel.components.${number}.serviceCommissionOptions.tierMode`\n | `payModel.components.${number}.serviceCommissionOptions.revenueRules.discountBasis`\n | `payModel.components.${number}.serviceCommissionOptions.revenueRules.taxBasis`\n | `payModel.components.${number}.productCommissionOptions.percent`\n | `payModel.components.${number}.name`\n | `payModel.components.${number}.type`\n | `payModel.combinator.greaterOfOptions.componentIds`\n | `payModel.combinator.type`,\n 5\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 payModelId: payModelId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.archivePayModel(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: { payModelId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModelId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Unarchives a pay model. Clears `archivedDate`, so the pay model can be updated and offered again.\n *\n * Unarchiving a pay model that isn't archived returns it unchanged.\n * @param payModelId - ID of the pay model to unarchive.\n * @public\n * @documentationMaturity preview\n * @requiredField payModelId\n * @permissionId staff:pay:v1:pay_model:unarchive_pay_model\n * @fqn wix.staff.pay.v1.PayModelsService.UnarchivePayModel\n */\nexport async function unarchivePayModel(\n payModelId: string\n): Promise<\n NonNullablePaths<\n UnarchivePayModelResponse,\n | `payModel.name`\n | `payModel.components`\n | `payModel.components.${number}.salaryOptions.amountPerPeriod`\n | `payModel.components.${number}.salaryOptions.prorateByDaysEmployed`\n | `payModel.components.${number}.hourlyOptions.rate`\n | `payModel.components.${number}.hourlyOptions.overtimeEligible`\n | `payModel.components.${number}.hourlyOptions.excludeSessionTime`\n | `payModel.components.${number}.flatPerSessionOptions.amount`\n | `payModel.components.${number}.flatPerSessionOptions.zeroWhenCancelled`\n | `payModel.components.${number}.basePlusPerHeadOptions.includedAttendees`\n | `payModel.components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee`\n | `payModel.components.${number}.basePlusPerHeadOptions.countBasis`\n | `payModel.components.${number}.basePlusPerHeadOptions.zeroWhenCancelled`\n | `payModel.components.${number}.basePlusPerHeadOptions.excludeFreeVisits`\n | `payModel.components.${number}.attendanceTiersOptions.countBasis`\n | `payModel.components.${number}.attendanceTiersOptions.zeroWhenCancelled`\n | `payModel.components.${number}.attendanceTiersOptions.excludeFreeVisits`\n | `payModel.components.${number}.serviceCommissionOptions.percent`\n | `payModel.components.${number}.serviceCommissionOptions.tierMode`\n | `payModel.components.${number}.serviceCommissionOptions.revenueRules.discountBasis`\n | `payModel.components.${number}.serviceCommissionOptions.revenueRules.taxBasis`\n | `payModel.components.${number}.productCommissionOptions.percent`\n | `payModel.components.${number}.name`\n | `payModel.components.${number}.type`\n | `payModel.combinator.greaterOfOptions.componentIds`\n | `payModel.combinator.type`,\n 5\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 payModelId: payModelId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.unarchivePayModel(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: { payModelId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModelId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Deletes multiple pay models.\n *\n * Each pay model is deleted on its own: one that pay terms use isn't deleted and its result fails with\n * `PAY_MODEL_IN_USE`, while the others are still deleted.\n *\n * To delete a single pay model, call Delete Pay Model.\n * @param payModelIds - IDs of the pay models to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField payModelIds\n * @permissionId staff:pay:v1:pay_model:bulk_delete_pay_models\n * @fqn wix.staff.pay.v1.PayModelsService.BulkDeletePayModels\n */\nexport async function bulkDeletePayModels(payModelIds: string[]): Promise<\n NonNullablePaths<\n BulkDeletePayModelsResponse,\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?: BulkDeletePayModelsApplicationErrors;\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 payModelIds: payModelIds,\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.bulkDeletePayModels(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: { payModelIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModelIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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: 'payModel.createdDate' },\n { path: 'payModel.updatedDate' },\n { path: 'payModel.archivedDate' },\n];\nconst TRANSFORM_PATHS_1 = [{ path: 'fieldMask' }];\nconst TRANSFORM_PATHS_2 = [\n { path: 'payModels.createdDate' },\n { path: 'payModels.updatedDate' },\n { path: 'payModels.archivedDate' },\n];\n\nfunction resolveWixStaffPayV1PayModelsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/pay-model',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_staff-pay_pay-models';\n\n/**\n * Creates a pay model.\n *\n * Components that don't have an ID get one, and tiers are sorted. A pay model is always created unarchived. To pay a\n * staff member with the pay model, add pay terms that point to it in their staff pay profile.\n */\nexport function createPayModel(payload: object): RequestOptionsFactory<any> {\n function __createPayModel({ 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.pay_model',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.CreatePayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models',\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 __createPayModel;\n}\n\n/** Retrieves a pay model. */\nexport function getPayModel(payload: object): RequestOptionsFactory<any> {\n function __getPayModel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'GET' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.GetPayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/{payModelId}',\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 __getPayModel;\n}\n\n/**\n * Updates a pay model.\n *\n * Each time the pay model is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the pay model.\n * This ensures you're working with the latest pay model and prevents unintended overwrites.\n *\n * Updating `components` replaces the whole list. Send each existing component's `id` back, so personal rates and pay\n * lines stay linked to it. Changes apply to staff pays calculated after the update, and the staff pays of the staff\n * members paid with the pay model are marked stale.\n *\n * An archived pay model can't be updated until it's unarchived with Unarchive Pay Model.\n */\nexport function updatePayModel(payload: object): RequestOptionsFactory<any> {\n function __updatePayModel({ 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.pay_model',\n method: 'PATCH' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.UpdatePayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/{payModel.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 __updatePayModel;\n}\n\n/**\n * Deletes a pay model.\n *\n * A pay model that any pay terms use, past, current or upcoming, can't be deleted. Archive it instead, with Archive\n * Pay Model.\n *\n * To delete multiple pay models in a single API call, call Bulk Delete Pay Models.\n */\nexport function deletePayModel(payload: object): RequestOptionsFactory<any> {\n function __deletePayModel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'DELETE' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.DeletePayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/{payModelId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deletePayModel;\n}\n\n/**\n * Retrieves a list of up to 100 pay models, given the provided paging, filtering, and sorting.\n *\n * Query Pay Models runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * Archived pay models are returned too. To leave them out, for example in lists and pickers, filter on\n * `{\"archivedDate\": {\"$exists\": false}}`.\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 queryPayModels(payload: object): RequestOptionsFactory<any> {\n function __queryPayModels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'GET' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.QueryPayModels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/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: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryPayModels;\n}\n\n/**\n * Archives a pay model. Sets `archivedDate`.\n *\n * Use it for a pay model that's no longer offered but that pay terms used, so it can't be deleted. Pay terms that use\n * the pay model keep it, and it can still be retrieved. An archived pay model can't be updated.\n *\n * Archiving an archived pay model returns it unchanged. To make it available again, call Unarchive Pay Model.\n */\nexport function archivePayModel(payload: object): RequestOptionsFactory<any> {\n function __archivePayModel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.ArchivePayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/{payModelId}/archive',\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 __archivePayModel;\n}\n\n/**\n * Unarchives a pay model. Clears `archivedDate`, so the pay model can be updated and offered again.\n *\n * Unarchiving a pay model that isn't archived returns it unchanged.\n */\nexport function unarchivePayModel(payload: object): RequestOptionsFactory<any> {\n function __unarchivePayModel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.UnarchivePayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/{payModelId}/unarchive',\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 __unarchivePayModel;\n}\n\n/**\n * Deletes multiple pay models.\n *\n * Each pay model is deleted on its own: one that pay terms use isn't deleted and its result fails with\n * `PAY_MODEL_IN_USE`, while the others are still deleted.\n *\n * To delete a single pay model, call Delete Pay Model.\n */\nexport function bulkDeletePayModels(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkDeletePayModels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.BulkDeletePayModels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/bulk/pay-models/delete',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkDeletePayModels;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAN;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,YAAY,OAAO;AAAA,QAC/C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,YAAY;AAAA,IACf;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAgBA,eAAsBO,qBAAoB,aAexC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA0C,oBAAoB,OAAO;AAE3E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAP;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,aAAa,OAAO;AAAA,QAChD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,aAAa;AAAA,IAChB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["archivePayModel","bulkDeletePayModels","createPayModel","deletePayModel","getPayModel","queryPayModels","unarchivePayModel","updatePayModel","import_timestamp","import_rest_modules","payload","import_transform_paths","ComponentType","AttendeeCountBasis","CommissionTierMode","DiscountBasis","TaxBasis","CombinatorType","SortOrder","WebhookIdentityType","createPayModel","sdkTransformError","getPayModel","updatePayModel","deletePayModel","queryPayModels","archivePayModel","unarchivePayModel","bulkDeletePayModels"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/staff-pay-v1-pay-model-pay-models.universal.ts","../../src/staff-pay-v1-pay-model-pay-models.http.ts"],"sourcesContent":["export * from './src/staff-pay-v1-pay-model-pay-models.universal.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 ambassadorWixStaffPayV1PayModel from './staff-pay-v1-pay-model-pay-models.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 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\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 CreatePayModelRequest {\n /** Pay model to create. */\n payModel: PayModel;\n}\n\nexport interface CreatePayModelResponse {\n /** Created pay model. */\n payModel?: PayModel;\n}\n\nexport interface GetPayModelRequest {\n /**\n * ID of the pay model to retrieve.\n * @format GUID\n */\n payModelId: string;\n}\n\nexport interface GetPayModelResponse {\n /** Retrieved pay model. */\n payModel?: PayModel;\n}\n\nexport interface UpdatePayModelRequest {\n /** Pay model to update. May be partial. */\n payModel: PayModel;\n /**\n * Set of fields to update.\n *\n * Fields that aren't included in `fieldMask.paths` are ignored.\n * @internal\n */\n fieldMask?: string[];\n}\n\nexport interface UpdatePayModelResponse {\n /** Updated pay model. */\n payModel?: PayModel;\n}\n\nexport interface DeletePayModelRequest {\n /**\n * ID of the pay model to delete.\n * @format GUID\n */\n payModelId: string;\n}\n\nexport interface DeletePayModelResponse {}\n\nexport interface QueryPayModelsRequest {\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 QueryPayModelsResponse {\n /** Retrieved pay models. */\n payModels?: PayModel[];\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 ArchivePayModelRequest {\n /**\n * ID of the pay model to archive.\n * @format GUID\n */\n payModelId: string;\n}\n\nexport interface ArchivePayModelResponse {\n /** Archived pay model. */\n payModel?: PayModel;\n}\n\nexport interface UnarchivePayModelRequest {\n /**\n * ID of the pay model to unarchive.\n * @format GUID\n */\n payModelId?: string;\n}\n\nexport interface UnarchivePayModelResponse {\n /** Unarchived pay model. */\n payModel?: PayModel;\n}\n\nexport interface BulkDeletePayModelsRequest {\n /**\n * IDs of the pay models to delete.\n * @minSize 1\n * @maxSize 100\n * @format GUID\n */\n payModelIds?: string[];\n}\n\nexport interface BulkDeletePayModelsResponse {\n /**\n * Results, 1 per requested pay model.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkPayModelResult[];\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 BulkPayModelResult {\n /** Metadata about the deletion of this pay model. */\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 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 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 CreatePayModelApplicationErrors =\n | {\n code?: 'INVALID_COMBINATOR';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_ATTENDEE_TIERS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'DUPLICATE_COMPONENT_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SERVICE_IN_TWO_RATES';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'TWO_DEFAULT_RATES';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MAX_BELOW_BASE';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type UpdatePayModelApplicationErrors =\n | {\n code?: 'INVALID_COMBINATOR';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_ATTENDEE_TIERS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'DUPLICATE_COMPONENT_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SERVICE_IN_TWO_RATES';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'TWO_DEFAULT_RATES';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MAX_BELOW_BASE';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PAY_MODEL_ARCHIVED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type DeletePayModelApplicationErrors = {\n code?: 'PAY_MODEL_IN_USE';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Creates a pay model.\n *\n * Components that don't have an ID get one, and tiers are sorted. A pay model is always created unarchived. To pay a\n * staff member with the pay model, add pay terms that point to it in their staff pay profile.\n * @param payModel - Pay model to create.\n * @public\n * @documentationMaturity preview\n * @requiredField payModel\n * @requiredField payModel.name\n * @permissionId staff:pay:v1:pay_model:create_pay_model\n * @returns Created pay model.\n * @fqn wix.staff.pay.v1.PayModelsService.CreatePayModel\n */\nexport async function createPayModel(\n payModel: NonNullablePaths<PayModel, `name`, 0>\n): Promise<\n NonNullablePaths<\n PayModel,\n | `name`\n | `components`\n | `components.${number}.salaryOptions.amountPerPeriod`\n | `components.${number}.salaryOptions.prorateByDaysEmployed`\n | `components.${number}.hourlyOptions.rate`\n | `components.${number}.hourlyOptions.overtimeEligible`\n | `components.${number}.hourlyOptions.excludeSessionTime`\n | `components.${number}.flatPerSessionOptions.amount`\n | `components.${number}.flatPerSessionOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.includedAttendees`\n | `components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee`\n | `components.${number}.basePlusPerHeadOptions.countBasis`\n | `components.${number}.basePlusPerHeadOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.excludeFreeVisits`\n | `components.${number}.attendanceTiersOptions.countBasis`\n | `components.${number}.attendanceTiersOptions.zeroWhenCancelled`\n | `components.${number}.attendanceTiersOptions.excludeFreeVisits`\n | `components.${number}.serviceCommissionOptions.percent`\n | `components.${number}.serviceCommissionOptions.tierMode`\n | `components.${number}.serviceCommissionOptions.revenueRules.discountBasis`\n | `components.${number}.serviceCommissionOptions.revenueRules.taxBasis`\n | `components.${number}.productCommissionOptions.percent`\n | `components.${number}.name`\n | `components.${number}.type`\n | `combinator.greaterOfOptions.componentIds`\n | `combinator.type`,\n 4\n > & {\n __applicationErrorsType?: CreatePayModelApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ payModel: payModel });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.createPayModel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.payModel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { payModel: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModel']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a pay model.\n * @param payModelId - ID of the pay model to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField payModelId\n * @permissionId staff:pay:v1:pay_model:get_pay_model\n * @returns Retrieved pay model.\n * @fqn wix.staff.pay.v1.PayModelsService.GetPayModel\n */\nexport async function getPayModel(\n payModelId: string\n): Promise<\n NonNullablePaths<\n PayModel,\n | `name`\n | `components`\n | `components.${number}.salaryOptions.amountPerPeriod`\n | `components.${number}.salaryOptions.prorateByDaysEmployed`\n | `components.${number}.hourlyOptions.rate`\n | `components.${number}.hourlyOptions.overtimeEligible`\n | `components.${number}.hourlyOptions.excludeSessionTime`\n | `components.${number}.flatPerSessionOptions.amount`\n | `components.${number}.flatPerSessionOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.includedAttendees`\n | `components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee`\n | `components.${number}.basePlusPerHeadOptions.countBasis`\n | `components.${number}.basePlusPerHeadOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.excludeFreeVisits`\n | `components.${number}.attendanceTiersOptions.countBasis`\n | `components.${number}.attendanceTiersOptions.zeroWhenCancelled`\n | `components.${number}.attendanceTiersOptions.excludeFreeVisits`\n | `components.${number}.serviceCommissionOptions.percent`\n | `components.${number}.serviceCommissionOptions.tierMode`\n | `components.${number}.serviceCommissionOptions.revenueRules.discountBasis`\n | `components.${number}.serviceCommissionOptions.revenueRules.taxBasis`\n | `components.${number}.productCommissionOptions.percent`\n | `components.${number}.name`\n | `components.${number}.type`\n | `combinator.greaterOfOptions.componentIds`\n | `combinator.type`,\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 payModelId: payModelId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.getPayModel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.payModel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { payModelId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModelId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a pay model.\n *\n * Each time the pay model is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the pay model.\n * This ensures you're working with the latest pay model and prevents unintended overwrites.\n *\n * Updating `components` replaces the whole list. Send each existing component's `id` back, so personal rates and pay\n * lines stay linked to it. Changes apply to staff pays calculated after the update, and the staff pays of the staff\n * members paid with the pay model are marked stale.\n *\n * An archived pay model can't be updated.\n * @param _id - Pay model ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField payModel\n * @requiredField payModel.revision\n * @permissionId staff:pay:v1:pay_model:update_pay_model\n * @returns Updated pay model.\n * @fqn wix.staff.pay.v1.PayModelsService.UpdatePayModel\n */\nexport async function updatePayModel(\n _id: string,\n payModel: NonNullablePaths<UpdatePayModel, `revision`, 0>\n): Promise<\n NonNullablePaths<\n PayModel,\n | `name`\n | `components`\n | `components.${number}.salaryOptions.amountPerPeriod`\n | `components.${number}.salaryOptions.prorateByDaysEmployed`\n | `components.${number}.hourlyOptions.rate`\n | `components.${number}.hourlyOptions.overtimeEligible`\n | `components.${number}.hourlyOptions.excludeSessionTime`\n | `components.${number}.flatPerSessionOptions.amount`\n | `components.${number}.flatPerSessionOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.includedAttendees`\n | `components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee`\n | `components.${number}.basePlusPerHeadOptions.countBasis`\n | `components.${number}.basePlusPerHeadOptions.zeroWhenCancelled`\n | `components.${number}.basePlusPerHeadOptions.excludeFreeVisits`\n | `components.${number}.attendanceTiersOptions.countBasis`\n | `components.${number}.attendanceTiersOptions.zeroWhenCancelled`\n | `components.${number}.attendanceTiersOptions.excludeFreeVisits`\n | `components.${number}.serviceCommissionOptions.percent`\n | `components.${number}.serviceCommissionOptions.tierMode`\n | `components.${number}.serviceCommissionOptions.revenueRules.discountBasis`\n | `components.${number}.serviceCommissionOptions.revenueRules.taxBasis`\n | `components.${number}.productCommissionOptions.percent`\n | `components.${number}.name`\n | `components.${number}.type`\n | `combinator.greaterOfOptions.componentIds`\n | `combinator.type`,\n 4\n > & {\n __applicationErrorsType?: UpdatePayModelApplicationErrors;\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, id: _id },\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.updatePayModel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.payModel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { payModel: '$[1]' },\n explicitPathsToArguments: { 'payModel.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'payModel']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdatePayModel {\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/**\n * Deletes a pay model.\n *\n * A pay model that any pay terms use, past, current or upcoming, can't be deleted. Archive it instead, with Archive\n * Pay Model.\n * @param payModelId - ID of the pay model to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField payModelId\n * @permissionId staff:pay:v1:pay_model:delete_pay_model\n * @fqn wix.staff.pay.v1.PayModelsService.DeletePayModel\n */\nexport async function deletePayModel(payModelId: string): Promise<\n void & {\n __applicationErrorsType?: DeletePayModelApplicationErrors;\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 payModelId: payModelId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.deletePayModel(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: { payModelId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModelId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 pay models, given the provided paging, filtering, and sorting.\n *\n * Query Pay Models runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * Archived pay models are returned too. To leave them out, for example in lists and pickers, filter on\n * `{\"archivedDate\": {\"$exists\": false}}`.\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:pay_model:query_pay_models\n * @fqn wix.staff.pay.v1.PayModelsService.QueryPayModels\n */\nexport function queryPayModels(): PayModelsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n PayModel,\n 'CURSOR',\n QueryPayModelsRequest,\n QueryPayModelsResponse\n >({\n func: async (payload: QueryPayModelsRequest) => {\n const reqOpts = ambassadorWixStaffPayV1PayModel.queryPayModels(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: QueryPayModelsRequest['query']) => {\n const args = [query, {}] as [QueryPayModelsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryPayModelsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.payModels,\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 PayModelsQueryResult extends QueryCursorResult {\n items: PayModel[];\n query: PayModelsQueryBuilder;\n next: () => Promise<PayModelsQueryResult>;\n prev: () => Promise<PayModelsQueryResult>;\n}\n\nexport interface PayModelsQueryBuilder {\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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 | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\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' | 'name',\n value: string\n ) => PayModelsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'name'\n | 'archivedDate',\n value: any\n ) => PayModelsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'name'\n | 'archivedDate',\n value: boolean\n ) => PayModelsQueryBuilder;\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' | '_createdDate' | '_updatedDate' | 'name' | 'archivedDate'\n >\n ) => PayModelsQueryBuilder;\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' | '_createdDate' | '_updatedDate' | 'name' | 'archivedDate'\n >\n ) => PayModelsQueryBuilder;\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) => PayModelsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => PayModelsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<PayModelsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.staff.pay.v1.PayModelsService.QueryPayModels\n * @requiredField query\n */\nexport async function typedQueryPayModels(\n query: PayModelQuery\n): Promise<\n NonNullablePaths<\n QueryPayModelsResponse,\n | `payModels`\n | `payModels.${number}.name`\n | `payModels.${number}.combinator.type`,\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 = ambassadorWixStaffPayV1PayModel.queryPayModels(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 PayModelQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: ['_createdDate', '_id', '_updatedDate', 'archivedDate', 'name'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n PayModel,\n PayModelQuerySpec\n>;\nexport type PayModelQuery = {\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 PayModel,\n PayModelQuerySpec,\n PayModelQuery\n >(),\n};\n\n/**\n * Archives a pay model. Sets `archivedDate`.\n *\n * Use it for a pay model that's no longer offered but that pay terms used, so it can't be deleted. Pay terms that use\n * the pay model keep it, and it can still be retrieved. An archived pay model can't be updated.\n *\n * Archiving an archived pay model returns it unchanged.\n * @param payModelId - ID of the pay model to archive.\n * @public\n * @documentationMaturity preview\n * @requiredField payModelId\n * @permissionId staff:pay:v1:pay_model:archive_pay_model\n * @fqn wix.staff.pay.v1.PayModelsService.ArchivePayModel\n */\nexport async function archivePayModel(\n payModelId: string\n): Promise<\n NonNullablePaths<\n ArchivePayModelResponse,\n | `payModel.name`\n | `payModel.components`\n | `payModel.components.${number}.salaryOptions.amountPerPeriod`\n | `payModel.components.${number}.salaryOptions.prorateByDaysEmployed`\n | `payModel.components.${number}.hourlyOptions.rate`\n | `payModel.components.${number}.hourlyOptions.overtimeEligible`\n | `payModel.components.${number}.hourlyOptions.excludeSessionTime`\n | `payModel.components.${number}.flatPerSessionOptions.amount`\n | `payModel.components.${number}.flatPerSessionOptions.zeroWhenCancelled`\n | `payModel.components.${number}.basePlusPerHeadOptions.includedAttendees`\n | `payModel.components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee`\n | `payModel.components.${number}.basePlusPerHeadOptions.countBasis`\n | `payModel.components.${number}.basePlusPerHeadOptions.zeroWhenCancelled`\n | `payModel.components.${number}.basePlusPerHeadOptions.excludeFreeVisits`\n | `payModel.components.${number}.attendanceTiersOptions.countBasis`\n | `payModel.components.${number}.attendanceTiersOptions.zeroWhenCancelled`\n | `payModel.components.${number}.attendanceTiersOptions.excludeFreeVisits`\n | `payModel.components.${number}.serviceCommissionOptions.percent`\n | `payModel.components.${number}.serviceCommissionOptions.tierMode`\n | `payModel.components.${number}.serviceCommissionOptions.revenueRules.discountBasis`\n | `payModel.components.${number}.serviceCommissionOptions.revenueRules.taxBasis`\n | `payModel.components.${number}.productCommissionOptions.percent`\n | `payModel.components.${number}.name`\n | `payModel.components.${number}.type`\n | `payModel.combinator.greaterOfOptions.componentIds`\n | `payModel.combinator.type`,\n 5\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 payModelId: payModelId,\n });\n\n const reqOpts = ambassadorWixStaffPayV1PayModel.archivePayModel(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: { payModelId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['payModelId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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: 'payModel.createdDate' },\n { path: 'payModel.updatedDate' },\n { path: 'payModel.archivedDate' },\n];\nconst TRANSFORM_PATHS_1 = [{ path: 'fieldMask' }];\nconst TRANSFORM_PATHS_2 = [\n { path: 'payModels.createdDate' },\n { path: 'payModels.updatedDate' },\n { path: 'payModels.archivedDate' },\n];\n\nfunction resolveWixStaffPayV1PayModelsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/pay-model',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_staff-pay_pay-models';\n\n/**\n * Creates a pay model.\n *\n * Components that don't have an ID get one, and tiers are sorted. A pay model is always created unarchived. To pay a\n * staff member with the pay model, add pay terms that point to it in their staff pay profile.\n */\nexport function createPayModel(payload: object): RequestOptionsFactory<any> {\n function __createPayModel({ 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.pay_model',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.CreatePayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models',\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 __createPayModel;\n}\n\n/** Retrieves a pay model. */\nexport function getPayModel(payload: object): RequestOptionsFactory<any> {\n function __getPayModel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'GET' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.GetPayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/{payModelId}',\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 __getPayModel;\n}\n\n/**\n * Updates a pay model.\n *\n * Each time the pay model is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the pay model.\n * This ensures you're working with the latest pay model and prevents unintended overwrites.\n *\n * Updating `components` replaces the whole list. Send each existing component's `id` back, so personal rates and pay\n * lines stay linked to it. Changes apply to staff pays calculated after the update, and the staff pays of the staff\n * members paid with the pay model are marked stale.\n *\n * An archived pay model can't be updated.\n */\nexport function updatePayModel(payload: object): RequestOptionsFactory<any> {\n function __updatePayModel({ 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.pay_model',\n method: 'PATCH' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.UpdatePayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/{payModel.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 __updatePayModel;\n}\n\n/**\n * Deletes a pay model.\n *\n * A pay model that any pay terms use, past, current or upcoming, can't be deleted. Archive it instead, with Archive\n * Pay Model.\n */\nexport function deletePayModel(payload: object): RequestOptionsFactory<any> {\n function __deletePayModel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'DELETE' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.DeletePayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/{payModelId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deletePayModel;\n}\n\n/**\n * Retrieves a list of up to 100 pay models, given the provided paging, filtering, and sorting.\n *\n * Query Pay Models runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `cursorPaging.limit` is `50`\n *\n * Archived pay models are returned too. To leave them out, for example in lists and pickers, filter on\n * `{\"archivedDate\": {\"$exists\": false}}`.\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 queryPayModels(payload: object): RequestOptionsFactory<any> {\n function __queryPayModels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'GET' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.QueryPayModels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/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: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryPayModels;\n}\n\n/**\n * Archives a pay model. Sets `archivedDate`.\n *\n * Use it for a pay model that's no longer offered but that pay terms used, so it can't be deleted. Pay terms that use\n * the pay model keep it, and it can still be retrieved. An archived pay model can't be updated.\n *\n * Archiving an archived pay model returns it unchanged.\n */\nexport function archivePayModel(payload: object): RequestOptionsFactory<any> {\n function __archivePayModel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.pay.v1.pay_model',\n method: 'POST' as any,\n methodFqn: 'wix.staff.pay.v1.PayModelsService.ArchivePayModel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffPayV1PayModelsServiceUrl({\n protoPath: '/v1/pay-models/{payModelId}/archive',\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 __archivePayModel;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AA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","getPayModel","queryPayModels","updatePayModel","import_timestamp","import_rest_modules","payload","import_transform_paths","ComponentType","AttendeeCountBasis","CommissionTierMode","DiscountBasis","TaxBasis","CombinatorType","SortOrder","WebhookIdentityType","createPayModel","sdkTransformError","getPayModel","updatePayModel","deletePayModel","queryPayModels","archivePayModel"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreatePayModelRequest as CreatePayModelRequest$1, CreatePayModelResponse as CreatePayModelResponse$1, GetPayModelRequest as GetPayModelRequest$1, GetPayModelResponse as GetPayModelResponse$1, UpdatePayModelRequest as UpdatePayModelRequest$1, UpdatePayModelResponse as UpdatePayModelResponse$1, DeletePayModelRequest as DeletePayModelRequest$1, DeletePayModelResponse as DeletePayModelResponse$1, QueryPayModelsRequest as QueryPayModelsRequest$1, QueryPayModelsResponse as QueryPayModelsResponse$1, ArchivePayModelRequest as ArchivePayModelRequest$1, ArchivePayModelResponse as ArchivePayModelResponse$1
|
|
1
|
+
import { CreatePayModelRequest as CreatePayModelRequest$1, CreatePayModelResponse as CreatePayModelResponse$1, GetPayModelRequest as GetPayModelRequest$1, GetPayModelResponse as GetPayModelResponse$1, UpdatePayModelRequest as UpdatePayModelRequest$1, UpdatePayModelResponse as UpdatePayModelResponse$1, DeletePayModelRequest as DeletePayModelRequest$1, DeletePayModelResponse as DeletePayModelResponse$1, QueryPayModelsRequest as QueryPayModelsRequest$1, QueryPayModelsResponse as QueryPayModelsResponse$1, ArchivePayModelRequest as ArchivePayModelRequest$1, ArchivePayModelResponse as ArchivePayModelResponse$1 } from './index.typings.js';
|
|
2
2
|
import '@wix/sdk-types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -72,8 +72,7 @@ interface PayModel {
|
|
|
72
72
|
* Date and time the pay model was archived.
|
|
73
73
|
*
|
|
74
74
|
* Returned only when the pay model is archived. An archived pay model can't be updated and isn't offered for new pay
|
|
75
|
-
* terms, but pay terms that already use it keep it, so it can still be retrieved. Set by Archive Pay Model
|
|
76
|
-
* by Unarchive Pay Model.
|
|
75
|
+
* terms, but pay terms that already use it keep it, so it can still be retrieved. Set by Archive Pay Model.
|
|
77
76
|
* @readonly
|
|
78
77
|
*/
|
|
79
78
|
archivedDate?: Date | null;
|
|
@@ -716,7 +715,7 @@ interface UnarchivePayModelRequest {
|
|
|
716
715
|
* ID of the pay model to unarchive.
|
|
717
716
|
* @format GUID
|
|
718
717
|
*/
|
|
719
|
-
payModelId
|
|
718
|
+
payModelId?: string;
|
|
720
719
|
}
|
|
721
720
|
interface UnarchivePayModelResponse {
|
|
722
721
|
/** Unarchived pay model. */
|
|
@@ -729,7 +728,7 @@ interface BulkDeletePayModelsRequest {
|
|
|
729
728
|
* @maxSize 100
|
|
730
729
|
* @format GUID
|
|
731
730
|
*/
|
|
732
|
-
payModelIds
|
|
731
|
+
payModelIds?: string[];
|
|
733
732
|
}
|
|
734
733
|
interface BulkDeletePayModelsResponse {
|
|
735
734
|
/**
|
|
@@ -991,12 +990,6 @@ type DeletePayModelApplicationErrors = {
|
|
|
991
990
|
description?: string;
|
|
992
991
|
data?: Record<string, any>;
|
|
993
992
|
};
|
|
994
|
-
/** @docsIgnore */
|
|
995
|
-
type BulkDeletePayModelsApplicationErrors = {
|
|
996
|
-
code?: 'PAY_MODEL_IN_USE';
|
|
997
|
-
description?: string;
|
|
998
|
-
data?: Record<string, any>;
|
|
999
|
-
};
|
|
1000
993
|
|
|
1001
994
|
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
1002
995
|
getUrl: (context: any) => string;
|
|
@@ -1022,9 +1015,5 @@ declare function queryPayModels(): __PublicMethodMetaInfo<'GET', {}, QueryPayMod
|
|
|
1022
1015
|
declare function archivePayModel(): __PublicMethodMetaInfo<'POST', {
|
|
1023
1016
|
payModelId: string;
|
|
1024
1017
|
}, ArchivePayModelRequest$1, ArchivePayModelRequest, ArchivePayModelResponse$1, ArchivePayModelResponse>;
|
|
1025
|
-
declare function unarchivePayModel(): __PublicMethodMetaInfo<'POST', {
|
|
1026
|
-
payModelId: string;
|
|
1027
|
-
}, UnarchivePayModelRequest$1, UnarchivePayModelRequest, UnarchivePayModelResponse$1, UnarchivePayModelResponse>;
|
|
1028
|
-
declare function bulkDeletePayModels(): __PublicMethodMetaInfo<'POST', {}, BulkDeletePayModelsRequest$1, BulkDeletePayModelsRequest, BulkDeletePayModelsResponse$1, BulkDeletePayModelsResponse>;
|
|
1029
1018
|
|
|
1030
|
-
export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type ApplicationError as ApplicationErrorOriginal, type ArchivePayModelRequest as ArchivePayModelRequestOriginal, type ArchivePayModelResponse as ArchivePayModelResponseOriginal, type AttendanceTier as AttendanceTierOriginal, type AttendanceTiersOptions as AttendanceTiersOptionsOriginal, AttendeeCountBasis as AttendeeCountBasisOriginal, type AttendeeCountBasisWithLiterals as AttendeeCountBasisWithLiteralsOriginal, type BasePlusPerHeadOptions as BasePlusPerHeadOptionsOriginal, type BulkActionMetadata as BulkActionMetadataOriginal, type
|
|
1019
|
+
export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type ApplicationError as ApplicationErrorOriginal, type ArchivePayModelRequest as ArchivePayModelRequestOriginal, type ArchivePayModelResponse as ArchivePayModelResponseOriginal, type AttendanceTier as AttendanceTierOriginal, type AttendanceTiersOptions as AttendanceTiersOptionsOriginal, AttendeeCountBasis as AttendeeCountBasisOriginal, type AttendeeCountBasisWithLiterals as AttendeeCountBasisWithLiteralsOriginal, type BasePlusPerHeadOptions as BasePlusPerHeadOptionsOriginal, type BulkActionMetadata as BulkActionMetadataOriginal, type BulkDeletePayModelsRequest as BulkDeletePayModelsRequestOriginal, type BulkDeletePayModelsResponse as BulkDeletePayModelsResponseOriginal, type BulkPayModelResult as BulkPayModelResultOriginal, type CombinatorOptionsOneOf as CombinatorOptionsOneOfOriginal, type Combinator as CombinatorOriginal, CombinatorType as CombinatorTypeOriginal, type CombinatorTypeWithLiterals as CombinatorTypeWithLiteralsOriginal, CommissionTierMode as CommissionTierModeOriginal, type CommissionTierModeWithLiterals as CommissionTierModeWithLiteralsOriginal, type CommissionTier as CommissionTierOriginal, ComponentType as ComponentTypeOriginal, type ComponentTypeWithLiterals as ComponentTypeWithLiteralsOriginal, type CostDeductionKindOneOf as CostDeductionKindOneOfOriginal, type CostDeduction as CostDeductionOriginal, type CreatePayModelApplicationErrors as CreatePayModelApplicationErrorsOriginal, type CreatePayModelRequest as CreatePayModelRequestOriginal, type CreatePayModelResponse as CreatePayModelResponseOriginal, type CursorPagingMetadata as CursorPagingMetadataOriginal, type CursorPaging as CursorPagingOriginal, type CursorQuery as CursorQueryOriginal, type CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOfOriginal, type Cursors as CursorsOriginal, type DeletePayModelApplicationErrors as DeletePayModelApplicationErrorsOriginal, type DeletePayModelRequest as DeletePayModelRequestOriginal, type DeletePayModelResponse as DeletePayModelResponseOriginal, DiscountBasis as DiscountBasisOriginal, type DiscountBasisWithLiterals as DiscountBasisWithLiteralsOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type ExtendedFields as ExtendedFieldsOriginal, type ExtraAttendeeTier as ExtraAttendeeTierOriginal, type FlatPerSessionOptions as FlatPerSessionOptionsOriginal, type GetPayModelRequest as GetPayModelRequestOriginal, type GetPayModelResponse as GetPayModelResponseOriginal, type GreaterOfOptions as GreaterOfOptionsOriginal, type HourlyOptions as HourlyOptionsOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type ItemMetadata as ItemMetadataOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type PayComponentOptionsOneOf as PayComponentOptionsOneOfOriginal, type PayComponent as PayComponentOriginal, type PayModel as PayModelOriginal, type PerCourseOptions as PerCourseOptionsOriginal, type PlanSaleCommissionOptions as PlanSaleCommissionOptionsOriginal, type ProductCommissionOptions as ProductCommissionOptionsOriginal, type QueryPayModelsRequest as QueryPayModelsRequestOriginal, type QueryPayModelsResponse as QueryPayModelsResponseOriginal, type RestoreInfo as RestoreInfoOriginal, type RevenueRules as RevenueRulesOriginal, type SalaryOptions as SalaryOptionsOriginal, type ServiceCommissionOptions as ServiceCommissionOptionsOriginal, SortOrder as SortOrderOriginal, type SortOrderWithLiterals as SortOrderWithLiteralsOriginal, type Sorting as SortingOriginal, TaxBasis as TaxBasisOriginal, type TaxBasisWithLiterals as TaxBasisWithLiteralsOriginal, type TipsOptions as TipsOptionsOriginal, type UnarchivePayModelRequest as UnarchivePayModelRequestOriginal, type UnarchivePayModelResponse as UnarchivePayModelResponseOriginal, type UpdatePayModelApplicationErrors as UpdatePayModelApplicationErrorsOriginal, type UpdatePayModelRequest as UpdatePayModelRequestOriginal, type UpdatePayModelResponse as UpdatePayModelResponseOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, archivePayModel, createPayModel, deletePayModel, getPayModel, queryPayModels, updatePayModel };
|