UNPKG

@phasesdk/api-client-for-economic

Version:

e-conomic REST API Library for Node.js is a powerful tool designed to simplify integration with the e-conomic platform for developers building Node.js applications. With this library, developers can effortlessly leverage the full functionality of the e-co

59 lines (58 loc) 1.95 kB
import { HttpResponse } from "../../types/Http.type"; import { VatAccount } from "./VatAccounts"; import RestApi from "../RestApi"; import { AuthToken } from "../../types/Economic.type"; import { EconomicResponse, Pagination } from "../../types/Economic.type"; export type Accrual = { accountingYears: string; accountNumber: string; accountsSummed: AccountsSummed[]; accountType: "profitAndLoss" | "status" | "totalFrom" | "heading" | "headingStart" | "sumInterval" | "sumAlpha"; balance: number; barred: boolean; blockDirectEntries: boolean; contraAccount: Pick<Account, "accountNumber" | "self">; debitCredit: "debit" | "credit"; draftBalance: number; name: string; self: string; totalFromAccount: Pick<Account, "accountNumber" | "self">; vatAccount: Pick<VatAccount, "vatCode" | "self">; }; export type AccountsSummed = { fromAccount: Pick<Account, "accountNumber" | "self">; toAccount: Pick<Account, "accountNumber" | "self">; }; export type Account = { accountNumber: number; accountType: string; balance: string; blockDirectEntries: boolean; debitCredit: string; name: string; accountingYears: string; self: string; }; export default class Accounts extends RestApi { /** * @constructor */ constructor(props: AuthToken); /** * Get collection of accounts. * @see https://restdocs.e-conomic.com/#get-accounts * * @param {number} offset * @param {number} limit * @returns {Promise<HttpResponse>} */ get(offset?: number, limit?: number): Promise<HttpResponse<EconomicResponse<Account[], Pagination, any>>>; /** * Get a specific accounts * * @see https://restdocs.e-conomic.com/#get-accounts-accountnumber * @param {number} accountNumber * @returns {Promise<HttpResponse<Account>>} */ getFor(accountNumber: number): Promise<HttpResponse<Account>>; }