// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as BusinessPartnersAPI from './business-partners'; import * as WorkersAPI from './workers'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Compensation associated with workers */ export class Compensations extends APIResource { /** * A list of compensations. * * - Requires: `API Tier 2` * - Expandable fields: `worker` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: CompensationListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/compensations/', PageCursorURL, { query, ...options }); } /** * Retrieves the Compensation for the Worker with the ID provided in the URL path. */ retrieve( id: string, query: CompensationRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/compensations/${id}/`, { query, ...options }); } } export type CompensationsPageCursorURL = PageCursorURL; export interface Compensation { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The worker's annual compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ annual_compensation?: Compensation.AnnualCompensation; /** * The worker's annual salary equivalent, for insurance purposes. It will be equal * to the worker's annual compensation, except for owners that are receiving no * cashcompensation. */ annual_salary_equivalent?: Compensation.AnnualSalaryEquivalent; /** * The worker's bonus schedule. */ bonus_schedule?: string; /** * The worker's hourly wage. This calculation assumes 40-hour work weeks for * workers with fixed compensation. */ hourly_wage?: Compensation.HourlyWage; /** * The worker's monthly compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ monthly_compensation?: Compensation.MonthlyCompensation; /** * The worker's on-target commission. */ on_target_commission?: Compensation.OnTargetCommission; /** * The payment terms for an worker's compensation. */ payment_terms?: string; /** * The payment type for an worker's compensation. */ payment_type?: string; /** * The worker's hourly wage. This calculation assumes 40-hour work weeks for * workers with fixed compensation. */ relocation_reimbursement?: Compensation.RelocationReimbursement; /** * Salary effective date */ salary_effective_date?: string; /** * The worker's signing bonus. */ signing_bonus?: Compensation.SigningBonus; /** * The worker's target annual bonus amount. */ target_annual_bonus?: Compensation.TargetAnnualBonus; /** * The worker's target annual bonus as a percent of annual compensation. */ target_annual_bonus_percent?: number; /** * The worker's weekly compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ weekly_compensation?: Compensation.WeeklyCompensation; /** * The worker's details. * * Expandable field */ worker?: WorkersAPI.Worker; /** * The worker's ID. */ worker_id?: string; } export namespace Compensation { /** * The worker's annual compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ export interface AnnualCompensation { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's annual salary equivalent, for insurance purposes. It will be equal * to the worker's annual compensation, except for owners that are receiving no * cashcompensation. */ export interface AnnualSalaryEquivalent { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's hourly wage. This calculation assumes 40-hour work weeks for * workers with fixed compensation. */ export interface HourlyWage { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's monthly compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ export interface MonthlyCompensation { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's on-target commission. */ export interface OnTargetCommission { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's hourly wage. This calculation assumes 40-hour work weeks for * workers with fixed compensation. */ export interface RelocationReimbursement { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's signing bonus. */ export interface SigningBonus { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's target annual bonus amount. */ export interface TargetAnnualBonus { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's weekly compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ export interface WeeklyCompensation { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } } /** * Meta information for the response. */ export interface CompensationRetrieveResponse extends BusinessPartnersAPI.Meta, Compensation {} export interface CompensationListParams { cursor?: string; expand?: string; order_by?: string; } export interface CompensationRetrieveParams { expand?: string; } export declare namespace Compensations { export { type Compensation as Compensation, type CompensationRetrieveResponse as CompensationRetrieveResponse, type CompensationsPageCursorURL as CompensationsPageCursorURL, type CompensationListParams as CompensationListParams, type CompensationRetrieveParams as CompensationRetrieveParams, }; }