@burdenoff/microfe-subscriberbot 2026.1107.8 → 2026.1110.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.
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +134 -151
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoot.js +10 -7
- package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.js +1 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +9 -10
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/AdminRoot.js +2 -3
- package/dist/subscriberbot/admin/AdminRoot.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +56 -57
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +107 -108
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/index.js +1 -1
- package/dist/subscriberbot/components/EmptyState.js +1 -2
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.js +1 -2
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/Modal.js +2 -3
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +1 -2
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.js +7 -8
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +1 -2
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +2 -3
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +7 -8
- package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.js +65 -66
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/decisions/decisionModel.js +2 -3
- package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -1
- package/dist/subscriberbot/components/decisions/index.js +4 -3
- package/dist/subscriberbot/components/index.js +8 -7
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +23 -24
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +40 -49
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +1 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -1
- package/dist/subscriberbot/components/mobile/index.js +4 -3
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +1 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +4 -5
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +4 -5
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/index.js +5 -4
- package/dist/subscriberbot/components/negotiations/labels.js +1 -2
- package/dist/subscriberbot/components/negotiations/labels.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +1 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/procurement/index.js +5 -4
- package/dist/subscriberbot/components/procurement/labels.js +1 -2
- package/dist/subscriberbot/components/procurement/labels.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.js +90 -91
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/savings/index.js +3 -2
- package/dist/subscriberbot/components/savings/savingsModel.js +2 -3
- package/dist/subscriberbot/components/savings/savingsModel.js.map +1 -1
- package/dist/subscriberbot/components/viz.js +2 -3
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/context/SubscriberBotContext.js +3 -3
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/context/index.js +1 -1
- package/dist/subscriberbot/hooks/index.js +2 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +2 -3
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -1
- package/dist/subscriberbot/hooks/useBankingApi.js +2 -3
- package/dist/subscriberbot/hooks/useBankingApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useCompactViewport.js +1 -2
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormError.js +1 -2
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormatters.js +1 -2
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.js +2 -3
- package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useProcurementApi.js +2 -3
- package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useRouteSelection.js +3 -3
- package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -2
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.js +9 -8
- package/dist/subscriberbot/pages/AssetVaultPage.js +34 -35
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +86 -87
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +194 -199
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +28 -29
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +179 -188
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.js +293 -298
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.js +25 -26
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +67 -68
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +126 -127
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +10 -11
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +23 -24
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +337 -359
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js +22 -27
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +25 -26
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +34 -35
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +125 -130
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +94 -95
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +15 -16
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +20 -21
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +86 -87
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +164 -165
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +20 -21
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +350 -351
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.js +95 -96
- package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +11 -12
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +62 -63
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +166 -172
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +12 -13
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +21 -22
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +242 -255
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +2 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js +1 -2
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/subscriberbot/store/index.js +1 -1
- package/dist/subscriberbot/store/subscriberbotStore.js +1 -2
- package/dist/subscriberbot/store/subscriberbotStore.js.map +1 -1
- package/dist/subscriberbot/utils/bankRedirectLink.js +18 -19
- package/dist/subscriberbot/utils/bankRedirectLink.js.map +1 -1
- package/dist/subscriberbot/utils/chartScale.js +1 -2
- package/dist/subscriberbot/utils/chartScale.js.map +1 -1
- package/dist/subscriberbot/utils/cn.js +2 -3
- package/dist/subscriberbot/utils/cn.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.js +4 -5
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/navigation.js +1 -2
- package/dist/subscriberbot/utils/navigation.js.map +1 -1
- package/dist/subscriberbot/utils/pageContext.js +3 -4
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -22
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.js +5 -6
- package/dist/subscriberbot/utils/portfolio.js.map +1 -1
- package/dist/subscriberbot/utils/renewals.js +1 -2
- package/dist/subscriberbot/utils/renewals.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
-
import { useFormatters as n } from "../../hooks/useFormatters.js";
|
|
4
|
-
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
5
|
-
import { ErrorView as i, LoadingView as a, Section as o } from "../../components/StateViews.js";
|
|
1
|
+
import { useFormatters as e } from "../../hooks/useFormatters.js";
|
|
6
2
|
import "../../components/index.js";
|
|
7
|
-
import { FEE_STATUS_LABEL as s, OPEN_STATUSES as c, REQUEST_TYPE_LABEL as l } from "../../components/procurement/labels.js";
|
|
8
|
-
import { ProcurementStatusPill as u } from "../../components/procurement/ProcurementStatusPill.js";
|
|
9
|
-
import { ProcurementThread as d } from "../../components/procurement/ProcurementThread.js";
|
|
10
3
|
import "../../components/procurement/index.js";
|
|
11
|
-
import {
|
|
4
|
+
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
5
|
+
import { ErrorView as n, LoadingView as r, Section as i } from "../../components/StateViews.js";
|
|
6
|
+
import { useSubscriberBot as a } from "../../context/SubscriberBotContext.js";
|
|
7
|
+
import { FEE_STATUS_LABEL as o, OPEN_STATUSES as s, REQUEST_TYPE_LABEL as c } from "../../components/procurement/labels.js";
|
|
8
|
+
import { ProcurementStatusPill as l } from "../../components/procurement/ProcurementStatusPill.js";
|
|
9
|
+
import { ProcurementThread as u } from "../../components/procurement/ProcurementThread.js";
|
|
10
|
+
import { useCancelProcurementRequest as d, useProcurementRequest as f, useProcurementTerms as p, useSendProcurementMessage as m, useSubmitProcurementRequest as h } from "../../hooks/useProcurementApi.js";
|
|
11
|
+
import { useTr as g } from "../../hooks/useTr.js";
|
|
12
12
|
import { useState as _ } from "react";
|
|
13
13
|
import { ArrowLeft as v, UserRoundCheck as y } from "lucide-react";
|
|
14
14
|
import { useParams as b } from "react-router";
|
|
15
15
|
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
16
16
|
import { GlassCard as C } from "@burdenoff/fe-libs/ui";
|
|
17
|
-
|
|
17
|
+
// src/subscriberbot/pages/procurement/ProcurementDetailPage.tsx
|
|
18
18
|
var w = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", T = "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50", E = "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50", D = (e) => e ? e instanceof Error ? e.message : String(e) : null;
|
|
19
19
|
function O({ label: e, value: t }) {
|
|
20
20
|
return /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", {
|
|
@@ -26,7 +26,7 @@ function O({ label: e, value: t }) {
|
|
|
26
26
|
})] });
|
|
27
27
|
}
|
|
28
28
|
function k({ request: e }) {
|
|
29
|
-
let
|
|
29
|
+
let t = g(), n = p(), r = h(), [i, a] = _(!1);
|
|
30
30
|
return /* @__PURE__ */ S(C, {
|
|
31
31
|
treatment: "metric",
|
|
32
32
|
className: "space-y-3 p-5",
|
|
@@ -34,88 +34,88 @@ function k({ request: e }) {
|
|
|
34
34
|
children: [
|
|
35
35
|
/* @__PURE__ */ x("p", {
|
|
36
36
|
className: "text-sm text-text-primary",
|
|
37
|
-
children:
|
|
37
|
+
children: t("procurement.submit.intro", "Submit this request to the Subscriber Bot procurement desk. An expert is assigned, negotiates with the vendor and keeps you posted here.")
|
|
38
38
|
}),
|
|
39
|
-
|
|
39
|
+
n.data && /* @__PURE__ */ S("div", {
|
|
40
40
|
className: "rounded-lg border border-border-subtle bg-bg-sunken p-3",
|
|
41
41
|
children: [/* @__PURE__ */ x("p", {
|
|
42
42
|
className: "text-xs leading-relaxed text-text-secondary",
|
|
43
43
|
"data-testid": "procurement-terms",
|
|
44
|
-
children:
|
|
44
|
+
children: n.data.authorizationText
|
|
45
45
|
}), /* @__PURE__ */ S("label", {
|
|
46
46
|
className: "mt-3 inline-flex items-start gap-2 text-sm text-text-primary",
|
|
47
47
|
children: [/* @__PURE__ */ x("input", {
|
|
48
48
|
type: "checkbox",
|
|
49
|
-
checked:
|
|
50
|
-
onChange: (e) =>
|
|
49
|
+
checked: i,
|
|
50
|
+
onChange: (e) => a(e.target.checked),
|
|
51
51
|
className: "mt-0.5"
|
|
52
|
-
}),
|
|
52
|
+
}), t("procurement.submit.accept", "I authorise the procurement desk on these terms")]
|
|
53
53
|
})]
|
|
54
54
|
}),
|
|
55
|
-
|
|
55
|
+
r.error && /* @__PURE__ */ x("p", {
|
|
56
56
|
role: "alert",
|
|
57
57
|
className: "text-sm text-status-error-text",
|
|
58
|
-
children: D(
|
|
58
|
+
children: D(r.error)
|
|
59
59
|
}),
|
|
60
60
|
/* @__PURE__ */ x("button", {
|
|
61
61
|
type: "button",
|
|
62
|
-
onClick: () =>
|
|
62
|
+
onClick: () => n.data && r.mutate({
|
|
63
63
|
id: e.id,
|
|
64
64
|
input: {
|
|
65
|
-
acceptAuthorization:
|
|
66
|
-
authorizationVersion:
|
|
65
|
+
acceptAuthorization: i,
|
|
66
|
+
authorizationVersion: n.data.authorizationVersion
|
|
67
67
|
}
|
|
68
68
|
}),
|
|
69
|
-
disabled:
|
|
69
|
+
disabled: r.isPending || !i || !n.data,
|
|
70
70
|
className: T,
|
|
71
|
-
children:
|
|
71
|
+
children: t("procurement.submit.cta", "Submit to the procurement desk")
|
|
72
72
|
})
|
|
73
73
|
]
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
function A({ request: e }) {
|
|
77
|
-
let
|
|
77
|
+
let t = g(), n = m(), [r, i] = _(""), a = e.status === "AWAITING_CUSTOMER";
|
|
78
78
|
return /* @__PURE__ */ S("div", {
|
|
79
79
|
className: "space-y-2",
|
|
80
80
|
"data-testid": "procurement-message",
|
|
81
81
|
children: [
|
|
82
|
-
|
|
82
|
+
a && /* @__PURE__ */ x("p", {
|
|
83
83
|
className: "rounded-lg bg-status-warning-bg-subtle px-3 py-2 text-sm text-status-warning-text",
|
|
84
|
-
children:
|
|
84
|
+
children: t("procurement.message.awaiting", "Your procurement expert is waiting for your reply. See the latest message below.")
|
|
85
85
|
}),
|
|
86
86
|
/* @__PURE__ */ x("label", {
|
|
87
87
|
htmlFor: "proc-message",
|
|
88
88
|
className: "sr-only",
|
|
89
|
-
children:
|
|
89
|
+
children: t("procurement.message.label", "Message")
|
|
90
90
|
}),
|
|
91
91
|
/* @__PURE__ */ x("textarea", {
|
|
92
92
|
id: "proc-message",
|
|
93
93
|
rows: 2,
|
|
94
|
-
value:
|
|
95
|
-
onChange: (e) =>
|
|
96
|
-
placeholder:
|
|
94
|
+
value: r,
|
|
95
|
+
onChange: (e) => i(e.target.value),
|
|
96
|
+
placeholder: t("procurement.message.placeholder", "Write to your procurement expert…"),
|
|
97
97
|
className: w
|
|
98
98
|
}),
|
|
99
|
-
|
|
99
|
+
n.error && /* @__PURE__ */ x("p", {
|
|
100
100
|
role: "alert",
|
|
101
101
|
className: "text-sm text-status-error-text",
|
|
102
|
-
children: D(
|
|
102
|
+
children: D(n.error)
|
|
103
103
|
}),
|
|
104
104
|
/* @__PURE__ */ x("button", {
|
|
105
105
|
type: "button",
|
|
106
|
-
disabled:
|
|
107
|
-
onClick: () =>
|
|
106
|
+
disabled: n.isPending || !r.trim(),
|
|
107
|
+
onClick: () => n.mutate({
|
|
108
108
|
id: e.id,
|
|
109
|
-
message:
|
|
110
|
-
}, { onSuccess: () =>
|
|
109
|
+
message: r
|
|
110
|
+
}, { onSuccess: () => i("") }),
|
|
111
111
|
className: E,
|
|
112
|
-
children:
|
|
112
|
+
children: a ? t("procurement.message.reply", "Reply to the expert") : t("procurement.message.send", "Send message")
|
|
113
113
|
})
|
|
114
114
|
]
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
function j({ request:
|
|
118
|
-
let { formatCurrency:
|
|
117
|
+
function j({ request: t }) {
|
|
118
|
+
let { formatCurrency: n } = e(), r = g(), i = o[t.feeStatus];
|
|
119
119
|
return /* @__PURE__ */ S(C, {
|
|
120
120
|
treatment: "metric",
|
|
121
121
|
className: "p-5",
|
|
@@ -125,80 +125,80 @@ function j({ request: e }) {
|
|
|
125
125
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
126
126
|
children: [
|
|
127
127
|
/* @__PURE__ */ x(O, {
|
|
128
|
-
label:
|
|
129
|
-
value:
|
|
128
|
+
label: r("procurement.outcome.baseline", "Baseline per year"),
|
|
129
|
+
value: t.baselineAnnualValue == null ? "—" : n(t.baselineAnnualValue, t.currency)
|
|
130
130
|
}),
|
|
131
131
|
/* @__PURE__ */ x(O, {
|
|
132
|
-
label:
|
|
133
|
-
value:
|
|
132
|
+
label: r("procurement.outcome.final", "Negotiated per year"),
|
|
133
|
+
value: t.finalAnnualValue == null ? "—" : n(t.finalAnnualValue, t.currency)
|
|
134
134
|
}),
|
|
135
135
|
/* @__PURE__ */ x(O, {
|
|
136
|
-
label:
|
|
137
|
-
value:
|
|
136
|
+
label: r("procurement.outcome.firstYear", "First-year savings"),
|
|
137
|
+
value: n(t.firstYearSavings, t.currency)
|
|
138
138
|
}),
|
|
139
139
|
/* @__PURE__ */ x(O, {
|
|
140
|
-
label:
|
|
141
|
-
value:
|
|
140
|
+
label: r("procurement.outcome.contract", "Savings over the term"),
|
|
141
|
+
value: n(t.contractSavings, t.currency)
|
|
142
142
|
}),
|
|
143
143
|
/* @__PURE__ */ x(O, {
|
|
144
|
-
label:
|
|
145
|
-
value:
|
|
144
|
+
label: r("procurement.outcome.term", "Final term"),
|
|
145
|
+
value: r("procurement.fact.months", "{{count}} months", { count: t.finalTermMonths ?? t.termMonths })
|
|
146
146
|
}),
|
|
147
147
|
/* @__PURE__ */ x(O, {
|
|
148
|
-
label:
|
|
149
|
-
value:
|
|
148
|
+
label: r("procurement.outcome.fee", "Success fee"),
|
|
149
|
+
value: t.feeStatus === "NONE" ? r(i.key, i.fallback) : `${n(t.feeAmount, t.currency)} · ${r(i.key, i.fallback)}`
|
|
150
150
|
})
|
|
151
151
|
]
|
|
152
152
|
}),
|
|
153
|
-
|
|
153
|
+
t.nonPriceWins && /* @__PURE__ */ x("p", {
|
|
154
154
|
className: "mt-4 text-sm text-text-primary",
|
|
155
|
-
children:
|
|
155
|
+
children: r("procurement.outcome.winsLabel", "Non-price wins: {{wins}}", { wins: t.nonPriceWins })
|
|
156
156
|
}),
|
|
157
|
-
|
|
157
|
+
t.outcomeSummary && /* @__PURE__ */ x("p", {
|
|
158
158
|
className: "mt-2 text-sm text-text-primary",
|
|
159
|
-
children:
|
|
159
|
+
children: t.outcomeSummary
|
|
160
160
|
})
|
|
161
161
|
]
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
function M() {
|
|
165
|
-
let { formatCurrency:
|
|
165
|
+
let { formatCurrency: o, formatDate: p, formatDateTime: m } = e(), h = g(), { id: _ } = b(), { navigateTo: w } = a(), { data: T, isLoading: M, isError: N, error: P, refetch: F } = f(_), I = d(), L = /* @__PURE__ */ S("button", {
|
|
166
166
|
type: "button",
|
|
167
167
|
onClick: () => w("/procurement"),
|
|
168
168
|
className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
169
169
|
children: [
|
|
170
170
|
/* @__PURE__ */ x(v, { className: "rtl:rotate-180 h-4 w-4" }),
|
|
171
171
|
" ",
|
|
172
|
-
|
|
172
|
+
h("procurement.back", "Back")
|
|
173
173
|
]
|
|
174
174
|
});
|
|
175
|
-
if (M) return /* @__PURE__ */ x(
|
|
176
|
-
if (N || !T) return /* @__PURE__ */ x(
|
|
177
|
-
title:
|
|
175
|
+
if (M) return /* @__PURE__ */ x(r, { label: h("procurement.loadingOne", "Loading request…") });
|
|
176
|
+
if (N || !T) return /* @__PURE__ */ x(t, {
|
|
177
|
+
title: h("procurement.title", "Expert procurement"),
|
|
178
178
|
actions: L,
|
|
179
|
-
children: /* @__PURE__ */ x(
|
|
180
|
-
title:
|
|
179
|
+
children: /* @__PURE__ */ x(n, {
|
|
180
|
+
title: h("procurement.notFound", "Procurement request not found"),
|
|
181
181
|
message: P instanceof Error ? P.message : void 0,
|
|
182
182
|
onRetry: () => void F()
|
|
183
183
|
})
|
|
184
184
|
});
|
|
185
|
-
let R =
|
|
186
|
-
return /* @__PURE__ */ S(
|
|
185
|
+
let R = s.includes(T.status), z = T.status === "SUCCEEDED" || T.status === "NO_SAVINGS", B = c[T.requestType];
|
|
186
|
+
return /* @__PURE__ */ S(t, {
|
|
187
187
|
title: T.productName ? `${T.vendorName} · ${T.productName}` : T.vendorName,
|
|
188
|
-
description: `${
|
|
188
|
+
description: `${h(B.key, B.fallback)}${T.category ? ` · ${T.category}` : ""}`,
|
|
189
189
|
actions: L,
|
|
190
190
|
children: [
|
|
191
191
|
/* @__PURE__ */ S("div", {
|
|
192
192
|
className: "flex flex-wrap items-center gap-3",
|
|
193
193
|
children: [
|
|
194
|
-
/* @__PURE__ */ x(
|
|
194
|
+
/* @__PURE__ */ x(l, { status: T.status }),
|
|
195
195
|
/* @__PURE__ */ x("span", {
|
|
196
196
|
className: "text-sm text-text-secondary",
|
|
197
|
-
children:
|
|
197
|
+
children: h("procurement.deadline", "Decide by {{date}}", { date: p(T.deadline) })
|
|
198
198
|
}),
|
|
199
199
|
T.submittedAt && /* @__PURE__ */ x("span", {
|
|
200
200
|
className: "text-xs text-text-secondary",
|
|
201
|
-
children:
|
|
201
|
+
children: h("procurement.submittedAt", "Submitted {{when}}", { when: m(T.submittedAt) })
|
|
202
202
|
})
|
|
203
203
|
]
|
|
204
204
|
}),
|
|
@@ -208,7 +208,7 @@ function M() {
|
|
|
208
208
|
children: [/* @__PURE__ */ x(y, {
|
|
209
209
|
className: "h-4 w-4",
|
|
210
210
|
"aria-hidden": !0
|
|
211
|
-
}),
|
|
211
|
+
}), h("procurement.expert", "Your procurement expert: {{name}}", { name: T.expertName })]
|
|
212
212
|
}),
|
|
213
213
|
/* @__PURE__ */ S(C, {
|
|
214
214
|
treatment: "metric",
|
|
@@ -217,20 +217,20 @@ function M() {
|
|
|
217
217
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
218
218
|
children: [
|
|
219
219
|
/* @__PURE__ */ x(O, {
|
|
220
|
-
label:
|
|
221
|
-
value: T.currentAnnualValue == null ? "—" :
|
|
220
|
+
label: h("procurement.fact.current", "Current per year"),
|
|
221
|
+
value: T.currentAnnualValue == null ? "—" : o(T.currentAnnualValue, T.currency)
|
|
222
222
|
}),
|
|
223
223
|
/* @__PURE__ */ x(O, {
|
|
224
|
-
label:
|
|
225
|
-
value: T.quotedAnnualValue == null ? "—" :
|
|
224
|
+
label: h("procurement.fact.quoted", "Vendor quote per year"),
|
|
225
|
+
value: T.quotedAnnualValue == null ? "—" : o(T.quotedAnnualValue, T.currency)
|
|
226
226
|
}),
|
|
227
227
|
/* @__PURE__ */ x(O, {
|
|
228
|
-
label:
|
|
229
|
-
value: T.targetAnnualValue == null ? "—" :
|
|
228
|
+
label: h("procurement.fact.target", "Target per year"),
|
|
229
|
+
value: T.targetAnnualValue == null ? "—" : o(T.targetAnnualValue, T.currency)
|
|
230
230
|
}),
|
|
231
231
|
/* @__PURE__ */ x(O, {
|
|
232
|
-
label:
|
|
233
|
-
value: `${
|
|
232
|
+
label: h("procurement.fact.term", "Term and seats"),
|
|
233
|
+
value: `${h("procurement.fact.months", "{{count}} months", { count: T.termMonths })}${T.seats == null ? "" : ` · ${T.seats}`}`
|
|
234
234
|
})
|
|
235
235
|
]
|
|
236
236
|
}), T.notes && /* @__PURE__ */ x("p", {
|
|
@@ -238,20 +238,20 @@ function M() {
|
|
|
238
238
|
children: T.notes
|
|
239
239
|
})]
|
|
240
240
|
}),
|
|
241
|
-
z && /* @__PURE__ */ x(
|
|
242
|
-
title:
|
|
241
|
+
z && /* @__PURE__ */ x(i, {
|
|
242
|
+
title: h("procurement.section.outcome", "Outcome"),
|
|
243
243
|
children: /* @__PURE__ */ x(j, { request: T })
|
|
244
244
|
}),
|
|
245
|
-
T.status === "DRAFT" && /* @__PURE__ */ x(
|
|
246
|
-
title:
|
|
245
|
+
T.status === "DRAFT" && /* @__PURE__ */ x(i, {
|
|
246
|
+
title: h("procurement.section.submit", "Submit"),
|
|
247
247
|
children: /* @__PURE__ */ x(k, { request: T })
|
|
248
248
|
}),
|
|
249
|
-
/* @__PURE__ */ S(
|
|
250
|
-
title:
|
|
249
|
+
/* @__PURE__ */ S(i, {
|
|
250
|
+
title: h("procurement.section.thread", "Messages and timeline"),
|
|
251
251
|
children: [R && T.status !== "DRAFT" && /* @__PURE__ */ x("div", {
|
|
252
252
|
className: "mb-4",
|
|
253
253
|
children: /* @__PURE__ */ x(A, { request: T })
|
|
254
|
-
}), /* @__PURE__ */ x(
|
|
254
|
+
}), /* @__PURE__ */ x(u, { events: T.events ?? [] })]
|
|
255
255
|
}),
|
|
256
256
|
R && /* @__PURE__ */ S("div", {
|
|
257
257
|
className: "mt-8 border-t border-border-subtle pt-4",
|
|
@@ -264,13 +264,12 @@ function M() {
|
|
|
264
264
|
disabled: I.isPending,
|
|
265
265
|
onClick: () => I.mutate({ id: T.id }),
|
|
266
266
|
className: E,
|
|
267
|
-
children: T.status === "DRAFT" ?
|
|
267
|
+
children: T.status === "DRAFT" ? h("procurement.cancel.draft", "Discard draft") : h("procurement.cancel.submitted", "Withdraw request and authorisation")
|
|
268
268
|
})]
|
|
269
269
|
})
|
|
270
270
|
]
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
|
-
//#endregion
|
|
274
273
|
export { M as ProcurementDetailPage };
|
|
275
274
|
|
|
276
275
|
//# sourceMappingURL=ProcurementDetailPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcurementDetailPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/procurement/ProcurementDetailPage.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Expert procurement request detail\n * @module subscriberbot/pages/procurement\n *\n * `/subscriberbot/procurement/:id` — the contract details, submission under\n * the procurement authorisation, the assigned expert, the message thread with\n * the expert, the negotiated outcome with savings and the success fee. Every\n * action is a real `Sub*Procurement*` mutation.\n */\n\nimport { useState } from 'react';\nimport { useParams } from 'react-router';\nimport { ArrowLeft, UserRoundCheck } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { ErrorView, LoadingView, PageLayout, Section } from '../../components';\nimport {\n FEE_STATUS_LABEL,\n OPEN_STATUSES,\n ProcurementStatusPill,\n ProcurementThread,\n REQUEST_TYPE_LABEL,\n} from '../../components/procurement';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport {\n useCancelProcurementRequest,\n useProcurementRequest,\n useProcurementTerms,\n useSendProcurementMessage,\n useSubmitProcurementRequest,\n} from '../../hooks/useProcurementApi';\nimport { useTr } from '../../hooks/useTr';\n\nimport type { SubProcurementRequest } from '../../types/procurement';\n\nconst inputCls =\n 'w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\nconst primaryBtn =\n 'rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50';\nconst secondaryBtn =\n 'rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50';\n\nconst errorText = (err: unknown): string | null =>\n err ? (err instanceof Error ? err.message : String(err)) : null;\n\nfunction Fact({ label, value }: { label: string; value: string }) {\n return (\n <div>\n <dt className=\"text-xs text-text-secondary\">{label}</dt>\n <dd className=\"mt-0.5 text-sm font-medium text-text-primary\">{value}</dd>\n </div>\n );\n}\n\nfunction SubmitPanel({ request }: { request: SubProcurementRequest }) {\n const tr = useTr();\n const terms = useProcurementTerms();\n const submit = useSubmitProcurementRequest();\n const [accepted, setAccepted] = useState(false);\n\n return (\n <GlassCard treatment=\"metric\" className=\"space-y-3 p-5\" data-testid=\"procurement-submit\">\n <p className=\"text-sm text-text-primary\">\n {tr(\n 'procurement.submit.intro',\n 'Submit this request to the Subscriber Bot procurement desk. An expert is assigned, negotiates with the vendor and keeps you posted here.'\n )}\n </p>\n {terms.data && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken p-3\">\n <p\n className=\"text-xs leading-relaxed text-text-secondary\"\n data-testid=\"procurement-terms\"\n >\n {terms.data.authorizationText}\n </p>\n <label className=\"mt-3 inline-flex items-start gap-2 text-sm text-text-primary\">\n <input\n type=\"checkbox\"\n checked={accepted}\n onChange={(e) => setAccepted(e.target.checked)}\n className=\"mt-0.5\"\n />\n {tr('procurement.submit.accept', 'I authorise the procurement desk on these terms')}\n </label>\n </div>\n )}\n {submit.error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {errorText(submit.error)}\n </p>\n )}\n <button\n type=\"button\"\n onClick={() =>\n terms.data &&\n submit.mutate({\n id: request.id,\n input: {\n acceptAuthorization: accepted,\n authorizationVersion: terms.data.authorizationVersion,\n },\n })\n }\n disabled={submit.isPending || !accepted || !terms.data}\n className={primaryBtn}\n >\n {tr('procurement.submit.cta', 'Submit to the procurement desk')}\n </button>\n </GlassCard>\n );\n}\n\nfunction MessagePanel({ request }: { request: SubProcurementRequest }) {\n const tr = useTr();\n const send = useSendProcurementMessage();\n const [message, setMessage] = useState('');\n const awaiting = request.status === 'AWAITING_CUSTOMER';\n return (\n <div className=\"space-y-2\" data-testid=\"procurement-message\">\n {awaiting && (\n <p className=\"rounded-lg bg-status-warning-bg-subtle px-3 py-2 text-sm text-status-warning-text\">\n {tr(\n 'procurement.message.awaiting',\n 'Your procurement expert is waiting for your reply. See the latest message below.'\n )}\n </p>\n )}\n <label htmlFor=\"proc-message\" className=\"sr-only\">\n {tr('procurement.message.label', 'Message')}\n </label>\n <textarea\n id=\"proc-message\"\n rows={2}\n value={message}\n onChange={(e) => setMessage(e.target.value)}\n placeholder={tr('procurement.message.placeholder', 'Write to your procurement expert…')}\n className={inputCls}\n />\n {send.error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {errorText(send.error)}\n </p>\n )}\n <button\n type=\"button\"\n disabled={send.isPending || !message.trim()}\n onClick={() =>\n send.mutate({ id: request.id, message }, { onSuccess: () => setMessage('') })\n }\n className={secondaryBtn}\n >\n {awaiting\n ? tr('procurement.message.reply', 'Reply to the expert')\n : tr('procurement.message.send', 'Send message')}\n </button>\n </div>\n );\n}\n\nfunction OutcomeSummary({ request: p }: { request: SubProcurementRequest }) {\n const { formatCurrency } = useFormatters();\n\n const tr = useTr();\n const fee = FEE_STATUS_LABEL[p.feeStatus];\n return (\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"procurement-outcome\">\n <dl className=\"grid grid-cols-2 gap-4 sm:grid-cols-4\">\n <Fact\n label={tr('procurement.outcome.baseline', 'Baseline per year')}\n value={\n p.baselineAnnualValue != null ? formatCurrency(p.baselineAnnualValue, p.currency) : '—'\n }\n />\n <Fact\n label={tr('procurement.outcome.final', 'Negotiated per year')}\n value={p.finalAnnualValue != null ? formatCurrency(p.finalAnnualValue, p.currency) : '—'}\n />\n <Fact\n label={tr('procurement.outcome.firstYear', 'First-year savings')}\n value={formatCurrency(p.firstYearSavings, p.currency)}\n />\n <Fact\n label={tr('procurement.outcome.contract', 'Savings over the term')}\n value={formatCurrency(p.contractSavings, p.currency)}\n />\n <Fact\n label={tr('procurement.outcome.term', 'Final term')}\n value={tr('procurement.fact.months', '{{count}} months', {\n count: p.finalTermMonths ?? p.termMonths,\n })}\n />\n <Fact\n label={tr('procurement.outcome.fee', 'Success fee')}\n value={\n p.feeStatus === 'NONE'\n ? tr(fee.key, fee.fallback)\n : `${formatCurrency(p.feeAmount, p.currency)} · ${tr(fee.key, fee.fallback)}`\n }\n />\n </dl>\n {p.nonPriceWins && (\n <p className=\"mt-4 text-sm text-text-primary\">\n {tr('procurement.outcome.winsLabel', 'Non-price wins: {{wins}}', {\n wins: p.nonPriceWins,\n })}\n </p>\n )}\n {p.outcomeSummary && <p className=\"mt-2 text-sm text-text-primary\">{p.outcomeSummary}</p>}\n </GlassCard>\n );\n}\n\nexport function ProcurementDetailPage() {\n const { formatCurrency, formatDate, formatDateTime } = useFormatters();\n\n const tr = useTr();\n const { id } = useParams<{ id: string }>();\n const { navigateTo } = useSubscriberBot();\n const { data: p, isLoading, isError, error, refetch } = useProcurementRequest(id);\n const cancel = useCancelProcurementRequest();\n\n const back = (\n <button\n type=\"button\"\n onClick={() => navigateTo('/procurement')}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <ArrowLeft className=\"rtl:rotate-180 h-4 w-4\" /> {tr('procurement.back', 'Back')}\n </button>\n );\n\n if (isLoading) return <LoadingView label={tr('procurement.loadingOne', 'Loading request…')} />;\n if (isError || !p) {\n return (\n <PageLayout title={tr('procurement.title', 'Expert procurement')} actions={back}>\n <ErrorView\n title={tr('procurement.notFound', 'Procurement request not found')}\n message={error instanceof Error ? error.message : undefined}\n onRetry={() => void refetch()}\n />\n </PageLayout>\n );\n }\n\n const open = OPEN_STATUSES.includes(p.status);\n const finished = p.status === 'SUCCEEDED' || p.status === 'NO_SAVINGS';\n const typeLabel = REQUEST_TYPE_LABEL[p.requestType];\n\n return (\n <PageLayout\n title={p.productName ? `${p.vendorName} · ${p.productName}` : p.vendorName}\n description={`${tr(typeLabel.key, typeLabel.fallback)}${p.category ? ` · ${p.category}` : ''}`}\n actions={back}\n >\n <div className=\"flex flex-wrap items-center gap-3\">\n <ProcurementStatusPill status={p.status} />\n <span className=\"text-sm text-text-secondary\">\n {tr('procurement.deadline', 'Decide by {{date}}', { date: formatDate(p.deadline) })}\n </span>\n {p.submittedAt && (\n <span className=\"text-xs text-text-secondary\">\n {tr('procurement.submittedAt', 'Submitted {{when}}', {\n when: formatDateTime(p.submittedAt),\n })}\n </span>\n )}\n </div>\n\n {p.expertName && (\n <p\n className=\"mt-3 inline-flex items-center gap-2 rounded-lg bg-[var(--color-accent-soft)] px-3 py-1.5 text-sm text-text-primary\"\n data-testid=\"procurement-expert\"\n >\n <UserRoundCheck className=\"h-4 w-4\" aria-hidden />\n {tr('procurement.expert', 'Your procurement expert: {{name}}', { name: p.expertName })}\n </p>\n )}\n\n <GlassCard treatment=\"metric\" className=\"mt-4 p-5\">\n <dl className=\"grid grid-cols-2 gap-4 sm:grid-cols-4\">\n <Fact\n label={tr('procurement.fact.current', 'Current per year')}\n value={\n p.currentAnnualValue != null ? formatCurrency(p.currentAnnualValue, p.currency) : '—'\n }\n />\n <Fact\n label={tr('procurement.fact.quoted', 'Vendor quote per year')}\n value={\n p.quotedAnnualValue != null ? formatCurrency(p.quotedAnnualValue, p.currency) : '—'\n }\n />\n <Fact\n label={tr('procurement.fact.target', 'Target per year')}\n value={\n p.targetAnnualValue != null ? formatCurrency(p.targetAnnualValue, p.currency) : '—'\n }\n />\n <Fact\n label={tr('procurement.fact.term', 'Term and seats')}\n value={`${tr('procurement.fact.months', '{{count}} months', { count: p.termMonths })}${\n p.seats != null ? ` · ${p.seats}` : ''\n }`}\n />\n </dl>\n {p.notes && (\n <p className=\"mt-3 whitespace-pre-wrap text-sm text-text-secondary\">{p.notes}</p>\n )}\n </GlassCard>\n\n {finished && (\n <Section title={tr('procurement.section.outcome', 'Outcome')}>\n <OutcomeSummary request={p} />\n </Section>\n )}\n\n {p.status === 'DRAFT' && (\n <Section title={tr('procurement.section.submit', 'Submit')}>\n <SubmitPanel request={p} />\n </Section>\n )}\n\n <Section title={tr('procurement.section.thread', 'Messages and timeline')}>\n {open && p.status !== 'DRAFT' && (\n <div className=\"mb-4\">\n <MessagePanel request={p} />\n </div>\n )}\n <ProcurementThread events={p.events ?? []} />\n </Section>\n\n {open && (\n <div className=\"mt-8 border-t border-border-subtle pt-4\">\n {cancel.error && (\n <p role=\"alert\" className=\"mb-2 text-sm text-status-error-text\">\n {errorText(cancel.error)}\n </p>\n )}\n <button\n type=\"button\"\n disabled={cancel.isPending}\n onClick={() => cancel.mutate({ id: p.id })}\n className={secondaryBtn}\n >\n {p.status === 'DRAFT'\n ? tr('procurement.cancel.draft', 'Discard draft')\n : tr('procurement.cancel.submitted', 'Withdraw request and authorisation')}\n </button>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,IAAM,IACJ,wMACI,IACJ,+HACI,IACJ,iIAEI,KAAa,MACjB,IAAO,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,IAAK;AAE7D,SAAS,EAAK,EAAE,UAAO,YAA2C;CAChE,OACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;EAAI,WAAU;YAA+B;CAAU,CAAA,GACvD,kBAAC,MAAD;EAAI,WAAU;YAAgD;CAAU,CAAA,CACrE,EAAA,CAAA;AAET;AAEA,SAAS,EAAY,EAAE,cAA+C;CACpE,IAAM,IAAK,EAAM,GACX,IAAQ,EAAoB,GAC5B,IAAS,EAA4B,GACrC,CAAC,GAAU,KAAe,EAAS,EAAK;CAE9C,OACE,kBAAC,GAAD;EAAW,WAAU;EAAS,WAAU;EAAgB,eAAY;YAApE;GACE,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,4BACA,0IACF;GACC,CAAA;GACF,EAAM,QACL,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,KAAD;KACE,WAAU;KACV,eAAY;eAEX,EAAM,KAAK;IACX,CAAA,GACH,kBAAC,SAAD;KAAO,WAAU;eAAjB,CACE,kBAAC,SAAD;MACE,MAAK;MACL,SAAS;MACT,WAAW,MAAM,EAAY,EAAE,OAAO,OAAO;MAC7C,WAAU;KACX,CAAA,GACA,EAAG,6BAA6B,iDAAiD,CAC7E;MACJ;;GAEN,EAAO,SACN,kBAAC,KAAD;IA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cACvD,kBAAC,GAAD,EAAa,SAAS,EAAI,CAAA;GACnB,CAAA;GAGX,kBAAC,GAAD;IAAS,OAAO,EAAG,8BAA8B,uBAAuB;cAAxE,CACG,KAAQ,EAAE,WAAW,WACpB,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD,EAAc,SAAS,EAAI,CAAA;IACxB,CAAA,GAEP,kBAAC,GAAD,EAAmB,QAAQ,EAAE,UAAU,CAAC,EAAI,CAAA,CACrC;;GAER,KACC,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,EAAO,SACN,kBAAC,KAAD;KAAG,MAAK;KAAQ,WAAU;eACvB,EAAU,EAAO,KAAK;IACtB,CAAA,GAEL,kBAAC,UAAD;KACE,MAAK;KACL,UAAU,EAAO;KACjB,eAAe,EAAO,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC;KACzC,WAAW;eAEV,EAAE,WAAW,UACV,EAAG,4BAA4B,eAAe,IAC9C,EAAG,gCAAgC,oCAAoC;IACrE,CAAA,CACL;;EAEG;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"ProcurementDetailPage.js","names":["inputCls","primaryBtn","secondaryBtn","errorText","err","Fact","label","value","SubmitPanel","tr","useTr","terms","useProcurementTerms","submit","useSubmitProcurementRequest","accepted","setAccepted","useState","GlassCard","request","MessagePanel","send","useSendProcurementMessage","message","setMessage","awaiting","OutcomeSummary","p","useFormatters","fee","FEE_STATUS_LABEL","formatCurrency","ProcurementDetailPage","useParams","useSubscriberBot","useProcurementRequest","id","cancel","useCancelProcurementRequest","back","navigateTo","ArrowLeft","isLoading","LoadingView","isError","PageLayout","ErrorView","error","refetch","open","OPEN_STATUSES","finished","typeLabel","REQUEST_TYPE_LABEL","ProcurementStatusPill","formatDate","formatDateTime","UserRoundCheck","Section","ProcurementThread"],"sources":["../../../../src/subscriberbot/pages/procurement/ProcurementDetailPage.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Expert procurement request detail\n * @module subscriberbot/pages/procurement\n *\n * `/subscriberbot/procurement/:id` — the contract details, submission under\n * the procurement authorisation, the assigned expert, the message thread with\n * the expert, the negotiated outcome with savings and the success fee. Every\n * action is a real `Sub*Procurement*` mutation.\n */\n\nimport { useState } from 'react';\nimport { useParams } from 'react-router';\nimport { ArrowLeft, UserRoundCheck } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { ErrorView, LoadingView, PageLayout, Section } from '../../components';\nimport {\n FEE_STATUS_LABEL,\n OPEN_STATUSES,\n ProcurementStatusPill,\n ProcurementThread,\n REQUEST_TYPE_LABEL,\n} from '../../components/procurement';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport {\n useCancelProcurementRequest,\n useProcurementRequest,\n useProcurementTerms,\n useSendProcurementMessage,\n useSubmitProcurementRequest,\n} from '../../hooks/useProcurementApi';\nimport { useTr } from '../../hooks/useTr';\n\nimport type { SubProcurementRequest } from '../../types/procurement';\n\nconst inputCls =\n 'w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\nconst primaryBtn =\n 'rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50';\nconst secondaryBtn =\n 'rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50';\n\nconst errorText = (err: unknown): string | null =>\n err ? (err instanceof Error ? err.message : String(err)) : null;\n\nfunction Fact({ label, value }: { label: string; value: string }) {\n return (\n <div>\n <dt className=\"text-xs text-text-secondary\">{label}</dt>\n <dd className=\"mt-0.5 text-sm font-medium text-text-primary\">{value}</dd>\n </div>\n );\n}\n\nfunction SubmitPanel({ request }: { request: SubProcurementRequest }) {\n const tr = useTr();\n const terms = useProcurementTerms();\n const submit = useSubmitProcurementRequest();\n const [accepted, setAccepted] = useState(false);\n\n return (\n <GlassCard treatment=\"metric\" className=\"space-y-3 p-5\" data-testid=\"procurement-submit\">\n <p className=\"text-sm text-text-primary\">\n {tr(\n 'procurement.submit.intro',\n 'Submit this request to the Subscriber Bot procurement desk. An expert is assigned, negotiates with the vendor and keeps you posted here.'\n )}\n </p>\n {terms.data && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken p-3\">\n <p\n className=\"text-xs leading-relaxed text-text-secondary\"\n data-testid=\"procurement-terms\"\n >\n {terms.data.authorizationText}\n </p>\n <label className=\"mt-3 inline-flex items-start gap-2 text-sm text-text-primary\">\n <input\n type=\"checkbox\"\n checked={accepted}\n onChange={(e) => setAccepted(e.target.checked)}\n className=\"mt-0.5\"\n />\n {tr('procurement.submit.accept', 'I authorise the procurement desk on these terms')}\n </label>\n </div>\n )}\n {submit.error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {errorText(submit.error)}\n </p>\n )}\n <button\n type=\"button\"\n onClick={() =>\n terms.data &&\n submit.mutate({\n id: request.id,\n input: {\n acceptAuthorization: accepted,\n authorizationVersion: terms.data.authorizationVersion,\n },\n })\n }\n disabled={submit.isPending || !accepted || !terms.data}\n className={primaryBtn}\n >\n {tr('procurement.submit.cta', 'Submit to the procurement desk')}\n </button>\n </GlassCard>\n );\n}\n\nfunction MessagePanel({ request }: { request: SubProcurementRequest }) {\n const tr = useTr();\n const send = useSendProcurementMessage();\n const [message, setMessage] = useState('');\n const awaiting = request.status === 'AWAITING_CUSTOMER';\n return (\n <div className=\"space-y-2\" data-testid=\"procurement-message\">\n {awaiting && (\n <p className=\"rounded-lg bg-status-warning-bg-subtle px-3 py-2 text-sm text-status-warning-text\">\n {tr(\n 'procurement.message.awaiting',\n 'Your procurement expert is waiting for your reply. See the latest message below.'\n )}\n </p>\n )}\n <label htmlFor=\"proc-message\" className=\"sr-only\">\n {tr('procurement.message.label', 'Message')}\n </label>\n <textarea\n id=\"proc-message\"\n rows={2}\n value={message}\n onChange={(e) => setMessage(e.target.value)}\n placeholder={tr('procurement.message.placeholder', 'Write to your procurement expert…')}\n className={inputCls}\n />\n {send.error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {errorText(send.error)}\n </p>\n )}\n <button\n type=\"button\"\n disabled={send.isPending || !message.trim()}\n onClick={() =>\n send.mutate({ id: request.id, message }, { onSuccess: () => setMessage('') })\n }\n className={secondaryBtn}\n >\n {awaiting\n ? tr('procurement.message.reply', 'Reply to the expert')\n : tr('procurement.message.send', 'Send message')}\n </button>\n </div>\n );\n}\n\nfunction OutcomeSummary({ request: p }: { request: SubProcurementRequest }) {\n const { formatCurrency } = useFormatters();\n\n const tr = useTr();\n const fee = FEE_STATUS_LABEL[p.feeStatus];\n return (\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"procurement-outcome\">\n <dl className=\"grid grid-cols-2 gap-4 sm:grid-cols-4\">\n <Fact\n label={tr('procurement.outcome.baseline', 'Baseline per year')}\n value={\n p.baselineAnnualValue != null ? formatCurrency(p.baselineAnnualValue, p.currency) : '—'\n }\n />\n <Fact\n label={tr('procurement.outcome.final', 'Negotiated per year')}\n value={p.finalAnnualValue != null ? formatCurrency(p.finalAnnualValue, p.currency) : '—'}\n />\n <Fact\n label={tr('procurement.outcome.firstYear', 'First-year savings')}\n value={formatCurrency(p.firstYearSavings, p.currency)}\n />\n <Fact\n label={tr('procurement.outcome.contract', 'Savings over the term')}\n value={formatCurrency(p.contractSavings, p.currency)}\n />\n <Fact\n label={tr('procurement.outcome.term', 'Final term')}\n value={tr('procurement.fact.months', '{{count}} months', {\n count: p.finalTermMonths ?? p.termMonths,\n })}\n />\n <Fact\n label={tr('procurement.outcome.fee', 'Success fee')}\n value={\n p.feeStatus === 'NONE'\n ? tr(fee.key, fee.fallback)\n : `${formatCurrency(p.feeAmount, p.currency)} · ${tr(fee.key, fee.fallback)}`\n }\n />\n </dl>\n {p.nonPriceWins && (\n <p className=\"mt-4 text-sm text-text-primary\">\n {tr('procurement.outcome.winsLabel', 'Non-price wins: {{wins}}', {\n wins: p.nonPriceWins,\n })}\n </p>\n )}\n {p.outcomeSummary && <p className=\"mt-2 text-sm text-text-primary\">{p.outcomeSummary}</p>}\n </GlassCard>\n );\n}\n\nexport function ProcurementDetailPage() {\n const { formatCurrency, formatDate, formatDateTime } = useFormatters();\n\n const tr = useTr();\n const { id } = useParams<{ id: string }>();\n const { navigateTo } = useSubscriberBot();\n const { data: p, isLoading, isError, error, refetch } = useProcurementRequest(id);\n const cancel = useCancelProcurementRequest();\n\n const back = (\n <button\n type=\"button\"\n onClick={() => navigateTo('/procurement')}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <ArrowLeft className=\"rtl:rotate-180 h-4 w-4\" /> {tr('procurement.back', 'Back')}\n </button>\n );\n\n if (isLoading) return <LoadingView label={tr('procurement.loadingOne', 'Loading request…')} />;\n if (isError || !p) {\n return (\n <PageLayout title={tr('procurement.title', 'Expert procurement')} actions={back}>\n <ErrorView\n title={tr('procurement.notFound', 'Procurement request not found')}\n message={error instanceof Error ? error.message : undefined}\n onRetry={() => void refetch()}\n />\n </PageLayout>\n );\n }\n\n const open = OPEN_STATUSES.includes(p.status);\n const finished = p.status === 'SUCCEEDED' || p.status === 'NO_SAVINGS';\n const typeLabel = REQUEST_TYPE_LABEL[p.requestType];\n\n return (\n <PageLayout\n title={p.productName ? `${p.vendorName} · ${p.productName}` : p.vendorName}\n description={`${tr(typeLabel.key, typeLabel.fallback)}${p.category ? ` · ${p.category}` : ''}`}\n actions={back}\n >\n <div className=\"flex flex-wrap items-center gap-3\">\n <ProcurementStatusPill status={p.status} />\n <span className=\"text-sm text-text-secondary\">\n {tr('procurement.deadline', 'Decide by {{date}}', { date: formatDate(p.deadline) })}\n </span>\n {p.submittedAt && (\n <span className=\"text-xs text-text-secondary\">\n {tr('procurement.submittedAt', 'Submitted {{when}}', {\n when: formatDateTime(p.submittedAt),\n })}\n </span>\n )}\n </div>\n\n {p.expertName && (\n <p\n className=\"mt-3 inline-flex items-center gap-2 rounded-lg bg-[var(--color-accent-soft)] px-3 py-1.5 text-sm text-text-primary\"\n data-testid=\"procurement-expert\"\n >\n <UserRoundCheck className=\"h-4 w-4\" aria-hidden />\n {tr('procurement.expert', 'Your procurement expert: {{name}}', { name: p.expertName })}\n </p>\n )}\n\n <GlassCard treatment=\"metric\" className=\"mt-4 p-5\">\n <dl className=\"grid grid-cols-2 gap-4 sm:grid-cols-4\">\n <Fact\n label={tr('procurement.fact.current', 'Current per year')}\n value={\n p.currentAnnualValue != null ? formatCurrency(p.currentAnnualValue, p.currency) : '—'\n }\n />\n <Fact\n label={tr('procurement.fact.quoted', 'Vendor quote per year')}\n value={\n p.quotedAnnualValue != null ? formatCurrency(p.quotedAnnualValue, p.currency) : '—'\n }\n />\n <Fact\n label={tr('procurement.fact.target', 'Target per year')}\n value={\n p.targetAnnualValue != null ? formatCurrency(p.targetAnnualValue, p.currency) : '—'\n }\n />\n <Fact\n label={tr('procurement.fact.term', 'Term and seats')}\n value={`${tr('procurement.fact.months', '{{count}} months', { count: p.termMonths })}${\n p.seats != null ? ` · ${p.seats}` : ''\n }`}\n />\n </dl>\n {p.notes && (\n <p className=\"mt-3 whitespace-pre-wrap text-sm text-text-secondary\">{p.notes}</p>\n )}\n </GlassCard>\n\n {finished && (\n <Section title={tr('procurement.section.outcome', 'Outcome')}>\n <OutcomeSummary request={p} />\n </Section>\n )}\n\n {p.status === 'DRAFT' && (\n <Section title={tr('procurement.section.submit', 'Submit')}>\n <SubmitPanel request={p} />\n </Section>\n )}\n\n <Section title={tr('procurement.section.thread', 'Messages and timeline')}>\n {open && p.status !== 'DRAFT' && (\n <div className=\"mb-4\">\n <MessagePanel request={p} />\n </div>\n )}\n <ProcurementThread events={p.events ?? []} />\n </Section>\n\n {open && (\n <div className=\"mt-8 border-t border-border-subtle pt-4\">\n {cancel.error && (\n <p role=\"alert\" className=\"mb-2 text-sm text-status-error-text\">\n {errorText(cancel.error)}\n </p>\n )}\n <button\n type=\"button\"\n disabled={cancel.isPending}\n onClick={() => cancel.mutate({ id: p.id })}\n className={secondaryBtn}\n >\n {p.status === 'DRAFT'\n ? tr('procurement.cancel.draft', 'Discard draft')\n : tr('procurement.cancel.submitted', 'Withdraw request and authorisation')}\n </button>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,IAAMA,IACJ,wMACIC,IACJ,+HACIC,IACJ,iIAEIC,KAAa,MACjBC,IAAOA,aAAe,QAAQA,EAAI,UAAU,OAAOA,CAAG,IAAK;AAE7D,SAASC,EAAK,EAAE,UAAO,YAA2C;CAChE,OACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;EAAI,WAAU;EAA+B,UAAAC;CAAU,CAAA,GACvD,kBAAC,MAAD;EAAI,WAAU;EAAgD,UAAAC;CAAU,CAAA,CACrE,EAAA,CAAA;AAET;AAEA,SAASC,EAAY,EAAE,cAA+C;CACpE,IAAMC,IAAKC,EAAM,GACXC,IAAQC,EAAoB,GAC5BC,IAASC,EAA4B,GACrC,CAACC,GAAUC,KAAeC,EAAS,EAAK;CAE9C,OACE,kBAACC,GAAD;EAAW,WAAU;EAAS,WAAU;EAAgB,eAAY;EAApE,UAAA;GACE,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAT,EACC,4BACA,0IACF;GACC,CAAA;GACFE,EAAM,QACL,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,KAAD;KACE,WAAU;KACV,eAAY;KAEX,UAAAA,EAAM,KAAK;IACX,CAAA,GACH,kBAAC,SAAD;KAAO,WAAU;KAAjB,UAAA,CACE,kBAAC,SAAD;MACE,MAAK;MACL,SAASI;MACT,WAAW,MAAMC,EAAY,EAAE,OAAO,OAAO;MAC7C,WAAU;KACX,CAAA,GACAP,EAAG,6BAA6B,iDAAiD,CAC7E;IACJ,CAAA,CAAA;;GAENI,EAAO,SACN,kBAAC,KAAD;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