@accounter/server 0.0.8-alpha-20251102162123-4116da86b4346a2ba1598da87dfbed6dff5b3393 → 0.0.8-alpha-20251102162844-adaba3b25910083f6ebd80bd580629e1c0871260
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.
- package/CHANGELOG.md +21 -5
- package/dist/green-invoice-graphql/src/mesh-artifacts/index.d.ts +1191 -1444
- package/dist/green-invoice-graphql/src/mesh-artifacts/index.js +427 -614
- package/dist/green-invoice-graphql/src/mesh-artifacts/index.js.map +1 -1
- package/dist/green-invoice-graphql/src/mesh-artifacts/sources/GreenInvoice/schemaWithAnnotations.js +9268 -11080
- package/dist/green-invoice-graphql/src/mesh-artifacts/sources/GreenInvoice/schemaWithAnnotations.js.map +1 -1
- package/dist/green-invoice-graphql/src/mesh-artifacts/sources/GreenInvoice/types.d.ts +639 -776
- package/dist/green-invoice-graphql/src/mesh-artifacts/sources/GreenInvoiceNew/schemaWithAnnotations.js +8 -8
- package/dist/green-invoice-graphql/src/mesh-artifacts/sources/GreenInvoiceNew/schemaWithAnnotations.js.map +1 -1
- package/dist/green-invoice-graphql/src/mesh-artifacts/sources/GreenInvoiceNew/types.d.ts +8 -8
- package/dist/server/src/modules/app-providers/green-invoice-client.d.ts +24 -28
- package/dist/server/src/modules/app-providers/green-invoice-client.js +1 -67
- package/dist/server/src/modules/app-providers/green-invoice-client.js.map +1 -1
- package/dist/server/src/modules/countries/types.d.ts +0 -251
- package/dist/server/src/modules/countries/types.js +0 -252
- package/dist/server/src/modules/countries/types.js.map +1 -1
- package/dist/server/src/modules/financial-entities/resolvers/businesses.resolver.js +2 -6
- package/dist/server/src/modules/financial-entities/resolvers/businesses.resolver.js.map +1 -1
- package/dist/server/src/modules/financial-entities/resolvers/clients.resolvers.js +0 -5
- package/dist/server/src/modules/financial-entities/resolvers/clients.resolvers.js.map +1 -1
- package/dist/server/src/modules/green-invoice/helpers/contract-to-draft.helper.js +1 -1
- package/dist/server/src/modules/green-invoice/helpers/contract-to-draft.helper.js.map +1 -1
- package/dist/server/src/modules/green-invoice/helpers/green-invoice.helper.d.ts +23 -26
- package/dist/server/src/modules/green-invoice/helpers/green-invoice.helper.js +4 -1018
- package/dist/server/src/modules/green-invoice/helpers/green-invoice.helper.js.map +1 -1
- package/dist/server/src/modules/green-invoice/helpers/issue-document.helper.d.ts +5 -4
- package/dist/server/src/modules/green-invoice/helpers/issue-document.helper.js +29 -0
- package/dist/server/src/modules/green-invoice/helpers/issue-document.helper.js.map +1 -1
- package/dist/server/src/modules/green-invoice/resolvers/green-invoice.resolvers.js +1 -2
- package/dist/server/src/modules/green-invoice/resolvers/green-invoice.resolvers.js.map +1 -1
- package/package.json +4 -4
- package/src/modules/app-providers/green-invoice-client.ts +1 -82
- package/src/modules/countries/types.ts +0 -252
- package/src/modules/financial-entities/resolvers/businesses.resolver.ts +2 -10
- package/src/modules/financial-entities/resolvers/clients.resolvers.ts +0 -11
- package/src/modules/green-invoice/helpers/contract-to-draft.helper.ts +1 -1
- package/src/modules/green-invoice/helpers/green-invoice.helper.ts +43 -1068
- package/src/modules/green-invoice/helpers/issue-document.helper.ts +41 -3
- package/src/modules/green-invoice/resolvers/green-invoice.resolvers.ts +6 -6
- package/dist/server/src/modules/green-invoice/helpers/green-invoice-clients.helper.d.ts +0 -5
- package/dist/server/src/modules/green-invoice/helpers/green-invoice-clients.helper.js +0 -194
- package/dist/server/src/modules/green-invoice/helpers/green-invoice-clients.helper.js.map +0 -1
- package/src/modules/green-invoice/helpers/green-invoice-clients.helper.ts +0 -241
|
@@ -1,254 +1,2 @@
|
|
|
1
1
|
export * from './__generated__/types.js';
|
|
2
2
|
export * from './__generated__/countries.types.js';
|
|
3
|
-
|
|
4
|
-
export enum CountryCode {
|
|
5
|
-
AFG = 'Afghanistan',
|
|
6
|
-
ALB = 'Albania',
|
|
7
|
-
DZA = 'Algeria',
|
|
8
|
-
ASM = 'American Samoa',
|
|
9
|
-
AND = 'Andorra',
|
|
10
|
-
AGO = 'Angola',
|
|
11
|
-
AIA = 'Anguilla',
|
|
12
|
-
ATA = 'Antarctica',
|
|
13
|
-
ATG = 'Antigua and Barbuda',
|
|
14
|
-
ARG = 'Argentina',
|
|
15
|
-
ARM = 'Armenia',
|
|
16
|
-
ABW = 'Aruba',
|
|
17
|
-
AUS = 'Australia',
|
|
18
|
-
AUT = 'Austria',
|
|
19
|
-
AZE = 'Azerbaijan',
|
|
20
|
-
BHS = 'Bahamas (the)',
|
|
21
|
-
BHR = 'Bahrain',
|
|
22
|
-
BGD = 'Bangladesh',
|
|
23
|
-
BRB = 'Barbados',
|
|
24
|
-
BLR = 'Belarus',
|
|
25
|
-
BEL = 'Belgium',
|
|
26
|
-
BLZ = 'Belize',
|
|
27
|
-
BEN = 'Benin',
|
|
28
|
-
BMU = 'Bermuda',
|
|
29
|
-
BTN = 'Bhutan',
|
|
30
|
-
BOL = 'Bolivia (Plurinational State of)',
|
|
31
|
-
BES = 'Bonaire, Sint Eustatius and Saba',
|
|
32
|
-
BIH = 'Bosnia and Herzegovina',
|
|
33
|
-
BWA = 'Botswana',
|
|
34
|
-
BVT = 'Bouvet Island',
|
|
35
|
-
BRA = 'Brazil',
|
|
36
|
-
IOT = 'British Indian Ocean Territory (the)',
|
|
37
|
-
BRN = 'Brunei Darussalam',
|
|
38
|
-
BGR = 'Bulgaria',
|
|
39
|
-
BFA = 'Burkina Faso',
|
|
40
|
-
BDI = 'Burundi',
|
|
41
|
-
CPV = 'Cabo Verde',
|
|
42
|
-
KHM = 'Cambodia',
|
|
43
|
-
CMR = 'Cameroon',
|
|
44
|
-
CAN = 'Canada',
|
|
45
|
-
CYM = 'Cayman Islands (the)',
|
|
46
|
-
CAF = 'Central African Republic (the)',
|
|
47
|
-
TCD = 'Chad',
|
|
48
|
-
CHL = 'Chile',
|
|
49
|
-
CHN = 'China',
|
|
50
|
-
CXR = 'Christmas Island',
|
|
51
|
-
CCK = 'Cocos (Keeling) Islands (the)',
|
|
52
|
-
COL = 'Colombia',
|
|
53
|
-
COM = 'Comoros (the)',
|
|
54
|
-
COD = 'Congo (the Democratic Republic of the)',
|
|
55
|
-
COG = 'Congo (the)',
|
|
56
|
-
COK = 'Cook Islands (the)',
|
|
57
|
-
CRI = 'Costa Rica',
|
|
58
|
-
HRV = 'Croatia',
|
|
59
|
-
CUB = 'Cuba',
|
|
60
|
-
CUW = 'Curaçao',
|
|
61
|
-
CYP = 'Cyprus',
|
|
62
|
-
CZE = 'Czechia',
|
|
63
|
-
CIV = "Côte d'Ivoire",
|
|
64
|
-
DNK = 'Denmark',
|
|
65
|
-
DJI = 'Djibouti',
|
|
66
|
-
DMA = 'Dominica',
|
|
67
|
-
DOM = 'Dominican Republic (the)',
|
|
68
|
-
ECU = 'Ecuador',
|
|
69
|
-
EGY = 'Egypt',
|
|
70
|
-
SLV = 'El Salvador',
|
|
71
|
-
GNQ = 'Equatorial Guinea',
|
|
72
|
-
ERI = 'Eritrea',
|
|
73
|
-
EST = 'Estonia',
|
|
74
|
-
SWZ = 'Eswatini',
|
|
75
|
-
ETH = 'Ethiopia',
|
|
76
|
-
FLK = 'Falkland Islands (the) [Malvinas]',
|
|
77
|
-
FRO = 'Faroe Islands (the)',
|
|
78
|
-
FJI = 'Fiji',
|
|
79
|
-
FIN = 'Finland',
|
|
80
|
-
FRA = 'France',
|
|
81
|
-
GUF = 'French Guiana',
|
|
82
|
-
PYF = 'French Polynesia',
|
|
83
|
-
ATF = 'French Southern Territories (the)',
|
|
84
|
-
GAB = 'Gabon',
|
|
85
|
-
GMB = 'Gambia (the)',
|
|
86
|
-
GEO = 'Georgia',
|
|
87
|
-
DEU = 'Germany',
|
|
88
|
-
GHA = 'Ghana',
|
|
89
|
-
GIB = 'Gibraltar',
|
|
90
|
-
GRC = 'Greece',
|
|
91
|
-
GRL = 'Greenland',
|
|
92
|
-
GRD = 'Grenada',
|
|
93
|
-
GLP = 'Guadeloupe',
|
|
94
|
-
GUM = 'Guam',
|
|
95
|
-
GTM = 'Guatemala',
|
|
96
|
-
GGY = 'Guernsey',
|
|
97
|
-
GIN = 'Guinea',
|
|
98
|
-
GNB = 'Guinea-Bissau',
|
|
99
|
-
GUY = 'Guyana',
|
|
100
|
-
HTI = 'Haiti',
|
|
101
|
-
HMD = 'Heard Island and McDonald Islands',
|
|
102
|
-
VAT = 'Holy See (the)',
|
|
103
|
-
HND = 'Honduras',
|
|
104
|
-
HKG = 'Hong Kong',
|
|
105
|
-
HUN = 'Hungary',
|
|
106
|
-
ISL = 'Iceland',
|
|
107
|
-
IND = 'India',
|
|
108
|
-
IDN = 'Indonesia',
|
|
109
|
-
IRN = 'Iran (Islamic Republic of)',
|
|
110
|
-
IRQ = 'Iraq',
|
|
111
|
-
IRL = 'Ireland',
|
|
112
|
-
IMN = 'Isle of Man',
|
|
113
|
-
ISR = 'Israel',
|
|
114
|
-
ITA = 'Italy',
|
|
115
|
-
JAM = 'Jamaica',
|
|
116
|
-
JPN = 'Japan',
|
|
117
|
-
JEY = 'Jersey',
|
|
118
|
-
JOR = 'Jordan',
|
|
119
|
-
KAZ = 'Kazakhstan',
|
|
120
|
-
KEN = 'Kenya',
|
|
121
|
-
KIR = 'Kiribati',
|
|
122
|
-
PRK = "Korea (the Democratic People's Republic of)",
|
|
123
|
-
KOR = 'Korea (the Republic of)',
|
|
124
|
-
KWT = 'Kuwait',
|
|
125
|
-
KGZ = 'Kyrgyzstan',
|
|
126
|
-
LAO = "Lao People's Democratic Republic (the)",
|
|
127
|
-
LVA = 'Latvia',
|
|
128
|
-
LBN = 'Lebanon',
|
|
129
|
-
LSO = 'Lesotho',
|
|
130
|
-
LBR = 'Liberia',
|
|
131
|
-
LBY = 'Libya',
|
|
132
|
-
LIE = 'Liechtenstein',
|
|
133
|
-
LTU = 'Lithuania',
|
|
134
|
-
LUX = 'Luxembourg',
|
|
135
|
-
MAC = 'Macao',
|
|
136
|
-
MDG = 'Madagascar',
|
|
137
|
-
MWI = 'Malawi',
|
|
138
|
-
MYS = 'Malaysia',
|
|
139
|
-
MDV = 'Maldives',
|
|
140
|
-
MLI = 'Mali',
|
|
141
|
-
MLT = 'Malta',
|
|
142
|
-
MHL = 'Marshall Islands (the)',
|
|
143
|
-
MTQ = 'Martinique',
|
|
144
|
-
MRT = 'Mauritania',
|
|
145
|
-
MUS = 'Mauritius',
|
|
146
|
-
MYT = 'Mayotte',
|
|
147
|
-
MEX = 'Mexico',
|
|
148
|
-
FSM = 'Micronesia (Federated States of)',
|
|
149
|
-
MDA = 'Moldova (the Republic of)',
|
|
150
|
-
MCO = 'Monaco',
|
|
151
|
-
MNG = 'Mongolia',
|
|
152
|
-
MNE = 'Montenegro',
|
|
153
|
-
MSR = 'Montserrat',
|
|
154
|
-
MAR = 'Morocco',
|
|
155
|
-
MOZ = 'Mozambique',
|
|
156
|
-
MMR = 'Myanmar',
|
|
157
|
-
NAM = 'Namibia',
|
|
158
|
-
NRU = 'Nauru',
|
|
159
|
-
NPL = 'Nepal',
|
|
160
|
-
NLD = 'Netherlands (the)',
|
|
161
|
-
NCL = 'New Caledonia',
|
|
162
|
-
NZL = 'New Zealand',
|
|
163
|
-
NIC = 'Nicaragua',
|
|
164
|
-
NER = 'Niger (the)',
|
|
165
|
-
NGA = 'Nigeria',
|
|
166
|
-
NIU = 'Niue',
|
|
167
|
-
NFK = 'Norfolk Island',
|
|
168
|
-
MNP = 'Northern Mariana Islands (the)',
|
|
169
|
-
NOR = 'Norway',
|
|
170
|
-
OMN = 'Oman',
|
|
171
|
-
PAK = 'Pakistan',
|
|
172
|
-
PLW = 'Palau',
|
|
173
|
-
PSE = 'Palestine, State of',
|
|
174
|
-
PAN = 'Panama',
|
|
175
|
-
PNG = 'Papua New Guinea',
|
|
176
|
-
PRY = 'Paraguay',
|
|
177
|
-
PER = 'Peru',
|
|
178
|
-
PHL = 'Philippines (the)',
|
|
179
|
-
PCN = 'Pitcairn',
|
|
180
|
-
POL = 'Poland',
|
|
181
|
-
PRT = 'Portugal',
|
|
182
|
-
PRI = 'Puerto Rico',
|
|
183
|
-
QAT = 'Qatar',
|
|
184
|
-
MKD = 'Republic of North Macedonia',
|
|
185
|
-
ROU = 'Romania',
|
|
186
|
-
RUS = 'Russian Federation (the)',
|
|
187
|
-
RWA = 'Rwanda',
|
|
188
|
-
REU = 'Réunion',
|
|
189
|
-
BLM = 'Saint Barthélemy',
|
|
190
|
-
SHN = 'Saint Helena, Ascension and Tristan da Cunha',
|
|
191
|
-
KNA = 'Saint Kitts and Nevis',
|
|
192
|
-
LCA = 'Saint Lucia',
|
|
193
|
-
MAF = 'Saint Martin (French part)',
|
|
194
|
-
SPM = 'Saint Pierre and Miquelon',
|
|
195
|
-
VCT = 'Saint Vincent and the Grenadines',
|
|
196
|
-
WSM = 'Samoa',
|
|
197
|
-
SMR = 'San Marino',
|
|
198
|
-
STP = 'Sao Tome and Principe',
|
|
199
|
-
SAU = 'Saudi Arabia',
|
|
200
|
-
SEN = 'Senegal',
|
|
201
|
-
SRB = 'Serbia',
|
|
202
|
-
SYC = 'Seychelles',
|
|
203
|
-
SLE = 'Sierra Leone',
|
|
204
|
-
SGP = 'Singapore',
|
|
205
|
-
SXM = 'Sint Maarten (Dutch part)',
|
|
206
|
-
SVK = 'Slovakia',
|
|
207
|
-
SVN = 'Slovenia',
|
|
208
|
-
SLB = 'Solomon Islands',
|
|
209
|
-
SOM = 'Somalia',
|
|
210
|
-
ZAF = 'South Africa',
|
|
211
|
-
SGS = 'South Georgia and the South Sandwich Islands',
|
|
212
|
-
SSD = 'South Sudan',
|
|
213
|
-
ESP = 'Spain',
|
|
214
|
-
LKA = 'Sri Lanka',
|
|
215
|
-
SDN = 'Sudan (the)',
|
|
216
|
-
SUR = 'Suriname',
|
|
217
|
-
SJM = 'Svalbard and Jan Mayen',
|
|
218
|
-
SWE = 'Sweden',
|
|
219
|
-
CHE = 'Switzerland',
|
|
220
|
-
SYR = 'Syrian Arab Republic',
|
|
221
|
-
TWN = 'Taiwan (Province of China)',
|
|
222
|
-
TJK = 'Tajikistan',
|
|
223
|
-
TZA = 'Tanzania, United Republic of',
|
|
224
|
-
THA = 'Thailand',
|
|
225
|
-
TLS = 'Timor-Leste',
|
|
226
|
-
TGO = 'Togo',
|
|
227
|
-
TKL = 'Tokelau',
|
|
228
|
-
TON = 'Tonga',
|
|
229
|
-
TTO = 'Trinidad and Tobago',
|
|
230
|
-
TUN = 'Tunisia',
|
|
231
|
-
TUR = 'Turkey',
|
|
232
|
-
TKM = 'Turkmenistan',
|
|
233
|
-
TCA = 'Turks and Caicos Islands (the)',
|
|
234
|
-
TUV = 'Tuvalu',
|
|
235
|
-
UGA = 'Uganda',
|
|
236
|
-
UKR = 'Ukraine',
|
|
237
|
-
ARE = 'United Arab Emirates (the)',
|
|
238
|
-
GBR = 'United Kingdom of Great Britain and Northern Ireland (the)',
|
|
239
|
-
UMI = 'United States Minor Outlying Islands (the)',
|
|
240
|
-
USA = 'United States of America (the)',
|
|
241
|
-
URY = 'Uruguay',
|
|
242
|
-
UZB = 'Uzbekistan',
|
|
243
|
-
VUT = 'Vanuatu',
|
|
244
|
-
VEN = 'Venezuela (Bolivarian Republic of)',
|
|
245
|
-
VNM = 'Viet Nam',
|
|
246
|
-
VGB = 'Virgin Islands (British)',
|
|
247
|
-
VIR = 'Virgin Islands (U.S.)',
|
|
248
|
-
WLF = 'Wallis and Futuna',
|
|
249
|
-
ESH = 'Western Sahara',
|
|
250
|
-
YEM = 'Yemen',
|
|
251
|
-
ZMB = 'Zambia',
|
|
252
|
-
ZWE = 'Zimbabwe',
|
|
253
|
-
ALA = 'Åland Islands',
|
|
254
|
-
}
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
SuggestionData,
|
|
4
4
|
suggestionDataSchema,
|
|
5
5
|
} from '@modules/financial-entities/helpers/business-suggestion-data-schema.helper.js';
|
|
6
|
-
import { updateGreenInvoiceClient } from '@modules/green-invoice/helpers/green-invoice-clients.helper.js';
|
|
7
6
|
import { SortCodesProvider } from '@modules/sort-codes/providers/sort-codes.provider.js';
|
|
8
7
|
import { TagsProvider } from '@modules/tags/providers/tags.provider.js';
|
|
9
8
|
import { TransactionsProvider } from '@modules/transactions/providers/transactions.provider.js';
|
|
@@ -110,9 +109,6 @@ export const businessesResolvers: FinancialEntitiesModule.Resolvers &
|
|
|
110
109
|
suggestionData,
|
|
111
110
|
pcn874RecordTypeOverride: fields.pcn874RecordType,
|
|
112
111
|
};
|
|
113
|
-
|
|
114
|
-
let updatedBusiness: IGetBusinessesByIdsResult | undefined = undefined;
|
|
115
|
-
|
|
116
112
|
try {
|
|
117
113
|
if (
|
|
118
114
|
fields.hebrewName ||
|
|
@@ -160,23 +156,19 @@ export const businessesResolvers: FinancialEntitiesModule.Resolvers &
|
|
|
160
156
|
}
|
|
161
157
|
}
|
|
162
158
|
|
|
163
|
-
updatedBusiness = await injector
|
|
159
|
+
const updatedBusiness = await injector
|
|
164
160
|
.get(BusinessesProvider)
|
|
165
161
|
.getBusinessByIdLoader.load(businessId);
|
|
166
162
|
if (!updatedBusiness) {
|
|
167
163
|
throw new Error(`Updated business not found`);
|
|
168
164
|
}
|
|
165
|
+
return updatedBusiness;
|
|
169
166
|
} catch (e) {
|
|
170
167
|
return {
|
|
171
168
|
__typename: 'CommonError',
|
|
172
169
|
message: `Failed to update business ID="${businessId}": ${(e as Error).message}`,
|
|
173
170
|
};
|
|
174
171
|
}
|
|
175
|
-
|
|
176
|
-
// update green invoice client if needed
|
|
177
|
-
await updateGreenInvoiceClient(businessId, injector, fields);
|
|
178
|
-
|
|
179
|
-
return updatedBusiness;
|
|
180
172
|
},
|
|
181
173
|
insertNewBusiness: async (
|
|
182
174
|
_,
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { GraphQLError } from 'graphql';
|
|
2
2
|
import { GreenInvoiceClientProvider } from '@modules/app-providers/green-invoice-client.js';
|
|
3
3
|
import { BusinessesProvider } from '@modules/financial-entities/providers/businesses.provider.js';
|
|
4
|
-
import {
|
|
5
|
-
addGreenInvoiceClient,
|
|
6
|
-
updateGreenInvoiceClient,
|
|
7
|
-
} from '@modules/green-invoice/helpers/green-invoice-clients.helper.js';
|
|
8
4
|
import { ClientsProvider } from '../providers/clients.provider.js';
|
|
9
5
|
import type {
|
|
10
6
|
FinancialEntitiesModule,
|
|
@@ -62,10 +58,6 @@ export const clientsResolvers: FinancialEntitiesModule.Resolvers = {
|
|
|
62
58
|
}
|
|
63
59
|
throw new Error(message);
|
|
64
60
|
});
|
|
65
|
-
|
|
66
|
-
// update green invoice client if needed
|
|
67
|
-
await updateGreenInvoiceClient(businessId, injector, undefined, fields);
|
|
68
|
-
|
|
69
61
|
return updatedClient;
|
|
70
62
|
} catch (e) {
|
|
71
63
|
return {
|
|
@@ -88,9 +80,6 @@ export const clientsResolvers: FinancialEntitiesModule.Resolvers = {
|
|
|
88
80
|
throw new Error(`No client returned after insertion`);
|
|
89
81
|
}
|
|
90
82
|
|
|
91
|
-
// create green invoice client record
|
|
92
|
-
await addGreenInvoiceClient(insertClient.business_id, injector);
|
|
93
|
-
|
|
94
83
|
return insertClient;
|
|
95
84
|
} catch (e) {
|
|
96
85
|
console.error(e);
|
|
@@ -9,7 +9,7 @@ import { Currency } from '@shared/enums';
|
|
|
9
9
|
import { NewDocumentInfo } from '@shared/gql-types';
|
|
10
10
|
import { dateToTimelessDateString } from '@shared/helpers';
|
|
11
11
|
import { TimelessDateString } from '@shared/types';
|
|
12
|
-
import { getClientFromGreenInvoiceClient } from './
|
|
12
|
+
import { getClientFromGreenInvoiceClient } from './issue-document.helper.js';
|
|
13
13
|
|
|
14
14
|
export const convertContractToDraft = async (
|
|
15
15
|
contract: IGetContractsByIdsResult,
|