@tesouro/embedded-components-react 0.5.303 → 0.5.305

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 (52) hide show
  1. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +9 -9
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +7 -7
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +10 -9
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +8 -7
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +7 -8
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +8 -28
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +24 -157
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +20 -13
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +13 -34
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +153 -89
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +17 -83
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +23 -3
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +42 -55
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +93 -107
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +77 -185
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +3 -80
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +55 -72
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +111 -113
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +184 -463
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +14 -4
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +78 -11
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +61 -74
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +115 -80
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +449 -216
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +116 -42
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +11 -249
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +85 -23
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +80 -648
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +240 -4
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +44 -40
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +38 -15
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +242 -240
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +25 -3
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +538 -3
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +3 -66
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +42 -1
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +239 -0
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +3 -0
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +5 -0
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +67 -0
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +1 -0
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +227 -38
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +82 -224
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +45 -82
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +4 -47
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index.js +2 -2
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index29.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +2 -2
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillsTab.js +6 -6
  51. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  52. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- import "./index20.js";
2
- import "./index25.js";
3
- import "./index33.js";
4
- import "./index35.js";
5
- import "./index37.js";
1
+ import "./index24.js";
2
+ import "./index29.js";
6
3
  import "./index38.js";
7
- import "./index39.js";
8
4
  import "./index40.js";
9
- import "./index41.js";
10
- import { BillCreateWidget as e, BillDetailsWidget as t } from "./index43.js";
5
+ import "./index42.js";
6
+ import "./index43.js";
11
7
  import "./index44.js";
12
- export { e as BillCreateWidget, t as BillDetailsWidget };
8
+ import "./index45.js";
9
+ import "./index46.js";
10
+ import { BillDetailsWidget as e, BillDialogWidget as t } from "./index48.js";
11
+ import "./index49.js";
12
+ export { e as BillDetailsWidget, t as BillDialogWidget };
@@ -11,17 +11,17 @@ import { useWidgetConfig as i } from "../../../../shared/feature/dist/lib/Widget
11
11
  import "../../../../shared/feature/dist/index.js";
12
12
  import { useGetApprovalPoliciesQuery as a } from "../../../../shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js";
13
13
  import "../../../../shared/approval-policy/data-access/dist/index.js";
14
- import { buildApprovalPolicyCardView as o } from "./index8.js";
14
+ import { buildApprovalPolicyCardView as o } from "./index7.js";
15
15
  import { usePayableApprovalRequestsQuery as s } from "../../data-access/dist/index2.js";
16
16
  import "../../data-access/dist/index.js";
17
- import { currentApprovalRound as c } from "./index3.js";
18
- import { usePayableApprovalRoundStart as l } from "./index11.js";
19
- import { buildPendingApproverGroups as u } from "./index9.js";
20
- import { buildPendingApproverGroupsFromCardView as d } from "./index10.js";
17
+ import { currentApprovalRound as c } from "./index8.js";
18
+ import { buildPendingApproverGroups as l } from "./index9.js";
19
+ import { buildPendingApproverGroupsFromCardView as u } from "./index10.js";
20
+ import { usePayableApprovalRoundStart as d } from "./index11.js";
21
21
  import { useMemo as f } from "react";
22
22
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js
23
23
  function p({ payableId: p, approvalPolicyId: m, enabled: h = !0, copy: g }) {
24
- let _ = h && !!m, { initResponse: v } = i(), y = e(v?.scopes, [t.ApprovalPolicyReadOrg]), b = e(v?.scopes, [t.ApprovalRequestReadOrg]), x = e(v?.scopes, [t.RoleReadOrg]), S = e(v?.scopes, [t.UserReadOrg]), C = a({ enabled: _ && y }), w = n({ enabled: _ && x }), T = r({ enabled: _ && S }), E = s(p, { enabled: _ && b }), { roundStartedAt: D } = l({
24
+ let _ = h && !!m, { initResponse: v } = i(), y = e(v?.scopes, [t.ApprovalPolicyReadOrg]), b = e(v?.scopes, [t.ApprovalRequestReadOrg]), x = e(v?.scopes, [t.RoleReadOrg]), S = e(v?.scopes, [t.UserReadOrg]), C = a({ enabled: _ && y }), w = n({ enabled: _ && x }), T = r({ enabled: _ && S }), E = s(p, { enabled: _ && b }), { roundStartedAt: D } = d({
25
25
  payableId: p,
26
26
  enabled: _ && b
27
27
  }), O = f(() => {
@@ -51,7 +51,7 @@ function p({ payableId: p, approvalPolicyId: m, enabled: h = !0, copy: g }) {
51
51
  ]);
52
52
  return {
53
53
  view: N,
54
- pendingApprovers: f(() => _ ? N ? d(N) : u({
54
+ pendingApprovers: f(() => _ ? N ? u(N) : l({
55
55
  requestsNewestFirst: E.data?.data,
56
56
  roundStartedAt: D,
57
57
  lookup: O
@@ -1,13 +1,14 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js
2
- function e({ isCapabilityUnknown: e, canApproveNow: t, canOverridePolicy: n, status: r, hasApprovalPolicy: i, pendingApproverNames: a, labels: o }) {
3
- if (e) return { showApprovalOverrideNotice: !1 };
4
- if (n) return { showApprovalOverrideNotice: !t };
5
- if (t || r !== "approve_in_progress" || !i) return { showApprovalOverrideNotice: !1 };
6
- let s = [...new Set(a)];
7
- return {
8
- showApprovalOverrideNotice: !1,
9
- awaitingApprovalNotice: s.length ? o.awaitingApprovalNotice(s) : o.awaitingApprovalUnknownNotice
2
+ function e(e) {
3
+ return [e.nominal_code, e.name].filter(Boolean).join(" — ");
4
+ }
5
+ function t({ isInitResolved: e, canReadGlCodes: t, isResolving: n, isError: r, optionCount: i, labels: a }) {
6
+ let o;
7
+ return e ? t ? r ? o = a.loadError : !n && i === 0 && (o = a.empty) : o = a.noAccess : o = void 0, {
8
+ unavailableMessage: o,
9
+ disabled: !e || !!o || n,
10
+ rosterAvailable: t && !n && !r
10
11
  };
11
12
  }
12
13
  //#endregion
13
- export { e as resolveApprovalNotices };
14
+ export { e as formatGlCodeLabel, t as resolveGlCodeAvailability };
@@ -1,12 +1,13 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js
2
- function e(e, t) {
3
- if (!e) return;
4
- let { onOpen: n, canEditExisting: r, ...i } = e;
2
+ function e({ isCapabilityUnknown: e, canApproveNow: t, canOverridePolicy: n, status: r, hasApprovalPolicy: i, pendingApproverNames: a, labels: o }) {
3
+ if (e) return { showApprovalOverrideNotice: !1 };
4
+ if (n) return { showApprovalOverrideNotice: !t };
5
+ if (t || r !== "approve_in_progress" || !i) return { showApprovalOverrideNotice: !1 };
6
+ let s = [...new Set(a)];
5
7
  return {
6
- ...i,
7
- onEditExisting: t && r ? n : void 0,
8
- onAdd: t ? void 0 : n
8
+ showApprovalOverrideNotice: !1,
9
+ awaitingApprovalNotice: s.length ? o.awaitingApprovalNotice(s) : o.awaitingApprovalUnknownNotice
9
10
  };
10
11
  }
11
12
  //#endregion
12
- export { e as resolvePaymentInstructionsGestures };
13
+ export { e as resolveApprovalNotices };
@@ -1,13 +1,12 @@
1
- import { formatRejectionDate as e } from "../../../../shared/util/dist/lib/formatRejectionDate.js";
2
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js
3
- function t({ payableStatus: t, approvalRequests: n, userNames: r, payableUpdatedAt: i, labels: a, now: o }) {
4
- let s = n.find((e) => e.status === "rejected");
5
- if (!s) return t !== "rejected" || !i ? void 0 : { actorLabel: a.rejectedOn(e(i, o)) };
6
- let c = s.rejected_by ? r.get(s.rejected_by) : void 0, l = e(s.updated_at, o);
2
+ function e(e, t) {
3
+ if (!e) return;
4
+ let { onOpen: n, canEditExisting: r, ...i } = e;
7
5
  return {
8
- actorLabel: c ? a.rejectedByOn(c, l) : a.rejectedOn(l),
9
- message: s.reject_reason ? a.rejectionMessage(s.reject_reason) : void 0
6
+ ...i,
7
+ onEditExisting: t && r ? n : void 0,
8
+ onAdd: t ? void 0 : n
10
9
  };
11
10
  }
12
11
  //#endregion
13
- export { t as resolveBillRejectionNotice };
12
+ export { e as resolvePaymentInstructionsGestures };
@@ -1,33 +1,13 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
6
- import { useCurrentUserQuery as t } from "../../../../shared/data-access/dist/lib/useCurrentUserQuery.js";
7
- import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
8
- import "../../../../shared/data-access/dist/index.js";
9
- import { useWidgetConfig as r } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
- import "../../../../shared/feature/dist/index.js";
11
- import { usePayableApprovalRequestsQuery as i } from "../../data-access/dist/index2.js";
12
- import "../../data-access/dist/index.js";
13
- import { currentApprovalRound as a } from "./index3.js";
14
- import { usePayableApprovalRoundStart as o } from "./index11.js";
1
+ import { formatRejectionDate as e } from "../../../../shared/util/dist/lib/formatRejectionDate.js";
15
2
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js
16
- function s({ payableId: s, status: c }) {
17
- let { initResponse: l } = r(), u = e(l?.scopes, [n.ApprovalRequestReadOrg]), d = c === "approve_in_progress" && u, { roundStartedAt: f } = o({
18
- payableId: s,
19
- enabled: d
20
- }), p = t({ enabled: d }), m = p.data?.id, h = (e) => e.caller_is_policy_approver ?? !!(m && e.user_ids.includes(m)), g = i(s, {
21
- enabled: d,
22
- hasAwaitedRequest: d ? (e) => a(e, f).some(h) : void 0,
23
- currentRoundStartedAt: f
24
- }), _ = d ? a(g.data?.data, f) : [], v = _.some(h), y = _.filter((e) => e.status === "waiting");
3
+ function t({ payableStatus: t, approvalRequests: n, userNames: r, payableUpdatedAt: i, labels: a, now: o }) {
4
+ let s = n.find((e) => e.status === "rejected");
5
+ if (!s) return t !== "rejected" || !i ? void 0 : { actorLabel: a.rejectedOn(e(i, o)) };
6
+ let c = s.rejected_by ? r.get(s.rejected_by) : void 0, l = e(s.updated_at, o);
25
7
  return {
26
- id: y.filter(h).find((e) => !(m && (e.approved_by ?? []).includes(m)))?.id,
27
- isPolicyApprover: v,
28
- hasWaitingRequest: y.length > 0,
29
- isLoading: g.isLoading || p.isLoading
8
+ actorLabel: c ? a.rejectedByOn(c, l) : a.rejectedOn(l),
9
+ message: s.reject_reason ? a.rejectionMessage(s.reject_reason) : void 0
30
10
  };
31
11
  }
32
12
  //#endregion
33
- export { s as useCurrentApprovalRequestId };
13
+ export { t as resolveBillRejectionNotice };
@@ -2,164 +2,31 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import "../../../../shared/ui/dist/index.js";
7
- import { useWidgetConfig as t } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
8
- import "../../../../shared/feature/dist/index.js";
9
- import { useApprovePayableApprovalRequestMutation as n, useRejectPayableApprovalRequestMutation as r } from "../../data-access/dist/index2.js";
10
- import { useCancelPayableMutation as i } from "../../data-access/dist/index6.js";
11
- import { useCancelScheduledPaymentMutation as a } from "../../data-access/dist/index7.js";
12
- import { useForceApprovePayableMutation as o } from "../../data-access/dist/index11.js";
13
- import { useForceRejectPayableMutation as s } from "../../data-access/dist/index12.js";
14
- import { useReopenPayableMutation as c } from "../../data-access/dist/index13.js";
5
+ import { usePayableApprovalRequestsQuery as e } from "../../data-access/dist/index2.js";
15
6
  import "../../data-access/dist/index.js";
16
- import { getBillDetailActions as l } from "./index7.js";
17
- import { useState as u } from "react";
18
- import { BanIcon as d, HandIcon as f } from "lucide-react";
7
+ import { currentApprovalRound as t } from "./index8.js";
8
+ import { usePayableApprovalRoundStart as n } from "./index11.js";
9
+ import { resolveBillRejectionNotice as r } from "./index16.js";
10
+ import { useMemo as i } from "react";
19
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js
20
- function p({ payableId: d, status: f, currentApprovalRequestId: p, arePendingApproversUnknown: m, hasScheduledPayment: h, scheduledPaymentIntentId: g, isScheduledPaymentUnknown: v, isPayabilityUnknown: x, labels: S, isMarkAsPaidPending: C, hasApprovalPolicy: w = !0, hasWaitingRequest: T, pendingApprovers: E, onPayBillSelect: D, onMarkAsPaidSelect: O, onEditSelect: k, onActionSucceeded: A }) {
21
- let { initResponse: j } = t(), M = r(), N = n(), P = i(), F = a(), I = c(), L = o(), R = s(), z = C || M.isPending || N.isPending || P.isPending || F.isPending || I.isPending || L.isPending || R.isPending, [B, V] = u(), H = B && (B.id !== "cancelScheduledPayment" || B.scheduledPaymentIntentId === g) ? B : void 0, U = d && f ? l({
22
- status: f,
23
- scopes: j?.scopes,
24
- canDecideApprovalRequest: !!p,
25
- arePendingApproversUnknown: m,
26
- hasApprovalPolicy: w,
27
- hasWaitingRequest: T,
28
- hasScheduledPayment: h || v,
29
- scheduledPaymentIntentId: g,
30
- isPayabilityUnknown: x,
31
- canEdit: !!k,
32
- labels: S
33
- }) : [], W = (t) => ({
34
- onError: () => e.error(S.actionError),
35
- onSuccess: () => {
36
- let n = b(t) && !w ? `${t}NoApprovalPolicy` : t;
37
- e.success(S.actionSuccess[n]), A?.(t);
38
- }
39
- }), G = {
40
- reject: {
41
- isPending: M.isPending,
42
- run: (e) => p && M.mutate({
43
- path: { approval_request_id: p },
44
- body: e ? { reject_reason: e } : void 0
45
- }, W("reject"))
46
- },
47
- approve: {
48
- isPending: N.isPending,
49
- run: () => p && N.mutate({ path: { approval_request_id: p } }, W("approve"))
50
- },
51
- cancel: {
52
- isPending: P.isPending,
53
- run: () => d && P.mutate({ path: { payable_id: d } }, W("cancel"))
54
- },
55
- cancelScheduledPayment: {
56
- isPending: F.isPending,
57
- run: () => {
58
- let e = H?.scheduledPaymentIntentId;
59
- d && e && F.mutate({
60
- path: { payment_intent_id: e },
61
- payableId: d
62
- }, W("cancelScheduledPayment"));
63
- }
64
- },
65
- reopen: {
66
- isPending: I.isPending,
67
- run: () => d && I.mutate({ path: { payable_id: d } }, W("reopen"))
68
- },
69
- forceApprove: {
70
- isPending: L.isPending,
71
- run: () => d && L.mutate({ path: { payable_id: d } }, W("forceApprove"))
72
- },
73
- forceReject: {
74
- isPending: R.isPending,
75
- run: () => d && R.mutate({ path: { payable_id: d } }, W("forceReject"))
76
- }
77
- }, K = U.map((e) => ({
78
- ...e,
79
- disabled: z,
80
- loading: e.id === "markAsPaid" ? C : G[e.id]?.isPending ?? !1,
81
- onSelect: () => {
82
- if (!z && d) {
83
- if (e.id === "payBill") {
84
- D();
85
- return;
86
- }
87
- if (e.id === "markAsPaid") {
88
- O();
89
- return;
90
- }
91
- if (e.id === "edit") {
92
- k?.();
93
- return;
94
- }
95
- if (y(e.id)) {
96
- V({
97
- id: e.id,
98
- scheduledPaymentIntentId: g
99
- });
100
- return;
101
- }
102
- G[e.id]?.run();
103
- }
104
- }
105
- }));
106
- return {
107
- isActionPending: z,
108
- actions: {
109
- row: K.filter((e) => e.surface === "row"),
110
- menu: K.filter((e) => e.surface === "menu")
111
- },
112
- decisionDialog: {
113
- open: !!H,
114
- copy: H ? {
115
- ...S.decisionDialog[H.id],
116
- ...b(H.id) && !w ? S.decisionDialog[H.id].noApprovalPolicy : void 0,
117
- presentation: _(H.id),
118
- pendingApprovers: b(H.id) ? E ?? [] : void 0
119
- } : void 0,
120
- isPending: H ? G[H.id]?.isPending ?? !1 : !1,
121
- onCancel: () => {
122
- z || V(void 0);
123
- },
124
- onConfirm: (e) => {
125
- H && !z && (G[H.id]?.run(e), V(void 0));
126
- }
127
- }
128
- };
129
- }
130
- var m = {
131
- alignment: "center",
132
- icon: f,
133
- tone: "destructive",
134
- actionWidth: "equal"
135
- }, h = {
136
- alignment: "center",
137
- icon: d,
138
- tone: "destructive",
139
- actionWidth: "equal"
140
- }, g = {
141
- alignment: "center",
142
- icon: d,
143
- tone: "destructive",
144
- actionWidth: "equal"
145
- };
146
- function _(e) {
147
- if (b(e)) return m;
148
- if (e === "reject") return h;
149
- if (e === "cancel") return g;
150
- }
151
- var v = [
152
- "reject",
153
- "cancel",
154
- "cancelScheduledPayment",
155
- "forceApprove",
156
- "forceReject"
157
- ];
158
- function y(e) {
159
- return v.includes(e);
160
- }
161
- function b(e) {
162
- return e === "forceApprove" || e === "forceReject";
12
+ function a({ payableId: a, payableStatus: o, payableUpdatedAt: s, enabled: c, userNames: l, labels: u }) {
13
+ let d = n({
14
+ payableId: a,
15
+ enabled: c
16
+ }), f = e(a, { enabled: c }), p = i(() => t(f.data?.data, d.roundStartedAt), [f.data, d.roundStartedAt]);
17
+ return i(() => r({
18
+ payableStatus: o,
19
+ approvalRequests: p,
20
+ userNames: l,
21
+ payableUpdatedAt: s,
22
+ labels: u
23
+ }), [
24
+ o,
25
+ s,
26
+ p,
27
+ l,
28
+ u
29
+ ]);
163
30
  }
164
31
  //#endregion
165
- export { p as usePayableDetailActions };
32
+ export { a as useBillRejectionNotice };
@@ -3,24 +3,31 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
6
- import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
6
+ import { useCurrentUserQuery as t } from "../../../../shared/data-access/dist/lib/useCurrentUserQuery.js";
7
+ import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
7
8
  import "../../../../shared/data-access/dist/index.js";
8
- import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
+ import { useWidgetConfig as r } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
10
  import "../../../../shared/feature/dist/index.js";
10
- import { isLiveScheduledPaymentRecord as r } from "../../../util/dist/lib/isLiveScheduledPaymentRecord.js";
11
- import { usePayablePaymentRecordsQuery as i } from "../../data-access/dist/index18.js";
11
+ import { usePayableApprovalRequestsQuery as i } from "../../data-access/dist/index2.js";
12
12
  import "../../data-access/dist/index.js";
13
+ import { currentApprovalRound as a } from "./index8.js";
14
+ import { usePayableApprovalRoundStart as o } from "./index11.js";
13
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js
14
- function a({ payableId: a, scheduledPaymentDate: o, enabled: s = !0 }) {
15
- let { initResponse: c } = n(), l = e(c?.scopes, [t.PaymentRecordReadOrg]), u = i(s ? a : void 0, { enabled: s && l }), d = u.paymentRecords.find(r), f = !!d || !!o, p = d?.planned_payment_date ?? (f ? o : void 0);
16
+ function s({ payableId: s, status: c }) {
17
+ let { initResponse: l } = r(), u = e(l?.scopes, [n.ApprovalRequestReadOrg]), d = c === "approve_in_progress" && u, { roundStartedAt: f } = o({
18
+ payableId: s,
19
+ enabled: d
20
+ }), p = t({ enabled: d }), m = p.data?.id, h = (e) => e.caller_is_policy_approver ?? !!(m && e.user_ids.includes(m)), g = i(s, {
21
+ enabled: d,
22
+ hasAwaitedRequest: d ? (e) => a(e, f).some(h) : void 0,
23
+ currentRoundStartedAt: f
24
+ }), _ = d ? a(g.data?.data, f) : [], v = _.some(h), y = _.filter((e) => e.status === "waiting");
16
25
  return {
17
- hasScheduledPayment: f,
18
- paymentRecords: u.paymentRecords,
19
- isError: u.isError,
20
- isResolving: u.isResolving,
21
- scheduledDate: p ?? void 0,
22
- scheduledPaymentIntentId: d?.payment_intent_id ?? void 0
26
+ id: y.filter(h).find((e) => !(m && (e.approved_by ?? []).includes(m)))?.id,
27
+ isPolicyApprover: v,
28
+ hasWaitingRequest: y.length > 0,
29
+ isLoading: g.isLoading || p.isLoading
23
30
  };
24
31
  }
25
32
  //#endregion
26
- export { a as useScheduledPayment };
33
+ export { s as useCurrentApprovalRequestId };
@@ -2,43 +2,22 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { hasAnyScope as t } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
7
- import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
8
- import "../../../../shared/data-access/dist/index.js";
9
- import "../../../../shared/ui/dist/index.js";
10
- import { useWidgetConfig as r } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
- import "../../../../shared/feature/dist/index.js";
12
- import { useDeletePayableMutation as i } from "../../data-access/dist/index10.js";
5
+ import { buildPayableAuditHistory as e, hasUnattributedAuditRows as t } from "../../../../shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js";
6
+ import { usePayableHistoryQuery as n } from "../../data-access/dist/index3.js";
13
7
  import "../../data-access/dist/index.js";
14
- import { useState as a } from "react";
8
+ import { useMemo as r } from "react";
15
9
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js
16
- function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
17
- let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
18
- id: "deleteDraft",
19
- label: l.menuItem,
20
- destructive: !0,
21
- onSelect: () => m(!0)
22
- }] : [], v = p && g;
10
+ function i({ payableId: i, userNames: a, isRosterError: o, labels: s }) {
11
+ let c = n(i), l = r(() => e(c.data?.data ?? [], a, s), [
12
+ c.data,
13
+ a,
14
+ s
15
+ ]);
23
16
  return {
24
- menuItems: _,
25
- dialog: {
26
- open: v,
27
- copy: v ? l.dialog : void 0,
28
- isPending: f.isPending,
29
- onCancel: () => {
30
- f.isPending || m(!1);
31
- },
32
- onConfirm: () => {
33
- g && o && !f.isPending && f.mutate({ path: { payable_id: o } }, {
34
- onError: () => e.error(l.error),
35
- onSuccess: () => {
36
- m(!1), u();
37
- }
38
- });
39
- }
40
- }
17
+ historyQuery: c,
18
+ rows: l,
19
+ namesError: o && t(c.data?.data ?? [], l, a)
41
20
  };
42
21
  }
43
22
  //#endregion
44
- export { o as useDraftDelete };
23
+ export { i as usePayableAuditHistory };