@orchesty/connector-wflow 2.0.0 → 2.0.2

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 (137) hide show
  1. package/dist/package.json +5 -2
  2. package/package.json +9 -3
  3. package/CHANGELOG.md +0 -43
  4. package/coverage/clover.xml +0 -382
  5. package/coverage/coverage-final.json +0 -18
  6. package/coverage/lcov-report/base.css +0 -224
  7. package/coverage/lcov-report/block-navigation.js +0 -87
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +0 -161
  10. package/coverage/lcov-report/prettify.css +0 -1
  11. package/coverage/lcov-report/prettify.js +0 -2
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +0 -210
  14. package/coverage/lcov-report/src/Batch/WflowSubscribeWebhookBatch.ts.html +0 -337
  15. package/coverage/lcov-report/src/Batch/WflowUnsubscribeWebhookBatch.ts.html +0 -262
  16. package/coverage/lcov-report/src/Batch/index.html +0 -131
  17. package/coverage/lcov-report/src/Connector/WflowGetDocumentConnector.ts.html +0 -1105
  18. package/coverage/lcov-report/src/Connector/WflowGetDocumentMainFileConnector.ts.html +0 -205
  19. package/coverage/lcov-report/src/Connector/WflowGetDocumentTypesConnector.ts.html +0 -292
  20. package/coverage/lcov-report/src/Connector/WflowGetOrganizationsConnector.ts.html +0 -205
  21. package/coverage/lcov-report/src/Connector/WflowPatchAccountingRulesConnector.ts.html +0 -244
  22. package/coverage/lcov-report/src/Connector/WflowPatchChartOfAccountsConnector.ts.html +0 -211
  23. package/coverage/lcov-report/src/Connector/WflowPatchContractsConnector.ts.html +0 -211
  24. package/coverage/lcov-report/src/Connector/WflowPatchCostCentersConnector.ts.html +0 -211
  25. package/coverage/lcov-report/src/Connector/WflowPatchSeriesConnector.ts.html +0 -268
  26. package/coverage/lcov-report/src/Connector/WflowPatchVatControlStatementLinesConnector.ts.html +0 -211
  27. package/coverage/lcov-report/src/Connector/WflowPatchVatReturnLinesConnector.ts.html +0 -214
  28. package/coverage/lcov-report/src/Connector/WflowPutDocumentConnector.ts.html +0 -532
  29. package/coverage/lcov-report/src/Connector/WflowUpdateDocumentStateConnector.ts.html +0 -193
  30. package/coverage/lcov-report/src/Connector/index.html +0 -296
  31. package/coverage/lcov-report/src/WflowApplication.ts.html +0 -538
  32. package/coverage/lcov-report/src/index.html +0 -116
  33. package/coverage/lcov-report/test/dataProvider.ts.html +0 -307
  34. package/coverage/lcov-report/test/index.html +0 -116
  35. package/coverage/lcov.info +0 -614
  36. package/jest.config.js +0 -13
  37. package/src/Batch/WflowSubscribeWebhookBatch.ts +0 -84
  38. package/src/Batch/WflowUnsubscribeWebhookBatch.ts +0 -59
  39. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/input.json +0 -7
  40. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/mock.json +0 -5
  41. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/output.json +0 -7
  42. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/input.json +0 -7
  43. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/mock.json +0 -5
  44. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/output.json +0 -7
  45. package/src/Batch/__tests__/WflowSubscribeWebhookBatch.ts +0 -17
  46. package/src/Batch/__tests__/WflowUnsubscribeWebhookBatch.ts +0 -17
  47. package/src/Connector/WflowGetDocumentConnector.ts +0 -340
  48. package/src/Connector/WflowGetDocumentMainFileConnector.ts +0 -40
  49. package/src/Connector/WflowGetDocumentTypesConnector.ts +0 -69
  50. package/src/Connector/WflowGetOrganizationsConnector.ts +0 -40
  51. package/src/Connector/WflowPatchAccountingRulesConnector.ts +0 -53
  52. package/src/Connector/WflowPatchChartOfAccountsConnector.ts +0 -42
  53. package/src/Connector/WflowPatchContractsConnector.ts +0 -42
  54. package/src/Connector/WflowPatchCostCentersConnector.ts +0 -42
  55. package/src/Connector/WflowPatchSeriesConnector.ts +0 -61
  56. package/src/Connector/WflowPatchVatControlStatementLinesConnector.ts +0 -42
  57. package/src/Connector/WflowPatchVatReturnLinesConnector.ts +0 -43
  58. package/src/Connector/WflowPutDocumentConnector.ts +0 -149
  59. package/src/Connector/WflowUpdateDocumentStateConnector.ts +0 -36
  60. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/input.json +0 -10
  61. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/mock.json +0 -449
  62. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/output.json +0 -451
  63. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/input.json +0 -9
  64. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/mock.json +0 -5
  65. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/output.json +0 -9
  66. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/input.json +0 -7
  67. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/mock.json +0 -32
  68. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/output.json +0 -29
  69. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/input.json +0 -7
  70. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/mock.json +0 -12
  71. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/output.json +0 -14
  72. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-input.json +0 -20
  73. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-mock.json +0 -5
  74. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-output.json +0 -20
  75. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/input.json +0 -12
  76. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/mock.json +0 -5
  77. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/output.json +0 -12
  78. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-input.json +0 -18
  79. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-mock.json +0 -5
  80. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-output.json +0 -18
  81. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/input.json +0 -11
  82. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/mock.json +0 -5
  83. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/output.json +0 -11
  84. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-input.json +0 -18
  85. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-mock.json +0 -5
  86. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-output.json +0 -18
  87. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/input.json +0 -11
  88. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/mock.json +0 -5
  89. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/output.json +0 -11
  90. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-input.json +0 -18
  91. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-mock.json +0 -5
  92. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-output.json +0 -18
  93. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/input.json +0 -11
  94. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/mock.json +0 -5
  95. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/output.json +0 -11
  96. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-input.json +0 -20
  97. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-mock.json +0 -5
  98. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-output.json +0 -20
  99. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/input.json +0 -12
  100. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/mock.json +0 -5
  101. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/output.json +0 -12
  102. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-input.json +0 -18
  103. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-mock.json +0 -5
  104. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-output.json +0 -18
  105. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/input.json +0 -11
  106. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/mock.json +0 -5
  107. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/output.json +0 -11
  108. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-input.json +0 -20
  109. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-mock.json +0 -5
  110. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-output.json +0 -20
  111. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/input.json +0 -12
  112. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/mock.json +0 -5
  113. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/output.json +0 -12
  114. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/input.json +0 -10
  115. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/mock.json +0 -5
  116. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/output.json +0 -10
  117. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/input.json +0 -9
  118. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/mock.json +0 -5
  119. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/output.json +0 -9
  120. package/src/Connector/__tests__/WflowGetDocumentConnector.ts +0 -17
  121. package/src/Connector/__tests__/WflowGetDocumentMainFileConnector.ts +0 -17
  122. package/src/Connector/__tests__/WflowGetDocumentTypesConnector.ts +0 -17
  123. package/src/Connector/__tests__/WflowGetOrganizationsConnector.ts +0 -17
  124. package/src/Connector/__tests__/WflowPatchAccountingRulesConnector.ts +0 -21
  125. package/src/Connector/__tests__/WflowPatchChartOfAccountsConnector.ts +0 -21
  126. package/src/Connector/__tests__/WflowPatchContractsConnector.ts +0 -21
  127. package/src/Connector/__tests__/WflowPatchCostCentersConnector.ts +0 -21
  128. package/src/Connector/__tests__/WflowPatchSeriesConnector.ts +0 -21
  129. package/src/Connector/__tests__/WflowPatchVatControlStatementLinesConnector.ts +0 -21
  130. package/src/Connector/__tests__/WflowPatchVatReturnLinesConnector.ts +0 -21
  131. package/src/Connector/__tests__/WflowPutDocumentConnector.ts +0 -17
  132. package/src/Connector/__tests__/WflowUpdateDocumentState.ts +0 -17
  133. package/src/WflowApplication.ts +0 -151
  134. package/test/dataProvider.ts +0 -74
  135. package/tsconfig.json +0 -9
  136. package/tsconfig.prod.json +0 -10
  137. package/tsconfig.prod.tsbuildinfo +0 -1
@@ -1,42 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-chart-of-accounts-connector`;
7
-
8
- export default class WflowPatchChartOfAccountsConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/chartofaccounts`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- }
41
-
42
- export type IOutput = IInput | IInput[];
@@ -1,42 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-contracts-connector`;
7
-
8
- export default class WflowPatchContractsConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/contracts`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- }
41
-
42
- export type IOutput = IInput | IInput[];
@@ -1,42 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-cost-centers-connector`;
7
-
8
- export default class WflowPatchCostCentersConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/costcenters`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- }
41
-
42
- export type IOutput = IInput | IInput[];
@@ -1,61 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-series-connector`;
7
-
8
- export default class WflowPatchSeriesConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/series`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export type DocumentKind =
35
- | 'IncomingInvoice'
36
- | 'OutgoingInvoice'
37
- | 'ExpenditureCashSlip'
38
- | 'SupplierOrder'
39
- | 'CustomerOrder'
40
- | 'Other'
41
- | 'Contract'
42
- | 'IncomeCashReceipt';
43
-
44
- export type InvoiceType =
45
- | 'TaxInvoice'
46
- | 'CreditNote'
47
- | 'DebitNote'
48
- | 'Proforma'
49
- | 'TaxInvoicePayment';
50
-
51
- export interface IInput {
52
- id?: string | null;
53
- externalId?: string | null;
54
- code?: string | null;
55
- description?: string | null;
56
- isValid?: boolean;
57
- kind?: DocumentKind;
58
- invoiceType?: InvoiceType;
59
- }
60
-
61
- export type IOutput = IInput | IInput[];
@@ -1,42 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-vat-control-statement-lines-connector`;
7
-
8
- export default class WflowPatchVatControlStatementLinesConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/vatcontrolstatementlines`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- }
41
-
42
- export type IOutput = IInput | IInput[];
@@ -1,43 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-vat-return-lines-connector`;
7
-
8
- export default class WflowPatchVatReturnLinesConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/vatreturnlines`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- reverseCharge?: boolean;
41
- }
42
-
43
- export type IOutput = IInput | IInput[];
@@ -1,149 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-put-document-connector`;
7
-
8
- export default class WflowPutDocumentConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
15
- const app = this.getApplication<WflowApplication>();
16
- const appInstall = await this.getApplicationInstallFromProcess(dto);
17
- const { externalId, ignoreLock, setAsFilled } = dto.getJsonData();
18
-
19
- const query = new URLSearchParams();
20
- if (externalId) query.set('externalId', externalId);
21
- if (ignoreLock) query.set('ignoreLock', ignoreLock.toString());
22
- if (setAsFilled) query.set('setAsFilled', setAsFilled.toString());
23
-
24
- const request = app.getRequestDto(
25
- dto,
26
- appInstall,
27
- HttpMethods.PUT,
28
- `/${app.getOrganization(appInstall)}/documents${query.size ? `?${query}` : ''}`,
29
- dto.getJsonData(),
30
- );
31
-
32
- await this.getSender().send(request);
33
-
34
- return dto;
35
- }
36
-
37
- }
38
-
39
- interface UpdateRegister {
40
- id: string;
41
- externalId: string;
42
- code: string;
43
- }
44
-
45
- export interface IInput {
46
- id: string;
47
- externalId?: string;
48
- ignoreLock?: boolean;
49
- setAsFilled?: boolean;
50
- type?: {
51
- id?: string;
52
- kind?: 'IncomingInvoice' | 'OutgoingInvoice' | 'ExpenditureCashSlip' | 'SupplierOrder' | 'CustomerOrder' | 'Other' | 'Contract' | 'IncomeCashReceipt';
53
- };
54
- number?: string;
55
- internalCode?: string;
56
- vatDocumentCode?: string;
57
- variableSymbol?: string;
58
- constantSymbol?: string;
59
- specificSymbol?: string;
60
- issueDate?: string;
61
- dueDate?: string;
62
- vatDate?: string;
63
- acceptDate?: string;
64
- caseDate?: string;
65
- validFrom?: string;
66
- validTo?: string;
67
- effectiveFrom?: string;
68
- effectiveTo?: string;
69
- signatureDate?: string;
70
- reviewDate?: string;
71
- accountTerm?: string;
72
- vatTerm?: string;
73
- totalAmount?: number;
74
- roundingAmount?: number;
75
- totalAmountFC?: number;
76
- advanceAmount?: number;
77
- currency?: string;
78
- partnerIC?: string;
79
- partnerVAT?: string;
80
- partnerLocalVAT?: string;
81
- partnerName?: string;
82
- partnerAddress?: string;
83
- partnerEmail?: string;
84
- accountNo?: string;
85
- bankCode?: string;
86
- iban?: string;
87
- bic?: string;
88
- meIC?: string;
89
- exchangeRate?: number;
90
- exchangeRateUnits?: number;
91
- tag?: string;
92
- orderNo?: string;
93
- description?: string;
94
- contactPersonName?: string;
95
- contactPersonEmail?: string;
96
- invoiceType?: 'TaxInvoice' | 'CreditNote' | 'DebitNote' | 'Proforma' | 'TaxInvoicePayment';
97
- expectedDeliveryDate?: string;
98
- deliveryLocation?: UpdateRegister;
99
- series?: string;
100
- serie?: UpdateRegister;
101
- accountCode?: string;
102
- doNotPay?: boolean;
103
- partner?: {
104
- id: string;
105
- };
106
- vaTs?: {
107
- type: 'Exempt' | 'FirstReduced' | 'SecondReduced' | 'Basic';
108
- rate?: number;
109
- base?: number;
110
- tax?: number;
111
- }[];
112
- lines?: {
113
- id?: string;
114
- totalAmount?: number;
115
- totalAmountFC?: number;
116
- accountCode?: string;
117
- currency?: string;
118
- description?: string;
119
- quantity?: number;
120
- unitPrice?: number;
121
- measureUnit?: string;
122
- order?: number;
123
- }[];
124
- accounting?: {
125
- businessItemCode?: string;
126
- accountingRule?: UpdateRegister;
127
- activity?: UpdateRegister;
128
- businessCase?: UpdateRegister;
129
- cardDocumentType?: UpdateRegister;
130
- cashDocumentType?: UpdateRegister;
131
- cashRegister?: UpdateRegister;
132
- contraAccount?: UpdateRegister;
133
- contract?: UpdateRegister;
134
- costCenter?: UpdateRegister;
135
- employee?: UpdateRegister;
136
- paymentMethod?: UpdateRegister;
137
- project?: UpdateRegister;
138
- vatControlStatementLine?: UpdateRegister;
139
- vatReturnLine?: UpdateRegister;
140
- vatReverseChargeCode?: UpdateRegister;
141
- vehicle?: UpdateRegister;
142
- vatSupplyModeCode?: 'Normal' | 'TravelService' | 'UsedGoods';
143
- vatApplyReductionCoefficient?: boolean;
144
- vatFixedAssets?: boolean;
145
- vatMode?: 'Standard' | 'ReverseChargeDomestic' | 'ReverseCharge' | 'Excluded' | 'InForeignCurrency';
146
- }
147
- }
148
-
149
- export type IOutput = IInput;
@@ -1,36 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-update-document-state-connector`;
7
-
8
- export default class WflowUpdateDocumentStateConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
15
- const { documentId } = dto.getJsonData();
16
- const app = this.getApplication<WflowApplication>();
17
- const appInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const request = app.getRequestDto(
20
- dto,
21
- appInstall,
22
- HttpMethods.PUT,
23
- `/${app.getOrganization(appInstall)}/documents/${documentId}/task/Export/processed`,
24
- );
25
-
26
- await this.getSender().send(request, [200]);
27
- return dto;
28
- }
29
-
30
- }
31
-
32
- export interface IInput {
33
- documentId: string;
34
- }
35
-
36
- export type IOutput = IInput;
@@ -1,10 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser",
4
- "sdk": "TestSdk"
5
- },
6
- "data": {
7
- "organization": "test",
8
- "documentId": "463b5265-2672-4191-9e3b-9d6fcfe6a452"
9
- }
10
- }