@wix/auto_sdk_staff-pay_staff-pay 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,232 @@
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { StaffPay, CreateStaffPayApplicationErrors, UpdateStaffPay, UpdateStaffPayApplicationErrors, DeleteStaffPayApplicationErrors, BulkDeleteStaffPaysResponse, BulkDeleteStaffPaysApplicationErrors, CalculateStaffPayResponse, CalculateStaffPayApplicationErrors, PreviewStaffPayCalculationOptions, PreviewStaffPayCalculationResponse, PreviewStaffPayCalculationApplicationErrors, BulkCalculateStaffPaysOptions, BulkCalculateStaffPaysResponse, BulkCalculateStaffPaysApplicationErrors, ApproveStaffPayResponse, ApproveStaffPayApplicationErrors, BulkApproveStaffPaysResponse, ReopenStaffPayResponse, ReopenStaffPayApplicationErrors, ExportStaffPaysOptions, ExportStaffPaysResponse, PayModel, PreviewStaffPayOptions, PreviewStaffPayResponse, StaffPaysQueryBuilder, StaffPayQuery, typedQueryStaffPays } from './index.typings.js';
3
+ export { AccountInfo, ActionEvent, Adjustment, AdjustmentType, AdjustmentTypeWithLiterals, ApplicationError, ApproveStaffPayRequest, AttendanceTier, AttendanceTiersOptions, AttendeeCountBasis, AttendeeCountBasisWithLiterals, BasePlusPerHeadOptions, BulkActionMetadata, BulkApproveStaffPaysRequest, BulkCalculateStaffPaysRequest, BulkCalculateStaffPaysResponseBulkStaffPayResult, BulkDeleteStaffPaysRequest, BulkDeleteStaffPaysResponseBulkStaffPayResult, BulkStaffPayResult, CalculateStaffPayRequest, Combinator, CombinatorOptionsOneOf, CombinatorType, CombinatorTypeWithLiterals, CommissionTier, CommissionTierMode, CommissionTierModeWithLiterals, CommonQueryWithEntityContext, ComponentPreview, ComponentType, ComponentTypeWithLiterals, CostDeduction, CostDeductionKindOneOf, CreateStaffPayRequest, CreateStaffPayResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteStaffPayRequest, DeleteStaffPayResponse, DiscountBasis, DiscountBasisWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExportFormat, ExportFormatWithLiterals, ExportStaffPaysRequest, ExtendedFields, ExtraAttendeeTier, FlatPerSessionOptions, GetStaffPayRequest, GetStaffPayResponse, GreaterOfOptions, HourlyOptions, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, MessageEnvelope, PayComponent, PayComponentOptionsOneOf, PayLine, PayLineSource, PayLineSourceType, PayLineSourceTypeWithLiterals, PayLineType, PayLineTypeWithLiterals, PerCourseOptions, PlanSaleCommissionOptions, PreviewStaffPayCalculationRequest, PreviewStaffPayRequest, ProductCommissionOptions, ProposedClockOut, QuantityUnit, QuantityUnitWithLiterals, QueryStaffPaysRequest, QueryStaffPaysResponse, ReopenStaffPayRequest, RestoreInfo, RevenueRules, SalaryOptions, SampleFacts, SamplePlanOrder, SampleSession, ServiceCommissionOptions, SortOrder, SortOrderWithLiterals, Sorting, StaffPayAlert, StaffPayAlertType, StaffPayAlertTypeWithLiterals, StaffPayQuerySpec, StaffPayStatus, StaffPayStatusWithLiterals, StaffPayTotals, StaffPaysQueryResult, StaleReason, StaleReasonType, StaleReasonTypeWithLiterals, TaxBasis, TaxBasisWithLiterals, TipsOptions, UpdateStaffPayRequest, UpdateStaffPayResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
4
+
5
+ declare function createStaffPay$1(httpClient: HttpClient): CreateStaffPaySignature;
6
+ interface CreateStaffPaySignature {
7
+ /**
8
+ * Creates a `DRAFT` staff pay for a staff member and pay period.
9
+ *
10
+ * A pay period is at most 62 days long, and a staff member's staff pays can't overlap. When the site has a pay schedule,
11
+ * a period that has no staff pay yet must be one of the schedule's periods, from its first period on, or the days
12
+ * between the last staff pay and the first period. To calculate the staff pay, call Calculate Staff Pay. To create and calculate a whole period at once, call
13
+ * Bulk Calculate Staff Pays.
14
+ * @param - Staff pay to create.
15
+ * @returns Created staff pay.
16
+ */
17
+ (staffPay: NonNullablePaths<StaffPay, `periodEndDate` | `periodStartDate` | `staffMemberId`, 0>): Promise<NonNullablePaths<StaffPay, `staffMemberId` | `periodStartDate` | `periodEndDate` | `status` | `stale` | `currency` | `totals.grossAmount` | `totals.paidHours` | `totals.overtimeHours` | `totals.sessionsCount` | `totals.serviceRevenueAmount` | `totals.commissionAmount` | `totals.tipsAmount` | `totals.adjustmentsAmount` | `totals.productRevenueAmount` | `totals.planRevenueAmount` | `totals.upcomingSessionsCount` | `lines` | `lines.${number}._id` | `lines.${number}.componentName` | `lines.${number}.type` | `lines.${number}.source.type` | `lines.${number}.source._id` | `lines.${number}.date` | `lines.${number}.quantity` | `lines.${number}.quantityUnit` | `lines.${number}.rate` | `lines.${number}.amount` | `lines.${number}.included` | `lines.${number}.explanation` | `adjustments` | `adjustments.${number}.type` | `adjustments.${number}.amount` | `adjustments.${number}.note` | `alerts` | `alerts.${number}.type` | `alerts.${number}.message` | `factsHash` | `payTermsIds`, 3> & {
18
+ __applicationErrorsType?: CreateStaffPayApplicationErrors;
19
+ }>;
20
+ }
21
+ declare function getStaffPay$1(httpClient: HttpClient): GetStaffPaySignature;
22
+ interface GetStaffPaySignature {
23
+ /**
24
+ * Retrieves a staff pay, including its pay lines.
25
+ * @param - ID of the staff pay to retrieve.
26
+ * @returns Retrieved staff pay.
27
+ */
28
+ (staffPayId: string): Promise<NonNullablePaths<StaffPay, `staffMemberId` | `periodStartDate` | `periodEndDate` | `status` | `stale` | `currency` | `totals.grossAmount` | `totals.paidHours` | `totals.overtimeHours` | `totals.sessionsCount` | `totals.serviceRevenueAmount` | `totals.commissionAmount` | `totals.tipsAmount` | `totals.adjustmentsAmount` | `totals.productRevenueAmount` | `totals.planRevenueAmount` | `totals.upcomingSessionsCount` | `lines` | `lines.${number}._id` | `lines.${number}.componentName` | `lines.${number}.type` | `lines.${number}.source.type` | `lines.${number}.source._id` | `lines.${number}.date` | `lines.${number}.quantity` | `lines.${number}.quantityUnit` | `lines.${number}.rate` | `lines.${number}.amount` | `lines.${number}.included` | `lines.${number}.explanation` | `adjustments` | `adjustments.${number}.type` | `adjustments.${number}.amount` | `adjustments.${number}.note` | `alerts` | `alerts.${number}.type` | `alerts.${number}.message` | `factsHash` | `payTermsIds`, 3>>;
29
+ }
30
+ declare function updateStaffPay$1(httpClient: HttpClient): UpdateStaffPaySignature;
31
+ interface UpdateStaffPaySignature {
32
+ /**
33
+ * Updates a staff pay's adjustments and extended fields.
34
+ *
35
+ * Each time the staff pay is updated, `revision` increments by 1. The current `revision` must be passed when updating
36
+ * the staff pay. This ensures you're working with the latest staff pay and prevents unintended overwrites.
37
+ *
38
+ * Supported properties: `adjustments`, `extendedFields`. Other paths in `fieldMask` are ignored.
39
+ *
40
+ * Adjustments are bonuses, deductions and reimbursements, and each becomes a pay line. A wrong calculated amount isn't
41
+ * corrected here: fix its source, such as the timecard or booking, and calculate the staff pay again. Changing the
42
+ * adjustments of a calculated staff pay marks it stale. An approved staff pay can't be updated until it's reopened with
43
+ * Reopen Staff Pay.
44
+ * @param - Staff pay ID.
45
+ * @returns Updated staff pay.
46
+ */
47
+ (_id: string, staffPay: NonNullablePaths<UpdateStaffPay, `revision`, 0>): Promise<NonNullablePaths<StaffPay, `staffMemberId` | `periodStartDate` | `periodEndDate` | `status` | `stale` | `currency` | `totals.grossAmount` | `totals.paidHours` | `totals.overtimeHours` | `totals.sessionsCount` | `totals.serviceRevenueAmount` | `totals.commissionAmount` | `totals.tipsAmount` | `totals.adjustmentsAmount` | `totals.productRevenueAmount` | `totals.planRevenueAmount` | `totals.upcomingSessionsCount` | `lines` | `lines.${number}._id` | `lines.${number}.componentName` | `lines.${number}.type` | `lines.${number}.source.type` | `lines.${number}.source._id` | `lines.${number}.date` | `lines.${number}.quantity` | `lines.${number}.quantityUnit` | `lines.${number}.rate` | `lines.${number}.amount` | `lines.${number}.included` | `lines.${number}.explanation` | `adjustments` | `adjustments.${number}.type` | `adjustments.${number}.amount` | `adjustments.${number}.note` | `alerts` | `alerts.${number}.type` | `alerts.${number}.message` | `factsHash` | `payTermsIds`, 3> & {
48
+ __applicationErrorsType?: UpdateStaffPayApplicationErrors;
49
+ }>;
50
+ }
51
+ declare function deleteStaffPay$1(httpClient: HttpClient): DeleteStaffPaySignature;
52
+ interface DeleteStaffPaySignature {
53
+ /**
54
+ * Deletes a staff pay.
55
+ *
56
+ * An approved staff pay can't be deleted until it's reopened with Reopen Staff Pay.
57
+ *
58
+ * To delete multiple staff pays in a single API call, call Bulk Delete Staff Pays.
59
+ * @param - ID of the staff pay to delete.
60
+ */
61
+ (staffPayId: string): Promise<void & {
62
+ __applicationErrorsType?: DeleteStaffPayApplicationErrors;
63
+ }>;
64
+ }
65
+ declare function bulkDeleteStaffPays$1(httpClient: HttpClient): BulkDeleteStaffPaysSignature;
66
+ interface BulkDeleteStaffPaysSignature {
67
+ /**
68
+ * Deletes multiple staff pays.
69
+ *
70
+ * Each staff pay is deleted on its own: an approved one isn't deleted and its result fails with `STAFF_PAY_APPROVED`,
71
+ * while the others are still deleted.
72
+ *
73
+ * To delete a single staff pay, call Delete Staff Pay.
74
+ * @param - IDs of the staff pays to delete.
75
+ */
76
+ (staffPayIds: string[]): Promise<NonNullablePaths<BulkDeleteStaffPaysResponse, `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> & {
77
+ __applicationErrorsType?: BulkDeleteStaffPaysApplicationErrors;
78
+ }>;
79
+ }
80
+ declare function calculateStaffPay$1(httpClient: HttpClient): CalculateStaffPaySignature;
81
+ interface CalculateStaffPaySignature {
82
+ /**
83
+ * Calculates a staff pay.
84
+ *
85
+ * Reads the staff member's data for the period: hours from Time Clock timecards, sessions with their attendance and
86
+ * service revenue from Bookings, and tips from Wix Tips. Applies the pay terms in effect on each day and replaces the
87
+ * staff pay's lines, totals and alerts. Moves a `DRAFT` staff pay to `CALCULATED` and clears `stale` and
88
+ * `staleReasons`.
89
+ *
90
+ * The data is read with the caller's permissions. A source the caller isn't allowed to read pays nothing and adds a
91
+ * `SOURCE_NOT_PERMITTED` alert, which blocks approval until someone allowed to read it calculates again.
92
+ *
93
+ * Currently supports commission on services. Product and pricing plan sales aren't read yet, so components paid on
94
+ * them pay nothing.
95
+ *
96
+ * An approved staff pay can't be calculated until it's reopened with Reopen Staff Pay. To preview
97
+ * a calculation without saving it, call Preview Staff Pay Calculation.
98
+ * @param - ID of the staff pay to calculate.
99
+ */
100
+ (staffPayId: string): Promise<NonNullablePaths<CalculateStaffPayResponse, `staffPay.staffMemberId` | `staffPay.periodStartDate` | `staffPay.periodEndDate` | `staffPay.status` | `staffPay.stale` | `staffPay.currency` | `staffPay.totals.grossAmount` | `staffPay.totals.paidHours` | `staffPay.totals.overtimeHours` | `staffPay.totals.sessionsCount` | `staffPay.totals.serviceRevenueAmount` | `staffPay.totals.commissionAmount` | `staffPay.totals.tipsAmount` | `staffPay.totals.adjustmentsAmount` | `staffPay.totals.productRevenueAmount` | `staffPay.totals.planRevenueAmount` | `staffPay.totals.upcomingSessionsCount` | `staffPay.lines` | `staffPay.lines.${number}._id` | `staffPay.lines.${number}.componentName` | `staffPay.lines.${number}.type` | `staffPay.lines.${number}.source.type` | `staffPay.lines.${number}.source._id` | `staffPay.lines.${number}.date` | `staffPay.lines.${number}.quantity` | `staffPay.lines.${number}.quantityUnit` | `staffPay.lines.${number}.rate` | `staffPay.lines.${number}.amount` | `staffPay.lines.${number}.included` | `staffPay.lines.${number}.explanation` | `staffPay.adjustments` | `staffPay.adjustments.${number}.type` | `staffPay.adjustments.${number}.amount` | `staffPay.adjustments.${number}.note` | `staffPay.alerts` | `staffPay.alerts.${number}.type` | `staffPay.alerts.${number}.message` | `staffPay.factsHash` | `staffPay.payTermsIds`, 4> & {
101
+ __applicationErrorsType?: CalculateStaffPayApplicationErrors;
102
+ }>;
103
+ }
104
+ declare function previewStaffPayCalculation$1(httpClient: HttpClient): PreviewStaffPayCalculationSignature;
105
+ interface PreviewStaffPayCalculationSignature {
106
+ /**
107
+ * Calculates a staff pay again without saving anything, and returns it as it would be.
108
+ *
109
+ * The saved staff pay, its status and `stale` stay as they are. Compare the returned `totals` and `lines` with the
110
+ * saved ones to see what calculating again would change. Works for an approved staff pay too, to show what changed
111
+ * since approval. To apply the changes, call Reopen Staff Pay and then
112
+ * Calculate Staff Pay.
113
+ *
114
+ * With `proposedClockOuts`, also shows what clocking out open timecards would pay, before the clock-outs are saved in
115
+ * Time Clock. Each timecard is calculated as clocked out at its proposed time, and its open timecard alert is
116
+ * removed.
117
+ * @param - ID of the staff pay to calculate again.
118
+ */
119
+ (staffPayId: string, options?: NonNullablePaths<PreviewStaffPayCalculationOptions, `proposedClockOuts.${number}.clockOut` | `proposedClockOuts.${number}.timecardId`, 2>): Promise<NonNullablePaths<PreviewStaffPayCalculationResponse, `staffPay.staffMemberId` | `staffPay.periodStartDate` | `staffPay.periodEndDate` | `staffPay.status` | `staffPay.stale` | `staffPay.currency` | `staffPay.totals.grossAmount` | `staffPay.totals.paidHours` | `staffPay.totals.overtimeHours` | `staffPay.totals.sessionsCount` | `staffPay.totals.serviceRevenueAmount` | `staffPay.totals.commissionAmount` | `staffPay.totals.tipsAmount` | `staffPay.totals.adjustmentsAmount` | `staffPay.totals.productRevenueAmount` | `staffPay.totals.planRevenueAmount` | `staffPay.totals.upcomingSessionsCount` | `staffPay.lines` | `staffPay.lines.${number}._id` | `staffPay.lines.${number}.componentName` | `staffPay.lines.${number}.type` | `staffPay.lines.${number}.source.type` | `staffPay.lines.${number}.source._id` | `staffPay.lines.${number}.date` | `staffPay.lines.${number}.quantity` | `staffPay.lines.${number}.quantityUnit` | `staffPay.lines.${number}.rate` | `staffPay.lines.${number}.amount` | `staffPay.lines.${number}.included` | `staffPay.lines.${number}.explanation` | `staffPay.adjustments` | `staffPay.adjustments.${number}.type` | `staffPay.adjustments.${number}.amount` | `staffPay.adjustments.${number}.note` | `staffPay.alerts` | `staffPay.alerts.${number}.type` | `staffPay.alerts.${number}.message` | `staffPay.factsHash` | `staffPay.payTermsIds`, 4> & {
120
+ __applicationErrorsType?: PreviewStaffPayCalculationApplicationErrors;
121
+ }>;
122
+ }
123
+ declare function bulkCalculateStaffPays$1(httpClient: HttpClient): BulkCalculateStaffPaysSignature;
124
+ interface BulkCalculateStaffPaysSignature {
125
+ /**
126
+ * Calculates a pay period for multiple staff members.
127
+ *
128
+ * Creates a `DRAFT` staff pay for each staff member who doesn't have one for the period yet, then calculates every
129
+ * staff pay of the period that isn't approved. Approved staff pays keep their result. In the open period and the last
130
+ * period that ended before it, an approved staff pay whose sessions, bookings, attendance or orders changed since
131
+ * approval is marked `stale`, with the `SOURCE_DATA_CHANGED` reason. Without `staffMemberIds`, the staff members whose
132
+ * pay terms are in effect on at least 1 day of the period are calculated.
133
+ *
134
+ * A period that has no staff pay yet must be one of the site's pay schedule's periods, as in Create Staff Pay.
135
+ *
136
+ * Each staff pay is calculated on its own, so one that fails doesn't affect the others.
137
+ *
138
+ * To calculate a single staff pay, call Calculate Staff Pay.
139
+ * @param - First day of the pay period, in `YYYY-MM-DD` format.
140
+ */
141
+ (periodStartDate: string, options?: NonNullablePaths<BulkCalculateStaffPaysOptions, `periodEndDate`, 0>): Promise<NonNullablePaths<BulkCalculateStaffPaysResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item.staffMemberId` | `results.${number}.item.periodStartDate` | `results.${number}.item.periodEndDate` | `results.${number}.item.status` | `results.${number}.item.stale` | `results.${number}.item.currency` | `results.${number}.item.totals.grossAmount` | `results.${number}.item.totals.paidHours` | `results.${number}.item.totals.overtimeHours` | `results.${number}.item.totals.sessionsCount` | `results.${number}.item.totals.serviceRevenueAmount` | `results.${number}.item.totals.commissionAmount` | `results.${number}.item.totals.tipsAmount` | `results.${number}.item.totals.adjustmentsAmount` | `results.${number}.item.totals.productRevenueAmount` | `results.${number}.item.totals.planRevenueAmount` | `results.${number}.item.totals.upcomingSessionsCount` | `results.${number}.item.factsHash` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 4> & {
142
+ __applicationErrorsType?: BulkCalculateStaffPaysApplicationErrors;
143
+ }>;
144
+ }
145
+ declare function approveStaffPay$1(httpClient: HttpClient): ApproveStaffPaySignature;
146
+ interface ApproveStaffPaySignature {
147
+ /**
148
+ * Approves a calculated staff pay and locks its result.
149
+ *
150
+ * The current `revision` must be passed, so the approved result is the one that was reviewed.
151
+ *
152
+ * A staff pay can't be approved while it's stale, while a timecard it pays was clocked out automatically, or while a
153
+ * source its last calculation couldn't read is missing. Calculate it again first. To change an approved staff pay,
154
+ * call Reopen Staff Pay.
155
+ *
156
+ * To approve multiple staff pays in a single API call, call Bulk Approve Staff Pays.
157
+ * @param - ID of the staff pay to approve.
158
+ * @param - Current revision of the staff pay.
159
+ */
160
+ (staffPayId: string, revision: string): Promise<NonNullablePaths<ApproveStaffPayResponse, `staffPay.staffMemberId` | `staffPay.periodStartDate` | `staffPay.periodEndDate` | `staffPay.status` | `staffPay.stale` | `staffPay.currency` | `staffPay.totals.grossAmount` | `staffPay.totals.paidHours` | `staffPay.totals.overtimeHours` | `staffPay.totals.sessionsCount` | `staffPay.totals.serviceRevenueAmount` | `staffPay.totals.commissionAmount` | `staffPay.totals.tipsAmount` | `staffPay.totals.adjustmentsAmount` | `staffPay.totals.productRevenueAmount` | `staffPay.totals.planRevenueAmount` | `staffPay.totals.upcomingSessionsCount` | `staffPay.lines` | `staffPay.lines.${number}._id` | `staffPay.lines.${number}.componentName` | `staffPay.lines.${number}.type` | `staffPay.lines.${number}.source.type` | `staffPay.lines.${number}.source._id` | `staffPay.lines.${number}.date` | `staffPay.lines.${number}.quantity` | `staffPay.lines.${number}.quantityUnit` | `staffPay.lines.${number}.rate` | `staffPay.lines.${number}.amount` | `staffPay.lines.${number}.included` | `staffPay.lines.${number}.explanation` | `staffPay.adjustments` | `staffPay.adjustments.${number}.type` | `staffPay.adjustments.${number}.amount` | `staffPay.adjustments.${number}.note` | `staffPay.alerts` | `staffPay.alerts.${number}.type` | `staffPay.alerts.${number}.message` | `staffPay.factsHash` | `staffPay.payTermsIds`, 4> & {
161
+ __applicationErrorsType?: ApproveStaffPayApplicationErrors;
162
+ }>;
163
+ }
164
+ declare function bulkApproveStaffPays$1(httpClient: HttpClient): BulkApproveStaffPaysSignature;
165
+ interface BulkApproveStaffPaysSignature {
166
+ /**
167
+ * Approves multiple calculated staff pays.
168
+ *
169
+ * Each staff pay is approved on its own at its current revision: one that can't be approved fails without affecting
170
+ * the others.
171
+ *
172
+ * To approve a single staff pay, call Approve Staff Pay.
173
+ * @param - IDs of the staff pays to approve.
174
+ */
175
+ (staffPayIds: string[]): Promise<NonNullablePaths<BulkApproveStaffPaysResponse, `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>>;
176
+ }
177
+ declare function reopenStaffPay$1(httpClient: HttpClient): ReopenStaffPaySignature;
178
+ interface ReopenStaffPaySignature {
179
+ /**
180
+ * Reopens an approved staff pay so it can be changed and calculated again.
181
+ *
182
+ * Moves the staff pay back to `CALCULATED`. Its approved result stays until it's calculated again. The staff pay is
183
+ * stale when its data changed while it was approved, and it keeps its `staleReasons`.
184
+ * @param - ID of the staff pay to reopen.
185
+ */
186
+ (staffPayId: string): Promise<NonNullablePaths<ReopenStaffPayResponse, `staffPay.staffMemberId` | `staffPay.periodStartDate` | `staffPay.periodEndDate` | `staffPay.status` | `staffPay.stale` | `staffPay.currency` | `staffPay.totals.grossAmount` | `staffPay.totals.paidHours` | `staffPay.totals.overtimeHours` | `staffPay.totals.sessionsCount` | `staffPay.totals.serviceRevenueAmount` | `staffPay.totals.commissionAmount` | `staffPay.totals.tipsAmount` | `staffPay.totals.adjustmentsAmount` | `staffPay.totals.productRevenueAmount` | `staffPay.totals.planRevenueAmount` | `staffPay.totals.upcomingSessionsCount` | `staffPay.lines` | `staffPay.lines.${number}._id` | `staffPay.lines.${number}.componentName` | `staffPay.lines.${number}.type` | `staffPay.lines.${number}.source.type` | `staffPay.lines.${number}.source._id` | `staffPay.lines.${number}.date` | `staffPay.lines.${number}.quantity` | `staffPay.lines.${number}.quantityUnit` | `staffPay.lines.${number}.rate` | `staffPay.lines.${number}.amount` | `staffPay.lines.${number}.included` | `staffPay.lines.${number}.explanation` | `staffPay.adjustments` | `staffPay.adjustments.${number}.type` | `staffPay.adjustments.${number}.amount` | `staffPay.adjustments.${number}.note` | `staffPay.alerts` | `staffPay.alerts.${number}.type` | `staffPay.alerts.${number}.message` | `staffPay.factsHash` | `staffPay.payTermsIds`, 4> & {
187
+ __applicationErrorsType?: ReopenStaffPayApplicationErrors;
188
+ }>;
189
+ }
190
+ declare function exportStaffPays$1(httpClient: HttpClient): ExportStaffPaysSignature;
191
+ interface ExportStaffPaysSignature {
192
+ /**
193
+ * Exports the approved staff pays of a pay period as a CSV file.
194
+ *
195
+ * Uses the requested `format`, or the format in the site's export settings when none is specified. Staff pays of the
196
+ * period that aren't approved are left out and counted in `skippedCount`. Sets `lastExportedDate` on each exported
197
+ * staff pay.
198
+ * @param - First day of the pay period to export, in `YYYY-MM-DD` format.
199
+ */
200
+ (periodStartDate: string, options?: ExportStaffPaysOptions): Promise<NonNullablePaths<ExportStaffPaysResponse, `fileName` | `content` | `skippedCount`, 0>>;
201
+ }
202
+ declare function previewStaffPay$1(httpClient: HttpClient): PreviewStaffPaySignature;
203
+ interface PreviewStaffPaySignature {
204
+ /**
205
+ * Calculates what a pay model would pay for a set of sample data, without saving anything.
206
+ *
207
+ * The pay model doesn't need to be saved first. Use it to show what a pay model pays while it's being edited.
208
+ * @param - Pay model to preview. May be unsaved.
209
+ */
210
+ (payModel: PayModel, options: NonNullablePaths<PreviewStaffPayOptions, `sampleFacts`, 0>): Promise<NonNullablePaths<PreviewStaffPayResponse, `components` | `components.${number}.componentName` | `components.${number}.amount` | `components.${number}.included` | `components.${number}.explanation` | `grossAmount`, 2>>;
211
+ }
212
+
213
+ declare function customQueryStaffPays(httpClient: HttpClient): {
214
+ (): StaffPaysQueryBuilder;
215
+ (query: StaffPayQuery): ReturnType<typeof typedQueryStaffPays>;
216
+ };
217
+ declare const createStaffPay: MaybeContext<BuildRESTFunction<typeof createStaffPay$1> & typeof createStaffPay$1>;
218
+ declare const getStaffPay: MaybeContext<BuildRESTFunction<typeof getStaffPay$1> & typeof getStaffPay$1>;
219
+ declare const updateStaffPay: MaybeContext<BuildRESTFunction<typeof updateStaffPay$1> & typeof updateStaffPay$1>;
220
+ declare const deleteStaffPay: MaybeContext<BuildRESTFunction<typeof deleteStaffPay$1> & typeof deleteStaffPay$1>;
221
+ declare const bulkDeleteStaffPays: MaybeContext<BuildRESTFunction<typeof bulkDeleteStaffPays$1> & typeof bulkDeleteStaffPays$1>;
222
+ declare const calculateStaffPay: MaybeContext<BuildRESTFunction<typeof calculateStaffPay$1> & typeof calculateStaffPay$1>;
223
+ declare const previewStaffPayCalculation: MaybeContext<BuildRESTFunction<typeof previewStaffPayCalculation$1> & typeof previewStaffPayCalculation$1>;
224
+ declare const bulkCalculateStaffPays: MaybeContext<BuildRESTFunction<typeof bulkCalculateStaffPays$1> & typeof bulkCalculateStaffPays$1>;
225
+ declare const approveStaffPay: MaybeContext<BuildRESTFunction<typeof approveStaffPay$1> & typeof approveStaffPay$1>;
226
+ declare const bulkApproveStaffPays: MaybeContext<BuildRESTFunction<typeof bulkApproveStaffPays$1> & typeof bulkApproveStaffPays$1>;
227
+ declare const reopenStaffPay: MaybeContext<BuildRESTFunction<typeof reopenStaffPay$1> & typeof reopenStaffPay$1>;
228
+ declare const exportStaffPays: MaybeContext<BuildRESTFunction<typeof exportStaffPays$1> & typeof exportStaffPays$1>;
229
+ declare const previewStaffPay: MaybeContext<BuildRESTFunction<typeof previewStaffPay$1> & typeof previewStaffPay$1>;
230
+ declare const queryStaffPays: MaybeContext<BuildRESTFunction<typeof customQueryStaffPays> & typeof customQueryStaffPays>;
231
+
232
+ export { ApproveStaffPayApplicationErrors, ApproveStaffPayResponse, BulkApproveStaffPaysResponse, BulkCalculateStaffPaysApplicationErrors, BulkCalculateStaffPaysOptions, BulkCalculateStaffPaysResponse, BulkDeleteStaffPaysApplicationErrors, BulkDeleteStaffPaysResponse, CalculateStaffPayApplicationErrors, CalculateStaffPayResponse, CreateStaffPayApplicationErrors, DeleteStaffPayApplicationErrors, ExportStaffPaysOptions, ExportStaffPaysResponse, PayModel, PreviewStaffPayCalculationApplicationErrors, PreviewStaffPayCalculationOptions, PreviewStaffPayCalculationResponse, PreviewStaffPayOptions, PreviewStaffPayResponse, ReopenStaffPayApplicationErrors, ReopenStaffPayResponse, StaffPay, StaffPayQuery, StaffPaysQueryBuilder, UpdateStaffPay, UpdateStaffPayApplicationErrors, approveStaffPay, bulkApproveStaffPays, bulkCalculateStaffPays, bulkDeleteStaffPays, calculateStaffPay, createStaffPay, deleteStaffPay, exportStaffPays, getStaffPay, previewStaffPay, previewStaffPayCalculation, queryStaffPays, reopenStaffPay, updateStaffPay };