// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * External earnings inputs for the company */ export class EarningsInputs extends APIResource { /** * A list of earnings-inputs. * * - Requires: `Global Payroll` */ list( options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/earnings-inputs/', PageCursorURL, options); } /** * Create a new earnings-input */ create( body: EarningsInputCreateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.post('/earnings-inputs/', { body, ...options }); } /** * Delete a earnings-input */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/earnings-inputs/${id}/`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } } export type EarningsInputListResponsesPageCursorURL = PageCursorURL; /** * V2 DTO representing an external earnings input record. * * Used by: * - GET /earnings-inputs/ (list) */ export interface EarningsInputListResponse { /** * Unique identifier for the earnings input. */ id?: string; /** * Earning amount as a string-encoded decimal. */ amount?: string; /** * How the earning is assigned (e.g. BY_PAY_PERIOD). */ assignment_type?: string; /** * Identifier for the legal entity (company entity relationship) this earning is * associated with. Use this to correlate earnings with a specific legal entity in * a multi-entity company. */ company_entity_id?: string; /** * Code identifying the earning type (e.g. regular_salary). */ earning_code?: string; /** * External reference identifier for this earning. */ external_id?: string; /** * Hours associated with this earning as a string-encoded decimal. */ hours?: string; /** * Whether this earning's amount was manually overridden instead of using the * calculated value. Always false for newly created earnings. */ is_overridden?: boolean; /** * The pay period basis date for this earning. */ pay_period_basis_date?: string; /** * Identifier of the payroll run this earning is assigned to, if any. */ run_id?: string; /** * Current status of the earnings input (e.g. UNASSIGNED, ASSIGNED). */ status?: string; /** * Time tracking labels associated with this earning. */ time_labels?: Array; /** * Identifier of the worker (role ID). */ worker_id?: string; } /** * V2 DTO representing an external earnings input record. * * Used by: * - GET /earnings-inputs/ (list) */ export interface EarningsInputCreateResponse { /** * Unique identifier for the earnings input. */ id?: string; /** * Earning amount as a string-encoded decimal. */ amount?: string; /** * How the earning is assigned (e.g. BY_PAY_PERIOD). */ assignment_type?: string; /** * Identifier for the legal entity (company entity relationship) this earning is * associated with. Use this to correlate earnings with a specific legal entity in * a multi-entity company. */ company_entity_id?: string; /** * Code identifying the earning type (e.g. regular_salary). */ earning_code?: string; /** * External reference identifier for this earning. */ external_id?: string; /** * Hours associated with this earning as a string-encoded decimal. */ hours?: string; /** * Whether this earning's amount was manually overridden instead of using the * calculated value. Always false for newly created earnings. */ is_overridden?: boolean; /** * The pay period basis date for this earning. */ pay_period_basis_date?: string; /** * Identifier of the payroll run this earning is assigned to, if any. */ run_id?: string; /** * Current status of the earnings input (e.g. UNASSIGNED, ASSIGNED). */ status?: string; /** * Time tracking labels associated with this earning. */ time_labels?: Array; /** * Identifier of the worker (role ID). */ worker_id?: string; } export interface EarningsInputCreateParams { /** * Earning amount as a string-encoded decimal. */ amount?: string; /** * How the earning is assigned (e.g. BY_PAY_PERIOD). */ assignment_type?: string; /** * Identifier for the legal entity (company entity relationship) this earning is * associated with. Use this to correlate earnings with a specific legal entity in * a multi-entity company. */ company_entity_id?: string; /** * Code identifying the earning type (e.g. regular_salary). */ earning_code?: string; /** * External reference identifier for this earning. */ external_id?: string; /** * Hours associated with this earning as a string-encoded decimal. */ hours?: string; /** * Whether this earning's amount was manually overridden instead of using the * calculated value. Always false for newly created earnings. */ is_overridden?: boolean; /** * The pay period basis date for this earning. */ pay_period_basis_date?: string; /** * Identifier of the payroll run this earning is assigned to, if any. */ run_id?: string; /** * Current status of the earnings input (e.g. UNASSIGNED, ASSIGNED). */ status?: string; /** * Time tracking labels associated with this earning. */ time_labels?: Array; /** * Identifier of the worker (role ID). */ worker_id?: string; } export declare namespace EarningsInputs { export { type EarningsInputListResponse as EarningsInputListResponse, type EarningsInputCreateResponse as EarningsInputCreateResponse, type EarningsInputListResponsesPageCursorURL as EarningsInputListResponsesPageCursorURL, type EarningsInputCreateParams as EarningsInputCreateParams, }; }