@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
88 lines (87 loc) • 3.2 kB
TypeScript
import RestApi from "../RestApi";
import { AuthToken } from "../../types/Economic.type";
import { HttpResponse } from "../../types/Http.type";
import { EconomicResponse, Pagination } from "../../types/Economic.type";
import { Layout } from "./Layouts";
import { Customer } from "./Customers";
export type Account = {
accountingYears: string;
accountNumber: number;
accountType: string;
balance: number;
blockDirectEntries: boolean;
debitCredit: string;
name: string;
self: string;
};
export type CustomerGroup = {
account: Account;
customerGroupNumber: number;
customers: string;
layout: Layout;
name: string;
self: string;
};
export type CreateCustomerGroup = {
account: {
accountNumber: number;
};
layout: {
layoutNumber: number;
};
name: string;
};
export default class CustomerGroups extends RestApi {
/**
* @constructor
*/
constructor(props: AuthToken);
getUrl(): string;
/**
* Get collection of customer groups.
* @see https://restdocs.e-conomic.com/#get-customer-groups
*
* @param {number} offset
* @param {number} limit
* @returns {Promise<HttpResponse>}
*/
get(skipPages?: number, limit?: number): Promise<HttpResponse<EconomicResponse<CustomerGroup[], Pagination, any>>>;
/**
* This endpoint allows you to fetch a collection of all customers in a specific customer group.
*
* @see https://restdocs.e-conomic.com/#get-customer-groups-customergroupnumber-customers
* @param {number} customerGroupNumber
* @returns {Promise<HttpResponse>}
*
*/
getCustomerGroupCustomers(customerGroupNumber: number, skipPages?: number, limit?: number): Promise<HttpResponse<EconomicResponse<Customer[], Pagination, any>>>;
/**
* Create a new customer group
* @see https://restdocs.e-conomic.com/#post-customer-groups
* @param {CreateCustomerGroup} customerGroup
* @returns {Promise<HttpResponse<CustomerGroup>>}
*/
createCustomerGroup(customerGroup: CreateCustomerGroup): Promise<HttpResponse<CustomerGroup>>;
/**
* Get a specific customer group
* @see https://restdocs.e-conomic.com/#get-customer-groups-customergroupnumber
* @param {number} customerGroupNumber
* @returns {Promise<HttpResponse<CustomerGroup>>}
*/
getFor(customerGroupNumber: number): Promise<HttpResponse<CustomerGroup>>;
/**
* Update an existing customer group
* @see https://restdocs.e-conomic.com/#put-customer-groups-customergroupnumber
* @param {number} customerGroupNumber
* @param {Partial<CreateCustomerGroup>} customerGroup
* @returns {Promise<HttpResponse<CustomerGroup>>}
*/
updateCustomerGroup(customerGroupNumber: number, customerGroup: Partial<CreateCustomerGroup>): Promise<HttpResponse<CustomerGroup>>;
/**
* Delete an existing customer group
* @see https://restdocs.e-conomic.com/#delete-customer-groups-customergroupnumber
* @param {number} customerGroupNumber
* @returns {Promise<HttpResponse<void>>}
*/
deleteCustomerGroup(customerGroupNumber: number): Promise<HttpResponse<void>>;
}