@dsptch-work/api-client 0.12.0 → 0.13.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.
@@ -5924,6 +5924,59 @@ export type ComplianceCheckParameters = {
5924
5924
  */
5925
5925
  time_due?: string | null;
5926
5926
  };
5927
+ /**
5928
+ * One compliance requirement from the catalog. Requirements ship with the application, so the catalog reads the same for every company.
5929
+ */
5930
+ export type ComplianceRequirementResponseObject = {
5931
+ /**
5932
+ * Unique identifier.
5933
+ */
5934
+ id: string;
5935
+ /**
5936
+ * Stable identifier for the requirement, as a class name. Unlike id, it is the same value in every environment, so hard-code this rather than a UUID when you need to address one requirement.
5937
+ */
5938
+ type: string;
5939
+ /**
5940
+ * Human-readable name of the requirement.
5941
+ */
5942
+ title: string;
5943
+ /**
5944
+ * Long-form explanation of what the requirement asks for and why it exists.
5945
+ */
5946
+ description: string;
5947
+ /**
5948
+ * The kind of record this requirement is checked against: a company, job, project, time card, pay period, user, or user employment. Only company, job, and project checks reach the company todos page.
5949
+ */
5950
+ target: 'Company' | 'Job' | 'Project' | 'Timekeeping::TimeCard' | 'Timekeeping::PayPeriod' | 'User' | 'UserCompany';
5951
+ /**
5952
+ * Grouping used for display and filtering.
5953
+ */
5954
+ category: 'apprenticeship' | 'certified_payroll' | 'company' | 'job' | 'payroll' | 'project' | 'regional' | 'tax_credit' | 'timekeeping' | 'worker';
5955
+ /**
5956
+ * Point in the compliance lifecycle at which the requirement applies.
5957
+ */
5958
+ phase: 'after_pay_date' | 'before_approval_deadline' | 'close_out' | 'maintenance' | 'onboarding' | 'setup';
5959
+ /**
5960
+ * How urgent a failure is; null when the requirement declares none.
5961
+ */
5962
+ priority: 'critical' | 'high' | 'medium' | 'low' | null;
5963
+ /**
5964
+ * The regulation or program the requirement derives from; null when it declares none.
5965
+ */
5966
+ requisite: 'apprenticeship' | 'best_practice' | 'dsptch' | 'federal_pwa' | 'ira' | 'ira_tax_credit' | 'payroll' | 'pwa' | 'regional_pwa' | 'timekeeping' | 'wh347' | null;
5967
+ /**
5968
+ * Display order within the requirement's phase; ties are common and broken by the caller.
5969
+ */
5970
+ sort_order: number;
5971
+ /**
5972
+ * When the record was created (ISO 8601).
5973
+ */
5974
+ created_at: string;
5975
+ /**
5976
+ * When the record was last updated (ISO 8601).
5977
+ */
5978
+ updated_at: string;
5979
+ };
5927
5980
  /**
5928
5981
  * A page of paystubs, with pagination metadata and navigation links.
5929
5982
  */
@@ -6009,7 +6062,7 @@ export type PaystubLineItemsResponseObject = {
6009
6062
  data: Array<PaystubLineItemResponseObject>;
6010
6063
  };
6011
6064
  /**
6012
- * An adjustment applied in the current pay period to correct a prior one, tied to the paystub line item it corrects. Read-only.
6065
+ * An adjustment applied in the current pay period to correct a prior one, tied to the paystub line item it corrects.
6013
6066
  */
6014
6067
  export type PriorPeriodAdjustmentResponseObject = {
6015
6068
  /**
@@ -6065,6 +6118,141 @@ export type PriorPeriodAdjustmentResponseObject = {
6065
6118
  */
6066
6119
  updated_at: string;
6067
6120
  };
6121
+ /**
6122
+ * Request body for allocating part of a retroactive-pay line item to an earlier time card. The time card comes from the path; the adjustment is always a retroactive increase.
6123
+ */
6124
+ export type PriorPeriodAdjustmentParameters = {
6125
+ /**
6126
+ * ID of the retroactive-pay line item funding this adjustment — one of the line items listed by the time card's adjustable line items endpoint. Required.
6127
+ */
6128
+ payrolls_paystub_line_item_id: string;
6129
+ /**
6130
+ * ID of the user recording the adjustment; must belong to the authenticated company. Required.
6131
+ */
6132
+ created_by_user_id: string;
6133
+ /**
6134
+ * Adjustment amount, in cents as a decimal string (e.g. "20000.0" is $200.00). Must be positive and may not exceed the line item's remaining adjustable_amount_cents. Required.
6135
+ */
6136
+ amount_cents: string;
6137
+ /**
6138
+ * Why the adjustment is being made: one of hours_correction, rate_correction, pwa_compliance, or other. Required.
6139
+ */
6140
+ rationale: 'hours_correction' | 'other' | 'pwa_compliance' | 'rate_correction';
6141
+ /**
6142
+ * ID of the job on the time card whose obligation this adjustment credits. Required whenever pwa_compliance_eligible is true, since compliance matches adjustments to obligations per job.
6143
+ */
6144
+ job_id?: string | null;
6145
+ /**
6146
+ * Free-text notes on the adjustment.
6147
+ */
6148
+ notes?: string | null;
6149
+ /**
6150
+ * Whether the adjustment counts toward prevailing-wage / apprenticeship (PWA) compliance. Defaults to true.
6151
+ */
6152
+ pwa_compliance_eligible?: boolean;
6153
+ };
6154
+ /**
6155
+ * What one PWA-tracked job on a time card still owes the worker, from the materialized prevailing-wage compliance view. Read-only.
6156
+ */
6157
+ export type PwaComplianceResponseObject = {
6158
+ /**
6159
+ * ID of the time card these figures cover.
6160
+ */
6161
+ timekeeping_time_card_id: string;
6162
+ /**
6163
+ * ID of the pay period the time card belongs to.
6164
+ */
6165
+ timekeeping_pay_period_id: string;
6166
+ /**
6167
+ * ID of the job whose obligation these figures cover.
6168
+ */
6169
+ job_id: string;
6170
+ /**
6171
+ * ID of the worker the obligation is owed to.
6172
+ */
6173
+ user_id: string;
6174
+ /**
6175
+ * Minutes worked on this job that count toward prevailing-wage obligations.
6176
+ */
6177
+ pwa_minutes_worked: number;
6178
+ /**
6179
+ * Federal obligation still outstanding including accrued interest, in cents as a decimal string, before crediting back pay.
6180
+ */
6181
+ federal_post_interest_outstanding_cents: string;
6182
+ /**
6183
+ * Regional (state) obligation still outstanding including accrued interest, in cents as a decimal string, before crediting back pay.
6184
+ */
6185
+ regional_post_interest_outstanding_cents: string;
6186
+ /**
6187
+ * Back pay already allocated to this job on this time card, in cents as a decimal string.
6188
+ */
6189
+ pwa_adjustments_cents: string;
6190
+ /**
6191
+ * Federal balance still due after crediting back pay, in cents as a decimal string.
6192
+ */
6193
+ federal_balance_due_cents: string;
6194
+ /**
6195
+ * Regional balance still due after crediting back pay, in cents as a decimal string.
6196
+ */
6197
+ regional_balance_due_cents: string;
6198
+ /**
6199
+ * The amount that settles every jurisdiction at once, in cents as a decimal string — corrections credit the federal and regional balances equally, so paying the larger clears both. Interest keeps accruing until the correcting payroll run's date, so a later payment has to clear more than this.
6200
+ */
6201
+ balance_due_cents: string;
6202
+ /**
6203
+ * Whether every payroll actual behind these figures has landed. When false, the balances read zero because the data is incomplete, not because the job is compliant.
6204
+ */
6205
+ all_actuals_exist: boolean;
6206
+ /**
6207
+ * Whether the job is settled — true only when actuals are complete and no balance is due.
6208
+ */
6209
+ compliant: boolean;
6210
+ };
6211
+ /**
6212
+ * A retroactive-pay line item that can fund a prior period adjustment on the time card it was requested for. Read-only.
6213
+ */
6214
+ export type AdjustableLineItemResponseObject = {
6215
+ /**
6216
+ * Unique identifier.
6217
+ */
6218
+ id: string;
6219
+ /**
6220
+ * ID of the paystub carrying this line item.
6221
+ */
6222
+ payrolls_paystub_id: string | null;
6223
+ /**
6224
+ * ID of the payroll run the paystub was produced by. Its run date is the correction date for compliance timeliness.
6225
+ */
6226
+ payrolls_payroll_run_id: string | null;
6227
+ /**
6228
+ * ID of the external map defining which compensation element this line item represents.
6229
+ */
6230
+ payrolls_external_map_id: string;
6231
+ /**
6232
+ * ID of the worker paid this line item.
6233
+ */
6234
+ user_id: string | null;
6235
+ /**
6236
+ * Full amount of the line item, in cents as a decimal string (e.g. "50000.0" is $500.00).
6237
+ */
6238
+ amount_cents: string;
6239
+ /**
6240
+ * Who contributes this amount: employee or employer.
6241
+ */
6242
+ contributor: 'employee' | 'employer';
6243
+ /**
6244
+ * What is left to allocate, in cents as a decimal string — the line item's amount less every adjustment already funded by it. A new adjustment may not exceed this.
6245
+ */
6246
+ adjustable_amount_cents: string;
6247
+ /**
6248
+ * When the record was created (ISO 8601).
6249
+ */
6250
+ created_at: string;
6251
+ /**
6252
+ * When the record was last updated (ISO 8601).
6253
+ */
6254
+ updated_at: string;
6255
+ };
6068
6256
  /**
6069
6257
  * What a worker was actually paid for a pay period, derived from imported paystub line items — gross and net pay, employee deductions (taxes, insurance, savings, garnishments), and employer contributions. Read-only. Every amount is a decimal string of cents.
6070
6258
  */
@@ -13552,6 +13740,90 @@ export type UpdateCheckResponses = {
13552
13740
  200: ComplianceCheckResponseObject;
13553
13741
  };
13554
13742
  export type UpdateCheckResponse = UpdateCheckResponses[keyof UpdateCheckResponses];
13743
+ export type ListRequirementsData = {
13744
+ body?: never;
13745
+ path?: never;
13746
+ query?: {
13747
+ /**
13748
+ * Fuzzy match against the requirement title
13749
+ */
13750
+ 'filter[search]'?: string;
13751
+ /**
13752
+ * Filter by requirement type (its STI class name)
13753
+ */
13754
+ 'filter[type]'?: string;
13755
+ /**
13756
+ * Filter by requirement category:
13757
+ * * `apprenticeship`
13758
+ * * `certified_payroll`
13759
+ * * `company`
13760
+ * * `job`
13761
+ * * `payroll`
13762
+ * * `project`
13763
+ * * `regional`
13764
+ * * `tax_credit`
13765
+ * * `timekeeping`
13766
+ * * `worker`
13767
+ *
13768
+ */
13769
+ 'filter[category]'?: string;
13770
+ /**
13771
+ * Filter by the compliance phase the requirement belongs to
13772
+ */
13773
+ 'filter[phase]'?: string;
13774
+ /**
13775
+ * Filter by requirement priority
13776
+ */
13777
+ 'filter[priority]'?: string;
13778
+ /**
13779
+ * Filter by the regulation the requirement derives from
13780
+ */
13781
+ 'filter[requisite]'?: string;
13782
+ /**
13783
+ * Filter by the record type the requirement is checked against
13784
+ */
13785
+ 'filter[target]'?: string;
13786
+ filter?: string;
13787
+ 'filter[unexpected]'?: string;
13788
+ /**
13789
+ * This pagination cursor corresponds to the cursor value found in the response in
13790
+ * `meta.page.next_cursor`.
13791
+ */
13792
+ 'page[cursor]'?: string;
13793
+ /**
13794
+ * Maximum number of records to return per page. Defaults to 20. A value above 100 is capped to 100 rather than rejected; a value that is zero, negative, or not an integer is rejected with a `400`.
13795
+ */
13796
+ 'page[limit]'?: number;
13797
+ page?: string;
13798
+ };
13799
+ url: '/api/v1/compliance/requirements';
13800
+ };
13801
+ export type ListRequirementsErrors = {
13802
+ /**
13803
+ * Bad Request
13804
+ */
13805
+ 400: Problem;
13806
+ /**
13807
+ * Forbidden
13808
+ */
13809
+ 403: Problem;
13810
+ /**
13811
+ * Unprocessable Content
13812
+ */
13813
+ 422: Problem;
13814
+ };
13815
+ export type ListRequirementsError = ListRequirementsErrors[keyof ListRequirementsErrors];
13816
+ export type ListRequirementsResponses = {
13817
+ /**
13818
+ * Success
13819
+ */
13820
+ 200: {
13821
+ meta: Meta;
13822
+ links: Links;
13823
+ data: Array<ComplianceRequirementResponseObject>;
13824
+ };
13825
+ };
13826
+ export type ListRequirementsResponse = ListRequirementsResponses[keyof ListRequirementsResponses];
13555
13827
  export type ListCustomFieldConfigsData = {
13556
13828
  body?: never;
13557
13829
  path?: never;
@@ -17121,6 +17393,57 @@ export type ListTemplatesResponses = {
17121
17393
  };
17122
17394
  };
17123
17395
  export type ListTemplatesResponse = ListTemplatesResponses[keyof ListTemplatesResponses];
17396
+ export type ListAdjustableLineItemsData = {
17397
+ body?: never;
17398
+ path: {
17399
+ time_card_id: string;
17400
+ };
17401
+ query?: {
17402
+ /**
17403
+ * Filter by paystub
17404
+ */
17405
+ 'filter[payrolls_paystub_id]'?: string;
17406
+ /**
17407
+ * This pagination cursor corresponds to the cursor value found in the response in
17408
+ * `meta.page.next_cursor`.
17409
+ */
17410
+ 'page[cursor]'?: string;
17411
+ /**
17412
+ * Maximum number of records to return per page. Defaults to 20. A value above 100 is capped to 100 rather than rejected; a value that is zero, negative, or not an integer is rejected with a `400`.
17413
+ */
17414
+ 'page[limit]'?: number;
17415
+ page?: string;
17416
+ filter?: string;
17417
+ 'filter[unexpected]'?: string;
17418
+ };
17419
+ url: '/api/v1/time_cards/{time_card_id}/adjustable_line_items';
17420
+ };
17421
+ export type ListAdjustableLineItemsErrors = {
17422
+ /**
17423
+ * Bad Request
17424
+ */
17425
+ 400: Problem;
17426
+ /**
17427
+ * Forbidden
17428
+ */
17429
+ 403: Problem;
17430
+ /**
17431
+ * Not Found
17432
+ */
17433
+ 404: Problem;
17434
+ };
17435
+ export type ListAdjustableLineItemsError = ListAdjustableLineItemsErrors[keyof ListAdjustableLineItemsErrors];
17436
+ export type ListAdjustableLineItemsResponses = {
17437
+ /**
17438
+ * Success
17439
+ */
17440
+ 200: {
17441
+ meta: Meta;
17442
+ links: Links;
17443
+ data: Array<AdjustableLineItemResponseObject>;
17444
+ };
17445
+ };
17446
+ export type ListAdjustableLineItemsResponse = ListAdjustableLineItemsResponses[keyof ListAdjustableLineItemsResponses];
17124
17447
  export type SetTimeCardLockData = {
17125
17448
  body: TimeCardLockParameters;
17126
17449
  path: {
@@ -17366,6 +17689,67 @@ export type ListPriorPeriodAdjustmentsResponses = {
17366
17689
  };
17367
17690
  };
17368
17691
  export type ListPriorPeriodAdjustmentsResponse = ListPriorPeriodAdjustmentsResponses[keyof ListPriorPeriodAdjustmentsResponses];
17692
+ export type CreatePriorPeriodAdjustmentData = {
17693
+ body: PriorPeriodAdjustmentParameters;
17694
+ path: {
17695
+ time_card_id: string;
17696
+ };
17697
+ query?: never;
17698
+ url: '/api/v1/time_cards/{time_card_id}/prior_period_adjustments';
17699
+ };
17700
+ export type CreatePriorPeriodAdjustmentErrors = {
17701
+ /**
17702
+ * Bad Request
17703
+ */
17704
+ 400: Problem;
17705
+ /**
17706
+ * Forbidden
17707
+ */
17708
+ 403: Problem;
17709
+ /**
17710
+ * Not Found
17711
+ */
17712
+ 404: Problem;
17713
+ /**
17714
+ * Unprocessable Content
17715
+ */
17716
+ 422: Problem;
17717
+ };
17718
+ export type CreatePriorPeriodAdjustmentError = CreatePriorPeriodAdjustmentErrors[keyof CreatePriorPeriodAdjustmentErrors];
17719
+ export type CreatePriorPeriodAdjustmentResponses = {
17720
+ /**
17721
+ * Created
17722
+ */
17723
+ 201: PriorPeriodAdjustmentResponseObject;
17724
+ };
17725
+ export type CreatePriorPeriodAdjustmentResponse = CreatePriorPeriodAdjustmentResponses[keyof CreatePriorPeriodAdjustmentResponses];
17726
+ export type DeletePriorPeriodAdjustmentData = {
17727
+ body?: never;
17728
+ path: {
17729
+ time_card_id: string;
17730
+ id: string;
17731
+ };
17732
+ query?: never;
17733
+ url: '/api/v1/time_cards/{time_card_id}/prior_period_adjustments/{id}';
17734
+ };
17735
+ export type DeletePriorPeriodAdjustmentErrors = {
17736
+ /**
17737
+ * Forbidden
17738
+ */
17739
+ 403: Problem;
17740
+ /**
17741
+ * Not Found
17742
+ */
17743
+ 404: Problem;
17744
+ };
17745
+ export type DeletePriorPeriodAdjustmentError = DeletePriorPeriodAdjustmentErrors[keyof DeletePriorPeriodAdjustmentErrors];
17746
+ export type DeletePriorPeriodAdjustmentResponses = {
17747
+ /**
17748
+ * Success
17749
+ */
17750
+ 200: PriorPeriodAdjustmentResponseObject;
17751
+ };
17752
+ export type DeletePriorPeriodAdjustmentResponse = DeletePriorPeriodAdjustmentResponses[keyof DeletePriorPeriodAdjustmentResponses];
17369
17753
  export type GetPriorPeriodAdjustmentData = {
17370
17754
  body?: never;
17371
17755
  path: {
@@ -17393,6 +17777,57 @@ export type GetPriorPeriodAdjustmentResponses = {
17393
17777
  200: PriorPeriodAdjustmentResponseObject;
17394
17778
  };
17395
17779
  export type GetPriorPeriodAdjustmentResponse = GetPriorPeriodAdjustmentResponses[keyof GetPriorPeriodAdjustmentResponses];
17780
+ export type ListPwaCompliancesData = {
17781
+ body?: never;
17782
+ path: {
17783
+ time_card_id: string;
17784
+ };
17785
+ query?: {
17786
+ /**
17787
+ * Filter by job
17788
+ */
17789
+ 'filter[job_id]'?: string;
17790
+ /**
17791
+ * This pagination cursor corresponds to the cursor value found in the response in
17792
+ * `meta.page.next_cursor`.
17793
+ */
17794
+ 'page[cursor]'?: string;
17795
+ /**
17796
+ * Maximum number of records to return per page. Defaults to 20. A value above 100 is capped to 100 rather than rejected; a value that is zero, negative, or not an integer is rejected with a `400`.
17797
+ */
17798
+ 'page[limit]'?: number;
17799
+ page?: string;
17800
+ filter?: string;
17801
+ 'filter[unexpected]'?: string;
17802
+ };
17803
+ url: '/api/v1/time_cards/{time_card_id}/pwa_compliances';
17804
+ };
17805
+ export type ListPwaCompliancesErrors = {
17806
+ /**
17807
+ * Bad Request
17808
+ */
17809
+ 400: Problem;
17810
+ /**
17811
+ * Forbidden
17812
+ */
17813
+ 403: Problem;
17814
+ /**
17815
+ * Not Found
17816
+ */
17817
+ 404: Problem;
17818
+ };
17819
+ export type ListPwaCompliancesError = ListPwaCompliancesErrors[keyof ListPwaCompliancesErrors];
17820
+ export type ListPwaCompliancesResponses = {
17821
+ /**
17822
+ * Success
17823
+ */
17824
+ 200: {
17825
+ meta: Meta;
17826
+ links: Links;
17827
+ data: Array<PwaComplianceResponseObject>;
17828
+ };
17829
+ };
17830
+ export type ListPwaCompliancesResponse = ListPwaCompliancesResponses[keyof ListPwaCompliancesResponses];
17396
17831
  export type CreateWorkerTimeCardApprovalData = {
17397
17832
  body: WorkerTimeCardApprovalParameters;
17398
17833
  path: {