-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpayments.ts
More file actions
121 lines (100 loc) · 2.7 KB
/
payments.ts
File metadata and controls
121 lines (100 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as HRISAPI from './hris';
import { PagePromise, SinglePage } from '../../core/pagination';
import { RequestOptions } from '../../internal/request-options';
export class Payments extends APIResource {
/**
* Read payroll and contractor related payments by the company.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const payment of client.hris.payments.list({
* end_date: '2021-01-01',
* start_date: '2021-01-01',
* })) {
* // ...
* }
* ```
*/
list(query: PaymentListParams, options?: RequestOptions): PagePromise<PaymentsSinglePage, Payment> {
return this._client.getAPIList('/employer/payment', SinglePage<Payment>, {
query,
...options,
__security: { bearerAuth: true },
});
}
}
export type PaymentsSinglePage = SinglePage<Payment>;
export interface Payment {
/**
* The unique id for the payment.
*/
id: string;
company_debit: HRISAPI.Money | null;
debit_date: string | null;
employee_taxes: HRISAPI.Money | null;
employer_taxes: HRISAPI.Money | null;
gross_pay: HRISAPI.Money | null;
/**
* Array of every individual on this payment.
*/
individual_ids: Array<string> | null;
net_pay: HRISAPI.Money | null;
pay_date: string | null;
/**
* List of pay frequencies associated with this payment.
*/
pay_frequencies: Array<
| 'annually'
| 'bi_weekly'
| 'daily'
| 'monthly'
| 'other'
| 'quarterly'
| 'semi_annually'
| 'semi_monthly'
| 'weekly'
> | null;
/**
* Array of the Finch id (uuidv4) of every pay group associated with this payment.
*/
pay_group_ids: Array<string> | null;
/**
* The pay period object.
*/
pay_period: Payment.PayPeriod | null;
}
export namespace Payment {
/**
* The pay period object.
*/
export interface PayPeriod {
end_date: string | null;
start_date: string | null;
}
}
export interface PaymentListParams {
/**
* The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD`
* format. Filters payments by their **pay_date** field.
*/
end_date: string;
/**
* The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD`
* format. Filters payments by their **pay_date** field.
*/
start_date: string;
/**
* The entity IDs to specify which entities' data to access.
*/
entity_ids?: Array<string>;
}
export declare namespace Payments {
export {
type Payment as Payment,
type PaymentsSinglePage as PaymentsSinglePage,
type PaymentListParams as PaymentListParams,
};
}