@accounter/server
Version:
Accounter GraphQL server
226 lines (225 loc) • 8.74 kB
TypeScript
import type { Environment } from '../../../shared/types/index.js';
import { ProviderCredentialsProvider } from '../../provider-credentials/providers/provider-credentials.provider.js';
export declare class DeelClientProvider {
private env;
private credentialsProvider;
private host;
private tokenPromise;
constructor(env: Environment, credentialsProvider: ProviderCredentialsProvider);
private timeZoneFix;
private getApiToken;
private _fetchToken;
getPaymentReceipts(): Promise<{
data: {
rows: {
id: string;
created_at: string;
deel_granted_credits_used: {
amount: string | null;
original_amount: string | null;
original_currency: string | null;
};
eor_early_invoicing_funds_used: {
amount: string | null;
original_amount: string | null;
original_currency: string | null;
};
general_funds_used: {
amount: string | null;
original_amount: string | null;
original_currency: string | null;
};
invoices: {
id: string;
}[];
label: string;
paid_at: string | null;
payment_currency: string;
prepaid_billing_credits_used: {
amount: string | null;
original_amount: string | null;
original_currency: string | null;
};
total: string;
total_due: string;
status: "paid";
timezone: string | null;
deel_reference: string | null;
payment_method?: {
type?: "ach" | "alviere_ach" | "adyen_card" | "bank_transfer" | "bt_card" | "bt_pay_pal" | "brex" | "coinbase" | "client_balance" | "eor_funding_balance" | "fee_credits" | "go_cardless" | "go_cardless_becs" | "mercury_wire" | "pay_pal" | "stablecoin_transfer" | "stripe_ach" | "stripe_bacs_debit" | "stripe_card" | "stripe_sepa_debit" | "transferwise" | undefined;
} | undefined;
workers?: {
id: string;
picUrl: string | null;
contract_id?: string | null | undefined;
name?: string | undefined;
public_id?: string | undefined;
}[] | undefined;
}[];
total: number;
next_cursor: string | null;
has_more: boolean | null;
total_count: number | null;
};
}>;
getPaymentBreakdown(paymentId: string): Promise<{
data: {
adjustment: "0.00";
approve_date: string;
approvers: string;
bonus: "0.00";
commissions: "0.00";
contract_country: string;
contract_id: null;
contract_start_date: string;
contract_type: string;
contractor_email: string;
contractor_employee_name: string;
contractor_pic_url: null;
contractor_unique_identifier: string;
currency: string;
date: string;
deductions: "0.00";
expenses: string;
frequency: "" | "custom" | "hourly" | "daily" | "weekly" | "biweekly" | "semimonthly" | "monthly";
general_ledger_account: "";
group_id: string;
invoice_id: string;
others: string;
overtime: "0.00";
payment_currency: string;
payment_date: string;
pro_rata: string;
processing_fee: string;
work: string;
total: string;
total_payment_currency: string;
}[];
}>;
getSalaryInvoices(): Promise<{
id: string;
amount: string;
billing_type: "FEE" | "WORK" | "RESERVE" | "PREPAID_BILLING";
contract_id: string | null;
created_at: string;
currency: string;
deel_fee: "0.00";
document_type: "INVOICE" | "FUNDING_STATEMENT";
due_date: string;
is_overdue: boolean;
issued_at: string;
label: string;
paid_at: string;
status: "pending" | "paid" | "processing" | "canceled" | "skipped" | "failed" | "refunded" | "processed";
total: string;
vat_id: "";
vat_percentage: "";
vat_total: "0.00";
recipient_legal_entity_id: "1dee10b1-105b-4dc7-bcdb-5ed5c52ba868";
}[]>;
getSalaryInvoiceFile(id: string): Promise<Blob>;
getContractDetails(contractId: string): Promise<{
data: {
client: {
email: string;
full_name: string;
id: string;
legal_entity: {
email: "";
id: string;
name: string;
registration_number: string;
subtype: "private-liability-company";
type: "company";
vat_number: string;
};
team: {
id: string;
name: string;
};
};
compensation_details: {
amount: string | null;
currency_code: string;
cycle_end: number | null;
cycle_end_type: "DAY_OF_MONTH" | "DAY_OF_WEEK" | "DAY_OF_LAST_WEEK" | null;
first_payment: number | null;
first_payment_date: string;
frequency: "" | "weekly" | "biweekly" | "semimonthly" | "monthly" | "calendar-month";
gross_annual_salary: number | "";
gross_signing_bonus: "";
gross_variable_bonus: "";
scale: "" | "custom" | "hourly" | "daily" | "monthly";
variable_compensations: never[];
};
contract_template: null;
created_at: string;
custom_fields: never[];
employment_details: {
days_per_week: 0;
hours_per_day: 0;
paid_vacation_days: 0;
probation_period: number;
probation_period_metadata: {
display_value: 90;
time_unit: "DAY";
} | null;
type: "ongoing_time_based" | "eor" | "pay_as_you_go_time_based";
};
employment_type: "FULL_TIME" | null;
external_id: null;
id: string;
invitations: {
client_email: string;
worker_email: string;
};
is_archived: boolean;
notice_period: number;
seniority: null;
signatures: {
client_signature: string;
client_signed_at: string;
signed_at: string;
worker_signature: string;
worker_signed_at: string;
};
special_clause: "";
start_date: string;
status: "in_progress" | "completed" | "cancelled" | "user_cancelled";
termination_date: string;
title: string;
type: "ongoing_time_based" | "eor" | "pay_as_you_go_time_based";
updated_at: string;
work_schedule: {
country: string;
days: {
day: "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" | "SATURDAY" | "SUNDAY";
end: string;
start: string;
work_hours: number;
}[];
employment_type: "FULL_TIME";
name: string;
work_hours_per_week: number;
work_schedule_type: string;
worker_types: ("HOURLY_EOR_EMPLOYEE" | "SALARIED_EOR_EMPLOYEE")[];
} | null;
worker: {
alternate_email: never[];
country: string;
date_of_birth: string;
email: string;
expected_email: string;
first_name: string;
full_name: string;
id: string;
last_name: string;
nationality: string | null;
};
job_title?: string | undefined;
scope_of_work?: string | undefined;
who_reports?: "both" | undefined;
work_statement_id?: string | undefined;
};
}>;
}