@spaceinvoices/react-ui 0.4.8 → 0.4.11

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 (276) hide show
  1. package/README.md +24 -8
  2. package/cli/dist/index.js +89 -26
  3. package/package.json +4 -1
  4. package/spaceinvoices.schema.json +6 -1
  5. package/src/common/autocomplete.tsx +69 -6
  6. package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +124 -285
  7. package/src/components/advance-invoices/list/list-table.tsx +10 -3
  8. package/src/components/advance-invoices/list/locales/de.ts +2 -0
  9. package/src/components/advance-invoices/list/locales/en.ts +1 -0
  10. package/src/components/advance-invoices/list/locales/es.ts +1 -0
  11. package/src/components/advance-invoices/list/locales/fr.ts +1 -0
  12. package/src/components/advance-invoices/list/locales/hr.ts +1 -0
  13. package/src/components/advance-invoices/list/locales/it.ts +1 -0
  14. package/src/components/advance-invoices/list/locales/nl.ts +1 -0
  15. package/src/components/advance-invoices/list/locales/pl.ts +1 -0
  16. package/src/components/advance-invoices/list/locales/pt.ts +1 -0
  17. package/src/components/advance-invoices/list/locales/sl.ts +1 -0
  18. package/src/components/advance-invoices/list/use-advance-invoice-download.ts +1 -12
  19. package/src/components/credit-notes/create/create-credit-note-form.tsx +116 -238
  20. package/src/components/credit-notes/list/list-table.tsx +6 -3
  21. package/src/components/credit-notes/list/use-credit-note-download.ts +1 -12
  22. package/src/components/customers/customer-autocomplete.tsx +64 -11
  23. package/src/components/customers/customer-list-table/customer-list-table.tsx +3 -2
  24. package/src/components/dashboard/collection-rate-card/collection-rate-card.tsx +9 -1
  25. package/src/components/dashboard/collection-rate-card/locales/bg.ts +3 -0
  26. package/src/components/dashboard/collection-rate-card/locales/cs.ts +3 -0
  27. package/src/components/dashboard/collection-rate-card/locales/et.ts +3 -0
  28. package/src/components/dashboard/collection-rate-card/locales/fi.ts +3 -0
  29. package/src/components/dashboard/collection-rate-card/locales/is.ts +3 -0
  30. package/src/components/dashboard/collection-rate-card/locales/nb.ts +3 -0
  31. package/src/components/dashboard/collection-rate-card/locales/sk.ts +3 -0
  32. package/src/components/dashboard/collection-rate-card/locales/sv.ts +3 -0
  33. package/src/components/dashboard/invoice-status-chart/invoice-status-chart.tsx +10 -2
  34. package/src/components/dashboard/invoice-status-chart/locales/bg.ts +10 -0
  35. package/src/components/dashboard/invoice-status-chart/locales/cs.ts +10 -0
  36. package/src/components/dashboard/invoice-status-chart/locales/de.ts +1 -0
  37. package/src/components/dashboard/invoice-status-chart/locales/es.ts +1 -0
  38. package/src/components/dashboard/invoice-status-chart/locales/et.ts +10 -0
  39. package/src/components/dashboard/invoice-status-chart/locales/fi.ts +10 -0
  40. package/src/components/dashboard/invoice-status-chart/locales/fr.ts +1 -0
  41. package/src/components/dashboard/invoice-status-chart/locales/hr.ts +1 -0
  42. package/src/components/dashboard/invoice-status-chart/locales/is.ts +10 -0
  43. package/src/components/dashboard/invoice-status-chart/locales/it.ts +1 -0
  44. package/src/components/dashboard/invoice-status-chart/locales/nb.ts +10 -0
  45. package/src/components/dashboard/invoice-status-chart/locales/nl.ts +1 -0
  46. package/src/components/dashboard/invoice-status-chart/locales/pl.ts +1 -0
  47. package/src/components/dashboard/invoice-status-chart/locales/pt.ts +1 -0
  48. package/src/components/dashboard/invoice-status-chart/locales/sk.ts +10 -0
  49. package/src/components/dashboard/invoice-status-chart/locales/sl.ts +1 -0
  50. package/src/components/dashboard/invoice-status-chart/locales/sv.ts +10 -0
  51. package/src/components/dashboard/payment-methods-chart/locales/bg.ts +12 -0
  52. package/src/components/dashboard/payment-methods-chart/locales/cs.ts +12 -0
  53. package/src/components/dashboard/payment-methods-chart/locales/et.ts +12 -0
  54. package/src/components/dashboard/payment-methods-chart/locales/fi.ts +12 -0
  55. package/src/components/dashboard/payment-methods-chart/locales/is.ts +12 -0
  56. package/src/components/dashboard/payment-methods-chart/locales/nb.ts +12 -0
  57. package/src/components/dashboard/payment-methods-chart/locales/sk.ts +12 -0
  58. package/src/components/dashboard/payment-methods-chart/locales/sv.ts +12 -0
  59. package/src/components/dashboard/payment-methods-chart/payment-methods-chart.tsx +9 -1
  60. package/src/components/dashboard/payment-trend-chart/locales/bg.ts +6 -0
  61. package/src/components/dashboard/payment-trend-chart/locales/cs.ts +6 -0
  62. package/src/components/dashboard/payment-trend-chart/locales/de.ts +1 -0
  63. package/src/components/dashboard/payment-trend-chart/locales/es.ts +1 -0
  64. package/src/components/dashboard/payment-trend-chart/locales/et.ts +6 -0
  65. package/src/components/dashboard/payment-trend-chart/locales/fi.ts +6 -0
  66. package/src/components/dashboard/payment-trend-chart/locales/fr.ts +1 -0
  67. package/src/components/dashboard/payment-trend-chart/locales/hr.ts +1 -0
  68. package/src/components/dashboard/payment-trend-chart/locales/is.ts +6 -0
  69. package/src/components/dashboard/payment-trend-chart/locales/it.ts +1 -0
  70. package/src/components/dashboard/payment-trend-chart/locales/nb.ts +6 -0
  71. package/src/components/dashboard/payment-trend-chart/locales/nl.ts +1 -0
  72. package/src/components/dashboard/payment-trend-chart/locales/pl.ts +1 -0
  73. package/src/components/dashboard/payment-trend-chart/locales/pt.ts +1 -0
  74. package/src/components/dashboard/payment-trend-chart/locales/sk.ts +6 -0
  75. package/src/components/dashboard/payment-trend-chart/locales/sl.ts +1 -0
  76. package/src/components/dashboard/payment-trend-chart/locales/sv.ts +6 -0
  77. package/src/components/dashboard/payment-trend-chart/payment-trend-chart.tsx +15 -8
  78. package/src/components/dashboard/revenue-trend-chart/locales/bg.ts +6 -0
  79. package/src/components/dashboard/revenue-trend-chart/locales/cs.ts +6 -0
  80. package/src/components/dashboard/revenue-trend-chart/locales/de.ts +1 -0
  81. package/src/components/dashboard/revenue-trend-chart/locales/es.ts +1 -0
  82. package/src/components/dashboard/revenue-trend-chart/locales/et.ts +6 -0
  83. package/src/components/dashboard/revenue-trend-chart/locales/fi.ts +6 -0
  84. package/src/components/dashboard/revenue-trend-chart/locales/fr.ts +1 -0
  85. package/src/components/dashboard/revenue-trend-chart/locales/hr.ts +1 -0
  86. package/src/components/dashboard/revenue-trend-chart/locales/is.ts +6 -0
  87. package/src/components/dashboard/revenue-trend-chart/locales/it.ts +1 -0
  88. package/src/components/dashboard/revenue-trend-chart/locales/nb.ts +6 -0
  89. package/src/components/dashboard/revenue-trend-chart/locales/nl.ts +1 -0
  90. package/src/components/dashboard/revenue-trend-chart/locales/pl.ts +1 -0
  91. package/src/components/dashboard/revenue-trend-chart/locales/pt.ts +1 -0
  92. package/src/components/dashboard/revenue-trend-chart/locales/sk.ts +6 -0
  93. package/src/components/dashboard/revenue-trend-chart/locales/sl.ts +1 -0
  94. package/src/components/dashboard/revenue-trend-chart/locales/sv.ts +6 -0
  95. package/src/components/dashboard/revenue-trend-chart/revenue-trend-chart.tsx +15 -8
  96. package/src/components/dashboard/tax-collected-card/locales.ts +110 -0
  97. package/src/components/dashboard/tax-collected-card/tax-collected-card.tsx +8 -2
  98. package/src/components/dashboard/tax-collected-card/use-tax-collected.ts +4 -4
  99. package/src/components/dashboard/top-customers-chart/locales/bg.ts +7 -0
  100. package/src/components/dashboard/top-customers-chart/locales/cs.ts +7 -0
  101. package/src/components/dashboard/top-customers-chart/locales/de.ts +2 -0
  102. package/src/components/dashboard/top-customers-chart/locales/es.ts +2 -0
  103. package/src/components/dashboard/top-customers-chart/locales/et.ts +7 -0
  104. package/src/components/dashboard/top-customers-chart/locales/fi.ts +7 -0
  105. package/src/components/dashboard/top-customers-chart/locales/fr.ts +2 -0
  106. package/src/components/dashboard/top-customers-chart/locales/hr.ts +2 -0
  107. package/src/components/dashboard/top-customers-chart/locales/is.ts +7 -0
  108. package/src/components/dashboard/top-customers-chart/locales/it.ts +2 -0
  109. package/src/components/dashboard/top-customers-chart/locales/nb.ts +7 -0
  110. package/src/components/dashboard/top-customers-chart/locales/nl.ts +2 -0
  111. package/src/components/dashboard/top-customers-chart/locales/pl.ts +2 -0
  112. package/src/components/dashboard/top-customers-chart/locales/pt.ts +2 -0
  113. package/src/components/dashboard/top-customers-chart/locales/sk.ts +7 -0
  114. package/src/components/dashboard/top-customers-chart/locales/sl.ts +2 -0
  115. package/src/components/dashboard/top-customers-chart/locales/sv.ts +7 -0
  116. package/src/components/dashboard/top-customers-chart/top-customers-chart.tsx +23 -12
  117. package/src/components/delivery-notes/create/create-delivery-note-form.tsx +33 -20
  118. package/src/components/delivery-notes/list/list-table.tsx +22 -13
  119. package/src/components/delivery-notes/list/locales/de.ts +2 -0
  120. package/src/components/delivery-notes/list/locales/en.ts +1 -0
  121. package/src/components/delivery-notes/list/locales/es.ts +1 -0
  122. package/src/components/delivery-notes/list/locales/fr.ts +1 -0
  123. package/src/components/delivery-notes/list/locales/hr.ts +1 -0
  124. package/src/components/delivery-notes/list/locales/it.ts +1 -0
  125. package/src/components/delivery-notes/list/locales/nl.ts +1 -0
  126. package/src/components/delivery-notes/list/locales/pl.ts +1 -0
  127. package/src/components/delivery-notes/list/locales/pt.ts +1 -0
  128. package/src/components/delivery-notes/list/locales/sl.ts +1 -0
  129. package/src/components/delivery-notes/list/use-delivery-note-download.ts +1 -12
  130. package/src/components/documents/create/document-add-item-form.tsx +28 -16
  131. package/src/components/documents/create/document-add-item-tax-rate-field.tsx +12 -2
  132. package/src/components/documents/create/document-items-section.tsx +70 -39
  133. package/src/components/documents/create/document-recipient-section.tsx +10 -1
  134. package/src/components/documents/create/live-preview.tsx +113 -15
  135. package/src/components/documents/create/prepare-document-submission.ts +35 -16
  136. package/src/components/documents/create/use-document-customer-form.ts +14 -3
  137. package/src/components/documents/documents.hooks.ts +7 -2
  138. package/src/components/documents/shared/document-preview-display.tsx +136 -67
  139. package/src/components/documents/shared/scaled-document-preview.tsx +45 -5
  140. package/src/components/documents/view/document-actions-bar.tsx +284 -182
  141. package/src/components/documents/view/document-activities-list.tsx +3 -0
  142. package/src/components/documents/view/document-payments-list.tsx +3 -0
  143. package/src/components/documents/view/locales/de.ts +8 -0
  144. package/src/components/documents/view/locales/es.ts +8 -0
  145. package/src/components/documents/view/locales/fr.ts +8 -0
  146. package/src/components/documents/view/locales/hr.ts +8 -0
  147. package/src/components/documents/view/locales/it.ts +8 -0
  148. package/src/components/documents/view/locales/nl.ts +8 -0
  149. package/src/components/documents/view/locales/pl.ts +8 -0
  150. package/src/components/documents/view/locales/pt.ts +8 -0
  151. package/src/components/documents/view/locales/sl.ts +8 -0
  152. package/src/components/documents/view/use-document-download.ts +14 -25
  153. package/src/components/entities/create-entity-form.tsx +101 -16
  154. package/src/components/entities/entity-settings-form/entity-settings-form.tsx +10 -10
  155. package/src/components/entities/entity-settings-form/locales/de.ts +10 -0
  156. package/src/components/entities/entity-settings-form/locales/es.ts +10 -0
  157. package/src/components/entities/entity-settings-form/locales/fr.ts +10 -0
  158. package/src/components/entities/entity-settings-form/locales/hr.ts +10 -0
  159. package/src/components/entities/entity-settings-form/locales/it.ts +10 -0
  160. package/src/components/entities/entity-settings-form/locales/nl.ts +10 -0
  161. package/src/components/entities/entity-settings-form/locales/pl.ts +10 -0
  162. package/src/components/entities/entity-settings-form/locales/pt.ts +10 -0
  163. package/src/components/entities/entity-settings-form/locales/sl.ts +10 -0
  164. package/src/components/entities/fina-settings-form/fina-operator-required-dialog.tsx +3 -3
  165. package/src/components/entities/fina-settings-form/fina-settings-form.tsx +78 -124
  166. package/src/components/entities/fina-settings-form/sections/certificate-settings-section.tsx +8 -1
  167. package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +14 -2
  168. package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +7 -2
  169. package/src/components/entities/furs-settings-form/furs-settings-form.tsx +56 -130
  170. package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx +8 -1
  171. package/src/components/entities/furs-settings-form/sections/enable-fiscalization-section.tsx +1 -0
  172. package/src/components/entities/furs-settings-form/sections/general-settings-section.tsx +15 -2
  173. package/src/components/entities/furs-settings-form/sections/premises-management-section.tsx +20 -3
  174. package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +38 -12
  175. package/src/components/entities/settings/defaults-settings-form.tsx +6 -6
  176. package/src/components/entities/settings/eslog-settings-form.tsx +13 -1
  177. package/src/components/entities/settings/pdf-template-selector/demo-invoice-data.ts +3 -22
  178. package/src/components/entities/shared/fiscalization-step-flow.ts +77 -0
  179. package/src/components/entities/shared/fiscalization-step-tabs.tsx +71 -0
  180. package/src/components/estimates/create/create-estimate-form.tsx +34 -21
  181. package/src/components/estimates/list/list-table.tsx +23 -14
  182. package/src/components/estimates/list/locales/de.ts +2 -0
  183. package/src/components/estimates/list/locales/en.ts +1 -0
  184. package/src/components/estimates/list/locales/es.ts +1 -0
  185. package/src/components/estimates/list/locales/fr.ts +1 -0
  186. package/src/components/estimates/list/locales/hr.ts +1 -0
  187. package/src/components/estimates/list/locales/it.ts +1 -0
  188. package/src/components/estimates/list/locales/nl.ts +1 -0
  189. package/src/components/estimates/list/locales/pl.ts +1 -0
  190. package/src/components/estimates/list/locales/pt.ts +1 -0
  191. package/src/components/estimates/list/locales/sl.ts +1 -0
  192. package/src/components/estimates/list/use-estimate-download.ts +1 -12
  193. package/src/components/export/document-export-form.tsx +33 -7
  194. package/src/components/export/sales-per-item-export-form.tsx +23 -7
  195. package/src/components/invoices/create/create-invoice-form.tsx +295 -329
  196. package/src/components/invoices/create/prepare-invoice-submission.ts +0 -8
  197. package/src/components/invoices/list/list-table.tsx +7 -4
  198. package/src/components/invoices/list/use-invoice-download.ts +1 -11
  199. package/src/components/invoices/send-email-dialog/locales/de.ts +20 -0
  200. package/src/components/invoices/send-email-dialog/locales/es.ts +20 -0
  201. package/src/components/invoices/send-email-dialog/locales/fr.ts +20 -0
  202. package/src/components/invoices/send-email-dialog/locales/hr.ts +20 -0
  203. package/src/components/invoices/send-email-dialog/locales/it.ts +20 -0
  204. package/src/components/invoices/send-email-dialog/locales/nl.ts +20 -0
  205. package/src/components/invoices/send-email-dialog/locales/pl.ts +20 -0
  206. package/src/components/invoices/send-email-dialog/locales/pt.ts +20 -0
  207. package/src/components/invoices/send-email-dialog/locales/sl.ts +20 -0
  208. package/src/components/invoices/send-email-dialog/send-email-dialog.tsx +77 -8
  209. package/src/components/invoices/view/eslog-info-display.tsx +17 -1
  210. package/src/components/invoices/view/fiscalization-status-card.tsx +7 -3
  211. package/src/components/items/item-combobox.tsx +26 -6
  212. package/src/components/items/item-list-table/item-list-table.tsx +5 -2
  213. package/src/components/payments/create-payment-form/index.ts +1 -0
  214. package/src/components/payments/list/list-table.tsx +14 -4
  215. package/src/components/recurring-invoices/list/list-table.tsx +7 -4
  216. package/src/components/request-logs/locales.ts +412 -0
  217. package/src/components/request-logs/request-log-detail.tsx +37 -21
  218. package/src/components/request-logs/request-log-list-table.tsx +57 -11
  219. package/src/components/table/data-table.tsx +5 -2
  220. package/src/components/table/date-cell.tsx +3 -1
  221. package/src/components/table/filter-bar.tsx +14 -2
  222. package/src/components/table/hooks/use-table-query.ts +1 -1
  223. package/src/components/table/locales.ts +1116 -0
  224. package/src/components/table/search-input.tsx +12 -3
  225. package/src/components/table/selection-toolbar.tsx +23 -6
  226. package/src/components/table/table-empty-state.tsx +43 -3
  227. package/src/components/table/table-no-results.tsx +3 -3
  228. package/src/components/table/table-pagination.tsx +4 -3
  229. package/src/components/table/types.ts +1 -0
  230. package/src/components/tax-reports/index.ts +1 -0
  231. package/src/components/tax-reports/kir-export-form.tsx +46 -8
  232. package/src/components/tax-reports/slovenia-tax-profile-step.tsx +191 -0
  233. package/src/components/tax-reports/slovenia-yearly-export-form.tsx +509 -0
  234. package/src/components/tax-reports/slovenia-yearly-review-step.tsx +253 -0
  235. package/src/components/tax-reports/slovenia-yearly-summary.tsx +19 -0
  236. package/src/components/taxes/tax-list-table/tax-list-table.tsx +3 -2
  237. package/src/components/ui/sidebar.tsx +3 -2
  238. package/src/components/ui/sticky-form-footer.tsx +7 -1
  239. package/src/components/webhook-logs/index.ts +6 -0
  240. package/src/components/webhook-logs/locales.ts +392 -0
  241. package/src/components/webhook-logs/webhook-delivery-detail.tsx +255 -0
  242. package/src/components/webhook-logs/webhook-delivery-list-table.tsx +278 -0
  243. package/src/components/wl-subscription/index.ts +1 -0
  244. package/src/components/wl-subscription/locked-feature.tsx +1 -0
  245. package/src/components/wl-subscription/paywall.tsx +193 -0
  246. package/src/components/wl-subscription/upgrade-modal.tsx +93 -29
  247. package/src/generate-schemas.ts +12 -7
  248. package/src/generated/schemas/customer.ts +2 -0
  249. package/src/generated/schemas/entity.ts +134 -0
  250. package/src/generated/schemas/exportsloveniayearlynormiranireport_body.ts +27 -0
  251. package/src/generated/schemas/index.ts +2 -0
  252. package/src/generated/schemas/me.ts +20 -1
  253. package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +40 -34
  254. package/src/generated/schemas/rendercreditnotepreview_body.ts +42 -36
  255. package/src/generated/schemas/renderdeliverynotepreview_body.ts +23 -13
  256. package/src/generated/schemas/renderestimatepreview_body.ts +23 -13
  257. package/src/generated/schemas/renderinvoicepreview_body.ts +40 -34
  258. package/src/generated/schemas/sendemail_body.ts +44 -0
  259. package/src/generated/schemas/sloveniataxprofile.ts +42 -0
  260. package/src/generated/schemas/startpdfexport_body.ts +91 -1
  261. package/src/generated/schemas/webhook.ts +10 -0
  262. package/src/hooks/use-duplicate-document.ts +51 -13
  263. package/src/hooks/use-eslog-validation.ts +59 -0
  264. package/src/hooks/use-premise-selection.ts +186 -0
  265. package/src/lib/browser-cookies.ts +4 -4
  266. package/src/lib/date-fns-locale.ts +48 -0
  267. package/src/lib/fiscalization-options.ts +81 -0
  268. package/src/lib/locale.ts +38 -0
  269. package/src/lib/template-variables.tsx +1 -1
  270. package/src/lib/translation.ts +14 -3
  271. package/src/providers/entities-context.tsx +1 -0
  272. package/src/providers/entities-provider.tsx +102 -3
  273. package/src/providers/form-footer-context.tsx +37 -4
  274. package/src/providers/sdk-provider.tsx +7 -2
  275. package/src/providers/white-label-provider.tsx +4 -1
  276. package/src/providers/wl-subscription-provider.tsx +90 -3
@@ -23,6 +23,7 @@ const DocumentEntity = z
23
23
  tax_number: z.union([z.string(), z.null()]),
24
24
  tax_number_2: z.union([z.string(), z.null()]),
25
25
  company_number: z.union([z.string(), z.null()]),
26
+ peppol_id: z.union([z.string(), z.null()]),
26
27
  is_end_consumer: z.union([z.boolean(), z.null()]),
27
28
  bank_account: z.union([
28
29
  z
@@ -30,13 +31,13 @@ const DocumentEntity = z
30
31
  type: z
31
32
  .enum(["iban", "us_domestic", "uk_domestic", "other"])
32
33
  .default("iban"),
33
- name: z.string(),
34
- bank_name: z.string(),
35
- iban: z.string(),
36
- account_number: z.string(),
37
- bic: z.string(),
38
- routing_number: z.string(),
39
- sort_code: z.string(),
34
+ name: z.union([z.string(), z.null()]),
35
+ bank_name: z.union([z.string(), z.null()]),
36
+ iban: z.union([z.string(), z.null()]),
37
+ account_number: z.union([z.string(), z.null()]),
38
+ bic: z.union([z.string(), z.null()]),
39
+ routing_number: z.union([z.string(), z.null()]),
40
+ sort_code: z.union([z.string(), z.null()]),
40
41
  })
41
42
  .partial()
42
43
  .passthrough(),
@@ -51,7 +52,7 @@ const DocumentEntity = z
51
52
  const CreateDocumentCustomer = DocumentEntity.and(
52
53
  z.union([
53
54
  z
54
- .object({ save_customer: z.boolean().default(true) })
55
+ .object({ save_customer: z.union([z.boolean(), z.null()]) })
55
56
  .partial()
56
57
  .passthrough(),
57
58
  z.null(),
@@ -63,28 +64,24 @@ const CreateDocumentCustomer = DocumentEntity.and(
63
64
  const CreateFinaInvoiceData = z.union([
64
65
  z
65
66
  .object({
66
- business_premise_name: z
67
- .string()
68
- .min(1)
69
- .max(20)
70
- .regex(/^[0-9a-zA-Z]{1,20}$/),
71
- electronic_device_name: z
72
- .string()
73
- .min(1)
74
- .max(20)
75
- .regex(/^\d{1,20}$/),
76
- operator_oib: z.string().min(11).max(11),
77
- payment_type: z.enum([
78
- "cash",
79
- "card",
80
- "online",
81
- "bank_transfer",
82
- "paypal",
83
- "crypto",
84
- "coupon",
85
- "other",
67
+ business_premise_name: z.union([z.string(), z.null()]),
68
+ electronic_device_name: z.union([z.string(), z.null()]),
69
+ operator_oib: z.union([z.string(), z.null()]),
70
+ operator_label: z.union([z.string(), z.null()]),
71
+ payment_type: z.union([
72
+ z.enum([
73
+ "cash",
74
+ "card",
75
+ "online",
76
+ "bank_transfer",
77
+ "paypal",
78
+ "crypto",
79
+ "coupon",
80
+ "other",
81
+ ]),
82
+ z.null(),
86
83
  ]),
87
- subsequent_submit: z.boolean(),
84
+ subsequent_submit: z.union([z.boolean(), z.null()]),
88
85
  })
89
86
  .partial(),
90
87
  z.null(),
@@ -109,9 +106,9 @@ const PartialCreditNotePreview = z.object({
109
106
  currency_code: z.string().max(3).optional(),
110
107
  metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
111
108
  reference: z.union([z.string(), z.null()]).optional(),
112
- date_due: z.union([z.string(), z.null()]).optional(),
113
109
  date_service: z.union([z.string(), z.null()]).optional(),
114
110
  date_service_to: z.union([z.string(), z.null()]).optional(),
111
+ date_due: z.union([z.string(), z.null()]).optional(),
115
112
  items: z
116
113
  .array(
117
114
  z
@@ -122,6 +119,15 @@ const PartialCreditNotePreview = z.object({
122
119
  price: z.number(),
123
120
  gross_price: z.number(),
124
121
  description: z.string(),
122
+ unit: z.string(),
123
+ discounts: z.array(
124
+ z
125
+ .object({
126
+ value: z.number(),
127
+ type: z.enum(["percent", "amount"]).optional(),
128
+ })
129
+ .passthrough()
130
+ ),
125
131
  taxes: z.array(
126
132
  z
127
133
  .object({ rate: z.number(), tax_id: z.string() })
@@ -142,7 +148,7 @@ const PartialCreditNotePreview = z.object({
142
148
  // Dependency schema for rendercreditnotepreview_body
143
149
  const DocumentItemTax = z
144
150
  .object({
145
- rate: z.number(),
151
+ rate: z.union([z.number(), z.null()]),
146
152
  tax_id: z.union([z.string(), z.null()]),
147
153
  classification: z.union([z.string(), z.null()]),
148
154
  reverse_charge: z.union([z.boolean(), z.null()]),
@@ -162,17 +168,17 @@ const LineDiscount = z.object({
162
168
  const CreateDocumentItem = z
163
169
  .object({
164
170
  type: z.union([z.literal("separator"), z.null()]),
165
- name: z.string().min(1),
171
+ name: z.union([z.string(), z.null()]),
166
172
  description: z.union([z.string(), z.null()]),
167
- price: z.number(),
173
+ price: z.union([z.number(), z.null()]),
168
174
  gross_price: z.union([z.number(), z.null()]),
169
- quantity: z.number().gte(-140737488355328).lte(140737488355327),
175
+ quantity: z.union([z.number(), z.null()]),
170
176
  unit: z.union([z.string(), z.null()]),
171
177
  taxes: z.array(DocumentItemTax),
172
178
  discounts: z.array(LineDiscount).max(5),
173
179
  item_id: z.union([z.string(), z.null()]),
174
180
  metadata: z.union([z.record(z.string(), z.any()), z.null()]),
175
- save_item: z.boolean().default(true),
181
+ save_item: z.union([z.boolean(), z.null()]),
176
182
  })
177
183
  .partial();
178
184
 
@@ -195,9 +201,9 @@ const CompleteCreditNotePreview = z.object({
195
201
  currency_code: z.string().max(3).optional(),
196
202
  metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
197
203
  reference: z.union([z.string(), z.null()]).optional(),
198
- date_due: z.union([z.string(), z.null()]).optional(),
199
204
  date_service: z.union([z.string(), z.null()]).optional(),
200
205
  date_service_to: z.union([z.string(), z.null()]).optional(),
206
+ date_due: z.union([z.string(), z.null()]).optional(),
201
207
  items: z.array(CreateDocumentItem).min(1),
202
208
  fina: CreateFinaInvoiceData.optional(),
203
209
  expected_total_with_tax: z.number().gt(0).optional(),
@@ -23,6 +23,7 @@ const DocumentEntity = z
23
23
  tax_number: z.union([z.string(), z.null()]),
24
24
  tax_number_2: z.union([z.string(), z.null()]),
25
25
  company_number: z.union([z.string(), z.null()]),
26
+ peppol_id: z.union([z.string(), z.null()]),
26
27
  is_end_consumer: z.union([z.boolean(), z.null()]),
27
28
  bank_account: z.union([
28
29
  z
@@ -30,13 +31,13 @@ const DocumentEntity = z
30
31
  type: z
31
32
  .enum(["iban", "us_domestic", "uk_domestic", "other"])
32
33
  .default("iban"),
33
- name: z.string(),
34
- bank_name: z.string(),
35
- iban: z.string(),
36
- account_number: z.string(),
37
- bic: z.string(),
38
- routing_number: z.string(),
39
- sort_code: z.string(),
34
+ name: z.union([z.string(), z.null()]),
35
+ bank_name: z.union([z.string(), z.null()]),
36
+ iban: z.union([z.string(), z.null()]),
37
+ account_number: z.union([z.string(), z.null()]),
38
+ bic: z.union([z.string(), z.null()]),
39
+ routing_number: z.union([z.string(), z.null()]),
40
+ sort_code: z.union([z.string(), z.null()]),
40
41
  })
41
42
  .partial()
42
43
  .passthrough(),
@@ -51,7 +52,7 @@ const DocumentEntity = z
51
52
  const CreateDocumentCustomer = DocumentEntity.and(
52
53
  z.union([
53
54
  z
54
- .object({ save_customer: z.boolean().default(true) })
55
+ .object({ save_customer: z.union([z.boolean(), z.null()]) })
55
56
  .partial()
56
57
  .passthrough(),
57
58
  z.null(),
@@ -91,6 +92,15 @@ const PartialDeliveryNotePreview = z.object({
91
92
  price: z.number(),
92
93
  gross_price: z.number(),
93
94
  description: z.string(),
95
+ unit: z.string(),
96
+ discounts: z.array(
97
+ z
98
+ .object({
99
+ value: z.number(),
100
+ type: z.enum(["percent", "amount"]).optional(),
101
+ })
102
+ .passthrough()
103
+ ),
94
104
  taxes: z.array(
95
105
  z
96
106
  .object({ rate: z.number(), tax_id: z.string() })
@@ -111,7 +121,7 @@ const PartialDeliveryNotePreview = z.object({
111
121
  // Dependency schema for renderdeliverynotepreview_body
112
122
  const DocumentItemTax = z
113
123
  .object({
114
- rate: z.number(),
124
+ rate: z.union([z.number(), z.null()]),
115
125
  tax_id: z.union([z.string(), z.null()]),
116
126
  classification: z.union([z.string(), z.null()]),
117
127
  reverse_charge: z.union([z.boolean(), z.null()]),
@@ -131,17 +141,17 @@ const LineDiscount = z.object({
131
141
  const CreateDocumentItem = z
132
142
  .object({
133
143
  type: z.union([z.literal("separator"), z.null()]),
134
- name: z.string().min(1),
144
+ name: z.union([z.string(), z.null()]),
135
145
  description: z.union([z.string(), z.null()]),
136
- price: z.number(),
146
+ price: z.union([z.number(), z.null()]),
137
147
  gross_price: z.union([z.number(), z.null()]),
138
- quantity: z.number().gte(-140737488355328).lte(140737488355327),
148
+ quantity: z.union([z.number(), z.null()]),
139
149
  unit: z.union([z.string(), z.null()]),
140
150
  taxes: z.array(DocumentItemTax),
141
151
  discounts: z.array(LineDiscount).max(5),
142
152
  item_id: z.union([z.string(), z.null()]),
143
153
  metadata: z.union([z.record(z.string(), z.any()), z.null()]),
144
- save_item: z.boolean().default(true),
154
+ save_item: z.union([z.boolean(), z.null()]),
145
155
  })
146
156
  .partial();
147
157
 
@@ -23,6 +23,7 @@ const DocumentEntity = z
23
23
  tax_number: z.union([z.string(), z.null()]),
24
24
  tax_number_2: z.union([z.string(), z.null()]),
25
25
  company_number: z.union([z.string(), z.null()]),
26
+ peppol_id: z.union([z.string(), z.null()]),
26
27
  is_end_consumer: z.union([z.boolean(), z.null()]),
27
28
  bank_account: z.union([
28
29
  z
@@ -30,13 +31,13 @@ const DocumentEntity = z
30
31
  type: z
31
32
  .enum(["iban", "us_domestic", "uk_domestic", "other"])
32
33
  .default("iban"),
33
- name: z.string(),
34
- bank_name: z.string(),
35
- iban: z.string(),
36
- account_number: z.string(),
37
- bic: z.string(),
38
- routing_number: z.string(),
39
- sort_code: z.string(),
34
+ name: z.union([z.string(), z.null()]),
35
+ bank_name: z.union([z.string(), z.null()]),
36
+ iban: z.union([z.string(), z.null()]),
37
+ account_number: z.union([z.string(), z.null()]),
38
+ bic: z.union([z.string(), z.null()]),
39
+ routing_number: z.union([z.string(), z.null()]),
40
+ sort_code: z.union([z.string(), z.null()]),
40
41
  })
41
42
  .partial()
42
43
  .passthrough(),
@@ -51,7 +52,7 @@ const DocumentEntity = z
51
52
  const CreateDocumentCustomer = DocumentEntity.and(
52
53
  z.union([
53
54
  z
54
- .object({ save_customer: z.boolean().default(true) })
55
+ .object({ save_customer: z.union([z.boolean(), z.null()]) })
55
56
  .partial()
56
57
  .passthrough(),
57
58
  z.null(),
@@ -92,6 +93,15 @@ const PartialEstimatePreview = z.object({
92
93
  price: z.number(),
93
94
  gross_price: z.number(),
94
95
  description: z.string(),
96
+ unit: z.string(),
97
+ discounts: z.array(
98
+ z
99
+ .object({
100
+ value: z.number(),
101
+ type: z.enum(["percent", "amount"]).optional(),
102
+ })
103
+ .passthrough()
104
+ ),
95
105
  taxes: z.array(
96
106
  z
97
107
  .object({ rate: z.number(), tax_id: z.string() })
@@ -111,7 +121,7 @@ const PartialEstimatePreview = z.object({
111
121
  // Dependency schema for renderestimatepreview_body
112
122
  const DocumentItemTax = z
113
123
  .object({
114
- rate: z.number(),
124
+ rate: z.union([z.number(), z.null()]),
115
125
  tax_id: z.union([z.string(), z.null()]),
116
126
  classification: z.union([z.string(), z.null()]),
117
127
  reverse_charge: z.union([z.boolean(), z.null()]),
@@ -131,17 +141,17 @@ const LineDiscount = z.object({
131
141
  const CreateDocumentItem = z
132
142
  .object({
133
143
  type: z.union([z.literal("separator"), z.null()]),
134
- name: z.string().min(1),
144
+ name: z.union([z.string(), z.null()]),
135
145
  description: z.union([z.string(), z.null()]),
136
- price: z.number(),
146
+ price: z.union([z.number(), z.null()]),
137
147
  gross_price: z.union([z.number(), z.null()]),
138
- quantity: z.number().gte(-140737488355328).lte(140737488355327),
148
+ quantity: z.union([z.number(), z.null()]),
139
149
  unit: z.union([z.string(), z.null()]),
140
150
  taxes: z.array(DocumentItemTax),
141
151
  discounts: z.array(LineDiscount).max(5),
142
152
  item_id: z.union([z.string(), z.null()]),
143
153
  metadata: z.union([z.record(z.string(), z.any()), z.null()]),
144
- save_item: z.boolean().default(true),
154
+ save_item: z.union([z.boolean(), z.null()]),
145
155
  })
146
156
  .partial();
147
157
 
@@ -23,6 +23,7 @@ const DocumentEntity = z
23
23
  tax_number: z.union([z.string(), z.null()]),
24
24
  tax_number_2: z.union([z.string(), z.null()]),
25
25
  company_number: z.union([z.string(), z.null()]),
26
+ peppol_id: z.union([z.string(), z.null()]),
26
27
  is_end_consumer: z.union([z.boolean(), z.null()]),
27
28
  bank_account: z.union([
28
29
  z
@@ -30,13 +31,13 @@ const DocumentEntity = z
30
31
  type: z
31
32
  .enum(["iban", "us_domestic", "uk_domestic", "other"])
32
33
  .default("iban"),
33
- name: z.string(),
34
- bank_name: z.string(),
35
- iban: z.string(),
36
- account_number: z.string(),
37
- bic: z.string(),
38
- routing_number: z.string(),
39
- sort_code: z.string(),
34
+ name: z.union([z.string(), z.null()]),
35
+ bank_name: z.union([z.string(), z.null()]),
36
+ iban: z.union([z.string(), z.null()]),
37
+ account_number: z.union([z.string(), z.null()]),
38
+ bic: z.union([z.string(), z.null()]),
39
+ routing_number: z.union([z.string(), z.null()]),
40
+ sort_code: z.union([z.string(), z.null()]),
40
41
  })
41
42
  .partial()
42
43
  .passthrough(),
@@ -51,7 +52,7 @@ const DocumentEntity = z
51
52
  const CreateDocumentCustomer = DocumentEntity.and(
52
53
  z.union([
53
54
  z
54
- .object({ save_customer: z.boolean().default(true) })
55
+ .object({ save_customer: z.union([z.boolean(), z.null()]) })
55
56
  .partial()
56
57
  .passthrough(),
57
58
  z.null(),
@@ -63,28 +64,24 @@ const CreateDocumentCustomer = DocumentEntity.and(
63
64
  const CreateFinaInvoiceData = z.union([
64
65
  z
65
66
  .object({
66
- business_premise_name: z
67
- .string()
68
- .min(1)
69
- .max(20)
70
- .regex(/^[0-9a-zA-Z]{1,20}$/),
71
- electronic_device_name: z
72
- .string()
73
- .min(1)
74
- .max(20)
75
- .regex(/^\d{1,20}$/),
76
- operator_oib: z.string().min(11).max(11),
77
- payment_type: z.enum([
78
- "cash",
79
- "card",
80
- "online",
81
- "bank_transfer",
82
- "paypal",
83
- "crypto",
84
- "coupon",
85
- "other",
67
+ business_premise_name: z.union([z.string(), z.null()]),
68
+ electronic_device_name: z.union([z.string(), z.null()]),
69
+ operator_oib: z.union([z.string(), z.null()]),
70
+ operator_label: z.union([z.string(), z.null()]),
71
+ payment_type: z.union([
72
+ z.enum([
73
+ "cash",
74
+ "card",
75
+ "online",
76
+ "bank_transfer",
77
+ "paypal",
78
+ "crypto",
79
+ "coupon",
80
+ "other",
81
+ ]),
82
+ z.null(),
86
83
  ]),
87
- subsequent_submit: z.boolean(),
84
+ subsequent_submit: z.union([z.boolean(), z.null()]),
88
85
  })
89
86
  .partial(),
90
87
  z.null(),
@@ -122,6 +119,15 @@ const PartialInvoicePreview = z.object({
122
119
  price: z.number(),
123
120
  gross_price: z.number(),
124
121
  description: z.string(),
122
+ unit: z.string(),
123
+ discounts: z.array(
124
+ z
125
+ .object({
126
+ value: z.number(),
127
+ type: z.enum(["percent", "amount"]).optional(),
128
+ })
129
+ .passthrough()
130
+ ),
125
131
  taxes: z.array(
126
132
  z
127
133
  .object({ rate: z.number(), tax_id: z.string() })
@@ -143,7 +149,7 @@ const PartialInvoicePreview = z.object({
143
149
  // Dependency schema for renderinvoicepreview_body
144
150
  const DocumentItemTax = z
145
151
  .object({
146
- rate: z.number(),
152
+ rate: z.union([z.number(), z.null()]),
147
153
  tax_id: z.union([z.string(), z.null()]),
148
154
  classification: z.union([z.string(), z.null()]),
149
155
  reverse_charge: z.union([z.boolean(), z.null()]),
@@ -163,17 +169,17 @@ const LineDiscount = z.object({
163
169
  const CreateDocumentItem = z
164
170
  .object({
165
171
  type: z.union([z.literal("separator"), z.null()]),
166
- name: z.string().min(1),
172
+ name: z.union([z.string(), z.null()]),
167
173
  description: z.union([z.string(), z.null()]),
168
- price: z.number(),
174
+ price: z.union([z.number(), z.null()]),
169
175
  gross_price: z.union([z.number(), z.null()]),
170
- quantity: z.number().gte(-140737488355328).lte(140737488355327),
176
+ quantity: z.union([z.number(), z.null()]),
171
177
  unit: z.union([z.string(), z.null()]),
172
178
  taxes: z.array(DocumentItemTax),
173
179
  discounts: z.array(LineDiscount).max(5),
174
180
  item_id: z.union([z.string(), z.null()]),
175
181
  metadata: z.union([z.record(z.string(), z.any()), z.null()]),
176
- save_item: z.boolean().default(true),
182
+ save_item: z.union([z.boolean(), z.null()]),
177
183
  })
178
184
  .partial();
179
185
 
@@ -16,6 +16,50 @@ const sendEmailSchemaDefinition = z.object({
16
16
  document_id: z.string().optional(),
17
17
  attach_pdf: z.boolean().optional().default(false),
18
18
  attach_eslog: z.boolean().optional().default(false),
19
+ locale: z
20
+ .enum([
21
+ "en-US",
22
+ "de-DE",
23
+ "it-IT",
24
+ "fr-FR",
25
+ "es-ES",
26
+ "sl-SI",
27
+ "pt-PT",
28
+ "nl-NL",
29
+ "pl-PL",
30
+ "hr-HR",
31
+ "sv-SE",
32
+ "fi-FI",
33
+ "et-EE",
34
+ "bg-BG",
35
+ "cs-CZ",
36
+ "sk-SK",
37
+ "nb-NO",
38
+ "is-IS",
39
+ ])
40
+ .optional(),
41
+ language: z
42
+ .enum([
43
+ "en-US",
44
+ "de-DE",
45
+ "it-IT",
46
+ "fr-FR",
47
+ "es-ES",
48
+ "sl-SI",
49
+ "pt-PT",
50
+ "nl-NL",
51
+ "pl-PL",
52
+ "hr-HR",
53
+ "sv-SE",
54
+ "fi-FI",
55
+ "et-EE",
56
+ "bg-BG",
57
+ "cs-CZ",
58
+ "sk-SK",
59
+ "nb-NO",
60
+ "is-IS",
61
+ ])
62
+ .optional(),
19
63
  });
20
64
 
21
65
  // Type for send email operation
@@ -0,0 +1,42 @@
1
+ /**
2
+ * This file was automatically generated using 'bun generate-schemas'.
3
+ * Do not edit this file manually. To update, run the generator again.
4
+ * @generated
5
+ */
6
+
7
+ import { z } from 'zod';
8
+
9
+ // Schemas for sloveniataxprofile endpoints
10
+
11
+ // Schema for update sloveniataxprofile operation
12
+ const updateSloveniaTaxProfileSchemaDefinition = z
13
+ .object({
14
+ business_form: z.enum(["sp", "doo", "dno", "club"]),
15
+ income_tax_regime: z.enum(["normirani", "dejanski"]),
16
+ vat_profile: z.enum(["standard", "special_vat_identified"]),
17
+ tax_residency: z.enum(["resident", "non_resident"]),
18
+ yearly_reporting: z
19
+ .object({
20
+ activity_code: z.union([z.string(), z.null()]),
21
+ registration_number: z.union([z.string(), z.null()]),
22
+ accounting_type: z.union([
23
+ z.enum(["records", "single_entry", "double_entry"]),
24
+ z.null(),
25
+ ]),
26
+ normiranec_insurance_basis: z.union([
27
+ z.enum(["full_time_self_employed", "other"]),
28
+ z.null(),
29
+ ]),
30
+ default_withholding_tax_amount: z.union([z.number(), z.null()]),
31
+ default_foreign_tax_credit_amount: z.union([z.number(), z.null()]),
32
+ })
33
+ .partial()
34
+ .passthrough(),
35
+ })
36
+ .partial()
37
+ .passthrough();
38
+
39
+ // Type for update sloveniataxprofile operation
40
+ export type UpdateSloveniaTaxProfileSchema = z.infer<typeof updateSloveniaTaxProfileSchemaDefinition>;
41
+
42
+ export const updateSloveniaTaxProfileSchema = updateSloveniaTaxProfileSchemaDefinition;
@@ -10,7 +10,53 @@ import { z } from 'zod';
10
10
 
11
11
  // Dependency schema for startpdfexport_body
12
12
  const PdfExportByDocumentIds = z
13
- .object({ document_ids: z.array(z.string()).min(1) })
13
+ .object({
14
+ document_ids: z.array(z.string()).min(1),
15
+ locale: z
16
+ .enum([
17
+ "en-US",
18
+ "de-DE",
19
+ "it-IT",
20
+ "fr-FR",
21
+ "es-ES",
22
+ "sl-SI",
23
+ "pt-PT",
24
+ "nl-NL",
25
+ "pl-PL",
26
+ "hr-HR",
27
+ "sv-SE",
28
+ "fi-FI",
29
+ "et-EE",
30
+ "bg-BG",
31
+ "cs-CZ",
32
+ "sk-SK",
33
+ "nb-NO",
34
+ "is-IS",
35
+ ])
36
+ .optional(),
37
+ language: z
38
+ .enum([
39
+ "en",
40
+ "de",
41
+ "sl",
42
+ "it",
43
+ "fr",
44
+ "es",
45
+ "pt",
46
+ "nl",
47
+ "pl",
48
+ "hr",
49
+ "sv",
50
+ "fi",
51
+ "et",
52
+ "bg",
53
+ "cs",
54
+ "sk",
55
+ "nb",
56
+ "is",
57
+ ])
58
+ .optional(),
59
+ })
14
60
  .passthrough();
15
61
 
16
62
 
@@ -30,6 +76,50 @@ const PdfExportByDateRange = z
30
76
  .min(1),
31
77
  date_from: z.string().optional(),
32
78
  date_to: z.string().optional(),
79
+ locale: z
80
+ .enum([
81
+ "en-US",
82
+ "de-DE",
83
+ "it-IT",
84
+ "fr-FR",
85
+ "es-ES",
86
+ "sl-SI",
87
+ "pt-PT",
88
+ "nl-NL",
89
+ "pl-PL",
90
+ "hr-HR",
91
+ "sv-SE",
92
+ "fi-FI",
93
+ "et-EE",
94
+ "bg-BG",
95
+ "cs-CZ",
96
+ "sk-SK",
97
+ "nb-NO",
98
+ "is-IS",
99
+ ])
100
+ .optional(),
101
+ language: z
102
+ .enum([
103
+ "en",
104
+ "de",
105
+ "sl",
106
+ "it",
107
+ "fr",
108
+ "es",
109
+ "pt",
110
+ "nl",
111
+ "pl",
112
+ "hr",
113
+ "sv",
114
+ "fi",
115
+ "et",
116
+ "bg",
117
+ "cs",
118
+ "sk",
119
+ "nb",
120
+ "is",
121
+ ])
122
+ .optional(),
33
123
  })
34
124
  .passthrough();
35
125
 
@@ -91,6 +91,11 @@ const createWebhookSchemaDefinition = z.object({
91
91
  "delivery_note.voided",
92
92
  "delivery_note.deleted",
93
93
  "delivery_note.restored",
94
+ "e_invoicing.submission.created",
95
+ "e_invoicing.submission.delivered",
96
+ "e_invoicing.submission.failed",
97
+ "e_invoicing.supplier.onboarded",
98
+ "e_invoicing.supplier.rejected",
94
99
  ])
95
100
  )
96
101
  .min(1),
@@ -186,6 +191,11 @@ const updateWebhookSchemaDefinition = z
186
191
  "delivery_note.voided",
187
192
  "delivery_note.deleted",
188
193
  "delivery_note.restored",
194
+ "e_invoicing.submission.created",
195
+ "e_invoicing.submission.delivered",
196
+ "e_invoicing.submission.failed",
197
+ "e_invoicing.supplier.onboarded",
198
+ "e_invoicing.supplier.rejected",
189
199
  ])
190
200
  )
191
201
  .min(1),