@wisemen/wise-invoicing-web 0.0.4 → 0.0.6

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 (91) hide show
  1. package/dist/{BillingDocumentDetailViewDataProvider-pePmiXWb.js → BillingDocumentDetailViewDataProvider-BGE-p_FL.js} +953 -863
  2. package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
  3. package/dist/{BillingDocumentPdf-Dg5JlQE1.js → BillingDocumentPdf-Ca81NkZq.js} +4 -4
  4. package/dist/{CreditNoteDetailViewDataProvider-C-A0jyVr.js → CreditNoteDetailViewDataProvider-b5dY_4mH.js} +181 -181
  5. package/dist/{CreditNotePdfViewDataProvider-DNUvFVDj.js → CreditNotePdfViewDataProvider-C2QqCdQ7.js} +3 -3
  6. package/dist/{CustomFieldValueText-DDQq-975.js → CustomFieldValueText-ne5yy02J.js} +2 -2
  7. package/dist/DataProvider-Dj34ljUX.js +75 -0
  8. package/dist/{DunningCaseDetailViewDataProvider-0WV-7-vg.js → DunningCaseDetailViewDataProvider-jsh-LlGx.js} +68 -59
  9. package/dist/DunningCaseOverviewView-WbXalMt6.js +747 -0
  10. package/dist/{DunningCaseReminderPdfViewDataProvider-DcM-7ECg.js → DunningCaseReminderPdfViewDataProvider-B3Y2aYFf.js} +1 -1
  11. package/dist/DunningCaseSendDialog-D7jAZ8yT.js +349 -0
  12. package/dist/{InvoiceDetailViewDataProvider-BDL9lAWe.js → InvoiceDetailViewDataProvider-BAVdcJay.js} +589 -498
  13. package/dist/{InvoiceOverviewViewDataProvider-B_jrcC_8.js → InvoiceOverviewViewDataProvider-BT9cuQXw.js} +546 -482
  14. package/dist/{InvoicePdfView-Bygb-9z6.js → InvoicePdfView-BpIaYdZX.js} +2 -2
  15. package/dist/{InvoicePdfViewDataProvider-nBk3XNrE.js → InvoicePdfViewDataProvider-DGCnmNE-.js} +3 -3
  16. package/dist/{InvoicePublicPdfViewDataProvider-DHJP_-7-.js → InvoicePublicPdfViewDataProvider-KV0_hKUI.js} +3 -3
  17. package/dist/{IssuerSettingsViewDataProvider-Dk_Q6w6f.js → IssuerSettingsViewDataProvider-Bs4rEES2.js} +4 -4
  18. package/dist/ReminderSettingsViewDataProvider-D4bRLLXx.js +711 -0
  19. package/dist/{api.util-Dm_TQedZ.js → api.util-BCSgCfpS.js} +528 -509
  20. package/dist/{billingDocumentDetail.transformer-zMTbka5p.js → billingDocumentDetail.transformer-DIKAl4_L.js} +58 -89
  21. package/dist/client/index.d.ts +1 -1
  22. package/dist/client/types.gen.d.ts +28 -5
  23. package/dist/client/zod.gen.d.ts +869 -623
  24. package/dist/{creditNoteDetail.query-BZqgZRSu.js → creditNoteDetail.query-DHP69UiB.js} +13 -13
  25. package/dist/{dist-DP8KNFVD.js → dist-D9lp7NDv.js} +20 -36
  26. package/dist/{dist-DJ8yJcb9.js → dist-PErDVE6-.js} +621 -671
  27. package/dist/{documentTitle.composable-CeaFddr1.js → documentTitle.composable-4ApFl9TZ.js} +10 -8
  28. package/dist/{i18n.lib-DUbAMBRb.js → i18n.lib-BGcQ_OBF.js} +50 -2
  29. package/dist/index.d.ts +51 -2
  30. package/dist/index.js +78 -78
  31. package/dist/{invoice.service-ChHEtXBA.js → invoice.service-DG5eacZC.js} +46 -46
  32. package/dist/{invoiceDeliveryStatus.util-BsA-MlA3.js → invoiceDeliveryStatus.util-CX-IdqAu.js} +28 -28
  33. package/dist/{invoiceDetail.query-O_CGvdwg.js → invoiceDetail.query-C_IMGjOX.js} +1 -1
  34. package/dist/{invoicingConfig.composable-c6w_aMm1.js → invoicingConfig.composable-Kad_HHx_.js} +2 -2
  35. package/dist/{issuerSettings.query-RqtrZFaB.js → issuerSettings.query-6wnSPphB.js} +2 -2
  36. package/dist/libs/i18n.lib.d.ts +50 -2
  37. package/dist/locales/en-US.json.d.ts +25 -1
  38. package/dist/locales/nl-BE.json.d.ts +25 -1
  39. package/dist/models/billing-document/billingDocumentLineItemGroupUpdateForm.model.d.ts +9 -3
  40. package/dist/modules/dunning-case/actions/dunningCase.actions.d.ts +12 -0
  41. package/dist/modules/dunning-case/actions/dunningCaseNavigateToCustomer.action.d.ts +1 -0
  42. package/dist/modules/dunning-case/actions/dunningCaseNavigateToDetail.action.d.ts +1 -0
  43. package/dist/modules/dunning-case/api/mutations/reminderConfigUpdate.mutation.d.ts +2 -0
  44. package/dist/modules/dunning-case/models/dunningCase.model.d.ts +12 -3
  45. package/dist/modules/dunning-case/models/reminderConfigForm.model.d.ts +3 -1
  46. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewActionsCell.vue.d.ts +13 -0
  47. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewCustomerCell.vue.d.ts +7 -0
  48. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewDaysOverdueCell.vue.d.ts +7 -0
  49. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewLastReminderCell.vue.d.ts +7 -0
  50. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewLevelCell.vue.d.ts +7 -0
  51. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewMetrics.vue.d.ts +8 -0
  52. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewOutstandingCell.vue.d.ts +7 -0
  53. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewReminderCell.vue.d.ts +7 -0
  54. package/dist/modules/dunning-case/use-cases/overview/components/dunningCaseOverviewActionsCell.spec.d.ts +1 -0
  55. package/dist/modules/dunning-case/use-cases/overview/components/dunningCaseOverviewLastReminderCell.spec.d.ts +1 -0
  56. package/dist/modules/dunning-case/use-cases/overview/components/dunningCaseOverviewReminderCell.spec.d.ts +1 -0
  57. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.d.ts +24 -0
  58. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewTableColumns.composable.d.ts +8 -0
  59. package/dist/modules/dunning-case/use-cases/send/dialogs/dunningCaseBulkSendDialog.spec.d.ts +1 -0
  60. package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderRow.vue.d.ts +3 -1
  61. package/dist/modules/dunning-case/use-cases/settings/components/reminderLadderFeeNotice.spec.d.ts +1 -0
  62. package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.d.ts +3 -1
  63. package/dist/modules/invoice/api/invoiceIndexCache.util.d.ts +4 -4
  64. package/dist/modules/invoice/api/queries/invoiceUserSearch.query.d.ts +3 -0
  65. package/dist/modules/invoice/api/query-keys/invoice.queryKeys.d.ts +8 -0
  66. package/dist/modules/invoice/api/services/invoiceUser.service.d.ts +6 -0
  67. package/dist/modules/invoice/components/form/InvoiceFormPreparedByField.vue.d.ts +16 -0
  68. package/dist/modules/invoice/models/invoice/update/invoicePreparer.model.d.ts +4 -0
  69. package/dist/modules/invoice/models/invoice/update/invoicePreparer.transformer.d.ts +5 -0
  70. package/dist/modules/invoice/models/invoice/update/invoiceUserSearchQueryParams.model.d.ts +3 -0
  71. package/dist/modules/invoice/models/invoice/update/invoiceUserSearchQueryParams.transformer.d.ts +6 -0
  72. package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +1 -0
  73. package/dist/{plainDate.transformer-BxvJpJOv.js → plainDate.transformer-Dfe5r84P.js} +32 -1
  74. package/dist/{reminderConfig.query-DzTN2AvU.js → reminderConfig.query-hmDNKreg.js} +105 -91
  75. package/dist/search.composable-BCtYqudV.js +52 -0
  76. package/dist/style.css +1 -1
  77. package/dist/ui/billing-document/table/billingDocumentLineItemsTable.context.d.ts +6 -6
  78. package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.d.ts +1 -1
  79. package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsRowMutations.composable.d.ts +2 -2
  80. package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsRowMutations.composable.spec.d.ts +1 -0
  81. package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsTableDrag.composable.d.ts +3 -1
  82. package/dist/ui/billing-document/table/field/BillingDocumentLineItemsTableField.vue.d.ts +2 -0
  83. package/dist/ui/billing-document/table/field/BillingDocumentLineItemsTableTextField.vue.d.ts +1 -0
  84. package/dist/ui/billing-document/table/utils/billingDocumentLineItemsEditor.util.d.ts +19 -0
  85. package/dist/ui/data-provider/DataProviderErrorState.vue.d.ts +7 -0
  86. package/dist/ui/data-provider/dataProviderErrorState.spec.d.ts +1 -0
  87. package/package.json +6 -1
  88. package/dist/DataProvider-CfHLB3rH.js +0 -48
  89. package/dist/DunningCaseOverviewView-CHdzfbhb.js +0 -553
  90. package/dist/DunningCaseSendDialog-DBtwr2ue.js +0 -350
  91. package/dist/ReminderSettingsViewDataProvider-CDBjfU7R.js +0 -668
@@ -1,49 +1,49 @@
1
- import { B as e, E as t, J as n, P as r, V as i, a, t as o, w as s } from "./api.util-Dm_TQedZ.js";
2
- import { d as c } from "./documentTitle.composable-CeaFddr1.js";
3
- import { n as l, t as u } from "./plainDate.transformer-BxvJpJOv.js";
4
- import { Fragment as d, computed as f, createElementBlock as p, createElementVNode as m, defineComponent as h, normalizeClass as g, openBlock as _, renderList as v } from "vue";
5
- import { useQuery as y } from "@wisemen/vue-core-api-utils";
6
- import { Temporal as b } from "temporal-polyfill";
1
+ import { B as e, E as t, J as n, P as r, V as i, a, t as o, w as s } from "./api.util-BCSgCfpS.js";
2
+ import { a as c, d as l, f as u } from "./documentTitle.composable-4ApFl9TZ.js";
3
+ import { i as d, r as f, t as p } from "./plainDate.transformer-Dfe5r84P.js";
4
+ import { Fragment as m, computed as h, createElementBlock as g, createElementVNode as _, defineComponent as v, normalizeClass as y, openBlock as b, renderList as x } from "vue";
5
+ import { useQuery as S } from "@wisemen/vue-core-api-utils";
6
+ import { Temporal as C } from "temporal-polyfill";
7
7
  //#region src/modules/dunning-case/models/dunningCase.transformer.ts
8
- var x = [
8
+ var w = [
9
9
  "en-US",
10
10
  "nl-BE",
11
11
  "fr-BE"
12
- ], S = /* @__PURE__ */ new Set(/* @__PURE__ */ "address.article.aside.blockquote.div.dl.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hr.li.main.nav.ol.p.pre.section.table.tbody.td.tfoot.th.thead.tr.ul".split(".")), C = /^\/?([a-z][a-z0-9-]*)/i, w = /&(#(?:x[\da-f]+|\d+)|[a-z][\da-z]+);/gi;
13
- function T(e) {
12
+ ], T = /* @__PURE__ */ new Set(/* @__PURE__ */ "address.article.aside.blockquote.div.dl.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hr.li.main.nav.ol.p.pre.section.table.tbody.td.tfoot.th.thead.tr.ul".split(".")), E = /^\/?([a-z][a-z0-9-]*)/i, D = /&(#(?:x[\da-f]+|\d+)|[a-z][\da-z]+);/gi;
13
+ function O(e) {
14
14
  return e.nodeType === 3;
15
15
  }
16
- function E(e) {
16
+ function k(e) {
17
17
  return e.nodeType === 1;
18
18
  }
19
- function D(e) {
19
+ function A(e) {
20
20
  let t = e;
21
21
  for (; t.startsWith("\n\n");) t = t.slice(2);
22
22
  for (; t.endsWith("\n\n");) t = t.slice(0, -2);
23
23
  return t;
24
24
  }
25
- function O(e) {
25
+ function j(e) {
26
26
  let t = globalThis.DOMParser;
27
- return D(t === void 0 ? M(e) : k(new t().parseFromString(e, "text/html").body.childNodes));
27
+ return A(t === void 0 ? F(e) : M(new t().parseFromString(e, "text/html").body.childNodes));
28
28
  }
29
- function k(e) {
29
+ function M(e) {
30
30
  let t = "";
31
31
  function n(e) {
32
32
  t += e.replaceAll("\xA0", " ");
33
33
  }
34
34
  function r(e) {
35
- if (T(e)) {
35
+ if (O(e)) {
36
36
  n(e.data);
37
37
  return;
38
38
  }
39
- if (!E(e)) return;
39
+ if (!k(e)) return;
40
40
  let i = e.tagName.toLowerCase();
41
41
  if (i === "script" || i === "style") return;
42
42
  if (i === "br") {
43
43
  n("\n");
44
44
  return;
45
45
  }
46
- let a = S.has(i);
46
+ let a = T.has(i);
47
47
  a && t.length > 0 && !t.endsWith("\n") && n("\n\n");
48
48
  for (let t of e.childNodes) r(t);
49
49
  a && t.length > 0 && !t.endsWith("\n") && n("\n\n");
@@ -51,16 +51,16 @@ function k(e) {
51
51
  for (let t of e) r(t);
52
52
  return t;
53
53
  }
54
- function A(e) {
55
- return `<p>${e.split("\n").map((e) => j(e)).join("<br>")}</p>`;
54
+ function N(e) {
55
+ return `<p>${e.split("\n").map((e) => P(e)).join("<br>")}</p>`;
56
56
  }
57
- function j(e) {
57
+ function P(e) {
58
58
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&#39;");
59
59
  }
60
- function M(e) {
60
+ function F(e) {
61
61
  let t = "", n = 0, r = null;
62
62
  function i(e) {
63
- t += N(e.replaceAll("\xA0", " "));
63
+ t += I(e.replaceAll("\xA0", " "));
64
64
  }
65
65
  function a() {
66
66
  t.length > 0 && !t.endsWith("\n") && (t += "\n\n");
@@ -82,7 +82,7 @@ function M(e) {
82
82
  r === null && i(e.slice(o));
83
83
  break;
84
84
  }
85
- let l = e.slice(o + 1, c).trim(), u = l.startsWith("/"), d = C.exec(l)?.[1]?.toLowerCase();
85
+ let l = e.slice(o + 1, c).trim(), u = l.startsWith("/"), d = E.exec(l)?.[1]?.toLowerCase();
86
86
  if (d === void 0) {
87
87
  n = c + 1;
88
88
  continue;
@@ -95,11 +95,11 @@ function M(e) {
95
95
  r = u ? null : d, n = c + 1;
96
96
  continue;
97
97
  }
98
- d === "br" ? t += "\n" : S.has(d) && (a(), (u || l.endsWith("/")) && a()), n = c + 1;
98
+ d === "br" ? t += "\n" : T.has(d) && (a(), (u || l.endsWith("/")) && a()), n = c + 1;
99
99
  }
100
100
  return t;
101
101
  }
102
- function N(e) {
102
+ function I(e) {
103
103
  let t = {
104
104
  amp: "&",
105
105
  apos: "'",
@@ -108,102 +108,105 @@ function N(e) {
108
108
  nbsp: " ",
109
109
  quot: "\""
110
110
  };
111
- return e.replace(w, (e, n) => n.startsWith("#x") || n.startsWith("#X") ? String.fromCodePoint(Number.parseInt(n.slice(2), 16)) : n.startsWith("#") ? String.fromCodePoint(Number.parseInt(n.slice(1), 10)) : t[n.toLowerCase()] ?? e);
111
+ return e.replace(D, (e, n) => n.startsWith("#x") || n.startsWith("#X") ? String.fromCodePoint(Number.parseInt(n.slice(2), 16)) : n.startsWith("#") ? String.fromCodePoint(Number.parseInt(n.slice(1), 10)) : t[n.toLowerCase()] ?? e);
112
112
  }
113
- function P(e, t) {
113
+ function L(e, t) {
114
114
  return e.items.find((e) => e.locale === t)?.value ?? "";
115
115
  }
116
- function F(e, t) {
117
- return { items: x.map((n) => ({
116
+ function R(e, t) {
117
+ return { items: w.map((n) => ({
118
118
  locale: n,
119
- value: t === "body" ? A(e[n][t]) : e[n][t]
119
+ value: t === "body" ? N(e[n][t]) : e[n][t]
120
120
  })) };
121
121
  }
122
- var I = class e {
122
+ var z = class e {
123
123
  static fromDetailDto(t) {
124
124
  return {
125
125
  uuid: t.uuid,
126
- closedAt: t.closedAt === null ? null : b.Instant.from(t.closedAt),
127
- createdAt: b.Instant.from(t.createdAt),
126
+ closedAt: t.closedAt === null ? null : C.Instant.from(t.closedAt),
127
+ createdAt: C.Instant.from(t.createdAt),
128
128
  lastReminderSentAt: e.fromNullableInstant(t.lastReminderSentAt),
129
- nextReminderOn: u.fromNullableDto(t.nextReminderOn),
130
- updatedAt: b.Instant.from(t.updatedAt),
131
- isClosed: t.isClosed,
129
+ nextReminderOn: p.fromNullableDto(t.nextReminderOn),
130
+ updatedAt: C.Instant.from(t.updatedAt),
132
131
  blockedReason: t.blockedReason,
133
132
  canSendReminder: t.canSendReminder,
134
133
  customer: t.customer,
135
134
  invoices: t.invoices.map(e.fromInvoiceDto),
136
135
  latestCreatedReminder: e.fromReminderDto(t.latestCreatedReminder),
137
136
  level: t.level ?? 0,
138
- outstandingBalance: l.fromDto(t.outstandingBalance),
139
- totalCredited: l.fromDto(t.totalCredited),
140
- totalFee: l.fromDto(t.totalFee),
141
- totalInvoiced: l.fromDto(t.totalInvoiced),
142
- totalPaid: l.fromDto(t.totalPaid)
137
+ outstandingBalance: d.fromDto(t.outstandingBalance),
138
+ totalCredited: d.fromDto(t.totalCredited),
139
+ totalFee: d.fromDto(t.totalFee),
140
+ totalInvoiced: d.fromDto(t.totalInvoiced),
141
+ totalPaid: d.fromDto(t.totalPaid)
143
142
  };
144
143
  }
145
144
  static fromIndexDto(t) {
146
145
  return {
147
146
  uuid: t.uuid,
148
147
  lastReminderSentAt: e.fromNullableInstant(t.lastReminderSentAt),
149
- nextReminderOn: t.nextReminderOn === null || t.nextReminderOn === "infinity" || t.nextReminderOn === "-infinity" ? null : u.fromDto(t.nextReminderOn),
148
+ nextReminderOn: t.nextReminderOn === null || t.nextReminderOn === "infinity" || t.nextReminderOn === "-infinity" ? null : p.fromDto(t.nextReminderOn),
150
149
  blockedReason: t.blockedReason,
151
150
  canSendReminder: t.canSendReminder,
152
151
  customer: t.customer,
153
152
  daysOverdue: t.daysOverdue,
154
153
  latestCreatedReminder: e.fromReminderDto(t.latestCreatedReminder),
155
154
  level: t.level,
156
- outstandingBalance: l.fromDto(t.outstandingBalance)
155
+ outstandingBalance: d.fromDto(t.outstandingBalance)
157
156
  };
158
157
  }
159
158
  static fromInvoiceDto(e) {
160
159
  return {
161
160
  uuid: e.uuid,
162
- dueOn: u.fromDto(e.dueOn),
161
+ dueOn: p.fromDto(e.dueOn),
163
162
  isDisputed: e.isDisputed,
164
- balanceDueAmount: l.fromDto(e.balanceDueAmount),
163
+ balanceDueAmount: d.fromDto(e.balanceDueAmount),
165
164
  creditNotes: e.creditNotes.map((e) => ({
166
165
  uuid: e.uuid,
167
- finalizedOn: u.fromDto(e.finalizedOn),
168
- grossAmount: l.fromDto(e.grossAmount),
166
+ finalizedOn: p.fromDto(e.finalizedOn),
167
+ grossAmount: d.fromDto(e.grossAmount),
169
168
  sequence: e.sequence
170
169
  })),
171
- grossAmount: l.fromDto(e.grossAmount),
172
- level: e.level,
173
- paidAmount: l.fromDto(e.paidAmount),
170
+ grossAmount: d.fromDto(e.grossAmount),
171
+ level: e.level ?? 0,
172
+ paidAmount: d.fromDto(e.paidAmount),
174
173
  payments: e.payments.map((e) => ({
175
174
  uuid: e.uuid,
176
- amount: l.fromDto(e.amount),
177
- date: u.fromDto(e.date)
175
+ amount: d.fromDto(e.amount),
176
+ date: p.fromDto(e.date)
178
177
  })),
179
178
  sequence: e.sequence,
180
179
  settlementStatus: e.settlementStatus,
181
180
  subject: e.subject,
182
- totalCreditedAmount: l.fromDto(e.totalCreditedAmount)
181
+ totalCreditedAmount: d.fromDto(e.totalCreditedAmount)
183
182
  };
184
183
  }
185
184
  static fromNullableInstant(e) {
186
- return e === null || e === "infinity" || e === "-infinity" ? null : b.Instant.from(e);
185
+ return e === null || e === "infinity" || e === "-infinity" ? null : C.Instant.from(e);
187
186
  }
188
187
  static fromReminderConfigDto(e) {
189
188
  return {
190
189
  uuid: e.uuid,
191
- fee: l.fromDto(e.fee),
190
+ fee: {
191
+ amount: e.fee.amount === null ? null : d.fromDto(e.fee.amount),
192
+ percentage: f.fromNullableDto(e.fee.percentage),
193
+ type: e.fee.type
194
+ },
192
195
  offsetDays: e.offsetDays,
193
196
  schedule: e.schedule,
194
197
  sequence: e.sequence,
195
198
  template: {
196
199
  "en-US": {
197
- body: O(P(e.template.body, "en-US")),
198
- subject: P(e.template.subject, "en-US")
200
+ body: j(L(e.template.body, "en-US")),
201
+ subject: L(e.template.subject, "en-US")
199
202
  },
200
203
  "fr-BE": {
201
- body: O(P(e.template.body, "fr-BE")),
202
- subject: P(e.template.subject, "fr-BE")
204
+ body: j(L(e.template.body, "fr-BE")),
205
+ subject: L(e.template.subject, "fr-BE")
203
206
  },
204
207
  "nl-BE": {
205
- body: O(P(e.template.body, "nl-BE")),
206
- subject: P(e.template.subject, "nl-BE")
208
+ body: j(L(e.template.body, "nl-BE")),
209
+ subject: L(e.template.subject, "nl-BE")
207
210
  }
208
211
  }
209
212
  };
@@ -216,25 +219,36 @@ var I = class e {
216
219
  }
217
220
  static reminderConfigsToDto(e) {
218
221
  return e.reminders.map((e) => ({
219
- fee: {
220
- amount: Math.round(e.feeAmount * 10 ** e.feePrecision),
221
- currency: e.feeCurrency,
222
- precision: e.feePrecision
222
+ fee: e.feeType === l.PERCENTAGE ? {
223
+ amount: null,
224
+ percentage: e.feePercentage / 100,
225
+ type: l.PERCENTAGE
226
+ } : {
227
+ amount: {
228
+ amount: Math.round(e.feeAmount * 10 ** e.feePrecision),
229
+ currency: e.feeCurrency,
230
+ precision: e.feePrecision
231
+ },
232
+ percentage: null,
233
+ type: l.AMOUNT
223
234
  },
224
235
  offsetDays: e.offsetDays,
225
236
  schedule: e.schedule,
226
237
  sequence: e.sequence,
227
238
  template: {
228
- body: F(e.template, "body"),
229
- subject: F(e.template, "subject")
239
+ body: R(e.template, "body"),
240
+ subject: R(e.template, "subject")
230
241
  }
231
242
  }));
232
243
  }
233
244
  static reminderConfigsToForm(e) {
245
+ let t = e.find((e) => e.fee.amount !== null)?.fee.amount ?? null, n = t?.currency ?? c.EUR, r = t?.precision ?? 2;
234
246
  return { reminders: e.toSorted((e, t) => e.sequence - t.sequence).map((e) => ({
235
- feeAmount: e.fee.amount / 10 ** e.fee.precision,
236
- feeCurrency: e.fee.currency,
237
- feePrecision: e.fee.precision,
247
+ feeAmount: e.fee.amount === null ? 0 : e.fee.amount.amount / 10 ** e.fee.amount.precision,
248
+ feeCurrency: e.fee.amount?.currency ?? n,
249
+ feePercentage: e.fee.percentage?.value ?? 0,
250
+ feePrecision: e.fee.amount?.precision ?? r,
251
+ feeType: e.fee.type,
238
252
  offsetDays: e.offsetDays,
239
253
  schedule: e.schedule,
240
254
  sequence: e.sequence,
@@ -244,73 +258,73 @@ var I = class e {
244
258
  };
245
259
  //#endregion
246
260
  //#region src/modules/dunning-case/api/services/dunningCase.service.ts
247
- function L(e) {
261
+ function B(e) {
248
262
  return {
249
263
  customerUuid: e.customerUuid,
250
264
  isOpen: e.isOpen,
251
265
  dunningCaseUuids: e.dunningCaseUuids === void 0 ? void 0 : {
252
- scope: c.INCLUDE,
266
+ scope: u.INCLUDE,
253
267
  values: e.dunningCaseUuids
254
268
  },
255
269
  level: e.level
256
270
  };
257
271
  }
258
- var R = class {
272
+ var V = class {
259
273
  static async getAll(e) {
260
274
  return (await o.fromPromise(i({ query: {
261
- filter: L(e),
275
+ filter: B(e),
262
276
  pagination: e.pagination
263
277
  } }))).map((e) => ({
264
- data: e.data.items.map(I.fromIndexDto),
278
+ data: e.data.items.map(z.fromIndexDto),
265
279
  meta: e.data.meta
266
280
  }));
267
281
  }
268
282
  static async getByUuid(t) {
269
- return (await o.fromPromise(e({ path: { uuid: t } }))).map((e) => I.fromDetailDto(e.data));
283
+ return (await o.fromPromise(e({ path: { uuid: t } }))).map((e) => z.fromDetailDto(e.data));
270
284
  }
271
285
  static async getReminderConfigs() {
272
- return (await o.fromPromise(n())).map((e) => e.data.items.map(I.fromReminderConfigDto));
286
+ return (await o.fromPromise(n())).map((e) => e.data.items.map(z.fromReminderConfigDto));
273
287
  }
274
288
  static async previewBulk(e) {
275
- return (await o.fromPromise(s({ query: { filter: L(e) } }))).map((e) => e.data);
289
+ return (await o.fromPromise(s({ query: { filter: B(e) } }))).map((e) => e.data);
276
290
  }
277
291
  static async send(e) {
278
292
  let n = await o.fromPromise(t({ path: { uuid: e } }));
279
293
  return o.void(n);
280
294
  }
281
295
  static async sendBulk(e) {
282
- return (await o.fromPromise(a({ query: { filter: L(e) } }))).map((e) => e.data);
296
+ return (await o.fromPromise(a({ query: { filter: B(e) } }))).map((e) => e.data);
283
297
  }
284
298
  static async updateReminderConfigs(e) {
285
- let t = await o.fromPromise(r({ body: { reminders: I.reminderConfigsToDto(e) } }));
299
+ let t = await o.fromPromise(r({ body: { reminders: z.reminderConfigsToDto(e) } }));
286
300
  return o.void(t);
287
301
  }
288
- }, z = {
302
+ }, H = {
289
303
  class: "flex shrink-0 gap-xxs",
290
304
  "aria-hidden": "true"
291
- }, B = /* @__PURE__ */ h({
305
+ }, U = /* @__PURE__ */ v({
292
306
  __name: "DunningCaseReminderLevelIndicator",
293
307
  props: {
294
308
  level: {},
295
309
  size: { default: "md" }
296
310
  },
297
311
  setup(e) {
298
- let t = e, n = f(() => Math.min(3, Math.max(0, t.level ?? 0))), r = f(() => t.level === 3 ? "error" : t.level === 2 ? "warning" : "brand"), i = f(() => t.size === "sm" ? "h-(--spacing-sm) w-(--spacing-md)" : "h-(--spacing-sm) w-(--spacing-lg)");
299
- return (e, t) => (_(), p("span", z, [(_(), p(d, null, v(3, (e) => m("span", {
312
+ let t = e, n = h(() => Math.min(3, Math.max(0, t.level ?? 0))), r = h(() => t.level === 3 ? "error" : t.level === 2 ? "warning" : "brand"), i = h(() => t.size === "sm" ? "h-(--spacing-sm) w-(--spacing-md)" : "h-(--spacing-sm) w-(--spacing-lg)");
313
+ return (e, t) => (b(), g("span", H, [(b(), g(m, null, x(3, (e) => _("span", {
300
314
  key: e,
301
- class: g([[i.value, e <= n.value ? {
315
+ class: y([[i.value, e <= n.value ? {
302
316
  "border-brand-500 bg-brand-500": r.value === "brand",
303
317
  "border-warning-500 bg-warning-solid": r.value === "warning",
304
318
  "border-error bg-error-solid": r.value === "error"
305
319
  } : "border-secondary bg-primary"], "rounded-full border"])
306
320
  }, null, 2)), 64))]));
307
321
  }
308
- }), V = 3e5;
309
- function H() {
310
- return y("reminderConfig", {
311
- staleTime: V,
312
- queryFn: () => R.getReminderConfigs()
322
+ }), W = 3e5;
323
+ function G() {
324
+ return S("reminderConfig", {
325
+ staleTime: W,
326
+ queryFn: () => V.getReminderConfigs()
313
327
  });
314
328
  }
315
329
  //#endregion
316
- export { I as i, B as n, R as r, H as t };
330
+ export { z as i, U as n, V as r, G as t };
@@ -0,0 +1,52 @@
1
+ import { useRoute as e, useRouter as t } from "vue-router";
2
+ import { computed as n, ref as r, watch as i } from "vue";
3
+ import { refDebounced as a } from "@vueuse/core";
4
+ //#region src/composables/routeQueryState.composable.ts
5
+ function o(n) {
6
+ let a = e(), o = t();
7
+ function s(e) {
8
+ if (e === null) return n.initialState;
9
+ try {
10
+ return n.serializer.parse(e);
11
+ } catch {
12
+ return n.initialState;
13
+ }
14
+ }
15
+ let c = r(s(a.query[n.key] ?? null));
16
+ return i(() => a.query[n.key], (e) => {
17
+ c.value = s(e ?? null);
18
+ }, { immediate: !0 }), i(c, (e) => {
19
+ o.replace({ query: {
20
+ ...a.query,
21
+ [n.key]: n.serializer.serialize(e) || void 0
22
+ } });
23
+ }, { deep: !0 }), c;
24
+ }
25
+ //#endregion
26
+ //#region src/composables/search/search.composable.ts
27
+ var s = 50, c = "search";
28
+ function l(e) {
29
+ let t = e?.debounceMs ?? s, i = e?.persistInUrl ?? !1, l = i === !0 || typeof i == "string" ? o({
30
+ initialState: "",
31
+ key: typeof i == "string" ? i : c,
32
+ serializer: {
33
+ parse: (e) => e,
34
+ serialize: (e) => e
35
+ }
36
+ }) : r(""), u = a(l, t), d = n(() => l.value !== u.value);
37
+ function f() {
38
+ l.value = "";
39
+ }
40
+ function p(e) {
41
+ l.value = e;
42
+ }
43
+ return {
44
+ isDebouncing: d,
45
+ clear: f,
46
+ debouncedSearch: n(() => u.value),
47
+ search: l,
48
+ updateSearch: p
49
+ };
50
+ }
51
+ //#endregion
52
+ export { l as t };