@wix/auto_sdk_staff-pay_pay-models 0.0.0-stage → 1.0.0

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.
@@ -0,0 +1,116 @@
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { PayModel, CreatePayModelApplicationErrors, UpdatePayModel, UpdatePayModelApplicationErrors, DeletePayModelApplicationErrors, ArchivePayModelResponse, UnarchivePayModelResponse, BulkDeletePayModelsResponse, BulkDeletePayModelsApplicationErrors, PayModelsQueryBuilder, PayModelQuery, typedQueryPayModels } from './index.typings.js';
3
+ export { AccountInfo, ActionEvent, ApplicationError, ArchivePayModelRequest, AttendanceTier, AttendanceTiersOptions, AttendeeCountBasis, AttendeeCountBasisWithLiterals, BasePlusPerHeadOptions, BulkActionMetadata, BulkDeletePayModelsRequest, BulkPayModelResult, Combinator, CombinatorOptionsOneOf, CombinatorType, CombinatorTypeWithLiterals, CommissionTier, CommissionTierMode, CommissionTierModeWithLiterals, CommonQueryWithEntityContext, ComponentType, ComponentTypeWithLiterals, CostDeduction, CostDeductionKindOneOf, CreatePayModelRequest, CreatePayModelResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeletePayModelRequest, DeletePayModelResponse, DiscountBasis, DiscountBasisWithLiterals, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExtendedFields, ExtraAttendeeTier, FlatPerSessionOptions, GetPayModelRequest, GetPayModelResponse, GreaterOfOptions, HourlyOptions, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, MessageEnvelope, PayComponent, PayComponentOptionsOneOf, PayModelQuerySpec, PayModelsQueryResult, PerCourseOptions, PlanSaleCommissionOptions, ProductCommissionOptions, QueryPayModelsRequest, QueryPayModelsResponse, RestoreInfo, RevenueRules, SalaryOptions, ServiceCommissionOptions, SortOrder, SortOrderWithLiterals, Sorting, TaxBasis, TaxBasisWithLiterals, TipsOptions, UnarchivePayModelRequest, UpdatePayModelRequest, UpdatePayModelResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
4
+
5
+ declare function createPayModel$1(httpClient: HttpClient): CreatePayModelSignature;
6
+ interface CreatePayModelSignature {
7
+ /**
8
+ * Creates a pay model.
9
+ *
10
+ * Components that don't have an ID get one, and tiers are sorted. A pay model is always created unarchived. To pay a
11
+ * staff member with the pay model, add pay terms that point to it in their staff pay profile.
12
+ * @param - Pay model to create.
13
+ * @returns Created pay model.
14
+ */
15
+ (payModel: NonNullablePaths<PayModel, `name`, 0>): Promise<NonNullablePaths<PayModel, `name` | `components` | `components.${number}.salaryOptions.amountPerPeriod` | `components.${number}.salaryOptions.prorateByDaysEmployed` | `components.${number}.hourlyOptions.rate` | `components.${number}.hourlyOptions.overtimeEligible` | `components.${number}.hourlyOptions.excludeSessionTime` | `components.${number}.flatPerSessionOptions.amount` | `components.${number}.flatPerSessionOptions.zeroWhenCancelled` | `components.${number}.basePlusPerHeadOptions.includedAttendees` | `components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee` | `components.${number}.basePlusPerHeadOptions.countBasis` | `components.${number}.basePlusPerHeadOptions.zeroWhenCancelled` | `components.${number}.basePlusPerHeadOptions.excludeFreeVisits` | `components.${number}.attendanceTiersOptions.countBasis` | `components.${number}.attendanceTiersOptions.zeroWhenCancelled` | `components.${number}.attendanceTiersOptions.excludeFreeVisits` | `components.${number}.serviceCommissionOptions.percent` | `components.${number}.serviceCommissionOptions.tierMode` | `components.${number}.serviceCommissionOptions.revenueRules.discountBasis` | `components.${number}.serviceCommissionOptions.revenueRules.taxBasis` | `components.${number}.productCommissionOptions.percent` | `components.${number}.name` | `components.${number}.type` | `combinator.greaterOfOptions.componentIds` | `combinator.type`, 4> & {
16
+ __applicationErrorsType?: CreatePayModelApplicationErrors;
17
+ }>;
18
+ }
19
+ declare function getPayModel$1(httpClient: HttpClient): GetPayModelSignature;
20
+ interface GetPayModelSignature {
21
+ /**
22
+ * Retrieves a pay model.
23
+ * @param - ID of the pay model to retrieve.
24
+ * @returns Retrieved pay model.
25
+ */
26
+ (payModelId: string): Promise<NonNullablePaths<PayModel, `name` | `components` | `components.${number}.salaryOptions.amountPerPeriod` | `components.${number}.salaryOptions.prorateByDaysEmployed` | `components.${number}.hourlyOptions.rate` | `components.${number}.hourlyOptions.overtimeEligible` | `components.${number}.hourlyOptions.excludeSessionTime` | `components.${number}.flatPerSessionOptions.amount` | `components.${number}.flatPerSessionOptions.zeroWhenCancelled` | `components.${number}.basePlusPerHeadOptions.includedAttendees` | `components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee` | `components.${number}.basePlusPerHeadOptions.countBasis` | `components.${number}.basePlusPerHeadOptions.zeroWhenCancelled` | `components.${number}.basePlusPerHeadOptions.excludeFreeVisits` | `components.${number}.attendanceTiersOptions.countBasis` | `components.${number}.attendanceTiersOptions.zeroWhenCancelled` | `components.${number}.attendanceTiersOptions.excludeFreeVisits` | `components.${number}.serviceCommissionOptions.percent` | `components.${number}.serviceCommissionOptions.tierMode` | `components.${number}.serviceCommissionOptions.revenueRules.discountBasis` | `components.${number}.serviceCommissionOptions.revenueRules.taxBasis` | `components.${number}.productCommissionOptions.percent` | `components.${number}.name` | `components.${number}.type` | `combinator.greaterOfOptions.componentIds` | `combinator.type`, 4>>;
27
+ }
28
+ declare function updatePayModel$1(httpClient: HttpClient): UpdatePayModelSignature;
29
+ interface UpdatePayModelSignature {
30
+ /**
31
+ * Updates a pay model.
32
+ *
33
+ * Each time the pay model is updated, `revision` increments by 1.
34
+ * The current `revision` must be passed when updating the pay model.
35
+ * This ensures you're working with the latest pay model and prevents unintended overwrites.
36
+ *
37
+ * Updating `components` replaces the whole list. Send each existing component's `id` back, so personal rates and pay
38
+ * lines stay linked to it. Changes apply to staff pays calculated after the update, and the staff pays of the staff
39
+ * members paid with the pay model are marked stale.
40
+ *
41
+ * An archived pay model can't be updated until it's unarchived with Unarchive Pay Model.
42
+ * @param - Pay model ID.
43
+ * @returns Updated pay model.
44
+ */
45
+ (_id: string, payModel: NonNullablePaths<UpdatePayModel, `revision`, 0>): Promise<NonNullablePaths<PayModel, `name` | `components` | `components.${number}.salaryOptions.amountPerPeriod` | `components.${number}.salaryOptions.prorateByDaysEmployed` | `components.${number}.hourlyOptions.rate` | `components.${number}.hourlyOptions.overtimeEligible` | `components.${number}.hourlyOptions.excludeSessionTime` | `components.${number}.flatPerSessionOptions.amount` | `components.${number}.flatPerSessionOptions.zeroWhenCancelled` | `components.${number}.basePlusPerHeadOptions.includedAttendees` | `components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee` | `components.${number}.basePlusPerHeadOptions.countBasis` | `components.${number}.basePlusPerHeadOptions.zeroWhenCancelled` | `components.${number}.basePlusPerHeadOptions.excludeFreeVisits` | `components.${number}.attendanceTiersOptions.countBasis` | `components.${number}.attendanceTiersOptions.zeroWhenCancelled` | `components.${number}.attendanceTiersOptions.excludeFreeVisits` | `components.${number}.serviceCommissionOptions.percent` | `components.${number}.serviceCommissionOptions.tierMode` | `components.${number}.serviceCommissionOptions.revenueRules.discountBasis` | `components.${number}.serviceCommissionOptions.revenueRules.taxBasis` | `components.${number}.productCommissionOptions.percent` | `components.${number}.name` | `components.${number}.type` | `combinator.greaterOfOptions.componentIds` | `combinator.type`, 4> & {
46
+ __applicationErrorsType?: UpdatePayModelApplicationErrors;
47
+ }>;
48
+ }
49
+ declare function deletePayModel$1(httpClient: HttpClient): DeletePayModelSignature;
50
+ interface DeletePayModelSignature {
51
+ /**
52
+ * Deletes a pay model.
53
+ *
54
+ * A pay model that any pay terms use, past, current or upcoming, can't be deleted. Archive it instead, with Archive
55
+ * Pay Model.
56
+ *
57
+ * To delete multiple pay models in a single API call, call Bulk Delete Pay Models.
58
+ * @param - ID of the pay model to delete.
59
+ */
60
+ (payModelId: string): Promise<void & {
61
+ __applicationErrorsType?: DeletePayModelApplicationErrors;
62
+ }>;
63
+ }
64
+ declare function archivePayModel$1(httpClient: HttpClient): ArchivePayModelSignature;
65
+ interface ArchivePayModelSignature {
66
+ /**
67
+ * Archives a pay model. Sets `archivedDate`.
68
+ *
69
+ * 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
70
+ * the pay model keep it, and it can still be retrieved. An archived pay model can't be updated.
71
+ *
72
+ * Archiving an archived pay model returns it unchanged. To make it available again, call Unarchive Pay Model.
73
+ * @param - ID of the pay model to archive.
74
+ */
75
+ (payModelId: string): Promise<NonNullablePaths<ArchivePayModelResponse, `payModel.name` | `payModel.components` | `payModel.components.${number}.salaryOptions.amountPerPeriod` | `payModel.components.${number}.salaryOptions.prorateByDaysEmployed` | `payModel.components.${number}.hourlyOptions.rate` | `payModel.components.${number}.hourlyOptions.overtimeEligible` | `payModel.components.${number}.hourlyOptions.excludeSessionTime` | `payModel.components.${number}.flatPerSessionOptions.amount` | `payModel.components.${number}.flatPerSessionOptions.zeroWhenCancelled` | `payModel.components.${number}.basePlusPerHeadOptions.includedAttendees` | `payModel.components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee` | `payModel.components.${number}.basePlusPerHeadOptions.countBasis` | `payModel.components.${number}.basePlusPerHeadOptions.zeroWhenCancelled` | `payModel.components.${number}.basePlusPerHeadOptions.excludeFreeVisits` | `payModel.components.${number}.attendanceTiersOptions.countBasis` | `payModel.components.${number}.attendanceTiersOptions.zeroWhenCancelled` | `payModel.components.${number}.attendanceTiersOptions.excludeFreeVisits` | `payModel.components.${number}.serviceCommissionOptions.percent` | `payModel.components.${number}.serviceCommissionOptions.tierMode` | `payModel.components.${number}.serviceCommissionOptions.revenueRules.discountBasis` | `payModel.components.${number}.serviceCommissionOptions.revenueRules.taxBasis` | `payModel.components.${number}.productCommissionOptions.percent` | `payModel.components.${number}.name` | `payModel.components.${number}.type` | `payModel.combinator.greaterOfOptions.componentIds` | `payModel.combinator.type`, 5>>;
76
+ }
77
+ declare function unarchivePayModel$1(httpClient: HttpClient): UnarchivePayModelSignature;
78
+ interface UnarchivePayModelSignature {
79
+ /**
80
+ * Unarchives a pay model. Clears `archivedDate`, so the pay model can be updated and offered again.
81
+ *
82
+ * Unarchiving a pay model that isn't archived returns it unchanged.
83
+ * @param - ID of the pay model to unarchive.
84
+ */
85
+ (payModelId: string): Promise<NonNullablePaths<UnarchivePayModelResponse, `payModel.name` | `payModel.components` | `payModel.components.${number}.salaryOptions.amountPerPeriod` | `payModel.components.${number}.salaryOptions.prorateByDaysEmployed` | `payModel.components.${number}.hourlyOptions.rate` | `payModel.components.${number}.hourlyOptions.overtimeEligible` | `payModel.components.${number}.hourlyOptions.excludeSessionTime` | `payModel.components.${number}.flatPerSessionOptions.amount` | `payModel.components.${number}.flatPerSessionOptions.zeroWhenCancelled` | `payModel.components.${number}.basePlusPerHeadOptions.includedAttendees` | `payModel.components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee` | `payModel.components.${number}.basePlusPerHeadOptions.countBasis` | `payModel.components.${number}.basePlusPerHeadOptions.zeroWhenCancelled` | `payModel.components.${number}.basePlusPerHeadOptions.excludeFreeVisits` | `payModel.components.${number}.attendanceTiersOptions.countBasis` | `payModel.components.${number}.attendanceTiersOptions.zeroWhenCancelled` | `payModel.components.${number}.attendanceTiersOptions.excludeFreeVisits` | `payModel.components.${number}.serviceCommissionOptions.percent` | `payModel.components.${number}.serviceCommissionOptions.tierMode` | `payModel.components.${number}.serviceCommissionOptions.revenueRules.discountBasis` | `payModel.components.${number}.serviceCommissionOptions.revenueRules.taxBasis` | `payModel.components.${number}.productCommissionOptions.percent` | `payModel.components.${number}.name` | `payModel.components.${number}.type` | `payModel.combinator.greaterOfOptions.componentIds` | `payModel.combinator.type`, 5>>;
86
+ }
87
+ declare function bulkDeletePayModels$1(httpClient: HttpClient): BulkDeletePayModelsSignature;
88
+ interface BulkDeletePayModelsSignature {
89
+ /**
90
+ * Deletes multiple pay models.
91
+ *
92
+ * Each pay model is deleted on its own: one that pay terms use isn't deleted and its result fails with
93
+ * `PAY_MODEL_IN_USE`, while the others are still deleted.
94
+ *
95
+ * To delete a single pay model, call Delete Pay Model.
96
+ * @param - IDs of the pay models to delete.
97
+ */
98
+ (payModelIds: string[]): Promise<NonNullablePaths<BulkDeletePayModelsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 4> & {
99
+ __applicationErrorsType?: BulkDeletePayModelsApplicationErrors;
100
+ }>;
101
+ }
102
+
103
+ declare function customQueryPayModels(httpClient: HttpClient): {
104
+ (): PayModelsQueryBuilder;
105
+ (query: PayModelQuery): ReturnType<typeof typedQueryPayModels>;
106
+ };
107
+ declare const createPayModel: MaybeContext<BuildRESTFunction<typeof createPayModel$1> & typeof createPayModel$1>;
108
+ declare const getPayModel: MaybeContext<BuildRESTFunction<typeof getPayModel$1> & typeof getPayModel$1>;
109
+ declare const updatePayModel: MaybeContext<BuildRESTFunction<typeof updatePayModel$1> & typeof updatePayModel$1>;
110
+ declare const deletePayModel: MaybeContext<BuildRESTFunction<typeof deletePayModel$1> & typeof deletePayModel$1>;
111
+ declare const archivePayModel: MaybeContext<BuildRESTFunction<typeof archivePayModel$1> & typeof archivePayModel$1>;
112
+ declare const unarchivePayModel: MaybeContext<BuildRESTFunction<typeof unarchivePayModel$1> & typeof unarchivePayModel$1>;
113
+ declare const bulkDeletePayModels: MaybeContext<BuildRESTFunction<typeof bulkDeletePayModels$1> & typeof bulkDeletePayModels$1>;
114
+ declare const queryPayModels: MaybeContext<BuildRESTFunction<typeof customQueryPayModels> & typeof customQueryPayModels>;
115
+
116
+ export { ArchivePayModelResponse, BulkDeletePayModelsApplicationErrors, BulkDeletePayModelsResponse, CreatePayModelApplicationErrors, DeletePayModelApplicationErrors, PayModel, PayModelQuery, PayModelsQueryBuilder, UnarchivePayModelResponse, UpdatePayModel, UpdatePayModelApplicationErrors, archivePayModel, bulkDeletePayModels, createPayModel, deletePayModel, getPayModel, queryPayModels, unarchivePayModel, updatePayModel };