@accounter/server 0.0.9-alpha-20251216161545-668306e40cf3aed663f444e0004246489fbec6d4 → 0.0.9-alpha-20251216205426-5f8c6ec241db9449687000a5cc5dbb8cbb861623

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 (57) hide show
  1. package/CHANGELOG.md +28 -5
  2. package/dist/green-invoice-graphql/src/mesh-artifacts/index.d.ts +1 -1
  3. package/dist/green-invoice-graphql/src/mesh-artifacts/index.js +2 -2
  4. package/dist/green-invoice-graphql/src/mesh-artifacts/index.js.map +1 -1
  5. package/dist/server/src/__generated__/types.d.ts +282 -301
  6. package/dist/server/src/__generated__/types.js.map +1 -1
  7. package/dist/server/src/modules/app-providers/green-invoice-client.d.ts +3 -3
  8. package/dist/server/src/modules/contracts/helpers/contracts.helper.d.ts +2 -0
  9. package/dist/server/src/modules/contracts/helpers/contracts.helper.js +20 -0
  10. package/dist/server/src/modules/contracts/helpers/contracts.helper.js.map +1 -1
  11. package/dist/server/src/modules/documents/__generated__/types.d.ts +121 -7
  12. package/dist/server/src/modules/documents/__generated__/types.js.map +1 -1
  13. package/dist/server/src/modules/documents/helpers/common.helper.d.ts +2 -0
  14. package/dist/server/src/modules/documents/helpers/common.helper.js +20 -0
  15. package/dist/server/src/modules/documents/helpers/common.helper.js.map +1 -1
  16. package/dist/server/src/modules/documents/helpers/issue-document.helper.d.ts +21 -0
  17. package/dist/server/src/modules/{green-invoice → documents}/helpers/issue-document.helper.js +61 -11
  18. package/dist/server/src/modules/documents/helpers/issue-document.helper.js.map +1 -0
  19. package/dist/server/src/modules/documents/index.js +9 -2
  20. package/dist/server/src/modules/documents/index.js.map +1 -1
  21. package/dist/server/src/modules/documents/resolvers/documents-issuing.resolver.d.ts +2 -0
  22. package/dist/server/src/modules/documents/resolvers/documents-issuing.resolver.js +357 -0
  23. package/dist/server/src/modules/documents/resolvers/documents-issuing.resolver.js.map +1 -0
  24. package/dist/server/src/modules/documents/typeDefs/documents-issuing.graphql.d.ts +2 -0
  25. package/dist/server/src/modules/documents/typeDefs/documents-issuing.graphql.js +228 -0
  26. package/dist/server/src/modules/documents/typeDefs/documents-issuing.graphql.js.map +1 -0
  27. package/dist/server/src/modules/green-invoice/__generated__/types.d.ts +6 -135
  28. package/dist/server/src/modules/green-invoice/__generated__/types.js +0 -2
  29. package/dist/server/src/modules/green-invoice/__generated__/types.js.map +1 -1
  30. package/dist/server/src/modules/green-invoice/helpers/green-invoice.helper.d.ts +21 -27
  31. package/dist/server/src/modules/green-invoice/helpers/green-invoice.helper.js +160 -151
  32. package/dist/server/src/modules/green-invoice/helpers/green-invoice.helper.js.map +1 -1
  33. package/dist/server/src/modules/green-invoice/resolvers/green-invoice.resolvers.js +4 -347
  34. package/dist/server/src/modules/green-invoice/resolvers/green-invoice.resolvers.js.map +1 -1
  35. package/dist/server/src/modules/green-invoice/typeDefs/green-invoice.graphql.js +4 -512
  36. package/dist/server/src/modules/green-invoice/typeDefs/green-invoice.graphql.js.map +1 -1
  37. package/dist/shaam-uniform-format-generator/src/generator/records/b110.d.ts +35 -35
  38. package/dist/shaam-uniform-format-generator/src/types/enums.d.ts +71 -71
  39. package/package.json +2 -2
  40. package/src/__generated__/types.ts +327 -620
  41. package/src/modules/contracts/helpers/contracts.helper.ts +22 -0
  42. package/src/modules/documents/__generated__/types.ts +121 -7
  43. package/src/modules/documents/helpers/common.helper.ts +21 -0
  44. package/src/modules/{green-invoice → documents}/helpers/issue-document.helper.ts +104 -44
  45. package/src/modules/documents/index.ts +9 -2
  46. package/src/modules/documents/resolvers/documents-issuing.resolver.ts +554 -0
  47. package/src/modules/documents/typeDefs/documents-issuing.graphql.ts +228 -0
  48. package/src/modules/green-invoice/__generated__/types.ts +6 -137
  49. package/src/modules/green-invoice/helpers/green-invoice.helper.ts +195 -201
  50. package/src/modules/green-invoice/resolvers/green-invoice.resolvers.ts +5 -520
  51. package/src/modules/green-invoice/typeDefs/green-invoice.graphql.ts +4 -512
  52. package/dist/server/src/modules/green-invoice/helpers/contract-to-draft.helper.d.ts +0 -7
  53. package/dist/server/src/modules/green-invoice/helpers/contract-to-draft.helper.js +0 -53
  54. package/dist/server/src/modules/green-invoice/helpers/contract-to-draft.helper.js.map +0 -1
  55. package/dist/server/src/modules/green-invoice/helpers/issue-document.helper.d.ts +0 -19
  56. package/dist/server/src/modules/green-invoice/helpers/issue-document.helper.js.map +0 -1
  57. package/src/modules/green-invoice/helpers/contract-to-draft.helper.ts +0 -69
@@ -1,79 +1,24 @@
1
1
  import { gql } from 'graphql-modules';
2
2
  export default gql `
3
3
  extend type Query {
4
- newDocumentInfoDraftByCharge(chargeId: UUID!): NewDocumentInfo! @auth(role: ACCOUNTANT)
5
- newDocumentInfoDraftByDocument(documentId: UUID!): NewDocumentInfo! @auth(role: ACCOUNTANT)
6
- clientMonthlyChargesDrafts(issueMonth: TimelessDate!): [NewDocumentInfo!]!
7
- @auth(role: ACCOUNTANT)
8
- clientChargesDraftsByContracts(
9
- issueMonth: TimelessDate!
10
- contractIds: [UUID!]!
11
- ): [NewDocumentInfo!]! @auth(role: ACCOUNTANT)
12
- clientMonthlyChargeDraft(clientId: UUID!, issueMonth: TimelessDate!): NewDocumentInfo!
13
- @auth(role: ACCOUNTANT)
14
4
  greenInvoiceClient(clientId: UUID!): GreenInvoiceClient! @auth(role: ACCOUNTANT)
15
5
  }
16
6
 
17
7
  extend type Mutation {
18
- fetchIncomeDocuments(ownerId: UUID!, singlePageLimit: Boolean): [Document!]! @auth(role: ADMIN)
19
- issueGreenInvoiceDocuments(
20
- generateDocumentsInfo: [NewDocumentInput!]!
21
- ): GenerateMonthlyClientDocumentsResult! @auth(role: ACCOUNTANT)
22
- previewGreenInvoiceDocument(input: NewDocumentInput!): FileScalar! @auth(role: ACCOUNTANT)
23
- issueGreenInvoiceDocument(
24
- input: NewDocumentInput!
25
- emailContent: String
26
- attachment: Boolean
27
- chargeId: UUID
28
- sendEmail: Boolean
29
- ): Charge! @auth(role: ACCOUNTANT)
8
+ syncGreenInvoiceDocuments(ownerId: UUID!, singlePageLimit: Boolean): [Document!]!
9
+ @auth(role: ADMIN)
30
10
  }
31
11
  extend type IssuedDocumentInfo {
32
- originalDocument: NewDocumentInfo
12
+ originalDocument: DocumentDraft
33
13
  }
34
14
 
35
15
  extend type ClientIntegrations {
36
16
  greenInvoiceInfo: GreenInvoiceClient
37
17
  }
38
18
 
39
- " result type for generateMonthlyClientDocuments" # eslint-disable-next-line @graphql-eslint/strict-id-in-types -- no current solution for this
40
- type GenerateMonthlyClientDocumentsResult {
41
- success: Boolean!
42
- errors: [String!]
43
- }
44
-
45
- " for previewing/issuing document "
46
- type NewDocumentInfo {
47
- description: String
48
- remarks: String
49
- footer: String
50
- type: DocumentType!
51
- date: String
52
- dueDate: String
53
- lang: GreenInvoiceDocumentLang!
54
- currency: Currency!
55
- vatType: GreenInvoiceVatType!
56
- discount: GreenInvoiceDiscount
57
- rounding: Boolean
58
- signed: Boolean
59
- maxPayments: Int
60
- client: GreenInvoiceClient
61
- income: [GreenInvoiceIncome!]
62
- payment: [GreenInvoicePayment!]
63
- linkedDocumentIds: [String!]
64
- linkedPaymentId: String
65
- linkType: GreenInvoiceLinkType
66
- }
67
-
68
- " discount info "
69
- type GreenInvoiceDiscount {
70
- amount: Float!
71
- type: GreenInvoiceDiscountType!
72
- }
73
-
74
19
  " client info "
75
20
  type GreenInvoiceClient {
76
- country: GreenInvoiceCountry
21
+ country: Country
77
22
  emails: [String!]
78
23
  greenInvoiceId: ID
79
24
  businessId: UUID!
@@ -88,458 +33,5 @@ export default gql `
88
33
  mobile: String
89
34
  add: Boolean
90
35
  }
91
-
92
- " income info "
93
- type GreenInvoiceIncome {
94
- currency: Currency!
95
- currencyRate: Float
96
- description: String!
97
- itemId: String
98
- price: Float!
99
- quantity: Float!
100
- vatRate: Float
101
- vatType: GreenInvoiceVatType!
102
- }
103
-
104
- " payment info "
105
- type GreenInvoicePayment {
106
- currency: Currency!
107
- currencyRate: Float
108
- date: String
109
- price: Float!
110
- type: GreenInvoicePaymentType!
111
- subType: GreenInvoicePaymentSubType
112
- bankName: String
113
- bankBranch: String
114
- bankAccount: String
115
- chequeNum: String
116
- accountId: String
117
- transactionId: String
118
- appType: GreenInvoicePaymentAppType
119
- cardType: GreenInvoicePaymentCardType
120
- cardNum: String
121
- dealType: GreenInvoicePaymentDealType
122
- numPayments: Int
123
- firstPayment: Float
124
- }
125
-
126
- " input for previewing document "
127
- input NewDocumentInput {
128
- description: String
129
- remarks: String
130
- footer: String
131
- type: DocumentType!
132
- date: String
133
- dueDate: String
134
- lang: GreenInvoiceDocumentLang!
135
- currency: Currency!
136
- vatType: GreenInvoiceVatType!
137
- discount: GreenInvoiceDiscountInput
138
- rounding: Boolean
139
- signed: Boolean
140
- maxPayments: Int
141
- client: GreenInvoiceClientInput
142
- income: [GreenInvoicePaymentIncomeInput!]
143
- payment: [GreenInvoicePaymentInput!]
144
- linkedDocumentIds: [String!]
145
- linkedPaymentId: String
146
- linkType: GreenInvoiceLinkType
147
- }
148
-
149
- " discount input "
150
- input GreenInvoiceDiscountInput {
151
- amount: Float!
152
- type: GreenInvoiceDiscountType!
153
- }
154
-
155
- " client input "
156
- input GreenInvoiceClientInput {
157
- country: GreenInvoiceCountry
158
- emails: [String!]
159
- greenInvoiceId: String
160
- businessId: UUID!
161
- name: String
162
- phone: String
163
- taxId: String
164
- self: Boolean
165
- address: String
166
- city: String
167
- zip: String
168
- fax: String
169
- mobile: String
170
- add: Boolean
171
- }
172
-
173
- " income input "
174
- input GreenInvoicePaymentIncomeInput {
175
- amount: Float
176
- amountTotal: Float
177
- catalogNum: String
178
- currency: Currency!
179
- currencyRate: Float
180
- description: String!
181
- itemId: String
182
- price: Float!
183
- quantity: Float!
184
- vat: Float
185
- vatRate: Float
186
- vatType: GreenInvoiceVatType!
187
- }
188
-
189
- " payment input "
190
- input GreenInvoicePaymentInput {
191
- currency: Currency!
192
- currencyRate: Float
193
- date: String
194
- price: Float!
195
- type: GreenInvoicePaymentType!
196
- subType: GreenInvoicePaymentSubType
197
- bankName: String
198
- bankBranch: String
199
- bankAccount: String
200
- chequeNum: String
201
- accountId: String
202
- transactionId: String
203
- appType: GreenInvoicePaymentAppType
204
- cardType: GreenInvoicePaymentCardType
205
- cardNum: String
206
- dealType: GreenInvoicePaymentDealType
207
- numPayments: Int
208
- firstPayment: Float
209
- }
210
-
211
- " document language enum "
212
- enum GreenInvoiceDocumentLang {
213
- ENGLISH
214
- HEBREW
215
- }
216
-
217
- " VAT type enum "
218
- enum GreenInvoiceVatType {
219
- DEFAULT
220
- EXEMPT
221
- MIXED
222
- }
223
-
224
- " discount type enum "
225
- enum GreenInvoiceDiscountType {
226
- SUM
227
- PERCENTAGE
228
- }
229
-
230
- " country enum (abbreviated for brevity - add more as needed) "
231
- enum GreenInvoiceCountry {
232
- UG
233
- UZ
234
- AT
235
- AU
236
- UA
237
- UY
238
- AZ
239
- CX
240
- AE
241
- IT
242
- BS
243
- GS
244
- UM
245
- VI
246
- VG
247
- HM
248
- TC
249
- MP
250
- MH
251
- SB
252
- FO
253
- FK
254
- FJ
255
- KM
256
- CK
257
- CC
258
- KY
259
- ID
260
- IS
261
- IE
262
- IR
263
- SV
264
- AL
265
- DZ
266
- AX
267
- AO
268
- AI
269
- AD
270
- AQ
271
- AG
272
- EE
273
- AF
274
- EC
275
- AR
276
- US
277
- AW
278
- ER
279
- AM
280
- ET
281
- BT
282
- BV
283
- BW
284
- BG
285
- BO
286
- BA
287
- BI
288
- BF
289
- BH
290
- BY
291
- BE
292
- BZ
293
- BD
294
- BJ
295
- BB
296
- BN
297
- BR
298
- GB
299
- BM
300
- DJ
301
- JM
302
- JE
303
- GA
304
- GE
305
- GH
306
- GT
307
- GU
308
- GP
309
- GY
310
- GI
311
- GN
312
- GW
313
- GQ
314
- GF
315
- GM
316
- GL
317
- DE
318
- GD
319
- GG
320
- DM
321
- DK
322
- ZA
323
- SS
324
- KR
325
- IM
326
- NF
327
- HT
328
- MV
329
- BQ
330
- IN
331
- NL
332
- HK
333
- HU
334
- HN
335
- IO
336
- TF
337
- PH
338
- DO
339
- CD
340
- CF
341
- PS
342
- WF
343
- VN
344
- VU
345
- VE
346
- VA
347
- ZW
348
- ZM
349
- CI
350
- TJ
351
- TV
352
- TG
353
- TO
354
- TN
355
- TK
356
- TR
357
- TM
358
- TW
359
- TZ
360
- TT
361
- GR
362
- JP
363
- JO
364
- IL
365
- KW
366
- CV
367
- LA
368
- LB
369
- LY
370
- LU
371
- LV
372
- LR
373
- LT
374
- LI
375
- LS
376
- MR
377
- MU
378
- ML
379
- MG
380
- MZ
381
- MD
382
- MN
383
- ME
384
- MS
385
- MC
386
- TL
387
- MM
388
- YT
389
- FM
390
- MW
391
- MY
392
- MT
393
- EG
394
- MO
395
- MK
396
- MX
397
- MA
398
- MQ
399
- NR
400
- NO
401
- NG
402
- NZ
403
- NU
404
- NE
405
- NI
406
- NA
407
- NP
408
- ST
409
- SJ
410
- EH
411
- SD
412
- SZ
413
- SO
414
- SY
415
- SR
416
- SL
417
- SC
418
- CN
419
- SG
420
- SI
421
- SK
422
- WS
423
- AS
424
- BL
425
- MF
426
- SM
427
- PM
428
- SN
429
- SH
430
- VC
431
- LC
432
- SX
433
- KN
434
- SA
435
- ES
436
- RS
437
- LK
438
- OM
439
- IQ
440
- PW
441
- PL
442
- PF
443
- PR
444
- PT
445
- PN
446
- FI
447
- PA
448
- PG
449
- PK
450
- PY
451
- PE
452
- TD
453
- CL
454
- CZ
455
- KP
456
- FR
457
- CU
458
- CO
459
- CG
460
- XK
461
- CR
462
- CW
463
- KZ
464
- QA
465
- KG
466
- KI
467
- NC
468
- KH
469
- CM
470
- CA
471
- KE
472
- CY
473
- HR
474
- RE
475
- RW
476
- RO
477
- RU
478
- SE
479
- CH
480
- TH
481
- YE
482
- }
483
-
484
- " payment sub type enum "
485
- enum GreenInvoicePaymentSubType {
486
- BITCOIN
487
- MONEY_EQUAL
488
- V_CHECK
489
- GIFT_CARD
490
- NII_EMPLOYEE_DEDUCTION
491
- ETHEREUM
492
- BUYME_VOUCHER
493
- PAYONEER
494
- }
495
-
496
- " payment app type enum "
497
- enum GreenInvoicePaymentAppType {
498
- BIT
499
- PAY_BY_PEPPER
500
- PAYBOX
501
- CULO
502
- GOOGLE_PAY
503
- APPLE_PAY
504
- }
505
-
506
- " card type enum "
507
- enum GreenInvoicePaymentCardType {
508
- UNKNOWN
509
- ISRACARD
510
- VISA
511
- MASTERCARD
512
- AMERICAN_EXPRESS
513
- DINERS
514
- }
515
-
516
- " deal type enum "
517
- enum GreenInvoicePaymentDealType {
518
- STANDARD
519
- PAYMENTS
520
- CREDIT
521
- DEFERRED
522
- OTHER
523
- RECURRING
524
- }
525
-
526
- " payment type enum "
527
- enum GreenInvoicePaymentType {
528
- TAX_DEDUCTION
529
- CASH
530
- CHEQUE
531
- CREDIT_CARD
532
- WIRE_TRANSFER
533
- PAYPAL
534
- OTHER_DEDUCTION
535
- PAYMENT_APP
536
- OTHER
537
- }
538
-
539
- " link type enum "
540
- enum GreenInvoiceLinkType {
541
- LINK
542
- CANCEL
543
- }
544
36
  `;
545
37
  //# sourceMappingURL=green-invoice.graphql.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"green-invoice.graphql.js","sourceRoot":"","sources":["../../../../../../src/modules/green-invoice/typeDefs/green-invoice.graphql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8hBjB,CAAC"}
1
+ {"version":3,"file":"green-invoice.graphql.js","sourceRoot":"","sources":["../../../../../../src/modules/green-invoice/typeDefs/green-invoice.graphql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCjB,CAAC"}
@@ -18,62 +18,62 @@ export declare const B110Schema: z.ZodObject<{
18
18
  customerSupplierAddressCountry: z.ZodOptional<z.ZodString>;
19
19
  countryCode: z.ZodOptional<z.ZodEnum<{
20
20
  ID: "ID";
21
- AE: "AE";
22
- AR: "AR";
23
21
  AT: "AT";
24
22
  AU: "AU";
25
- BE: "BE";
23
+ UA: "UA";
24
+ AE: "AE";
25
+ IT: "IT";
26
+ IE: "IE";
27
+ EE: "EE";
28
+ AR: "AR";
29
+ US: "US";
26
30
  BG: "BG";
31
+ BE: "BE";
27
32
  BR: "BR";
28
- CA: "CA";
29
- CH: "CH";
30
- CL: "CL";
31
- CN: "CN";
32
- CY: "CY";
33
- CZ: "CZ";
33
+ GB: "GB";
34
34
  DE: "DE";
35
35
  DK: "DK";
36
- EE: "EE";
37
- EG: "EG";
38
- ES: "ES";
39
- FI: "FI";
40
- FR: "FR";
41
- GB: "GB";
42
- GR: "GR";
36
+ ZA: "ZA";
37
+ KR: "KR";
38
+ IN: "IN";
39
+ NL: "NL";
43
40
  HK: "HK";
44
- HR: "HR";
45
41
  HU: "HU";
46
- IE: "IE";
47
- IL: "IL";
48
- IN: "IN";
49
- IT: "IT";
42
+ PH: "PH";
43
+ VN: "VN";
44
+ TR: "TR";
45
+ GR: "GR";
50
46
  JP: "JP";
51
- KR: "KR";
52
- LT: "LT";
47
+ IL: "IL";
53
48
  LU: "LU";
54
49
  LV: "LV";
50
+ LT: "LT";
51
+ MY: "MY";
55
52
  MT: "MT";
53
+ EG: "EG";
56
54
  MX: "MX";
57
- MY: "MY";
58
- NL: "NL";
59
55
  NO: "NO";
60
56
  NZ: "NZ";
61
- PH: "PH";
57
+ CN: "CN";
58
+ SG: "SG";
59
+ SI: "SI";
60
+ SK: "SK";
61
+ SA: "SA";
62
+ ES: "ES";
62
63
  PL: "PL";
63
64
  PT: "PT";
65
+ FI: "FI";
66
+ CL: "CL";
67
+ CZ: "CZ";
68
+ FR: "FR";
69
+ CA: "CA";
70
+ CY: "CY";
71
+ HR: "HR";
64
72
  RO: "RO";
65
73
  RU: "RU";
66
- SA: "SA";
67
74
  SE: "SE";
68
- SG: "SG";
69
- SI: "SI";
70
- SK: "SK";
75
+ CH: "CH";
71
76
  TH: "TH";
72
- TR: "TR";
73
- UA: "UA";
74
- US: "US";
75
- VN: "VN";
76
- ZA: "ZA";
77
77
  }>>;
78
78
  parentAccountKey: z.ZodOptional<z.ZodString>;
79
79
  accountOpeningBalance: z.ZodNumber;