@chift/chift-nodejs 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/.eslintcache +1 -0
  2. package/.eslintignore +1 -0
  3. package/.eslintrc.json +25 -0
  4. package/.github/workflows/ci.yml +73 -0
  5. package/.husky/pre-commit +4 -0
  6. package/.prettierignore +1 -0
  7. package/.prettierrc.json +7 -0
  8. package/CHANGELOG.md +4 -0
  9. package/LICENSE +201 -0
  10. package/README.md +48 -0
  11. package/coverage/clover.xml +1645 -0
  12. package/coverage/coverage-final.json +19 -0
  13. package/coverage/lcov-report/base.css +224 -0
  14. package/coverage/lcov-report/block-navigation.js +87 -0
  15. package/coverage/lcov-report/favicon.png +0 -0
  16. package/coverage/lcov-report/index.html +146 -0
  17. package/coverage/lcov-report/prettify.css +1 -0
  18. package/coverage/lcov-report/prettify.js +2 -0
  19. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  20. package/coverage/lcov-report/sorter.js +196 -0
  21. package/coverage/lcov-report/src/helpers/index.html +131 -0
  22. package/coverage/lcov-report/src/helpers/openapi.ts.html +151 -0
  23. package/coverage/lcov-report/src/helpers/settings.ts.html +94 -0
  24. package/coverage/lcov-report/src/index.html +116 -0
  25. package/coverage/lcov-report/src/index.ts.html +88 -0
  26. package/coverage/lcov-report/src/modules/accounting.ts.html +1156 -0
  27. package/coverage/lcov-report/src/modules/api.ts.html +190 -0
  28. package/coverage/lcov-report/src/modules/consumer.ts.html +616 -0
  29. package/coverage/lcov-report/src/modules/consumers.ts.html +331 -0
  30. package/coverage/lcov-report/src/modules/custom.ts.html +193 -0
  31. package/coverage/lcov-report/src/modules/datastores.ts.html +142 -0
  32. package/coverage/lcov-report/src/modules/ecommerce.ts.html +331 -0
  33. package/coverage/lcov-report/src/modules/flow.ts.html +589 -0
  34. package/coverage/lcov-report/src/modules/index.html +326 -0
  35. package/coverage/lcov-report/src/modules/integrations.ts.html +151 -0
  36. package/coverage/lcov-report/src/modules/internalApi.ts.html +586 -0
  37. package/coverage/lcov-report/src/modules/invoicing.ts.html +391 -0
  38. package/coverage/lcov-report/src/modules/pos.ts.html +421 -0
  39. package/coverage/lcov-report/src/modules/sync.ts.html +316 -0
  40. package/coverage/lcov-report/src/modules/syncs.ts.html +169 -0
  41. package/coverage/lcov-report/src/modules/webhooks.ts.html +343 -0
  42. package/coverage/lcov.info +1976 -0
  43. package/dist/src/helpers/openapi.d.ts +3 -0
  44. package/dist/src/helpers/openapi.js +18 -0
  45. package/dist/src/helpers/settings.d.ts +4 -0
  46. package/dist/src/helpers/settings.js +5 -0
  47. package/dist/src/index.d.ts +1 -0
  48. package/dist/src/index.js +17 -0
  49. package/dist/src/modules/accounting.d.ts +48 -0
  50. package/dist/src/modules/accounting.js +255 -0
  51. package/dist/src/modules/api.d.ts +39333 -0
  52. package/dist/src/modules/api.js +36 -0
  53. package/dist/src/modules/consumer.d.ts +2588 -0
  54. package/dist/src/modules/consumer.js +118 -0
  55. package/dist/src/modules/consumers.d.ts +13034 -0
  56. package/dist/src/modules/consumers.js +51 -0
  57. package/dist/src/modules/custom.d.ts +8 -0
  58. package/dist/src/modules/custom.js +36 -0
  59. package/dist/src/modules/datastores.d.ts +18 -0
  60. package/dist/src/modules/datastores.js +23 -0
  61. package/dist/src/modules/ecommerce.d.ts +16 -0
  62. package/dist/src/modules/ecommerce.js +69 -0
  63. package/dist/src/modules/flow.d.ts +15 -0
  64. package/dist/src/modules/flow.js +156 -0
  65. package/dist/src/modules/integrations.d.ts +14 -0
  66. package/dist/src/modules/integrations.js +23 -0
  67. package/dist/src/modules/internalApi.d.ts +22 -0
  68. package/dist/src/modules/internalApi.js +160 -0
  69. package/dist/src/modules/invoicing.d.ts +18 -0
  70. package/dist/src/modules/invoicing.js +90 -0
  71. package/dist/src/modules/pos.d.ts +20 -0
  72. package/dist/src/modules/pos.js +80 -0
  73. package/dist/src/modules/sync.d.ts +10494 -0
  74. package/dist/src/modules/sync.js +75 -0
  75. package/dist/src/modules/syncs.d.ts +26200 -0
  76. package/dist/src/modules/syncs.js +29 -0
  77. package/dist/src/modules/webhooks.d.ts +55 -0
  78. package/dist/src/modules/webhooks.js +53 -0
  79. package/dist/src/types/api.d.ts +28 -0
  80. package/dist/src/types/api.js +2 -0
  81. package/dist/src/types/consumers.d.ts +8 -0
  82. package/dist/src/types/consumers.js +2 -0
  83. package/dist/src/types/public-api/mappings.d.ts +21 -0
  84. package/dist/src/types/public-api/mappings.js +2 -0
  85. package/dist/src/types/sync.d.ts +20 -0
  86. package/dist/src/types/sync.js +2 -0
  87. package/dist/test/modules/accounting.test.d.ts +1 -0
  88. package/dist/test/modules/accounting.test.js +453 -0
  89. package/dist/test/modules/consumer.test.d.ts +1 -0
  90. package/dist/test/modules/consumer.test.js +89 -0
  91. package/dist/test/modules/consumers.test.d.ts +1 -0
  92. package/dist/test/modules/consumers.test.js +109 -0
  93. package/dist/test/modules/ecommerce.test.d.ts +1 -0
  94. package/dist/test/modules/ecommerce.test.js +193 -0
  95. package/dist/test/modules/flow.test.d.ts +1 -0
  96. package/dist/test/modules/flow.test.js +69 -0
  97. package/dist/test/modules/integrations.test.d.ts +1 -0
  98. package/dist/test/modules/integrations.test.js +54 -0
  99. package/dist/test/modules/invoicing.test.d.ts +1 -0
  100. package/dist/test/modules/invoicing.test.js +108 -0
  101. package/dist/test/modules/pos.test.d.ts +1 -0
  102. package/dist/test/modules/pos.test.js +164 -0
  103. package/dist/test/modules/sync.test.d.ts +1 -0
  104. package/dist/test/modules/sync.test.js +81 -0
  105. package/dist/test/modules/syncs.test.d.ts +1 -0
  106. package/dist/test/modules/syncs.test.js +53 -0
  107. package/dist/test/modules/webhooks.test.d.ts +1 -0
  108. package/dist/test/modules/webhooks.test.js +120 -0
  109. package/jest.config.ts +195 -0
  110. package/package.json +47 -0
  111. package/src/helpers/openapi.ts +22 -0
  112. package/src/helpers/settings.ts +3 -0
  113. package/src/index.ts +1 -0
  114. package/src/modules/accounting.ts +357 -0
  115. package/src/modules/api.ts +35 -0
  116. package/src/modules/consumer.ts +177 -0
  117. package/src/modules/consumers.ts +82 -0
  118. package/src/modules/custom.ts +36 -0
  119. package/src/modules/datastores.ts +19 -0
  120. package/src/modules/ecommerce.ts +82 -0
  121. package/src/modules/flow.ts +168 -0
  122. package/src/modules/integrations.ts +22 -0
  123. package/src/modules/internalApi.ts +162 -0
  124. package/src/modules/invoicing.ts +106 -0
  125. package/src/modules/pos.ts +112 -0
  126. package/src/modules/sync.ts +77 -0
  127. package/src/modules/syncs.ts +28 -0
  128. package/src/modules/webhooks.ts +86 -0
  129. package/src/types/api.ts +35 -0
  130. package/src/types/consumers.ts +9 -0
  131. package/src/types/public-api/mappings.ts +21 -0
  132. package/src/types/public-api/schema.d.ts +9436 -0
  133. package/src/types/sync.ts +23 -0
  134. package/test/data/accounting_invoice.pdf +0 -0
  135. package/test/modules/accounting.test.ts +483 -0
  136. package/test/modules/consumer.test.ts +68 -0
  137. package/test/modules/consumers.test.ts +83 -0
  138. package/test/modules/ecommerce.test.ts +177 -0
  139. package/test/modules/integrations.test.ts +22 -0
  140. package/test/modules/invoicing.test.ts +88 -0
  141. package/test/modules/pos.test.ts +145 -0
  142. package/test/modules/sync.test.ts +60 -0
  143. package/test/modules/syncs.test.ts +23 -0
  144. package/test/modules/webhooks.test.ts +92 -0
  145. package/test/set_envs.sh +14 -0
  146. package/tsconfig.json +107 -0
@@ -0,0 +1,3 @@
1
+ import { InternalAPI } from '../modules/internalApi';
2
+ import { RequestFactory, ApiFor } from '../types/api';
3
+ export declare function createApiFor<TFactory extends RequestFactory>(factory: TFactory, internalApi: InternalAPI, consumerName: string, consumerId: string): ApiFor<TFactory>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createApiFor = void 0;
4
+ function createApiFor(factory, internalApi, consumerName, consumerId) {
5
+ return new Proxy(factory, {
6
+ get(target, property) {
7
+ return (...args) => {
8
+ const requestData = target[property](...args);
9
+ requestData.property = property;
10
+ requestData.consumerName = consumerName;
11
+ requestData.consumerId = consumerId;
12
+ requestData.url = requestData.url.replace('{consumer_id}', consumerId);
13
+ return internalApi.makeRequest(requestData);
14
+ };
15
+ },
16
+ });
17
+ }
18
+ exports.createApiFor = createApiFor;
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ BASE_URL: string;
3
+ };
4
+ export default _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ BASE_URL: 'https://api.chift.eu',
5
+ };
@@ -0,0 +1 @@
1
+ export * from './modules/api';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./modules/api"), exports);
@@ -0,0 +1,48 @@
1
+ import { operations, components } from '../types/public-api/schema';
2
+ import { RequestData } from '../types/api';
3
+ type getChartOfAccountsParams = Omit<operations['accounting_get_chart_of_accounts']['parameters']['query'], 'page' | 'size'>;
4
+ type getMiscOperationsParams = Omit<operations['accounting_get_miscellaneous_operations']['parameters']['query'], 'page' | 'size'>;
5
+ type getJournalEntriesWithMultiplePlansParams = Omit<operations['accounting_get_journal_entries_mutli_plan']['parameters']['query'], 'page' | 'size'>;
6
+ type getJournalEntriesParams = Omit<operations['accounting_get_journal_entries']['parameters']['query'], 'page' | 'size'>;
7
+ type getInvoicesByTypeWithMultiplePlansParams = Omit<operations['accounting_get_invoices_by_type_multi_analytic_plans']['parameters']['query'], 'page' | 'size'>;
8
+ type getInvoicesByTypeParams = Omit<operations['accounting_get_invoices_by_type']['parameters']['query'], 'page' | 'size'>;
9
+ declare const accountingFactory: {
10
+ getAnalyticPlans(): RequestData<components['schemas']['AnalyticPlanItem'][]>;
11
+ getClients(): RequestData<components['schemas']['ClientItemOut'][]>;
12
+ createClient(client: components['schemas']['ClientItemIn'], params: operations['accounting_create_client']['parameters']['query']): RequestData<components['schemas']['ClientItemOut']>;
13
+ getClient(clientId: string): RequestData<components['schemas']['ClientItemOut']>;
14
+ updateClient(clientId: string, client: components['schemas']['ClientItemUpdate']): RequestData<components['schemas']['ClientItemOut']>;
15
+ getSuppliers(): RequestData<components['schemas']['SupplierItemOut'][]>;
16
+ createSupplier(supplier: components['schemas']['SupplierItemIn'], params: operations['accounting_create_supplier']['parameters']['query']): RequestData<components['schemas']['SupplierItemOut']>;
17
+ getSupplier(supplierId: string): RequestData<components['schemas']['SupplierItemOut']>;
18
+ updateSupplier(supplierId: string, supplier: components['schemas']['SupplierItemUpdate']): RequestData<components['schemas']['SupplierItemOut']>;
19
+ createInvoice(invoice: components['schemas']['InvoiceItemInMonoAnalyticPlan'], params: operations['accounting_create_invoice']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOutMonoAnalyticPlan']>;
20
+ createInvoiceWithMultiplePlans(invoice: components['schemas']['InvoiceItemInMultiAnalyticPlans'], params: operations['accounting_create_invoice_multiple_plans']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOutMultiAnalyticPlans']>;
21
+ getInvoicesByType(invoice_type: components['schemas']['app__routers__accounting__InvoiceType'], params: getInvoicesByTypeParams): RequestData<components['schemas']['InvoiceItemOutMonoAnalyticPlan'][]>;
22
+ getInvoice(invoiceId: string, params: operations['accounting_get_invoice']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOutMonoAnalyticPlan']>;
23
+ getInvoiceWithMultiplePlans(invoiceId: string, params: operations['accounting_get_invoice_multi_analytic_plans']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOutMultiAnalyticPlans']>;
24
+ getInvoicesByTypeWithMultiplePlans(invoice_type: components['schemas']['app__routers__accounting__InvoiceType'], params: getInvoicesByTypeWithMultiplePlansParams): RequestData<components['schemas']['InvoiceItemOutMultiAnalyticPlans'][]>;
25
+ createAnalyticAccount(analyticAccount: components['schemas']['AnalyticAccountItemIn']): RequestData<components['schemas']['AnalyticAccountItemOut']>;
26
+ getAnalyticAccounts(): RequestData<components['schemas']['AnalyticAccountItemOut'][]>;
27
+ createAnalyticAccountWithMultiplePlans(analytic_plan: string, analyticAccount: components['schemas']['AnalyticAccountItemIn']): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']>;
28
+ getAnalyticAccount(analytic_account_id: string): RequestData<components['schemas']['AnalyticAccountItemOut']>;
29
+ updateAnalyticAccount(analytic_account_id: string, analyticAccount: components['schemas']['AnalyticAccountItemUpdate']): RequestData<components['schemas']['AnalyticAccountItemOut']>;
30
+ getAnalyticAccountWithMultiplePlans(analytic_account_id: string, analytic_plan: string): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']>;
31
+ updateAnalyticAccountWithMultiplePlans(analytic_account_id: string, analytic_plan: string, analyticAccount: components['schemas']['AnalyticAccountItemUpdate']): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']>;
32
+ getAnalyticAccountsWithMultiplePlans(): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans'][]>;
33
+ getAnalyticLinesOfAccount(analytic_account_id: string): RequestData<components['schemas']['AnalyticAccountLineItemOut'][]>;
34
+ getJournalEntries(params: getJournalEntriesParams): RequestData<components['schemas']['JournalEntryMonoAnalyticPlan'][]>;
35
+ getJournalEntriesWithMultiplePlans(params: getJournalEntriesWithMultiplePlansParams): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan'][]>;
36
+ getPaymentsByInvoiceId(invoice_id: string): RequestData<components['schemas']['Payment'][]>;
37
+ getJournals(): RequestData<components['schemas']['Journal'][]>;
38
+ getVatCodes(): RequestData<components['schemas']['app__routers__accounting__VatCode'][]>;
39
+ getMiscOperations(params: getMiscOperationsParams): RequestData<components['schemas']['MiscellaneousOperationOut'][]>;
40
+ createMiscOperation(operation: components['schemas']['MiscellaneousOperationIn']): RequestData<components['schemas']['MiscellaneousOperationOut']>;
41
+ getMiscOperation(operation_id: string): RequestData<components['schemas']['MiscellaneousOperationOut']>;
42
+ attachPDF(invoice_id: string, attachment: components['schemas']['AttachmentItem'], params: operations['accounting_add_attachment']['parameters']['query']): RequestData<operations['accounting_add_attachment']['responses'][201]>;
43
+ getChartOfAccounts(params: getChartOfAccountsParams): RequestData<components['schemas']['AccountItem'][]>;
44
+ getBalanceOfAccounts(filter: components['schemas']['AccountBalanceFilter']): RequestData<components['schemas']['AccountBalance'][]>;
45
+ getEmployees(): RequestData<components['schemas']['EmployeeItem'][]>;
46
+ createFinancialEntry(financial_entry: components['schemas']['FinancialEntryItemIn']): RequestData<components['schemas']['FinancialEntryItemOut']>;
47
+ };
48
+ export { accountingFactory };
@@ -0,0 +1,255 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.accountingFactory = void 0;
4
+ const accountingFactory = {
5
+ getAnalyticPlans() {
6
+ return {
7
+ method: 'get',
8
+ url: '/consumers/{consumer_id}/accounting/analytic-plans',
9
+ };
10
+ },
11
+ getClients() {
12
+ return {
13
+ method: 'get',
14
+ url: '/consumers/{consumer_id}/accounting/clients',
15
+ };
16
+ },
17
+ createClient(client, params) {
18
+ return {
19
+ method: 'post',
20
+ url: '/consumers/{consumer_id}/accounting/clients',
21
+ body: client,
22
+ params: params,
23
+ };
24
+ },
25
+ getClient(clientId) {
26
+ return {
27
+ method: 'get',
28
+ url: `/consumers/{consumer_id}/accounting/clients/${clientId}`,
29
+ };
30
+ },
31
+ updateClient(clientId, client) {
32
+ return {
33
+ method: 'patch',
34
+ url: `/consumers/{consumer_id}/accounting/clients/${clientId}`,
35
+ body: client,
36
+ };
37
+ },
38
+ getSuppliers() {
39
+ return {
40
+ method: 'get',
41
+ url: '/consumers/{consumer_id}/accounting/suppliers',
42
+ };
43
+ },
44
+ createSupplier(supplier, params) {
45
+ return {
46
+ method: 'post',
47
+ url: '/consumers/{consumer_id}/accounting/suppliers',
48
+ body: supplier,
49
+ params: params,
50
+ };
51
+ },
52
+ getSupplier(supplierId) {
53
+ return {
54
+ method: 'get',
55
+ url: `/consumers/{consumer_id}/accounting/suppliers/${supplierId}`,
56
+ };
57
+ },
58
+ updateSupplier(supplierId, supplier) {
59
+ return {
60
+ method: 'patch',
61
+ url: `/consumers/{consumer_id}/accounting/suppliers/${supplierId}`,
62
+ body: supplier,
63
+ };
64
+ },
65
+ createInvoice(invoice, params) {
66
+ return {
67
+ params,
68
+ method: 'post',
69
+ url: '/consumers/{consumer_id}/accounting/invoices',
70
+ body: invoice,
71
+ };
72
+ },
73
+ createInvoiceWithMultiplePlans(invoice, params) {
74
+ return {
75
+ params,
76
+ method: 'post',
77
+ url: '/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans',
78
+ body: invoice,
79
+ };
80
+ },
81
+ getInvoicesByType(invoice_type, params) {
82
+ return {
83
+ params,
84
+ method: 'get',
85
+ url: `/consumers/{consumer_id}/accounting/invoices/type/${invoice_type}`,
86
+ };
87
+ },
88
+ getInvoice(invoiceId, params) {
89
+ return {
90
+ params,
91
+ method: 'get',
92
+ url: `/consumers/{consumer_id}/accounting/invoices/${invoiceId}`,
93
+ };
94
+ },
95
+ getInvoiceWithMultiplePlans(invoiceId, params) {
96
+ return {
97
+ params,
98
+ method: 'get',
99
+ url: `/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans/${invoiceId}`,
100
+ };
101
+ },
102
+ getInvoicesByTypeWithMultiplePlans(invoice_type, params) {
103
+ return {
104
+ params,
105
+ method: 'get',
106
+ url: `/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans/type/${invoice_type}`,
107
+ };
108
+ },
109
+ createAnalyticAccount(analyticAccount) {
110
+ return {
111
+ method: 'post',
112
+ url: '/consumers/{consumer_id}/accounting/analytic-accounts',
113
+ body: analyticAccount,
114
+ };
115
+ },
116
+ getAnalyticAccounts() {
117
+ return {
118
+ method: 'get',
119
+ url: '/consumers/{consumer_id}/accounting/analytic-accounts',
120
+ };
121
+ },
122
+ createAnalyticAccountWithMultiplePlans(analytic_plan, analyticAccount) {
123
+ return {
124
+ method: 'post',
125
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/multi-analytic-plans/${analytic_plan}`,
126
+ body: analyticAccount,
127
+ };
128
+ },
129
+ getAnalyticAccount(analytic_account_id) {
130
+ return {
131
+ method: 'get',
132
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}`,
133
+ };
134
+ },
135
+ updateAnalyticAccount(analytic_account_id, analyticAccount) {
136
+ return {
137
+ method: 'patch',
138
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}`,
139
+ body: analyticAccount,
140
+ };
141
+ },
142
+ getAnalyticAccountWithMultiplePlans(analytic_account_id, analytic_plan) {
143
+ return {
144
+ method: 'get',
145
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}/multi-analytic-plans/${analytic_plan}`,
146
+ };
147
+ },
148
+ updateAnalyticAccountWithMultiplePlans(analytic_account_id, analytic_plan, analyticAccount) {
149
+ return {
150
+ method: 'patch',
151
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}/multi-analytic-plans/${analytic_plan}`,
152
+ body: analyticAccount,
153
+ };
154
+ },
155
+ getAnalyticAccountsWithMultiplePlans() {
156
+ return {
157
+ method: 'get',
158
+ url: '/consumers/{consumer_id}/accounting/analytic-accounts/multi-analytic-plans',
159
+ };
160
+ },
161
+ getAnalyticLinesOfAccount(analytic_account_id) {
162
+ return {
163
+ method: 'get',
164
+ url: `/consumers/{consumer_id}/accounting/analytic-account-lines/account/${analytic_account_id}`,
165
+ };
166
+ },
167
+ getJournalEntries(params) {
168
+ return {
169
+ params,
170
+ method: 'get',
171
+ url: `/consumers/{consumer_id}/accounting/journal/entries`,
172
+ };
173
+ },
174
+ getJournalEntriesWithMultiplePlans(params) {
175
+ return {
176
+ params,
177
+ method: 'get',
178
+ url: `/consumers/{consumer_id}/accounting/journal/entries/multi-analytic-plans`,
179
+ };
180
+ },
181
+ getPaymentsByInvoiceId(invoice_id) {
182
+ return {
183
+ method: 'get',
184
+ url: `/consumers/{consumer_id}/accounting/invoices/id/${invoice_id}/payments`,
185
+ };
186
+ },
187
+ getJournals() {
188
+ return {
189
+ method: 'get',
190
+ url: `/consumers/{consumer_id}/accounting/journals`,
191
+ };
192
+ },
193
+ getVatCodes() {
194
+ return {
195
+ method: 'get',
196
+ url: `/consumers/{consumer_id}/accounting/vat-codes`,
197
+ };
198
+ },
199
+ getMiscOperations(params) {
200
+ return {
201
+ params,
202
+ method: 'get',
203
+ url: '/consumers/{consumer_id}/accounting/miscellaneous-operation',
204
+ };
205
+ },
206
+ createMiscOperation(operation) {
207
+ return {
208
+ method: 'post',
209
+ url: '/consumers/{consumer_id}/accounting/miscellaneous-operation',
210
+ body: operation,
211
+ };
212
+ },
213
+ getMiscOperation(operation_id) {
214
+ return {
215
+ method: 'get',
216
+ url: `/consumers/{consumer_id}/accounting/miscellaneous-operation/${operation_id}`,
217
+ };
218
+ },
219
+ attachPDF(invoice_id, attachment, params) {
220
+ return {
221
+ params,
222
+ method: 'post',
223
+ url: `/consumers/{consumer_id}/accounting/invoices/pdf/${invoice_id}`,
224
+ body: attachment,
225
+ };
226
+ },
227
+ getChartOfAccounts(params) {
228
+ return {
229
+ params,
230
+ method: 'get',
231
+ url: '/consumers/{consumer_id}/accounting/chart-of-accounts',
232
+ };
233
+ },
234
+ getBalanceOfAccounts(filter) {
235
+ return {
236
+ method: 'post',
237
+ url: '/consumers/{consumer_id}/accounting/chart-of-accounts/balance',
238
+ body: filter,
239
+ };
240
+ },
241
+ getEmployees() {
242
+ return {
243
+ method: 'get',
244
+ url: '/consumers/{consumer_id}/accounting/employees',
245
+ };
246
+ },
247
+ createFinancialEntry(financial_entry) {
248
+ return {
249
+ method: 'post',
250
+ url: '/consumers/{consumer_id}/accounting/financial-entry',
251
+ body: financial_entry,
252
+ };
253
+ },
254
+ };
255
+ exports.accountingFactory = accountingFactory;