@wisemen/wise-invoicing-web 0.2.0 → 0.3.1

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 (118) hide show
  1. package/dist/{ApprovalReminderSettingsViewDataProvider-D-qXZrPT.js → ApprovalReminderSettingsViewDataProvider-DwtfyQpx.js} +4 -4
  2. package/dist/{BillingDocumentDetailViewDataProvider-DDdtlW-2.js → BillingDocumentDetailViewDataProvider-Dub07ybW.js} +1373 -1217
  3. package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
  4. package/dist/{BillingDocumentPdf-ehdFB6mr.js → BillingDocumentPdf-DgtUB45R.js} +20 -13
  5. package/dist/{CreditNoteDetailViewDataProvider-11a-JO3H.js → CreditNoteDetailViewDataProvider-BxNfC6yO.js} +90 -90
  6. package/dist/{CreditNotePdfViewDataProvider-bfeaya3P.js → CreditNotePdfViewDataProvider-D0j8qqK-.js} +2 -2
  7. package/dist/{CustomFieldValueText-CZQXGE5F.js → CustomFieldValueText-Cuhs9sRn.js} +26 -26
  8. package/dist/DunningCaseDetailViewDataProvider-ou1FfNWQ.js +439 -0
  9. package/dist/{DunningCaseOverviewView-y_bCmi5j.js → DunningCaseOverviewView--zaPD0-c.js} +255 -203
  10. package/dist/{DunningCaseReminderPdfViewDataProvider-DNODfED_.js → DunningCaseReminderPdfViewDataProvider-BpUDbbSH.js} +5 -4
  11. package/dist/{DunningCaseSendDialog-BPXcqit5.js → DunningCaseSendDialog-Co4oLFtZ.js} +83 -72
  12. package/dist/InvoiceApprovalOutOfSyncIndicator-H6H7kjAE.js +45 -0
  13. package/dist/InvoiceApprovalOverviewView-Bw-6rkon.js +814 -0
  14. package/dist/InvoiceApprovalStatusBadge-IyzJ--TJ.js +127 -0
  15. package/dist/InvoiceApproveDialogDataProvider-8G-11W1e.js +377 -0
  16. package/dist/{InvoiceDetailViewDataProvider-BYeaaQzL.js → InvoiceDetailViewDataProvider-B9gul2ei.js} +750 -692
  17. package/dist/InvoiceOverviewViewDataProvider-5KgIdhfL.js +1892 -0
  18. package/dist/{InvoicePdfView-BJRTg_TH.js → InvoicePdfView-5sJ-u_gT.js} +10 -4
  19. package/dist/{InvoicePdfViewDataProvider-CwI_uGm3.js → InvoicePdfViewDataProvider-BLVXDPv6.js} +3 -3
  20. package/dist/{InvoicePublicPdfViewDataProvider-uZUfsr5K.js → InvoicePublicPdfViewDataProvider-CnhYazmB.js} +3 -3
  21. package/dist/InvoicePublicProFormaPdfViewDataProvider-CcvGISK6.js +47 -0
  22. package/dist/{InvoicingFileUploadProvider-D9Xk4rQM.js → InvoicingFileUploadProvider-Kcq7kSSt.js} +2 -2
  23. package/dist/{IssuerSettingsViewDataProvider-CGRa8F-2.js → IssuerSettingsViewDataProvider-BuSIVnIl.js} +3 -3
  24. package/dist/{ReminderSettingsViewDataProvider-1ucp3z2T.js → ReminderSettingsViewDataProvider-CH7gSXnj.js} +100 -102
  25. package/dist/{api.util-C_kMGlJN.js → api.util-CkIRZS3h.js} +985 -930
  26. package/dist/{billingDocumentDetail.transformer-Da6_-Hv9.js → billingDocumentDetail.transformer-Bfd8geNo.js} +5 -7
  27. package/dist/client/index.d.ts +2 -2
  28. package/dist/client/sdk.gen.d.ts +2 -1
  29. package/dist/client/types.gen.d.ts +114 -31
  30. package/dist/client/zod.gen.d.ts +343 -78
  31. package/dist/composables/sending-refetch/sendingRefetch.composable.d.ts +7 -0
  32. package/dist/composables/sending-refetch/sendingRefetch.composable.spec.d.ts +1 -0
  33. package/dist/{creditNoteDetail.query-DLR7L0Ep.js → creditNoteDetail.query-tLnfqsEB.js} +27 -27
  34. package/dist/customerUuid.model-ClN4Vi9n.js +18 -0
  35. package/dist/{dist-Cxdm09Lp.js → dist-BQbaoN5W.js} +144 -96
  36. package/dist/{dist-CoztMdYH.js → dist-CGZBUnWK.js} +62 -62
  37. package/dist/{dist-boJIIxnT.js → dist-Cdbpkd3Y.js} +1 -1
  38. package/dist/{documentTitle.composable-DsBbzhXN.js → documentTitle.composable-CRJjS6p-.js} +19 -17
  39. package/dist/{i18n.lib-Cvr8pcDw.js → i18n.lib--mzprLMR.js} +88 -54
  40. package/dist/index.d.ts +56 -22
  41. package/dist/index.js +193 -201
  42. package/dist/{invoice.service-DEEA9mal.js → invoice.service-B1w16_Md.js} +184 -172
  43. package/dist/{invoiceApproval.service-DvL3LliM.js → invoiceApproval.service-BHAJmFkU.js} +8 -8
  44. package/dist/{invoiceApprovalStatus.util-3Zh10Pj8.js → invoiceApprovalStatus.util-DohOKR4q.js} +42 -38
  45. package/dist/invoiceCustomer.service-DpVfpQUD.js +39 -0
  46. package/dist/{invoiceDetail.query-CRoH_SgM.js → invoiceDetail.query-CfyNSXLS.js} +1 -1
  47. package/dist/{invoiceDeliveryStatus.util-nCsqDypY.js → invoiceIndexCache.util-BDLs7W9m.js} +128 -51
  48. package/dist/{invoicingConfig.composable-rxjGK882.js → invoicingConfig.composable-COn1rKRf.js} +2 -2
  49. package/dist/{issuerSettings.query-Dc5gsaEm.js → issuerSettings.query-CDFk2GiP.js} +3 -2
  50. package/dist/libs/i18n.lib.d.ts +56 -22
  51. package/dist/locales/en-US.json.d.ts +44 -27
  52. package/dist/locales/nl-BE.json.d.ts +44 -27
  53. package/dist/models/billing-document/activity-log/billingDocumentActivityLog.model.d.ts +8 -1
  54. package/dist/models/billing-document/activity-log/billingDocumentActivityLog.util.d.ts +12 -0
  55. package/dist/models/billing-document/activity-log/billingDocumentActivityLog.util.spec.d.ts +1 -0
  56. package/dist/models/billing-document/billingDocumentDetail.model.d.ts +2 -6
  57. package/dist/modules/dunning-case/api/mutations/dunningCaseReminderRetry.mutation.d.ts +4 -0
  58. package/dist/modules/dunning-case/api/services/dunningCase.service.d.ts +2 -1
  59. package/dist/modules/dunning-case/models/dunningCase.model.d.ts +5 -0
  60. package/dist/modules/dunning-case/models/dunningCaseReminderPdf.model.d.ts +0 -4
  61. package/dist/modules/dunning-case/models/dunningCaseReminderPdf.transformer.d.ts +0 -1
  62. package/dist/modules/dunning-case/test/builders/dunningCaseReminderPdfDto.builder.d.ts +1 -0
  63. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewActionsCell.vue.d.ts +2 -0
  64. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.d.ts +2 -2
  65. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.spec.d.ts +1 -0
  66. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewTableColumns.composable.d.ts +1 -0
  67. package/dist/modules/dunning-case/use-cases/pdf/components/DunningCaseReminderPdfTable.vue.d.ts +0 -4
  68. package/dist/modules/dunning-case/use-cases/send/dialogs/DunningCaseBulkSendDialog.vue.d.ts +2 -1
  69. package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderRow.vue.d.ts +4 -4
  70. package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.d.ts +2 -2
  71. package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.spec.d.ts +1 -0
  72. package/dist/modules/invoice/api/mutations/invoiceRejectApproval.mutation.d.ts +8 -0
  73. package/dist/modules/invoice/api/queries/invoicePublicProFormaDetail.query.d.ts +2 -0
  74. package/dist/modules/invoice/api/query-keys/invoice.queryKeys.d.ts +6 -0
  75. package/dist/modules/invoice/api/services/invoice.service.d.ts +1 -0
  76. package/dist/modules/invoice/models/invoice/approval/invoiceApproveForm.model.d.ts +4 -2
  77. package/dist/modules/invoice/models/invoice/approval/invoiceApproveForm.model.spec.d.ts +1 -0
  78. package/dist/modules/invoice/models/invoice/approval/invoiceRejectForm.model.d.ts +8 -0
  79. package/dist/modules/invoice/models/invoice/detail/invoiceDetail.model.d.ts +1 -0
  80. package/dist/modules/invoice/models/invoice/index/invoiceIndexQueryParams.model.d.ts +2 -3
  81. package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.model.d.ts +2 -9
  82. package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.util.d.ts +4 -2
  83. package/dist/modules/invoice/models/invoice/payment/invoicePaymentCreate.transformer.spec.d.ts +1 -0
  84. package/dist/modules/invoice/models/invoice/pdf/invoicePdfDetail.transformer.d.ts +2 -1
  85. package/dist/modules/invoice/routes/invoice.routes.d.ts +4 -0
  86. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialog.vue.d.ts +1 -0
  87. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialogDataProvider.vue.d.ts +13 -0
  88. package/dist/modules/invoice/use-cases/detail/dialogs/InvoicePaymentDeleteDialog.vue.d.ts +13 -0
  89. package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewDataTableFilters.composable.d.ts +2 -3
  90. package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewSelection.composable.d.ts +11 -9
  91. package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +2 -2
  92. package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendApprovalDialog.vue.d.ts +3 -1
  93. package/dist/modules/invoice/use-cases/overview/utils/invoiceOverviewBulkActionFeedback.util.d.ts +7 -4
  94. package/dist/modules/invoice/use-cases/overview/utils/invoiceOverviewBulkActionFeedback.util.spec.d.ts +1 -0
  95. package/dist/modules/invoice/use-cases/pdf/components/BillingDocumentPdf.vue.d.ts +1 -0
  96. package/dist/modules/invoice/use-cases/pdf/components/InvoicePdfWatermark.vue.d.ts +4 -1
  97. package/dist/modules/invoice/use-cases/pdf/views/InvoicePdfView.vue.d.ts +1 -0
  98. package/dist/modules/invoice/use-cases/pdf/views/InvoicePublicProFormaPdfViewDataProvider.vue.d.ts +3 -0
  99. package/dist/modules/invoice-approval/actions/invoiceApprovalSendRequest.action.d.ts +2 -0
  100. package/dist/modules/invoice-approval/actions/invoiceApprovalSendRequest.spec.d.ts +1 -0
  101. package/dist/modules/invoice-approval/models/invoiceApprovalIndex.transformer.spec.d.ts +1 -0
  102. package/dist/modules/invoice-approval/models/invoiceApprovalIndexQueryParams.transformer.spec.d.ts +1 -0
  103. package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverview.composable.d.ts +5 -6
  104. package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewFilters.composable.d.ts +0 -5
  105. package/dist/modules/settings/models/issuer-settings/issuerSettings.model.d.ts +1 -0
  106. package/dist/{reminderConfig.query-snaHQmrY.js → reminderConfig.query-DSO0ekC_.js} +112 -105
  107. package/dist/routes/invoicingPublicRoutes.composable.d.ts +4 -0
  108. package/dist/style.css +1 -1
  109. package/dist/ui/billing-document/sidebar/BillingDocumentDetailSidebarActivityApprovalDetails.vue.d.ts +7 -0
  110. package/package.json +3 -3
  111. package/dist/DunningCaseDetailViewDataProvider-DC-ziMoO.js +0 -409
  112. package/dist/InvoiceApprovalOverviewView-DZ14mi4L.js +0 -870
  113. package/dist/InvoiceApprovalStatusBadge-U-dW2hR4.js +0 -161
  114. package/dist/InvoiceApproveDialog-2LXneG2r.js +0 -308
  115. package/dist/InvoiceOverviewBulkSendApprovalDialog-99dfuN4i.js +0 -318
  116. package/dist/InvoiceOverviewViewDataProvider-CZIQeftL.js +0 -1620
  117. package/dist/customerUuid.model-GUFYq3O2.js +0 -5
  118. package/dist/modules/invoice-approval/actions/invoiceApprovalUnmarkAsNeedsApproval.action.d.ts +0 -1
@@ -1,31 +1,32 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { t } from "./documentTitle.composable-DsBbzhXN.js";
2
+ import { t } from "./documentTitle.composable-CRJjS6p-.js";
3
3
  import { r as n } from "./useCurrencyFormat.composable-MtZaqKnO.js";
4
- import { n as r } from "./invoicingConfig.composable-rxjGK882.js";
4
+ import { n as r } from "./invoicingConfig.composable-COn1rKRf.js";
5
5
  import { t as i } from "./search.composable-CU9OpyUB.js";
6
- import { n as a, r as o } from "./reminderConfig.query-snaHQmrY.js";
7
- import { C as s, M as c, R as l, c as u, ct as d, l as f, ot as p } from "./dist-Cxdm09Lp.js";
8
- import { i as m, o as h, r as g, t as _ } from "./DunningCaseSendDialog-BPXcqit5.js";
9
- import { f as v, i as y, n as ee, o as te, r as b, s as ne } from "./dist-CoztMdYH.js";
10
- import { z as re } from "zod";
11
- import { useI18n as x } from "vue-i18n";
12
- import { Fragment as S, computed as C, createBlock as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, createVNode as O, defineComponent as k, nextTick as A, normalizeClass as j, normalizeStyle as M, onMounted as N, openBlock as P, ref as F, renderList as I, toDisplayString as L, unref as R, watch as ie, withCtx as z } from "vue";
13
- import { useMutation as B, useOffsetInfiniteQuery as V } from "@wisemen/vue-core-api-utils";
6
+ import { n as a, r as o } from "./reminderConfig.query-DSO0ekC_.js";
7
+ import { B as s, P as c, T as l, c as u, dt as d, l as f, lt as p } from "./dist-BQbaoN5W.js";
8
+ import { a as m, n as h, r as g, s as _, t as v } from "./DunningCaseSendDialog-Co4oLFtZ.js";
9
+ import { n as ee } from "./customerUuid.model-ClN4Vi9n.js";
10
+ import { f as y, i as b, n as te, o as ne, r as x, s as re } from "./dist-CGZBUnWK.js";
11
+ import { z as ie } from "zod";
12
+ import { useI18n as S } from "vue-i18n";
13
+ import { Fragment as C, computed as w, createBlock as T, createCommentVNode as E, createElementBlock as D, createElementVNode as O, createVNode as k, defineComponent as A, nextTick as j, normalizeClass as M, normalizeStyle as ae, onMounted as N, openBlock as P, ref as F, renderList as I, toDisplayString as L, unref as R, watch as z, withCtx as B } from "vue";
14
+ import { useMutation as oe, useOffsetInfiniteQuery as V } from "@wisemen/vue-core-api-utils";
14
15
  import { useRouter as H } from "vue-router";
15
16
  import { Temporal as U } from "temporal-polyfill";
16
- import { UIBadge as W, UIButton as G, UIDashboardPage as ae, UIDialogBody as K, UIDialogFooter as q, UIDialogFooterCancel as J, UIDialogFooterPrimary as Y, UIDialogHeader as X, UIFormDialog as oe, UITable as se, UITableCell as Z, UITableCellInteractiveElement as ce, UITabs as le, UITabsItem as ue, UITabsList as de, createComponent as Q, defineTableColumns as fe, useOverlay as pe, useToast as me } from "@wisemen/vue-core-design-system";
17
- import { createAction as he } from "@wisemen/vue-core-actions";
18
- import { useForm as ge } from "formango";
17
+ import { UIBadge as W, UIButton as G, UIDashboardPage as se, UIDialogBody as K, UIDialogFooter as q, UIDialogFooterCancel as J, UIDialogFooterPrimary as Y, UIDialogHeader as X, UIFormDialog as ce, UITable as le, UITableCell as Z, UITableCellInteractiveElement as ue, UITabs as de, UITabsItem as fe, UITabsList as pe, createComponent as Q, defineTableColumns as me, useOverlay as he, useToast as ge } from "@wisemen/vue-core-design-system";
18
+ import { createAction as _e } from "@wisemen/vue-core-actions";
19
+ import { useForm as ve } from "formango";
19
20
  //#region src/modules/dunning-case/api/queries/dunningCaseIndex.query.ts
20
21
  function $(e) {
21
- let t = C(() => ({
22
+ let t = w(() => ({
22
23
  customerUuid: e.params.customerUuid?.value,
23
24
  isOpen: e.params.isOpen?.value,
24
25
  dunningCaseUuids: e.params.dunningCaseUuids?.value,
25
26
  level: e.params.level?.value
26
27
  }));
27
28
  return V("dunningCaseIndex", {
28
- isEnabled: C(() => e.isEnabled?.value ?? !0),
29
+ isEnabled: w(() => e.isEnabled?.value ?? !0),
29
30
  params: { queryParams: t },
30
31
  queryFn: (e) => o.getAll({
31
32
  ...t.value,
@@ -35,9 +36,9 @@ function $(e) {
35
36
  }
36
37
  //#endregion
37
38
  //#region src/modules/dunning-case/actions/dunningCaseNavigateToCustomer.action.ts
38
- function _e() {
39
- let e = x(), t = H(), n = r();
40
- return he({
39
+ function ye() {
40
+ let e = S(), t = H(), n = r();
41
+ return _e({
41
42
  id: "dunning-case-navigate-to-customer",
42
43
  isApplicable: (e) => {
43
44
  let t = e.targetedModelOfType("DunningCase");
@@ -53,9 +54,9 @@ function _e() {
53
54
  }
54
55
  //#endregion
55
56
  //#region src/modules/dunning-case/actions/dunningCaseNavigateToDetail.action.ts
56
- function ve() {
57
- let e = x(), t = H();
58
- return he({
57
+ function be() {
58
+ let e = S(), t = H();
59
+ return _e({
59
60
  id: "dunning-case-navigate-to-detail",
60
61
  isApplicable: (e) => e.hasTargetedModelsOfType("DunningCase"),
61
62
  name: () => e.t("module.dunning_case.overview.menu.view_case"),
@@ -71,7 +72,7 @@ function ve() {
71
72
  }
72
73
  //#endregion
73
74
  //#region src/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewMetrics.vue?vue&type=script&setup=true&lang.ts
74
- var ye = ["aria-label"], be = { class: "text-xs font-semibold text-secondary uppercase" }, xe = { class: "mt-xl font-mono text-4xl font-semibold text-primary" }, Se = { class: "mt-xs text-sm text-secondary" }, Ce = { class: "lg:col-span-2" }, we = { class: "flex h-1.5 w-full overflow-hidden rounded-full bg-secondary" }, Te = { class: "mt-xl grid grid-cols-1 gap-md sm:grid-cols-3" }, Ee = { class: "flex min-w-0 items-center gap-sm" }, De = { class: "truncate text-sm text-secondary" }, Oe = { class: "shrink-0 font-mono text-sm font-semibold text-primary tabular-nums" }, ke = /* @__PURE__ */ k({
75
+ var xe = ["aria-label"], Se = { class: "text-xs font-semibold text-secondary uppercase" }, Ce = { class: "mt-xl font-mono text-4xl font-semibold text-primary" }, we = { class: "mt-xs text-sm text-secondary" }, Te = { class: "lg:col-span-2" }, Ee = { class: "flex h-1.5 w-full overflow-hidden rounded-full bg-secondary" }, De = { class: "mt-xl grid grid-cols-1 gap-md sm:grid-cols-3" }, Oe = { class: "flex min-w-0 items-center gap-sm" }, ke = { class: "truncate text-sm text-secondary" }, Ae = { class: "shrink-0 font-mono text-sm font-semibold text-primary tabular-nums" }, je = /* @__PURE__ */ A({
75
76
  __name: "DunningCaseOverviewMetrics",
76
77
  props: {
77
78
  hasLevelCountError: { type: Boolean },
@@ -79,140 +80,177 @@ var ye = ["aria-label"], be = { class: "text-xs font-semibold text-secondary upp
79
80
  levelCountTotal: {}
80
81
  },
81
82
  setup(e) {
82
- let t = e, n = x(), r = C(() => t.hasLevelCountError ? n.t("module.dunning_case.overview.metrics_unavailable") : t.levelCountTotal === null ? n.t("module.dunning_case.common.loading") : n.t("module.dunning_case.overview.case_count", { count: t.levelCountTotal }));
83
+ let t = e, n = S(), r = w(() => t.hasLevelCountError ? n.t("module.dunning_case.overview.metrics_unavailable") : t.levelCountTotal === null ? n.t("module.dunning_case.common.loading") : n.t("module.dunning_case.overview.case_count", { count: t.levelCountTotal }));
83
84
  function i(e) {
84
85
  return e === 0 ? n.t("module.dunning_case.level.none") : n.t("module.dunning_case.level.reminder", { level: e });
85
86
  }
86
- return (t, a) => (P(), E("section", {
87
+ return (t, a) => (P(), D("section", {
87
88
  "aria-label": R(n).t("module.dunning_case.overview.levels"),
88
89
  class: "grid min-w-0 grid-cols-1 gap-2xl rounded-lg border border-secondary bg-primary p-2xl shadow-sm lg:grid-cols-3 lg:items-center"
89
- }, [D("div", null, [
90
- D("p", be, L(R(n).t("module.dunning_case.overview.levels")), 1),
91
- D("p", xe, L(e.levelCountTotal ?? "—"), 1),
92
- D("p", Se, L(r.value), 1)
93
- ]), D("div", Ce, [D("div", we, [(P(!0), E(S, null, I(e.levelCounts, (e, t) => (P(), E("span", {
90
+ }, [O("div", null, [
91
+ O("p", Se, L(R(n).t("module.dunning_case.overview.levels")), 1),
92
+ O("p", Ce, L(e.levelCountTotal ?? "—"), 1),
93
+ O("p", we, L(r.value), 1)
94
+ ]), O("div", Te, [O("div", Ee, [(P(!0), D(C, null, I(e.levelCounts, (e, t) => (P(), D("span", {
94
95
  key: t,
95
- class: j({
96
+ class: M({
96
97
  "bg-brand-500": t === 0,
97
98
  "bg-error-solid": t === 2,
98
99
  "bg-warning-solid": t === 1
99
100
  }),
100
- style: M({ flexGrow: e ?? 0 })
101
- }, null, 6))), 128))]), D("div", Te, [(P(!0), E(S, null, I(e.levelCounts, (e, t) => (P(), E("div", {
101
+ style: ae({ flexGrow: e ?? 0 })
102
+ }, null, 6))), 128))]), O("div", De, [(P(!0), D(C, null, I(e.levelCounts, (e, t) => (P(), D("div", {
102
103
  key: t,
103
104
  class: "flex items-center justify-between gap-xl"
104
- }, [D("div", Ee, [D("span", { class: j([{
105
+ }, [O("div", Oe, [O("span", { class: M([{
105
106
  "bg-brand-500": t === 0,
106
107
  "bg-error-solid": t === 2,
107
108
  "bg-warning-solid": t === 1
108
- }, "size-2 shrink-0 rounded-full"]) }, null, 2), D("p", De, L(i(t + 1)), 1)]), D("p", Oe, L(e ?? "—"), 1)]))), 128))])])], 8, ye));
109
+ }, "size-2 shrink-0 rounded-full"]) }, null, 2), O("p", ke, L(i(t + 1)), 1)]), O("p", Ae, L(e ?? "—"), 1)]))), 128))])])], 8, xe));
109
110
  }
110
- });
111
- //#endregion
112
- //#region src/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.ts
113
- function Ae(e) {
114
- let t = C(() => !0), { isFetchingNextPage: n, isLoading: r, fetchNextPage: i, result: a } = $({ params: {
111
+ }), Me = {
112
+ uuid: "00000000-0000-4000-8000-000000000000",
113
+ sentAt: null,
114
+ hasErrors: !1
115
+ };
116
+ function Ne(e, t) {
117
+ if (e === null || t === null) return e === t;
118
+ let n = e.sentAt === null || t.sentAt === null ? e.sentAt === t.sentAt : e.sentAt.equals(t.sentAt);
119
+ return e.uuid === t.uuid && n && e.hasErrors === t.hasErrors;
120
+ }
121
+ function Pe(e) {
122
+ let t = w(() => !0), { isFetchingNextPage: n, isLoading: r, fetchNextPage: i, refetch: a, result: o } = $({ params: {
115
123
  customerUuid: e.customerUuid,
116
124
  isOpen: t,
117
- level: C(() => e.activeLevel.value ?? void 0)
118
- } }), o = C(() => a.value.isOk() ? a.value.getValue().data : []), s = C(() => a.value.isErr() ? a.value.getError() : null), c = $({ params: {
125
+ level: w(() => e.activeLevel.value ?? void 0)
126
+ } });
127
+ function s() {
128
+ return o.value.isOk() ? o.value.getValue().data : [];
129
+ }
130
+ let c = F(/* @__PURE__ */ new Map()), l = w(() => s().map((e) => {
131
+ let t = c.value.get(e.uuid);
132
+ return t !== void 0 && Ne(e.latestCreatedReminder, t) ? {
133
+ ...e,
134
+ latestCreatedReminder: Me
135
+ } : e;
136
+ })), u = w(() => o.value.isErr() ? o.value.getError() : null);
137
+ ee({
138
+ refetch: a,
139
+ sendingUuids: () => l.value.filter((e) => m(e.latestCreatedReminder) === "sending").map((e) => e.uuid),
140
+ onLimitReached: () => {
141
+ c.value = /* @__PURE__ */ new Map();
142
+ }
143
+ });
144
+ let d = $({ params: {
119
145
  customerUuid: e.customerUuid,
120
146
  isOpen: t,
121
- level: C(() => 1)
122
- } }), l = $({ params: {
147
+ level: w(() => 1)
148
+ } }), f = $({ params: {
123
149
  customerUuid: e.customerUuid,
124
150
  isOpen: t,
125
- level: C(() => 2)
126
- } }), u = $({ params: {
151
+ level: w(() => 2)
152
+ } }), p = $({ params: {
127
153
  customerUuid: e.customerUuid,
128
154
  isOpen: t,
129
- level: C(() => 3)
130
- } }), d = C(() => [
131
- c,
132
- l,
133
- u
134
- ].map((e) => e.result.value.isOk() ? e.result.value.getValue().meta.total : null));
155
+ level: w(() => 3)
156
+ } }), h = w(() => [
157
+ d,
158
+ f,
159
+ p
160
+ ].map((e) => e.result.value.isOk() ? e.result.value.getValue().meta.total : null)), g = w(() => [
161
+ d,
162
+ f,
163
+ p
164
+ ].some((e) => e.result.value.isErr())), _ = w(() => h.value.every((e) => e !== null) ? h.value.reduce((e, t) => e + t, 0) : null);
165
+ function v() {
166
+ let e = s();
167
+ return (t) => {
168
+ let n = new Map(c.value);
169
+ for (let r of e) t.includes(r.uuid) || n.set(r.uuid, r.latestCreatedReminder);
170
+ c.value = n;
171
+ };
172
+ }
135
173
  return {
136
- hasLevelCountError: C(() => [
137
- c,
138
- l,
139
- u
140
- ].some((e) => e.result.value.isErr())),
174
+ hasLevelCountError: g,
141
175
  isFetchingNextPage: n,
142
176
  isLoading: r,
143
- data: o,
144
- error: s,
177
+ data: l,
178
+ error: u,
145
179
  fetchNextPage: i,
146
- levelCounts: d,
147
- levelCountTotal: C(() => d.value.every((e) => e !== null) ? d.value.reduce((e, t) => e + t, 0) : null),
148
- result: a
180
+ levelCounts: h,
181
+ levelCountTotal: _,
182
+ trackBulkSend: v
149
183
  };
150
184
  }
151
185
  //#endregion
152
186
  //#region src/modules/dunning-case/api/queries/dunningCaseCustomerIndex.query.ts
153
- function je(e) {
154
- let t = C(() => ({ search: e.params.search?.value }));
187
+ function Fe(e) {
188
+ let t = w(() => ({ search: e.params.search?.value }));
155
189
  return V("dunningCaseCustomerIndex", {
156
190
  params: { queryParams: t },
157
- queryFn: (e) => h.getAll(t.value.search, e)
191
+ queryFn: (e) => _.getAll(t.value.search, e)
158
192
  });
159
193
  }
160
194
  //#endregion
161
195
  //#region src/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewFilters.composable.ts
162
- function Me() {
163
- let e = x(), t = i({ debounceMs: 250 }), n = je({ params: { search: t.debouncedSearch } }), r = C(() => n.result.value.isOk() ? n.result.value.getValue().data : []), a = y({
196
+ function Ie() {
197
+ let e = S(), t = i({ debounceMs: 250 }), n = Fe({ params: { search: t.debouncedSearch } }), r = w(() => n.result.value.isOk() ? n.result.value.getValue().data : []), a = b({
164
198
  actionGroup: { name: "dunning-cases" },
165
- filters: [v({
199
+ filters: [y({
166
200
  defaultValue: {
167
- operator: b.INCLUDES,
201
+ operator: x.INCLUDES,
168
202
  value: []
169
203
  },
170
204
  disableOperators: !0,
171
205
  displayFn: (e) => r.value.find((t) => t.uuid === e)?.name ?? e,
172
206
  key: "customerUuids",
173
207
  label: e.t("module.dunning_case.overview.filter_customer"),
174
- options: async (e) => a.values.value.customerUuids.value.length > 0 ? [] : (t.updateSearch(e), await A(), r.value.map((e) => e.uuid))
208
+ options: async (e) => a.values.value.customerUuids.value.length > 0 ? [] : (t.updateSearch(e), await j(), r.value.map((e) => e.uuid))
175
209
  })]
176
210
  });
177
- return ie(() => a.values.value.customerUuids, (e) => {
178
- (e.operator !== b.INCLUDES || e.value.length > 1) && (a.values.value.customerUuids = {
179
- operator: b.INCLUDES,
211
+ return z(() => a.values.value.customerUuids, (e) => {
212
+ (e.operator !== x.INCLUDES || e.value.length > 1) && (a.values.value.customerUuids = {
213
+ operator: x.INCLUDES,
180
214
  value: e.value.slice(-1)
181
215
  });
182
216
  }, {
183
217
  deep: !0,
184
218
  immediate: !0
185
219
  }), {
186
- customerUuid: C(() => a.values.value.customerUuids.value[0]),
220
+ customerUuid: w(() => a.values.value.customerUuids.value[0]),
187
221
  filters: a
188
222
  };
189
223
  }
190
224
  //#endregion
191
225
  //#region src/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewActionsCell.vue?vue&type=script&setup=true&lang.ts
192
- var Ne = { class: "flex w-full items-center justify-end gap-xs" }, Pe = /* @__PURE__ */ k({
226
+ var Le = { class: "flex w-full items-center justify-end gap-xs" }, Re = /* @__PURE__ */ A({
193
227
  __name: "DunningCaseOverviewActionsCell",
194
228
  props: { item: {} },
195
- emits: ["send", "viewCustomer"],
229
+ emits: [
230
+ "retry",
231
+ "send",
232
+ "viewCustomer"
233
+ ],
196
234
  setup(e, { emit: t }) {
197
- let n = e, i = t, a = x(), o = r(), c = C(() => o.getCustomerDetailRoute(n.item.customer.uuid)), l = C(() => n.item.blockedReason !== null), u = C(() => g(n.item.latestCreatedReminder)), f = C(() => l.value ? a.t("module.dunning_case.overview.blocked") : n.item.nextReminderOn === null ? a.t("module.dunning_case.overview.not_scheduled") : a.t("module.dunning_case.overview.send"));
198
- return (t, n) => (P(), w(R(Z), null, {
199
- default: z(() => [O(R(ce), { class: "w-full" }, {
200
- default: z(() => [D("div", Ne, [l.value && c.value !== null ? (P(), w(R(G), {
235
+ let n = e, i = t, a = S(), o = r(), s = w(() => o.getCustomerDetailRoute(n.item.customer.uuid)), c = w(() => n.item.blockedReason !== null), u = w(() => m(n.item.latestCreatedReminder)), f = w(() => n.item.canRetryReminder ? a.t("module.dunning_case.overview.retry") : c.value ? a.t("module.dunning_case.overview.blocked") : n.item.nextReminderOn === null ? a.t("module.dunning_case.overview.not_scheduled") : a.t("module.dunning_case.overview.send"));
236
+ return (t, n) => (P(), T(R(Z), null, {
237
+ default: B(() => [k(R(ue), { class: "w-full" }, {
238
+ default: B(() => [O("div", Le, [c.value && s.value !== null ? (P(), T(R(G), {
201
239
  key: 0,
202
- "icon-right": R(s),
240
+ "icon-right": R(l),
203
241
  label: R(a).t("module.dunning_case.overview.fix"),
204
242
  size: "sm",
205
243
  variant: "secondary",
206
244
  onClick: n[0] ||= (e) => i("viewCustomer")
207
- }, null, 8, ["icon-right", "label"])) : (P(), w(R(G), {
245
+ }, null, 8, ["icon-right", "label"])) : (P(), T(R(G), {
208
246
  key: 1,
209
- "icon-right": e.item.canSendReminder ? R(d) : void 0,
210
- "is-disabled": l.value || !e.item.canSendReminder,
247
+ "icon-right": e.item.canSendReminder || e.item.canRetryReminder ? R(d) : void 0,
248
+ "is-disabled": c.value || !e.item.canSendReminder && !e.item.canRetryReminder,
211
249
  "is-loading": u.value === "sending",
212
250
  label: f.value,
213
251
  size: "sm",
214
252
  variant: "secondary",
215
- onClick: n[1] ||= (e) => i("send")
253
+ onClick: n[1] ||= (t) => e.item.canRetryReminder ? i("retry") : i("send")
216
254
  }, null, 8, [
217
255
  "icon-right",
218
256
  "is-disabled",
@@ -224,35 +262,35 @@ var Ne = { class: "flex w-full items-center justify-end gap-xs" }, Pe = /* @__PU
224
262
  _: 1
225
263
  }));
226
264
  }
227
- }), Fe = { class: "truncate text-sm font-medium text-primary" }, Ie = /* @__PURE__ */ k({
265
+ }), ze = { class: "truncate text-sm font-medium text-primary" }, Be = /* @__PURE__ */ A({
228
266
  __name: "DunningCaseOverviewCustomerCell",
229
267
  props: { item: {} },
230
268
  setup(e) {
231
- return (t, n) => (P(), w(R(Z), null, {
232
- default: z(() => [D("span", Fe, L(e.item.customer.name), 1)]),
269
+ return (t, n) => (P(), T(R(Z), null, {
270
+ default: B(() => [O("span", ze, L(e.item.customer.name), 1)]),
233
271
  _: 1
234
272
  }));
235
273
  }
236
- }), Le = /* @__PURE__ */ k({
274
+ }), Ve = /* @__PURE__ */ A({
237
275
  __name: "DunningCaseOverviewDaysOverdueCell",
238
276
  props: { item: {} },
239
277
  setup(e) {
240
- return (t, n) => (P(), w(R(Z), null, {
241
- default: z(() => [D("span", { class: j([{
278
+ return (t, n) => (P(), T(R(Z), null, {
279
+ default: B(() => [O("span", { class: M([{
242
280
  "text-error-primary": e.item.level === 3,
243
281
  "text-primary": e.item.level !== 3
244
282
  }, "w-full text-right font-mono text-sm tabular-nums"]) }, L(e.item.daysOverdue), 3)]),
245
283
  _: 1
246
284
  }));
247
285
  }
248
- }), Re = {
286
+ }), He = {
249
287
  key: 0,
250
288
  class: "font-mono text-xs text-secondary tabular-nums"
251
- }, ze = /* @__PURE__ */ k({
289
+ }, Ue = /* @__PURE__ */ A({
252
290
  __name: "DunningCaseOverviewLastReminderCell",
253
291
  props: { item: {} },
254
292
  setup(e) {
255
- let t = e, n = x(), r = C(() => {
293
+ let t = e, n = S(), r = w(() => {
256
294
  if (t.item.level === null) return null;
257
295
  if (t.item.lastReminderSentAt === null) return n.t("module.dunning_case.overview.last_reminder_not_sent");
258
296
  let e = U.Now.instant().epochMilliseconds - t.item.lastReminderSentAt.epochMilliseconds, r = Math.floor(e / 36e5);
@@ -264,45 +302,45 @@ var Ne = { class: "flex w-full items-center justify-end gap-xs" }, Pe = /* @__PU
264
302
  level: t.item.level
265
303
  });
266
304
  });
267
- return (e, t) => (P(), w(R(Z), null, {
268
- default: z(() => [r.value === null ? T("", !0) : (P(), E("span", Re, L(r.value), 1))]),
305
+ return (e, t) => (P(), T(R(Z), null, {
306
+ default: B(() => [r.value === null ? E("", !0) : (P(), D("span", He, L(r.value), 1))]),
269
307
  _: 1
270
308
  }));
271
309
  }
272
- }), Be = {
310
+ }), We = {
273
311
  key: 0,
274
312
  class: "flex min-w-0 items-center gap-sm"
275
- }, Ve = { class: "truncate text-xs text-primary" }, He = /* @__PURE__ */ k({
313
+ }, Ge = { class: "truncate text-xs text-primary" }, Ke = /* @__PURE__ */ A({
276
314
  __name: "DunningCaseOverviewLevelCell",
277
315
  props: { item: {} },
278
316
  setup(e) {
279
- let t = x();
317
+ let t = S();
280
318
  function n(e) {
281
319
  return e === 0 ? t.t("module.dunning_case.level.none") : t.t("module.dunning_case.level.reminder", { level: e });
282
320
  }
283
- return (t, r) => (P(), w(R(Z), null, {
284
- default: z(() => [e.item.level === null ? T("", !0) : (P(), E("div", Be, [O(a, {
321
+ return (t, r) => (P(), T(R(Z), null, {
322
+ default: B(() => [e.item.level === null ? E("", !0) : (P(), D("div", We, [k(a, {
285
323
  level: e.item.level,
286
324
  size: "sm"
287
- }, null, 8, ["level"]), D("span", Ve, L(n(e.item.level)), 1)]))]),
325
+ }, null, 8, ["level"]), O("span", Ge, L(n(e.item.level)), 1)]))]),
288
326
  _: 1
289
327
  }));
290
328
  }
291
- }), Ue = { class: "w-full text-right font-mono text-sm font-medium text-primary tabular-nums" }, We = /* @__PURE__ */ k({
329
+ }), qe = { class: "w-full text-right font-mono text-sm font-medium text-primary tabular-nums" }, Je = /* @__PURE__ */ A({
292
330
  __name: "DunningCaseOverviewOutstandingCell",
293
331
  props: { item: {} },
294
332
  setup(e) {
295
333
  let t = n();
296
- return (n, r) => (P(), w(R(Z), null, {
297
- default: z(() => [D("span", Ue, L(R(t).formatMonetary(e.item.outstandingBalance)), 1)]),
334
+ return (n, r) => (P(), T(R(Z), null, {
335
+ default: B(() => [O("span", qe, L(R(t).formatMonetary(e.item.outstandingBalance)), 1)]),
298
336
  _: 1
299
337
  }));
300
338
  }
301
- }), Ge = { class: "flex flex-col items-start gap-xxs" }, Ke = /* @__PURE__ */ k({
339
+ }), Ye = { class: "flex flex-col items-start gap-xxs" }, Xe = /* @__PURE__ */ A({
302
340
  __name: "DunningCaseOverviewReminderCell",
303
341
  props: { item: {} },
304
342
  setup(e) {
305
- let t = e, n = x(), r = C(() => g(t.item.latestCreatedReminder));
343
+ let t = e, n = S(), r = w(() => m(t.item.latestCreatedReminder));
306
344
  function i(e) {
307
345
  let t = U.Now.plainDateISO().until(e, { largestUnit: "days" }).days;
308
346
  return t <= 0 ? n.t("module.dunning_case.overview.due_today") : n.t("module.dunning_case.overview.due_in_days", { count: t });
@@ -310,14 +348,14 @@ var Ne = { class: "flex w-full items-center justify-end gap-xs" }, Pe = /* @__PU
310
348
  function a(e) {
311
349
  return U.PlainDate.compare(e, U.Now.plainDateISO()) <= 0;
312
350
  }
313
- return (t, n) => (P(), w(R(Z), null, {
314
- default: z(() => [D("div", Ge, [e.item.nextReminderOn === null ? T("", !0) : (P(), w(R(W), {
351
+ return (t, n) => (P(), T(R(Z), null, {
352
+ default: B(() => [O("div", Ye, [e.item.nextReminderOn === null ? E("", !0) : (P(), T(R(W), {
315
353
  key: 0,
316
354
  color: a(e.item.nextReminderOn) ? "success" : "warning",
317
355
  label: i(e.item.nextReminderOn),
318
356
  size: "sm",
319
357
  variant: "translucent"
320
- }, null, 8, ["color", "label"])), O(m, {
358
+ }, null, 8, ["color", "label"])), k(h, {
321
359
  "blocked-reason": e.item.blockedReason,
322
360
  status: r.value
323
361
  }, null, 8, ["blocked-reason", "status"])])]),
@@ -327,9 +365,9 @@ var Ne = { class: "flex w-full items-center justify-end gap-xs" }, Pe = /* @__PU
327
365
  });
328
366
  //#endregion
329
367
  //#region src/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewTableColumns.composable.ts
330
- function qe(e) {
331
- let t = x();
332
- return C(() => fe()([
368
+ function Ze(e) {
369
+ let t = S();
370
+ return w(() => me()([
333
371
  {
334
372
  headerLabel: t.t("module.dunning_case.overview.table.customer"),
335
373
  key: "customer",
@@ -337,7 +375,7 @@ function qe(e) {
337
375
  max: "1fr",
338
376
  min: "12rem"
339
377
  },
340
- component: (e) => Q(Ie, { item: e })
378
+ component: (e) => Q(Be, { item: e })
341
379
  },
342
380
  {
343
381
  headerLabel: t.t("module.dunning_case.overview.table.level"),
@@ -346,7 +384,7 @@ function qe(e) {
346
384
  max: "10rem",
347
385
  min: "8rem"
348
386
  },
349
- component: (e) => Q(He, { item: e })
387
+ component: (e) => Q(Ke, { item: e })
350
388
  },
351
389
  {
352
390
  headerLabel: t.t("module.dunning_case.overview.table.days_overdue"),
@@ -355,7 +393,7 @@ function qe(e) {
355
393
  max: "9rem",
356
394
  min: "7rem"
357
395
  },
358
- component: (e) => Q(Le, { item: e })
396
+ component: (e) => Q(Ve, { item: e })
359
397
  },
360
398
  {
361
399
  headerLabel: t.t("module.dunning_case.overview.table.next_reminder"),
@@ -364,7 +402,7 @@ function qe(e) {
364
402
  max: "14rem",
365
403
  min: "10rem"
366
404
  },
367
- component: (e) => Q(Ke, { item: e })
405
+ component: (e) => Q(Xe, { item: e })
368
406
  },
369
407
  {
370
408
  headerLabel: t.t("module.dunning_case.overview.table.last_reminder"),
@@ -373,7 +411,7 @@ function qe(e) {
373
411
  max: "12rem",
374
412
  min: "9rem"
375
413
  },
376
- component: (e) => Q(ze, { item: e })
414
+ component: (e) => Q(Ue, { item: e })
377
415
  },
378
416
  {
379
417
  headerLabel: t.t("module.dunning_case.overview.table.outstanding"),
@@ -382,7 +420,7 @@ function qe(e) {
382
420
  max: "10rem",
383
421
  min: "8rem"
384
422
  },
385
- component: (e) => Q(We, { item: e })
423
+ component: (e) => Q(Je, { item: e })
386
424
  },
387
425
  {
388
426
  headerLabel: "",
@@ -391,8 +429,9 @@ function qe(e) {
391
429
  max: "11rem",
392
430
  min: "9rem"
393
431
  },
394
- component: (t) => Q(Pe, {
432
+ component: (t) => Q(Re, {
395
433
  item: t,
434
+ onRetry: () => e.onRetry(t),
396
435
  onSend: () => e.onSend(t),
397
436
  onViewCustomer: () => e.onViewCustomer(t)
398
437
  })
@@ -401,8 +440,8 @@ function qe(e) {
401
440
  }
402
441
  //#endregion
403
442
  //#region src/modules/dunning-case/api/mutations/dunningCaseBulkSend.mutation.ts
404
- function Je() {
405
- return B({
443
+ function Qe() {
444
+ return oe({
406
445
  queryFn: (e) => o.sendBulk(e.params.queryParams),
407
446
  queryKeysToInvalidate: {
408
447
  dunningCaseDetail: {},
@@ -412,7 +451,7 @@ function Je() {
412
451
  }
413
452
  //#endregion
414
453
  //#region src/modules/dunning-case/use-cases/send/components/DunningCaseBulkSendStat.vue
415
- var Ye = /* @__PURE__ */ k({
454
+ var $e = /* @__PURE__ */ A({
416
455
  __name: "DunningCaseBulkSendStat",
417
456
  props: {
418
457
  hasSeparator: { type: Boolean },
@@ -422,20 +461,20 @@ var Ye = /* @__PURE__ */ k({
422
461
  },
423
462
  setup(e) {
424
463
  let t = e;
425
- return (e, n) => (P(), E("div", { class: j([{ "border-r border-secondary": t.hasSeparator }, "p-lg"]) }, [D("p", { class: j([{
464
+ return (e, n) => (P(), D("div", { class: M([{ "border-r border-secondary": t.hasSeparator }, "p-lg"]) }, [O("p", { class: M([{
426
465
  "text-primary": t.tone === "default",
427
466
  "text-success-primary": t.tone === "success",
428
467
  "text-warning-primary": t.tone === "warning"
429
- }, "font-mono text-2xl font-semibold tabular-nums"]) }, L(t.value), 3), D("p", { class: j([{
468
+ }, "font-mono text-2xl font-semibold tabular-nums"]) }, L(t.value), 3), O("p", { class: M([{
430
469
  "text-secondary": t.tone === "default",
431
470
  "text-success-primary": t.tone === "success",
432
471
  "text-warning-primary": t.tone === "warning"
433
472
  }, "mt-xs text-xs font-medium uppercase"]) }, L(t.label), 3)], 2));
434
473
  }
435
- }), Xe = { class: "flex flex-col gap-md" }, Ze = { class: "grid grid-cols-3 overflow-hidden rounded-md border border-secondary" }, Qe = { class: "rounded-md bg-success-primary px-lg py-md text-sm font-medium text-success-primary" }, $e = {
474
+ }), et = { class: "flex flex-col gap-md" }, tt = { class: "grid grid-cols-3 overflow-hidden rounded-md border border-secondary" }, nt = { class: "rounded-md bg-success-primary px-lg py-md text-sm font-medium text-success-primary" }, rt = {
436
475
  key: 0,
437
476
  class: "rounded-md border border-secondary px-lg py-md text-sm text-secondary"
438
- }, et = /* @__PURE__ */ k({
477
+ }, it = /* @__PURE__ */ A({
439
478
  __name: "DunningCaseBulkSendSummary",
440
479
  props: {
441
480
  processableCount: {},
@@ -443,7 +482,7 @@ var Ye = /* @__PURE__ */ k({
443
482
  totalCount: {}
444
483
  },
445
484
  setup(e) {
446
- let t = e, n = x(), r = C(() => [
485
+ let t = e, n = S(), r = w(() => [
447
486
  {
448
487
  label: n.t("module.dunning_case.bulk_send.total"),
449
488
  tone: "default",
@@ -460,8 +499,8 @@ var Ye = /* @__PURE__ */ k({
460
499
  value: t.skippedCount
461
500
  }
462
501
  ]);
463
- return (e, i) => (P(), E("div", Xe, [
464
- D("div", Ze, [(P(!0), E(S, null, I(r.value, (e, t) => (P(), w(Ye, {
502
+ return (e, i) => (P(), D("div", et, [
503
+ O("div", tt, [(P(!0), D(C, null, I(r.value, (e, t) => (P(), T($e, {
465
504
  key: e.label,
466
505
  "has-separator": t < r.value.length - 1,
467
506
  label: e.label,
@@ -473,14 +512,14 @@ var Ye = /* @__PURE__ */ k({
473
512
  "tone",
474
513
  "value"
475
514
  ]))), 128))]),
476
- D("p", Qe, L(R(n).t("module.dunning_case.bulk_send.processable", { count: t.processableCount })), 1),
477
- t.skippedCount > 0 ? (P(), E("p", $e, L(R(n).t("module.dunning_case.bulk_send.skipped", { count: t.skippedCount })), 1)) : T("", !0)
515
+ O("p", nt, L(R(n).t("module.dunning_case.bulk_send.processable", { count: t.processableCount })), 1),
516
+ t.skippedCount > 0 ? (P(), D("p", rt, L(R(n).t("module.dunning_case.bulk_send.skipped", { count: t.skippedCount })), 1)) : E("", !0)
478
517
  ]));
479
518
  }
480
- }), tt = {
519
+ }), at = {
481
520
  key: 0,
482
521
  class: "text-sm text-secondary"
483
- }, nt = /* @__PURE__ */ k({
522
+ }, ot = /* @__PURE__ */ A({
484
523
  __name: "DunningCaseBulkSendDialog",
485
524
  props: { onSent: { type: Function } },
486
525
  emits: ["close"],
@@ -495,7 +534,7 @@ var Ye = /* @__PURE__ */ k({
495
534
  function s(e) {
496
535
  return Object.hasOwn(a, e);
497
536
  }
498
- let c = x(), l = me(), u = Je(), f = F(null), p = F(!0), m = C(() => f.value?.meta.processed ?? 0);
537
+ let c = S(), l = ge(), u = Qe(), f = F(null), p = F(!0), m = w(() => f.value?.meta.processed ?? 0);
499
538
  function h(e) {
500
539
  let t = e.errors.at(0)?.errors.at(0)?.code;
501
540
  return t !== void 0 && s(t) ? c.t(a[t]) : c.t("module.dunning_case.bulk_send.skip_reason.unknown");
@@ -511,8 +550,8 @@ var Ye = /* @__PURE__ */ k({
511
550
  reason: e
512
551
  })).join(", ");
513
552
  }
514
- let _ = ge({
515
- schema: re.object({}),
553
+ let _ = ve({
554
+ schema: ie.object({}),
516
555
  onSubmit: async () => {
517
556
  let e = await u.execute({ params: { queryParams: i } });
518
557
  if (e.isErr()) {
@@ -532,7 +571,7 @@ var Ye = /* @__PURE__ */ k({
532
571
  skipped: e.value.meta.skipped,
533
572
  summary: t
534
573
  })
535
- }), n.onSent(), r("close");
574
+ }), n.onSent(e.value.skipped.map((e) => e.uuid)), r("close");
536
575
  }
537
576
  });
538
577
  async function v() {
@@ -545,13 +584,13 @@ var Ye = /* @__PURE__ */ k({
545
584
  }
546
585
  return N(() => {
547
586
  v();
548
- }), (e, t) => (P(), w(R(oe), {
587
+ }), (e, t) => (P(), T(R(ce), {
549
588
  form: R(_),
550
589
  size: "md",
551
590
  onClose: t[0] ||= (e) => r("close")
552
591
  }, {
553
- default: z(() => [
554
- O(R(X), {
592
+ default: B(() => [
593
+ k(R(X), {
555
594
  title: p.value ? R(c).t("module.dunning_case.bulk_send.title") : R(c).t("module.dunning_case.bulk_send.confirm_question", { count: m.value }),
556
595
  description: R(c).t("module.dunning_case.bulk_send.description"),
557
596
  "has-separator": !1,
@@ -561,8 +600,8 @@ var Ye = /* @__PURE__ */ k({
561
600
  "description",
562
601
  "icon"
563
602
  ]),
564
- O(R(K), null, {
565
- default: z(() => [f.value === null ? (P(), E("p", tt, L(R(c).t("module.dunning_case.bulk_send.loading")), 1)) : (P(), w(et, {
603
+ k(R(K), null, {
604
+ default: B(() => [f.value === null ? (P(), D("p", at, L(R(c).t("module.dunning_case.bulk_send.loading")), 1)) : (P(), T(it, {
566
605
  key: 1,
567
606
  "processable-count": f.value.meta.processed,
568
607
  "skipped-count": f.value.meta.skipped,
@@ -574,8 +613,8 @@ var Ye = /* @__PURE__ */ k({
574
613
  ]))]),
575
614
  _: 1
576
615
  }),
577
- O(R(q), { "has-separator": !1 }, {
578
- right: z(() => [O(R(J)), O(R(Y), {
616
+ k(R(q), { "has-separator": !1 }, {
617
+ right: B(() => [k(R(J)), k(R(Y), {
579
618
  "icon-right": R(d),
580
619
  "is-disabled": p.value || m.value === 0,
581
620
  "is-loading": R(_).isSubmitting.value,
@@ -594,18 +633,18 @@ var Ye = /* @__PURE__ */ k({
594
633
  _: 1
595
634
  }, 8, ["form"]));
596
635
  }
597
- }), rt = { class: "flex min-h-0 flex-1 flex-col gap-xl px-3xl py-xl" }, it = { class: "flex shrink-0 flex-col gap-lg md:flex-row md:items-center md:justify-between" }, at = { class: "text-lg font-semibold text-primary" }, ot = { class: "mt-xs text-sm text-secondary" }, st = { class: "flex items-center gap-sm" }, ct = {
636
+ }), st = { class: "flex min-h-0 flex-1 flex-col gap-xl px-3xl py-xl" }, ct = { class: "flex shrink-0 flex-col gap-lg md:flex-row md:items-center md:justify-between" }, lt = { class: "text-lg font-semibold text-primary" }, ut = { class: "mt-xs text-sm text-secondary" }, dt = { class: "flex items-center gap-sm" }, ft = {
598
637
  key: 0,
599
638
  class: "shrink-0"
600
- }, lt = { class: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-secondary bg-primary shadow-sm" }, ut = { class: "flex flex-col gap-md border-b border-secondary p-sm md:flex-row md:items-center md:justify-between" }, dt = { class: "flex items-center justify-between gap-md border-b border-secondary p-sm" }, ft = {
639
+ }, pt = { class: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-secondary bg-primary shadow-sm" }, mt = { class: "flex flex-col gap-md border-b border-secondary p-sm md:flex-row md:items-center md:justify-between" }, ht = { class: "flex items-center justify-between gap-md border-b border-secondary p-sm" }, gt = {
601
640
  key: 0,
602
641
  class: "px-sm text-xs text-secondary"
603
- }, pt = { class: "relative flex min-h-0 flex-1 flex-col" }, mt = /*@__PURE__*/ k({
642
+ }, _t = { class: "relative flex min-h-0 flex-1 flex-col" }, vt = /*@__PURE__*/ A({
604
643
  __name: "DunningCaseOverviewView",
605
644
  setup(e) {
606
- let n = x(), i = pe(), a = H(), o = t(), s = r(), f = F("all"), m = C(() => [
645
+ let n = S(), i = he(), a = ge(), o = H(), l = t(), f = r(), m = g(), h = F("all"), _ = w(() => [
607
646
  {
608
- icon: l,
647
+ icon: s,
609
648
  key: "all",
610
649
  label: n.t("module.dunning_case.overview.filter_all")
611
650
  },
@@ -624,67 +663,80 @@ var Ye = /* @__PURE__ */ k({
624
663
  key: "level-3",
625
664
  label: n.t("module.dunning_case.level.reminder", { level: 3 })
626
665
  }
627
- ]), h = C(() => f.value === "all" ? null : Number(f.value.replace("level-", ""))), g = F(!0), { customerUuid: v, filters: y } = Me();
628
- ee(y), o.set(() => n.t("module.dunning_case.title"));
629
- let { hasLevelCountError: b, isFetchingNextPage: re, isLoading: k, data: A, error: j, fetchNextPage: M, levelCounts: N, levelCountTotal: ie, result: B } = Ae({
630
- customerUuid: v,
631
- activeLevel: h
632
- }), V = C(() => y.activeFilters.value.length);
633
- function U(e) {
634
- i.create(_, { props: { dunningCaseUuid: e.uuid } }).open();
666
+ ]), ee = w(() => h.value === "all" ? null : Number(h.value.replace("level-", ""))), y = F(!0), { customerUuid: b, filters: x } = Ie();
667
+ te(x), l.set(() => n.t("module.dunning_case.title"));
668
+ let { hasLevelCountError: ie, isFetchingNextPage: A, isLoading: j, data: M, error: ae, fetchNextPage: N, levelCounts: z, levelCountTotal: oe, trackBulkSend: V } = Pe({
669
+ customerUuid: b,
670
+ activeLevel: ee
671
+ }), U = w(() => x.activeFilters.value.length);
672
+ function W(e) {
673
+ i.create(v, { props: { dunningCaseUuid: e.uuid } }).open();
635
674
  }
636
- function W() {
637
- i.create(nt, { props: { onSent: () => {
638
- B.value;
639
- } } }).open();
675
+ async function K(e) {
676
+ if (e.latestCreatedReminder === null) return;
677
+ let t = await m.execute({ params: { dunningCaseReminderUuid: e.latestCreatedReminder.uuid } });
678
+ if (t.isErr()) {
679
+ a.apiError(t.error);
680
+ return;
681
+ }
682
+ a.show({
683
+ duration: Infinity,
684
+ message: n.t("module.dunning_case.retry.success", { customer: e.customer.name })
685
+ });
686
+ }
687
+ function q() {
688
+ i.create(ot, { props: { onSent: V() } }).open();
640
689
  }
641
- function K(e) {
642
- let t = s.getCustomerDetailRoute(e.customer.uuid);
643
- t !== null && a.push(t);
690
+ function J(e) {
691
+ let t = f.getCustomerDetailRoute(e.customer.uuid);
692
+ t !== null && o.push(t);
644
693
  }
645
- function q(e) {
694
+ function Y(e) {
646
695
  return {
647
696
  name: "dunning-case-detail",
648
697
  params: { dunningCaseUuid: e.uuid }
649
698
  };
650
699
  }
651
- let J = ve(), Y = _e(), X = qe({
652
- onSend: U,
653
- onViewCustomer: K
700
+ let X = be(), ce = ye(), Z = Ze({
701
+ onRetry: (e) => {
702
+ K(e);
703
+ },
704
+ onSend: W,
705
+ onViewCustomer: J
654
706
  });
655
- return (e, t) => (P(), w(R(ae), {
707
+ return (e, t) => (P(), T(R(se), {
656
708
  title: R(n).t("module.dunning_case.title"),
657
709
  "is-title-hidden": !0
658
710
  }, {
659
- default: z(() => [D("div", rt, [
660
- D("div", it, [D("div", null, [D("h2", at, L(R(n).t("module.dunning_case.title")), 1), D("p", ot, L(R(n).t("module.dunning_case.overview.description")), 1)]), D("div", st, [O(R(G), {
661
- "icon-left": g.value ? R(p) : R(c),
662
- label: R(n).t(g.value ? "module.dunning_case.overview.hide_metrics" : "module.dunning_case.overview.show_metrics"),
711
+ default: B(() => [O("div", st, [
712
+ O("div", ct, [O("div", null, [O("h2", lt, L(R(n).t("module.dunning_case.title")), 1), O("p", ut, L(R(n).t("module.dunning_case.overview.description")), 1)]), O("div", dt, [k(R(G), {
713
+ "icon-left": y.value ? R(p) : R(c),
714
+ label: R(n).t(y.value ? "module.dunning_case.overview.hide_metrics" : "module.dunning_case.overview.show_metrics"),
663
715
  variant: "secondary",
664
- onClick: t[0] ||= (e) => g.value = !g.value
665
- }, null, 8, ["icon-left", "label"]), O(R(G), {
716
+ onClick: t[0] ||= (e) => y.value = !y.value
717
+ }, null, 8, ["icon-left", "label"]), k(R(G), {
666
718
  "icon-right": R(d),
667
719
  label: R(n).t("module.dunning_case.overview.send_all"),
668
- onClick: W
720
+ onClick: q
669
721
  }, null, 8, ["icon-right", "label"])])]),
670
- g.value ? (P(), E("div", ct, [O(ke, {
671
- "has-level-count-error": R(b),
672
- "level-counts": R(N),
673
- "level-count-total": R(ie)
722
+ y.value ? (P(), D("div", ft, [k(je, {
723
+ "has-level-count-error": R(ie),
724
+ "level-counts": R(z),
725
+ "level-count-total": R(oe)
674
726
  }, null, 8, [
675
727
  "has-level-count-error",
676
728
  "level-counts",
677
729
  "level-count-total"
678
- ])])) : T("", !0),
679
- D("div", lt, [
680
- D("div", ut, [O(R(le), {
681
- modelValue: f.value,
682
- "onUpdate:modelValue": t[1] ||= (e) => f.value = e,
730
+ ])])) : E("", !0),
731
+ O("div", pt, [
732
+ O("div", mt, [k(R(de), {
733
+ modelValue: h.value,
734
+ "onUpdate:modelValue": t[1] ||= (e) => h.value = e,
683
735
  "aria-label": R(n).t("module.dunning_case.overview.filter_label"),
684
736
  variant: "button-border"
685
737
  }, {
686
- default: z(() => [O(R(de), null, {
687
- default: z(() => [(P(!0), E(S, null, I(m.value, (e) => (P(), w(R(ue), {
738
+ default: B(() => [k(R(pe), null, {
739
+ default: B(() => [(P(!0), D(C, null, I(_.value, (e) => (P(), T(R(fe), {
688
740
  key: e.key,
689
741
  config: { left: {
690
742
  icon: e.icon,
@@ -700,31 +752,31 @@ var Ye = /* @__PURE__ */ k({
700
752
  _: 1
701
753
  })]),
702
754
  _: 1
703
- }, 8, ["modelValue", "aria-label"]), O(R(G), {
755
+ }, 8, ["modelValue", "aria-label"]), k(R(G), {
704
756
  "icon-right": R(d),
705
757
  label: R(n).t("module.dunning_case.overview.send_all"),
706
758
  size: "sm",
707
- onClick: W
759
+ onClick: q
708
760
  }, null, 8, ["icon-right", "label"])]),
709
- D("div", dt, [V.value === 0 ? (P(), E("p", ft, L(R(n).t("module.dunning_case.overview.no_active_filters")), 1)) : (P(), w(R(te), { key: 1 })), O(R(ne))]),
710
- D("div", pt, [O(R(se), {
711
- "active-filter-count": V.value,
712
- columns: R(X),
713
- data: R(A),
714
- error: R(j),
761
+ O("div", ht, [U.value === 0 ? (P(), D("p", gt, L(R(n).t("module.dunning_case.overview.no_active_filters")), 1)) : (P(), T(R(ne), { key: 1 })), k(R(re))]),
762
+ O("div", _t, [k(R(le), {
763
+ "active-filter-count": U.value,
764
+ columns: R(Z),
765
+ data: R(M),
766
+ error: R(ae),
715
767
  "get-key": (e) => e.uuid,
716
- actions: [R(J), R(Y)],
768
+ actions: [R(X), R(ce)],
717
769
  "get-action-model": (e) => ({
718
770
  key: e.uuid,
719
771
  modelName: "DunningCase",
720
772
  ...e
721
773
  }),
722
- "get-link": q,
723
- "is-fetching-next-page": R(re),
724
- "is-loading": R(k),
774
+ "get-link": Y,
775
+ "is-fetching-next-page": R(A),
776
+ "is-loading": R(j),
725
777
  variant: "full-page",
726
- onClearFilters: t[2] ||= (e) => R(y).clearAll(),
727
- onNextPage: R(M)
778
+ onClearFilters: t[2] ||= (e) => R(x).clearAll(),
779
+ onNextPage: R(N)
728
780
  }, null, 8, [
729
781
  "active-filter-count",
730
782
  "columns",
@@ -742,6 +794,6 @@ var Ye = /* @__PURE__ */ k({
742
794
  _: 1
743
795
  }, 8, ["title"]));
744
796
  }
745
- }), ht = /* @__PURE__ */ e({ default: () => gt }), gt = mt;
797
+ }), yt = /* @__PURE__ */ e({ default: () => bt }), bt = vt;
746
798
  //#endregion
747
- export { ht as n, $ as r, gt as t };
799
+ export { yt as n, $ as r, bt as t };