@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;
payment_method?: {
type?: "ach" | "adyen_card" | "alviere_ach" | "bank_transfer" | "brex" | "bt_card" | "bt_pay_pal" | "client_balance" | "coinbase" | "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;
prepaid_billing_credits_used: {
amount: string | null;
original_amount: string | null;
original_currency: string | null;
};
total: string;
total_due: string;
status: "paid";
workers?: {
id: string;
contract_id?: string | null | undefined;
name?: string | undefined;
picUrl: string | null;
public_id?: string | undefined;
}[] | undefined;
timezone: string | null;
deel_reference: string | null;
}[];
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: "" | "biweekly" | "custom" | "daily" | "hourly" | "monthly" | "semimonthly" | "weekly";
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" | "PREPAID_BILLING" | "RESERVE" | "WORK";
contract_id: string | null;
created_at: string;
currency: string;
deel_fee: "0.00";
document_type: "FUNDING_STATEMENT" | "INVOICE";
due_date: string;
is_overdue: boolean;
issued_at: string;
label: string;
paid_at: string;
status: "canceled" | "failed" | "paid" | "pending" | "processed" | "processing" | "refunded" | "skipped";
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_LAST_WEEK" | "DAY_OF_MONTH" | "DAY_OF_WEEK" | null;
first_payment: number | null;
first_payment_date: string;
frequency: "" | "biweekly" | "calendar-month" | "monthly" | "semimonthly" | "weekly";
gross_annual_salary: number | "";
gross_signing_bonus: "";
gross_variable_bonus: "";
scale: "" | "custom" | "daily" | "hourly" | "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: "eor" | "ongoing_time_based" | "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;
job_title?: string | undefined;
notice_period: number;
scope_of_work?: string | undefined;
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: "cancelled" | "completed" | "in_progress" | "user_cancelled";
termination_date: string;
title: string;
type: "eor" | "ongoing_time_based" | "pay_as_you_go_time_based";
updated_at: string;
who_reports?: "both" | undefined;
work_schedule: {
country: string;
days: {
day: "FRIDAY" | "MONDAY" | "SATURDAY" | "SUNDAY" | "THURSDAY" | "TUESDAY" | "WEDNESDAY";
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;
work_statement_id?: string | undefined;
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;
};
};
}>;
}