@burdenoff/microfe-subscriberbot 2026.1031.1 → 2026.1102.2

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 (112) hide show
  1. package/dist/stories/pages/NegotiationDetailPage.stories.d.ts +11 -0
  2. package/dist/stories/pages/NegotiationDetailPage.stories.d.ts.map +1 -0
  3. package/dist/stories/pages/NegotiationNewPage.stories.d.ts +9 -0
  4. package/dist/stories/pages/NegotiationNewPage.stories.d.ts.map +1 -0
  5. package/dist/stories/pages/NegotiationsPage.stories.d.ts +11 -0
  6. package/dist/stories/pages/NegotiationsPage.stories.d.ts.map +1 -0
  7. package/dist/stories/pages/ProcurementDetailPage.stories.d.ts +10 -0
  8. package/dist/stories/pages/ProcurementDetailPage.stories.d.ts.map +1 -0
  9. package/dist/stories/pages/ProcurementNewPage.stories.d.ts +9 -0
  10. package/dist/stories/pages/ProcurementNewPage.stories.d.ts.map +1 -0
  11. package/dist/stories/pages/ProcurementPage.stories.d.ts +11 -0
  12. package/dist/stories/pages/ProcurementPage.stories.d.ts.map +1 -0
  13. package/dist/stories/support/negotiationFixtures.d.ts +14 -0
  14. package/dist/stories/support/negotiationFixtures.d.ts.map +1 -0
  15. package/dist/stories/support/procurementFixtures.d.ts +14 -0
  16. package/dist/stories/support/procurementFixtures.d.ts.map +1 -0
  17. package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +1 -1
  18. package/dist/subscriberbot/SubscriberBotRoutes.js +30 -6
  19. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  20. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
  21. package/dist/subscriberbot/admin/AdminDashboardPage.js +166 -146
  22. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  23. package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts +4 -0
  24. package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -0
  25. package/dist/subscriberbot/admin/NegotiationDeskPanel.js +210 -0
  26. package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -0
  27. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts +4 -0
  28. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -0
  29. package/dist/subscriberbot/admin/ProcurementDeskPanel.js +450 -0
  30. package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -0
  31. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts +8 -0
  32. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts.map +1 -0
  33. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +18 -0
  34. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -0
  35. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts +8 -0
  36. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -0
  37. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +49 -0
  38. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -0
  39. package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts +13 -0
  40. package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -0
  41. package/dist/subscriberbot/components/negotiations/OutcomeForm.js +112 -0
  42. package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -0
  43. package/dist/subscriberbot/components/negotiations/index.d.ts +5 -0
  44. package/dist/subscriberbot/components/negotiations/index.d.ts.map +1 -0
  45. package/dist/subscriberbot/components/negotiations/index.js +4 -0
  46. package/dist/subscriberbot/components/negotiations/labels.d.ts +16 -0
  47. package/dist/subscriberbot/components/negotiations/labels.d.ts.map +1 -0
  48. package/dist/subscriberbot/components/negotiations/labels.js +179 -0
  49. package/dist/subscriberbot/components/negotiations/labels.js.map +1 -0
  50. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts +12 -0
  51. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -0
  52. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +155 -0
  53. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -0
  54. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts +8 -0
  55. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts.map +1 -0
  56. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +18 -0
  57. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -0
  58. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts +13 -0
  59. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -0
  60. package/dist/subscriberbot/components/procurement/ProcurementThread.js +51 -0
  61. package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -0
  62. package/dist/subscriberbot/components/procurement/index.d.ts +5 -0
  63. package/dist/subscriberbot/components/procurement/index.d.ts.map +1 -0
  64. package/dist/subscriberbot/components/procurement/index.js +4 -0
  65. package/dist/subscriberbot/components/procurement/labels.d.ts +16 -0
  66. package/dist/subscriberbot/components/procurement/labels.d.ts.map +1 -0
  67. package/dist/subscriberbot/components/procurement/labels.js +154 -0
  68. package/dist/subscriberbot/components/procurement/labels.js.map +1 -0
  69. package/dist/subscriberbot/hooks/useNegotiationApi.d.ts +51 -0
  70. package/dist/subscriberbot/hooks/useNegotiationApi.d.ts.map +1 -0
  71. package/dist/subscriberbot/hooks/useNegotiationApi.js +106 -0
  72. package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -0
  73. package/dist/subscriberbot/hooks/useProcurementApi.d.ts +58 -0
  74. package/dist/subscriberbot/hooks/useProcurementApi.d.ts.map +1 -0
  75. package/dist/subscriberbot/hooks/useProcurementApi.js +128 -0
  76. package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -0
  77. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +1 -0
  78. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
  79. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -1
  80. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  81. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +11 -0
  82. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -0
  83. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +312 -0
  84. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -0
  85. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +11 -0
  86. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -0
  87. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +375 -0
  88. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -0
  89. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +10 -0
  90. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -0
  91. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +155 -0
  92. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -0
  93. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +11 -0
  94. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -0
  95. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +276 -0
  96. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -0
  97. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +12 -0
  98. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -0
  99. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +362 -0
  100. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -0
  101. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +11 -0
  102. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -0
  103. package/dist/subscriberbot/pages/procurement/ProcurementPage.js +156 -0
  104. package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -0
  105. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  106. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +149 -124
  107. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  108. package/dist/subscriberbot/types/negotiation.d.ts +101 -0
  109. package/dist/subscriberbot/types/negotiation.d.ts.map +1 -0
  110. package/dist/subscriberbot/types/procurement.d.ts +127 -0
  111. package/dist/subscriberbot/types/procurement.d.ts.map +1 -0
  112. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OutcomeForm.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/negotiations/OutcomeForm.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAG1D,OAAO,KAAK,EACV,cAAc,EAEd,gCAAgC,EACjC,MAAM,yBAAyB,CAAC;AAMjC,UAAU,gBAAgB;IACxB,WAAW,EAAE,cAAc,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;CAC7D;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAoH5C,CAAC"}
@@ -0,0 +1,112 @@
1
+ import { formatCurrency as e } from "../../utils/formatters.js";
2
+ import { useTr as t } from "../../hooks/useTr.js";
3
+ import { useState as n } from "react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/subscriberbot/components/negotiations/OutcomeForm.tsx
6
+ var a = "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)]", o = "mb-1 block text-xs font-medium text-text-secondary", s = ({ negotiation: s, pending: c, error: l, submitLabel: u, onSubmit: d }) => {
7
+ let f = t(), [p, m] = n("SUCCEEDED"), [h, g] = n(""), [_, v] = n(""), [y, b] = n(""), [x, S] = n(!!s.relationshipId);
8
+ return /* @__PURE__ */ i("form", {
9
+ onSubmit: (e) => {
10
+ e.preventDefault(), d({
11
+ outcome: p,
12
+ ...p === "SUCCEEDED" && h ? { newAmount: Number(h) } : {},
13
+ ...p === "SUCCEEDED" && _ ? { oneTimeCredit: Number(_) } : {},
14
+ ...y.trim() ? { summary: y.trim() } : {},
15
+ ...p === "SUCCEEDED" && s.relationshipId ? { applyToRelationship: x } : {}
16
+ });
17
+ },
18
+ className: "space-y-3",
19
+ "data-testid": "negotiation-outcome-form",
20
+ children: [
21
+ /* @__PURE__ */ i("fieldset", {
22
+ className: "flex flex-wrap gap-4 text-sm text-text-primary",
23
+ children: [
24
+ /* @__PURE__ */ r("legend", {
25
+ className: o,
26
+ children: f("negotiations.outcome.result", "Result")
27
+ }),
28
+ /* @__PURE__ */ i("label", {
29
+ className: "inline-flex items-center gap-2",
30
+ children: [/* @__PURE__ */ r("input", {
31
+ type: "radio",
32
+ name: "outcome",
33
+ checked: p === "SUCCEEDED",
34
+ onChange: () => m("SUCCEEDED")
35
+ }), f("negotiations.outcome.succeeded", "The bill was lowered or credited")]
36
+ }),
37
+ /* @__PURE__ */ i("label", {
38
+ className: "inline-flex items-center gap-2",
39
+ children: [/* @__PURE__ */ r("input", {
40
+ type: "radio",
41
+ name: "outcome",
42
+ checked: p === "NO_SAVINGS",
43
+ onChange: () => m("NO_SAVINGS")
44
+ }), f("negotiations.outcome.noSavings", "No savings offered")]
45
+ })
46
+ ]
47
+ }),
48
+ p === "SUCCEEDED" && /* @__PURE__ */ i("div", {
49
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
50
+ children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("label", {
51
+ htmlFor: "outcome-new-amount",
52
+ className: o,
53
+ children: f("negotiations.outcome.newAmount", "New price ({{current}} today)", { current: e(s.currentAmount, s.currency) })
54
+ }), /* @__PURE__ */ r("input", {
55
+ id: "outcome-new-amount",
56
+ type: "number",
57
+ min: "0",
58
+ step: "0.01",
59
+ value: h,
60
+ onChange: (e) => g(e.target.value),
61
+ className: a
62
+ })] }), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("label", {
63
+ htmlFor: "outcome-credit",
64
+ className: o,
65
+ children: f("negotiations.outcome.credit", "One-off credit or refund")
66
+ }), /* @__PURE__ */ r("input", {
67
+ id: "outcome-credit",
68
+ type: "number",
69
+ min: "0",
70
+ step: "0.01",
71
+ value: _,
72
+ onChange: (e) => v(e.target.value),
73
+ className: a
74
+ })] })]
75
+ }),
76
+ /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("label", {
77
+ htmlFor: "outcome-summary",
78
+ className: o,
79
+ children: f("negotiations.outcome.summary", "What was agreed")
80
+ }), /* @__PURE__ */ r("textarea", {
81
+ id: "outcome-summary",
82
+ rows: 2,
83
+ value: y,
84
+ onChange: (e) => b(e.target.value),
85
+ className: a
86
+ })] }),
87
+ p === "SUCCEEDED" && s.relationshipId && /* @__PURE__ */ i("label", {
88
+ className: "inline-flex items-center gap-2 text-sm text-text-primary",
89
+ children: [/* @__PURE__ */ r("input", {
90
+ type: "checkbox",
91
+ checked: x,
92
+ onChange: (e) => S(e.target.checked)
93
+ }), f("negotiations.outcome.apply", "Update the tracked subscription with the new price")]
94
+ }),
95
+ l && /* @__PURE__ */ r("p", {
96
+ role: "alert",
97
+ className: "text-sm text-status-error-text",
98
+ children: l
99
+ }),
100
+ /* @__PURE__ */ r("button", {
101
+ type: "submit",
102
+ disabled: c,
103
+ className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
104
+ children: u
105
+ })
106
+ ]
107
+ });
108
+ };
109
+ //#endregion
110
+ export { s as OutcomeForm };
111
+
112
+ //# sourceMappingURL=OutcomeForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OutcomeForm.js","names":[],"sources":["../../../../src/subscriberbot/components/negotiations/OutcomeForm.tsx"],"sourcesContent":["/**\n * Outcome form shared by the customer (self-serve) and the negotiation desk.\n */\nimport { useState, type FC, type FormEvent } from 'react';\nimport { useTr } from '../../hooks/useTr';\nimport { formatCurrency } from '../../utils/formatters';\nimport type {\n SubNegotiation,\n SubNegotiationOutcome,\n SubRecordNegotiationOutcomeInput,\n} from '../../types/negotiation';\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 labelCls = 'mb-1 block text-xs font-medium text-text-secondary';\n\ninterface OutcomeFormProps {\n negotiation: SubNegotiation;\n pending: boolean;\n error?: string | null;\n submitLabel: string;\n onSubmit: (input: SubRecordNegotiationOutcomeInput) => void;\n}\n\nexport const OutcomeForm: FC<OutcomeFormProps> = ({\n negotiation,\n pending,\n error,\n submitLabel,\n onSubmit,\n}) => {\n const tr = useTr();\n const [outcome, setOutcome] = useState<SubNegotiationOutcome>('SUCCEEDED');\n const [newAmount, setNewAmount] = useState('');\n const [credit, setCredit] = useState('');\n const [summary, setSummary] = useState('');\n const [apply, setApply] = useState(Boolean(negotiation.relationshipId));\n\n const handleSubmit = (e: FormEvent) => {\n e.preventDefault();\n onSubmit({\n outcome,\n ...(outcome === 'SUCCEEDED' && newAmount ? { newAmount: Number(newAmount) } : {}),\n ...(outcome === 'SUCCEEDED' && credit ? { oneTimeCredit: Number(credit) } : {}),\n ...(summary.trim() ? { summary: summary.trim() } : {}),\n ...(outcome === 'SUCCEEDED' && negotiation.relationshipId\n ? { applyToRelationship: apply }\n : {}),\n });\n };\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-3\" data-testid=\"negotiation-outcome-form\">\n <fieldset className=\"flex flex-wrap gap-4 text-sm text-text-primary\">\n <legend className={labelCls}>{tr('negotiations.outcome.result', 'Result')}</legend>\n <label className=\"inline-flex items-center gap-2\">\n <input\n type=\"radio\"\n name=\"outcome\"\n checked={outcome === 'SUCCEEDED'}\n onChange={() => setOutcome('SUCCEEDED')}\n />\n {tr('negotiations.outcome.succeeded', 'The bill was lowered or credited')}\n </label>\n <label className=\"inline-flex items-center gap-2\">\n <input\n type=\"radio\"\n name=\"outcome\"\n checked={outcome === 'NO_SAVINGS'}\n onChange={() => setOutcome('NO_SAVINGS')}\n />\n {tr('negotiations.outcome.noSavings', 'No savings offered')}\n </label>\n </fieldset>\n {outcome === 'SUCCEEDED' && (\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"outcome-new-amount\" className={labelCls}>\n {tr('negotiations.outcome.newAmount', 'New price ({{current}} today)', {\n current: formatCurrency(negotiation.currentAmount, negotiation.currency),\n })}\n </label>\n <input\n id=\"outcome-new-amount\"\n type=\"number\"\n min=\"0\"\n step=\"0.01\"\n value={newAmount}\n onChange={(e) => setNewAmount(e.target.value)}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor=\"outcome-credit\" className={labelCls}>\n {tr('negotiations.outcome.credit', 'One-off credit or refund')}\n </label>\n <input\n id=\"outcome-credit\"\n type=\"number\"\n min=\"0\"\n step=\"0.01\"\n value={credit}\n onChange={(e) => setCredit(e.target.value)}\n className={inputCls}\n />\n </div>\n </div>\n )}\n <div>\n <label htmlFor=\"outcome-summary\" className={labelCls}>\n {tr('negotiations.outcome.summary', 'What was agreed')}\n </label>\n <textarea\n id=\"outcome-summary\"\n rows={2}\n value={summary}\n onChange={(e) => setSummary(e.target.value)}\n className={inputCls}\n />\n </div>\n {outcome === 'SUCCEEDED' && negotiation.relationshipId && (\n <label className=\"inline-flex items-center gap-2 text-sm text-text-primary\">\n <input type=\"checkbox\" checked={apply} onChange={(e) => setApply(e.target.checked)} />\n {tr('negotiations.outcome.apply', 'Update the tracked subscription with the new price')}\n </label>\n )}\n {error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error}\n </p>\n )}\n <button\n type=\"submit\"\n disabled={pending}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {submitLabel}\n </button>\n </form>\n );\n};\n"],"mappings":";;;;;AAYA,IAAM,IACJ,wMACI,IAAW,sDAUJ,KAAqC,EAChD,gBACA,YACA,UACA,gBACA,kBACI;CACJ,IAAM,IAAK,EAAM,GACX,CAAC,GAAS,KAAc,EAAgC,WAAW,GACnE,CAAC,GAAW,KAAgB,EAAS,EAAE,GACvC,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,CAAC,GAAS,KAAc,EAAS,EAAE,GACnC,CAAC,GAAO,KAAY,EAAS,EAAQ,EAAY,cAAe;CAetE,OACE,kBAAC,QAAD;EAAM,WAdc,MAAiB;GAErC,AADA,EAAE,eAAe,GACjB,EAAS;IACP;IACA,GAAI,MAAY,eAAe,IAAY,EAAE,WAAW,OAAO,CAAS,EAAE,IAAI,CAAC;IAC/E,GAAI,MAAY,eAAe,IAAS,EAAE,eAAe,OAAO,CAAM,EAAE,IAAI,CAAC;IAC7E,GAAI,EAAQ,KAAK,IAAI,EAAE,SAAS,EAAQ,KAAK,EAAE,IAAI,CAAC;IACpD,GAAI,MAAY,eAAe,EAAY,iBACvC,EAAE,qBAAqB,EAAM,IAC7B,CAAC;GACP,CAAC;EACH;EAGgC,WAAU;EAAY,eAAY;YAAhE;GACE,kBAAC,YAAD;IAAU,WAAU;cAApB;KACE,kBAAC,UAAD;MAAQ,WAAW;gBAAW,EAAG,+BAA+B,QAAQ;KAAU,CAAA;KAClF,kBAAC,SAAD;MAAO,WAAU;gBAAjB,CACE,kBAAC,SAAD;OACE,MAAK;OACL,MAAK;OACL,SAAS,MAAY;OACrB,gBAAgB,EAAW,WAAW;MACvC,CAA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AAM,EAAS,EAAE,OAAO,OAAO;IAAI,CAAA,GACpF,EAAG,8BAA8B,oDAAoD,CACjF;;GAER,KACC,kBAAC,KAAD;IAAG,MAAK;IAAQ,WAAU;cACvB;GACA,CAAA;GAEL,kBAAC,UAAD;IACE,MAAK;IACL,UAAU;IACV,WAAU;cAET;GACK,CAAA;EACJ;;AAEV"}
@@ -0,0 +1,5 @@
1
+ export * from './labels';
2
+ export { NegotiationStatusPill } from './NegotiationStatusPill';
3
+ export { NegotiationTimeline } from './NegotiationTimeline';
4
+ export { OutcomeForm } from './OutcomeForm';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/negotiations/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ import "./labels.js";
2
+ import "./NegotiationStatusPill.js";
3
+ import "./NegotiationTimeline.js";
4
+ import "./OutcomeForm.js";
@@ -0,0 +1,16 @@
1
+ import { SubNegotiationBillType, SubNegotiationEventKind, SubNegotiationFeeStatus, SubNegotiationStatus, SubNegotiationTarget } from '../../types/negotiation';
2
+
3
+ export type Label = {
4
+ key: string;
5
+ fallback: string;
6
+ };
7
+ export declare const BILL_TYPES: SubNegotiationBillType[];
8
+ export declare const BILL_TYPE_LABEL: Record<SubNegotiationBillType, Label>;
9
+ export declare const TARGETS: SubNegotiationTarget[];
10
+ export declare const TARGET_LABEL: Record<SubNegotiationTarget, Label>;
11
+ export declare const STATUS_LABEL: Record<SubNegotiationStatus, Label>;
12
+ export declare const FEE_STATUS_LABEL: Record<SubNegotiationFeeStatus, Label>;
13
+ export declare const EVENT_LABEL: Record<SubNegotiationEventKind, Label>;
14
+ export declare function statusTone(status: SubNegotiationStatus): string;
15
+ export declare const OPEN_STATUSES: SubNegotiationStatus[];
16
+ //# sourceMappingURL=labels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/negotiations/labels.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,KAAK,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,eAAO,MAAM,UAAU,EAAE,sBAAsB,EAS9C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,sBAAsB,EAAE,KAAK,CASjE,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,oBAAoB,EAMzC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAY5D,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAQ5D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAKnE,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAc9D,CAAC;AAYF,wBAAgB,UAAU,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAE/D;AAED,eAAO,MAAM,aAAa,EAAE,oBAAoB,EAK/C,CAAC"}
@@ -0,0 +1,179 @@
1
+ //#region src/subscriberbot/components/negotiations/labels.ts
2
+ var e = [
3
+ "INTERNET",
4
+ "CABLE_TV",
5
+ "MOBILE_PHONE",
6
+ "HOME_PHONE",
7
+ "INSURANCE",
8
+ "UTILITY",
9
+ "SUBSCRIPTION",
10
+ "OTHER"
11
+ ], t = {
12
+ CABLE_TV: {
13
+ key: "negotiations.billType.cableTv",
14
+ fallback: "Cable TV"
15
+ },
16
+ INTERNET: {
17
+ key: "negotiations.billType.internet",
18
+ fallback: "Internet"
19
+ },
20
+ MOBILE_PHONE: {
21
+ key: "negotiations.billType.mobilePhone",
22
+ fallback: "Mobile phone"
23
+ },
24
+ HOME_PHONE: {
25
+ key: "negotiations.billType.homePhone",
26
+ fallback: "Home phone"
27
+ },
28
+ INSURANCE: {
29
+ key: "negotiations.billType.insurance",
30
+ fallback: "Insurance"
31
+ },
32
+ UTILITY: {
33
+ key: "negotiations.billType.utility",
34
+ fallback: "Utility"
35
+ },
36
+ SUBSCRIPTION: {
37
+ key: "negotiations.billType.subscription",
38
+ fallback: "Subscription"
39
+ },
40
+ OTHER: {
41
+ key: "negotiations.billType.other",
42
+ fallback: "Other"
43
+ }
44
+ }, n = [
45
+ "LOWER_PRICE",
46
+ "REMOVE_FEES",
47
+ "BETTER_PLAN_SAME_PRICE",
48
+ "RETENTION_OFFER",
49
+ "CANCEL_IF_NO_DEAL"
50
+ ], r = {
51
+ LOWER_PRICE: {
52
+ key: "negotiations.target.lowerPrice",
53
+ fallback: "Lower the price"
54
+ },
55
+ REMOVE_FEES: {
56
+ key: "negotiations.target.removeFees",
57
+ fallback: "Remove fees"
58
+ },
59
+ BETTER_PLAN_SAME_PRICE: {
60
+ key: "negotiations.target.betterPlan",
61
+ fallback: "Better plan for the same price"
62
+ },
63
+ RETENTION_OFFER: {
64
+ key: "negotiations.target.retention",
65
+ fallback: "Best retention offer"
66
+ },
67
+ CANCEL_IF_NO_DEAL: {
68
+ key: "negotiations.target.cancelIfNoDeal",
69
+ fallback: "Lower the price or cancel"
70
+ }
71
+ }, i = {
72
+ DRAFT: {
73
+ key: "negotiations.status.draft",
74
+ fallback: "Draft"
75
+ },
76
+ SUBMITTED: {
77
+ key: "negotiations.status.submitted",
78
+ fallback: "Submitted"
79
+ },
80
+ IN_PROGRESS: {
81
+ key: "negotiations.status.inProgress",
82
+ fallback: "Negotiating"
83
+ },
84
+ AWAITING_CUSTOMER: {
85
+ key: "negotiations.status.awaitingCustomer",
86
+ fallback: "Needs your reply"
87
+ },
88
+ SUCCEEDED: {
89
+ key: "negotiations.status.succeeded",
90
+ fallback: "Bill lowered"
91
+ },
92
+ NO_SAVINGS: {
93
+ key: "negotiations.status.noSavings",
94
+ fallback: "No savings"
95
+ },
96
+ CANCELLED: {
97
+ key: "negotiations.status.cancelled",
98
+ fallback: "Cancelled"
99
+ }
100
+ }, a = {
101
+ NONE: {
102
+ key: "negotiations.fee.none",
103
+ fallback: "No fee"
104
+ },
105
+ PENDING_BILLING: {
106
+ key: "negotiations.fee.pending",
107
+ fallback: "Fee pending"
108
+ },
109
+ BILLED: {
110
+ key: "negotiations.fee.billed",
111
+ fallback: "Fee billed"
112
+ },
113
+ WAIVED: {
114
+ key: "negotiations.fee.waived",
115
+ fallback: "Fee waived"
116
+ }
117
+ }, o = {
118
+ CREATED: {
119
+ key: "negotiations.event.created",
120
+ fallback: "Request created"
121
+ },
122
+ UPDATED: {
123
+ key: "negotiations.event.updated",
124
+ fallback: "Details updated"
125
+ },
126
+ SUBMITTED: {
127
+ key: "negotiations.event.submitted",
128
+ fallback: "Submitted"
129
+ },
130
+ STATUS_CHANGED: {
131
+ key: "negotiations.event.statusChanged",
132
+ fallback: "Status changed"
133
+ },
134
+ NOTE: {
135
+ key: "negotiations.event.note",
136
+ fallback: "Message"
137
+ },
138
+ OUTCOME_RECORDED: {
139
+ key: "negotiations.event.outcome",
140
+ fallback: "Outcome recorded"
141
+ },
142
+ FEE_BILLED: {
143
+ key: "negotiations.event.feeBilled",
144
+ fallback: "Success fee billed"
145
+ },
146
+ FEE_BILLING_FAILED: {
147
+ key: "negotiations.event.feeBillingFailed",
148
+ fallback: "Fee billing failed (will be retried)"
149
+ },
150
+ FEE_WAIVED: {
151
+ key: "negotiations.event.feeWaived",
152
+ fallback: "Success fee waived"
153
+ },
154
+ CANCELLED: {
155
+ key: "negotiations.event.cancelled",
156
+ fallback: "Cancelled"
157
+ }
158
+ }, s = {
159
+ DRAFT: "bg-bg-sunken text-text-secondary",
160
+ SUBMITTED: "bg-[var(--color-accent-soft)] text-text-primary",
161
+ IN_PROGRESS: "bg-[var(--color-accent-soft)] text-text-primary",
162
+ AWAITING_CUSTOMER: "bg-status-warning-bg-subtle text-status-warning-text",
163
+ SUCCEEDED: "bg-status-success-bg-subtle text-status-success-text",
164
+ NO_SAVINGS: "bg-bg-sunken text-text-secondary",
165
+ CANCELLED: "bg-bg-sunken text-text-secondary"
166
+ };
167
+ function c(e) {
168
+ return s[e];
169
+ }
170
+ var l = [
171
+ "DRAFT",
172
+ "SUBMITTED",
173
+ "IN_PROGRESS",
174
+ "AWAITING_CUSTOMER"
175
+ ];
176
+ //#endregion
177
+ export { e as BILL_TYPES, t as BILL_TYPE_LABEL, o as EVENT_LABEL, a as FEE_STATUS_LABEL, l as OPEN_STATUSES, i as STATUS_LABEL, n as TARGETS, r as TARGET_LABEL, c as statusTone };
178
+
179
+ //# sourceMappingURL=labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.js","names":[],"sources":["../../../../src/subscriberbot/components/negotiations/labels.ts"],"sourcesContent":["/**\n * Bill negotiation labels (BOFF-4154): i18n keys with English fallbacks.\n */\nimport type {\n SubNegotiationBillType,\n SubNegotiationEventKind,\n SubNegotiationFeeStatus,\n SubNegotiationStatus,\n SubNegotiationTarget,\n} from '../../types/negotiation';\n\nexport type Label = { key: string; fallback: string };\n\nexport const BILL_TYPES: SubNegotiationBillType[] = [\n 'INTERNET',\n 'CABLE_TV',\n 'MOBILE_PHONE',\n 'HOME_PHONE',\n 'INSURANCE',\n 'UTILITY',\n 'SUBSCRIPTION',\n 'OTHER',\n];\n\nexport const BILL_TYPE_LABEL: Record<SubNegotiationBillType, Label> = {\n CABLE_TV: { key: 'negotiations.billType.cableTv', fallback: 'Cable TV' },\n INTERNET: { key: 'negotiations.billType.internet', fallback: 'Internet' },\n MOBILE_PHONE: { key: 'negotiations.billType.mobilePhone', fallback: 'Mobile phone' },\n HOME_PHONE: { key: 'negotiations.billType.homePhone', fallback: 'Home phone' },\n INSURANCE: { key: 'negotiations.billType.insurance', fallback: 'Insurance' },\n UTILITY: { key: 'negotiations.billType.utility', fallback: 'Utility' },\n SUBSCRIPTION: { key: 'negotiations.billType.subscription', fallback: 'Subscription' },\n OTHER: { key: 'negotiations.billType.other', fallback: 'Other' },\n};\n\nexport const TARGETS: SubNegotiationTarget[] = [\n 'LOWER_PRICE',\n 'REMOVE_FEES',\n 'BETTER_PLAN_SAME_PRICE',\n 'RETENTION_OFFER',\n 'CANCEL_IF_NO_DEAL',\n];\n\nexport const TARGET_LABEL: Record<SubNegotiationTarget, Label> = {\n LOWER_PRICE: { key: 'negotiations.target.lowerPrice', fallback: 'Lower the price' },\n REMOVE_FEES: { key: 'negotiations.target.removeFees', fallback: 'Remove fees' },\n BETTER_PLAN_SAME_PRICE: {\n key: 'negotiations.target.betterPlan',\n fallback: 'Better plan for the same price',\n },\n RETENTION_OFFER: { key: 'negotiations.target.retention', fallback: 'Best retention offer' },\n CANCEL_IF_NO_DEAL: {\n key: 'negotiations.target.cancelIfNoDeal',\n fallback: 'Lower the price or cancel',\n },\n};\n\nexport const STATUS_LABEL: Record<SubNegotiationStatus, Label> = {\n DRAFT: { key: 'negotiations.status.draft', fallback: 'Draft' },\n SUBMITTED: { key: 'negotiations.status.submitted', fallback: 'Submitted' },\n IN_PROGRESS: { key: 'negotiations.status.inProgress', fallback: 'Negotiating' },\n AWAITING_CUSTOMER: { key: 'negotiations.status.awaitingCustomer', fallback: 'Needs your reply' },\n SUCCEEDED: { key: 'negotiations.status.succeeded', fallback: 'Bill lowered' },\n NO_SAVINGS: { key: 'negotiations.status.noSavings', fallback: 'No savings' },\n CANCELLED: { key: 'negotiations.status.cancelled', fallback: 'Cancelled' },\n};\n\nexport const FEE_STATUS_LABEL: Record<SubNegotiationFeeStatus, Label> = {\n NONE: { key: 'negotiations.fee.none', fallback: 'No fee' },\n PENDING_BILLING: { key: 'negotiations.fee.pending', fallback: 'Fee pending' },\n BILLED: { key: 'negotiations.fee.billed', fallback: 'Fee billed' },\n WAIVED: { key: 'negotiations.fee.waived', fallback: 'Fee waived' },\n};\n\nexport const EVENT_LABEL: Record<SubNegotiationEventKind, Label> = {\n CREATED: { key: 'negotiations.event.created', fallback: 'Request created' },\n UPDATED: { key: 'negotiations.event.updated', fallback: 'Details updated' },\n SUBMITTED: { key: 'negotiations.event.submitted', fallback: 'Submitted' },\n STATUS_CHANGED: { key: 'negotiations.event.statusChanged', fallback: 'Status changed' },\n NOTE: { key: 'negotiations.event.note', fallback: 'Message' },\n OUTCOME_RECORDED: { key: 'negotiations.event.outcome', fallback: 'Outcome recorded' },\n FEE_BILLED: { key: 'negotiations.event.feeBilled', fallback: 'Success fee billed' },\n FEE_BILLING_FAILED: {\n key: 'negotiations.event.feeBillingFailed',\n fallback: 'Fee billing failed (will be retried)',\n },\n FEE_WAIVED: { key: 'negotiations.event.feeWaived', fallback: 'Success fee waived' },\n CANCELLED: { key: 'negotiations.event.cancelled', fallback: 'Cancelled' },\n};\n\nconst STATUS_TONE: Record<SubNegotiationStatus, string> = {\n DRAFT: 'bg-bg-sunken text-text-secondary',\n SUBMITTED: 'bg-[var(--color-accent-soft)] text-text-primary',\n IN_PROGRESS: 'bg-[var(--color-accent-soft)] text-text-primary',\n AWAITING_CUSTOMER: 'bg-status-warning-bg-subtle text-status-warning-text',\n SUCCEEDED: 'bg-status-success-bg-subtle text-status-success-text',\n NO_SAVINGS: 'bg-bg-sunken text-text-secondary',\n CANCELLED: 'bg-bg-sunken text-text-secondary',\n};\n\nexport function statusTone(status: SubNegotiationStatus): string {\n return STATUS_TONE[status];\n}\n\nexport const OPEN_STATUSES: SubNegotiationStatus[] = [\n 'DRAFT',\n 'SUBMITTED',\n 'IN_PROGRESS',\n 'AWAITING_CUS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AAQ;EAAE,KAAK;EAA2B,UAAU;CAAa;AACnE,GAEa,IAAsD;CACjE,SAAS;EAAE,KAAK;EAA8B,UAAU;CAAkB;CAC1E,SAAS;EAAE,KAAK;EAA8B,UAAU;CAAkB;CAC1E,WAAW;EAAE,KAAK;EAAgC,UAAU;CAAY;CACxE,gBAAgB;EAAE,KAAK;EAAoC,UAAU;CAAiB;CACtF,MAAM;EAAE,KAAK;EAA2B,UAAU;CAAU;CAC5D,kBAAkB;EAAE,KAAK;EAA8B,UAAU;CAAmB;CACpF,YAAY;EAAE,KAAK;EAAgC,UAAU;CAAqB;CAClF,oBAAoB;EAClB,KAAK;EACL,UAAU;CACZ;CACA,YAAY;EAAE,KAAK;EAAgC,UAAU;CAAqB;CAClF,WAAW;EAAE,KAAK;EAAgC,UAAU;CAAY;AAC1E,GAEM,IAAoD;CACxD,OAAO;CACP,WAAW;CACX,aAAa;CACb,mBAAmB;CACnB,WAAW;CACX,YAAY;CACZ,WAAW;AACb;AAEA,SAAgB,EAAW,GAAsC;CAC/D,OAAO,EAAY;AACrB;AAEA,IAAa,IAAwC;CACnD;CACA;CACA;CACA;AACF"}
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { SubProcurementRequest, SubRecordProcurementOutcomeInput } from '../../types/procurement';
3
+
4
+ interface ProcurementOutcomeFormProps {
5
+ request: SubProcurementRequest;
6
+ pending: boolean;
7
+ error?: string | null;
8
+ onSubmit: (input: SubRecordProcurementOutcomeInput) => void;
9
+ }
10
+ export declare const ProcurementOutcomeForm: FC<ProcurementOutcomeFormProps>;
11
+ export {};
12
+ //# sourceMappingURL=ProcurementOutcomeForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcurementOutcomeForm.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/procurement/ProcurementOutcomeForm.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAG1D,OAAO,KAAK,EAEV,qBAAqB,EACrB,gCAAgC,EACjC,MAAM,yBAAyB,CAAC;AAMjC,UAAU,2BAA2B;IACnC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;CAC7D;AAcD,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAsKlE,CAAC"}
@@ -0,0 +1,155 @@
1
+ import { formatCurrency as e } from "../../utils/formatters.js";
2
+ import { useTr as t } from "../../hooks/useTr.js";
3
+ import { useState as n } from "react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/subscriberbot/components/procurement/ProcurementOutcomeForm.tsx
6
+ var a = "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)]", o = "mb-1 block text-xs font-medium text-text-secondary";
7
+ function s(e, t, n, r) {
8
+ if (e == null || !Number.isFinite(t)) return 0;
9
+ let i = Math.max(0, e - t);
10
+ return Math.round((i * Math.min(12, Math.max(0, n)) / 12 + r) * 100) / 100;
11
+ }
12
+ var c = ({ request: c, pending: l, error: u, onSubmit: d }) => {
13
+ let f = t(), [p, m] = n("SUCCEEDED"), [h, g] = n(""), [_, v] = n(String(c.termMonths)), [y, b] = n(""), [x, S] = n(""), [C, w] = n(""), [T, E] = n(!!c.relationshipId), D = Number(h), O = Number(_) || c.termMonths, k = Number(y) || 0, A = h ? s(c.baselineAnnualValue, D, O, k) : 0, j = Math.round(A * c.feeRate * 100) / 100;
14
+ return /* @__PURE__ */ i("form", {
15
+ onSubmit: (e) => {
16
+ e.preventDefault(), d({
17
+ outcome: p,
18
+ ...h ? { finalAnnualValue: D } : {},
19
+ ..._ ? { finalTermMonths: O } : {},
20
+ ...p === "SUCCEEDED" && y ? { oneTimeCredit: k } : {},
21
+ ...x.trim() ? { nonPriceWins: x.trim() } : {},
22
+ ...C.trim() ? { summary: C.trim() } : {},
23
+ ...p === "SUCCEEDED" && c.relationshipId ? { applyToRelationship: T } : {}
24
+ });
25
+ },
26
+ className: "space-y-3",
27
+ "data-testid": "procurement-outcome-form",
28
+ children: [
29
+ /* @__PURE__ */ i("fieldset", {
30
+ className: "flex flex-wrap gap-4 text-sm text-text-primary",
31
+ children: [
32
+ /* @__PURE__ */ r("legend", {
33
+ className: o,
34
+ children: f("procurement.outcome.result", "Result")
35
+ }),
36
+ /* @__PURE__ */ i("label", {
37
+ className: "inline-flex items-center gap-2",
38
+ children: [/* @__PURE__ */ r("input", {
39
+ type: "radio",
40
+ name: `outcome-${c.id}`,
41
+ checked: p === "SUCCEEDED",
42
+ onChange: () => m("SUCCEEDED")
43
+ }), f("procurement.outcome.succeeded", "Savings secured")]
44
+ }),
45
+ /* @__PURE__ */ i("label", {
46
+ className: "inline-flex items-center gap-2",
47
+ children: [/* @__PURE__ */ r("input", {
48
+ type: "radio",
49
+ name: `outcome-${c.id}`,
50
+ checked: p === "NO_SAVINGS",
51
+ onChange: () => m("NO_SAVINGS")
52
+ }), f("procurement.outcome.noSavings", "No savings")]
53
+ })
54
+ ]
55
+ }),
56
+ /* @__PURE__ */ i("div", {
57
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
58
+ children: [
59
+ /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("label", {
60
+ htmlFor: `final-${c.id}`,
61
+ className: o,
62
+ children: f("procurement.outcome.finalValue", "Final annual value ({{currency}})", { currency: c.currency })
63
+ }), /* @__PURE__ */ r("input", {
64
+ id: `final-${c.id}`,
65
+ type: "number",
66
+ min: "0",
67
+ step: "0.01",
68
+ value: h,
69
+ onChange: (e) => g(e.target.value),
70
+ className: a
71
+ })] }),
72
+ /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("label", {
73
+ htmlFor: `term-${c.id}`,
74
+ className: o,
75
+ children: f("procurement.outcome.finalTerm", "Final term (months)")
76
+ }), /* @__PURE__ */ r("input", {
77
+ id: `term-${c.id}`,
78
+ type: "number",
79
+ min: "1",
80
+ max: "60",
81
+ step: "1",
82
+ value: _,
83
+ onChange: (e) => v(e.target.value),
84
+ className: a
85
+ })] }),
86
+ p === "SUCCEEDED" && /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("label", {
87
+ htmlFor: `credit-${c.id}`,
88
+ className: o,
89
+ children: f("procurement.outcome.credit", "One-off credit")
90
+ }), /* @__PURE__ */ r("input", {
91
+ id: `credit-${c.id}`,
92
+ type: "number",
93
+ min: "0",
94
+ step: "0.01",
95
+ value: y,
96
+ onChange: (e) => b(e.target.value),
97
+ className: a
98
+ })] })
99
+ ]
100
+ }),
101
+ /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("label", {
102
+ htmlFor: `wins-${c.id}`,
103
+ className: o,
104
+ children: f("procurement.outcome.wins", "Non-price wins (price caps, extra seats, payment terms)")
105
+ }), /* @__PURE__ */ r("input", {
106
+ id: `wins-${c.id}`,
107
+ value: x,
108
+ onChange: (e) => S(e.target.value),
109
+ className: a
110
+ })] }),
111
+ /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("label", {
112
+ htmlFor: `summary-${c.id}`,
113
+ className: o,
114
+ children: f("procurement.outcome.summary", "Summary for the customer")
115
+ }), /* @__PURE__ */ r("textarea", {
116
+ id: `summary-${c.id}`,
117
+ rows: 2,
118
+ value: C,
119
+ onChange: (e) => w(e.target.value),
120
+ className: a
121
+ })] }),
122
+ p === "SUCCEEDED" && c.relationshipId && /* @__PURE__ */ i("label", {
123
+ className: "inline-flex items-center gap-2 text-sm text-text-primary",
124
+ children: [/* @__PURE__ */ r("input", {
125
+ type: "checkbox",
126
+ checked: T,
127
+ onChange: (e) => E(e.target.checked)
128
+ }), f("procurement.outcome.apply", "Update the tracked subscription to the new price")]
129
+ }),
130
+ p === "SUCCEEDED" && h && /* @__PURE__ */ r("p", {
131
+ className: "text-xs text-text-secondary",
132
+ "data-testid": "procurement-outcome-preview",
133
+ children: f("procurement.outcome.preview", "First-year savings {{savings}} · success fee {{fee}}", {
134
+ savings: e(A, c.currency),
135
+ fee: e(j, c.currency)
136
+ })
137
+ }),
138
+ u && /* @__PURE__ */ r("p", {
139
+ role: "alert",
140
+ className: "text-sm text-status-error-text",
141
+ children: u
142
+ }),
143
+ /* @__PURE__ */ r("button", {
144
+ type: "submit",
145
+ disabled: l || p === "SUCCEEDED" && !h,
146
+ className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
147
+ children: f("procurement.outcome.save", "Save outcome and bill fee")
148
+ })
149
+ ]
150
+ });
151
+ };
152
+ //#endregion
153
+ export { c as ProcurementOutcomeForm };
154
+
155
+ //# sourceMappingURL=ProcurementOutcomeForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcurementOutcomeForm.js","names":[],"sources":["../../../../src/subscriberbot/components/procurement/ProcurementOutcomeForm.tsx"],"sourcesContent":["/**\n * Outcome form used by the procurement desk to close a request (BOFF-4158).\n * Savings and the success fee are computed by the service from the baseline\n * (the vendor quote, else the current price); the form previews them.\n */\nimport { useState, type FC, type FormEvent } from 'react';\nimport { useTr } from '../../hooks/useTr';\nimport { formatCurrency } from '../../utils/formatters';\nimport type {\n SubProcurementOutcome,\n SubProcurementRequest,\n SubRecordProcurementOutcomeInput,\n} 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 labelCls = 'mb-1 block text-xs font-medium text-text-secondary';\n\ninterface ProcurementOutcomeFormProps {\n request: SubProcurementRequest;\n pending: boolean;\n error?: string | null;\n onSubmit: (input: SubRecordProcurementOutcomeInput) => void;\n}\n\n/** First-year savings preview, mirroring the service maths. */\nfunction previewSavings(\n baseline: number | null,\n finalValue: number,\n termMonths: number,\n credit: number\n): number {\n if (baseline == null || !Number.isFinite(finalValue)) return 0;\n const annual = Math.max(0, baseline - finalValue);\n return Math.round(((annual * Math.min(12, Math.max(0, termMonths))) / 12 + credit) * 100) / 100;\n}\n\nexport const ProcurementOutcomeForm: FC<ProcurementOutcomeFormProps> = ({\n request,\n pending,\n error,\n onSubmit,\n}) => {\n const tr = useTr();\n const [outcome, setOutcome] = useState<SubProcurementOutcome>('SUCCEEDED');\n const [finalValue, setFinalValue] = useState('');\n const [finalTerm, setFinalTerm] = useState(String(request.termMonths));\n const [credit, setCredit] = useState('');\n const [wins, setWins] = useState('');\n const [summary, setSummary] = useState('');\n const [apply, setApply] = useState(Boolean(request.relationshipId));\n\n const finalNumber = Number(finalValue);\n const termNumber = Number(finalTerm) || request.termMonths;\n const creditNumber = Number(credit) || 0;\n const firstYear = finalValue\n ? previewSavings(request.baselineAnnualValue, finalNumber, termNumber, creditNumber)\n : 0;\n const fee = Math.round(firstYear * request.feeRate * 100) / 100;\n\n const handleSubmit = (e: FormEvent) => {\n e.preventDefault();\n onSubmit({\n outcome,\n ...(finalValue ? { finalAnnualValue: finalNumber } : {}),\n ...(finalTerm ? { finalTermMonths: termNumber } : {}),\n ...(outcome === 'SUCCEEDED' && credit ? { oneTimeCredit: creditNumber } : {}),\n ...(wins.trim() ? { nonPriceWins: wins.trim() } : {}),\n ...(summary.trim() ? { summary: summary.trim() } : {}),\n ...(outcome === 'SUCCEEDED' && request.relationshipId ? { applyToRelationship: apply } : {}),\n });\n };\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-3\" data-testid=\"procurement-outcome-form\">\n <fieldset className=\"flex flex-wrap gap-4 text-sm text-text-primary\">\n <legend className={labelCls}>{tr('procurement.outcome.result', 'Result')}</legend>\n <label className=\"inline-flex items-center gap-2\">\n <input\n type=\"radio\"\n name={`outcome-${request.id}`}\n checked={outcome === 'SUCCEEDED'}\n onChange={() => setOutcome('SUCCEEDED')}\n />\n {tr('procurement.outcome.succeeded', 'Savings secured')}\n </label>\n <label className=\"inline-flex items-center gap-2\">\n <input\n type=\"radio\"\n name={`outcome-${request.id}`}\n checked={outcome === 'NO_SAVINGS'}\n onChange={() => setOutcome('NO_SAVINGS')}\n />\n {tr('procurement.outcome.noSavings', 'No savings')}\n </label>\n </fieldset>\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-3\">\n <div>\n <label htmlFor={`final-${request.id}`} className={labelCls}>\n {tr('procurement.outcome.finalValue', 'Final annual value ({{currency}})', {\n currency: request.currency,\n })}\n </label>\n <input\n id={`final-${request.id}`}\n type=\"number\"\n min=\"0\"\n step=\"0.01\"\n value={finalValue}\n onChange={(e) => setFinalValue(e.target.value)}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor={`term-${request.id}`} className={labelCls}>\n {tr('procurement.outcome.finalTerm', 'Final term (months)')}\n </label>\n <input\n id={`term-${request.id}`}\n type=\"number\"\n min=\"1\"\n max=\"60\"\n step=\"1\"\n value={finalTerm}\n onChange={(e) => setFinalTerm(e.target.value)}\n className={inputCls}\n />\n </div>\n {outcome === 'SUCCEEDED' && (\n <div>\n <label htmlFor={`credit-${request.id}`} className={labelCls}>\n {tr('procurement.outcome.credit', 'One-off credit')}\n </label>\n <input\n id={`credit-${request.id}`}\n type=\"number\"\n min=\"0\"\n step=\"0.01\"\n value={credit}\n onChange={(e) => setCredit(e.target.value)}\n className={inputCls}\n />\n </div>\n )}\n </div>\n <div>\n <label htmlFor={`wins-${request.id}`} className={labelCls}>\n {tr(\n 'procurement.outcome.wins',\n 'Non-price wins (price caps, extra seats, payment terms)'\n )}\n </label>\n <input\n id={`wins-${request.id}`}\n value={wins}\n onChange={(e) => setWins(e.target.value)}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor={`summary-${request.id}`} className={labelCls}>\n {tr('procurement.outcome.summary', 'Summary for the customer')}\n </label>\n <textarea\n id={`summary-${request.id}`}\n rows={2}\n value={summary}\n onChange={(e) => setSummary(e.target.value)}\n className={inputCls}\n />\n </div>\n {outcome === 'SUCCEEDED' && request.relationshipId && (\n <label className=\"inline-flex items-center gap-2 text-sm text-text-primary\">\n <input type=\"checkbox\" checked={apply} onChange={(e) => setApply(e.target.checked)} />\n {tr('procurement.outcome.apply', 'Update the tracked subscription to the new price')}\n </label>\n )}\n {outcome === 'SUCCEEDED' && finalValue && (\n <p className=\"text-xs text-text-secondary\" data-testid=\"procurement-outcome-preview\">\n {tr(\n 'procurement.outcome.preview',\n 'First-year savings {{savings}} · success fee {{fee}}',\n {\n savings: formatCurrency(firstYear, request.currency),\n fee: formatCurrency(fee, request.currency),\n }\n )}\n </p>\n )}\n {error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error}\n </p>\n )}\n <button\n type=\"submit\"\n disabled={pending || (outcome === 'SUCCEEDED' && !finalValue)}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {tr('procurement.outcome.save', 'Save outcome and bill fee')}\n </button>\n </form>\n );\n};\n"],"mappings":";;;;;AAcA,IAAM,IACJ,wMACI,IAAW;AAUjB,SAAS,EACP,GACA,GACA,GACA,GACQ;CACR,IAAI,KAAY,QAAQ,CAAC,OAAO,SAAS,CAAU,GAAG,OAAO;CAC7D,IAAM,IAAS,KAAK,IAAI,GAAG,IAAW,CAAU;CAChD,OAAO,KAAK,OAAQ,IAAS,KAAK,IAAI,IAAI,KAAK,IAAI,GAAG,CAAU,CAAC,IAAK,KAAK,KAAU,GAAG,IAAI;AAC9F;AAEA,IAAa,KAA2D,EACtE,YACA,YACA,UACA,kBACI;CACJ,IAAM,IAAK,EAAM,GACX,CAAC,GAAS,KAAc,EAAgC,WAAW,GACnE,CAAC,GAAY,KAAiB,EAAS,EAAE,GACzC,CAAC,GAAW,KAAgB,EAAS,OAAO,EAAQ,UAAU,CAAC,GAC/D,CAAC,G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GACK,CAAA,GACP,kBAAC,SAAD;IACE,IAAI,QAAQ,EAAQ;IACpB,OAAO;IACP,WAAW,MAAM,EAAQ,EAAE,OAAO,KAAK;IACvC,WAAW;GACZ,CAAA,CACE,EAAA,CAAA;GACL,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;IAAO,SAAS,WAAW,EAAQ;IAAM,WAAW;cACjD,EAAG,+BAA+B,0BAA0B;GACxD,CAAA,GACP,kBAAC,YAAD;IACE,IAAI,WAAW,EAAQ;IACvB,MAAM;IACN,OAAO;IACP,WAAW,MAAM,EAAW,EAAE,OAAO,KAAK;IAC1C,WAAW;GACZ,CAAA,CACE,EAAA,CAAA;GACJ,MAAY,eAAe,EAAQ,kBAClC,kBAAC,SAAD;IAAO,WAAU;cAAjB,CACE,kBAAC,SAAD;KAAO,MAAK;KAAW,SAAS;KAAO,WAAW,MAAM,EAAS,EAAE,OAAO,OAAO;IAAI,CAAA,GACpF,EAAG,6BAA6B,kDAAkD,CAC9E;;GAER,MAAY,eAAe,KAC1B,kBAAC,KAAD;IAAG,WAAU;IAA8B,eAAY;cACpD,EACC,+BACA,wDACA;KACE,SAAS,EAAe,GAAW,EAAQ,QAAQ;KACnD,KAAK,EAAe,GAAK,EAAQ,QAAQ;IAC3C,CACF;GACC,CAAA;GAEJ,KACC,kBAAC,KAAD;IAAG,MAAK;IAAQ,WAAU;cACvB;GACA,CAAA;GAEL,kBAAC,UAAD;IACE,MAAK;IACL,UAAU,KAAY,MAAY,eAAe,CAAC;IAClD,WAAU;cAET,EAAG,4BAA4B,2BAA2B;GACrD,CAAA;EACJ;;AAEV"}
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { SubProcurementStatus } from '../../types/procurement';
3
+
4
+ export declare const ProcurementStatusPill: FC<{
5
+ status: SubProcurementStatus;
6
+ className?: string;
7
+ }>;
8
+ //# sourceMappingURL=ProcurementStatusPill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcurementStatusPill.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/procurement/ProcurementStatusPill.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAGpE,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC;IAAE,MAAM,EAAE,oBAAoB,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAmB1F,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { cn as e } from "../../utils/cn.js";
2
+ import { useTr as t } from "../../hooks/useTr.js";
3
+ import { STATUS_LABEL as n, procurementStatusTone as r } from "./labels.js";
4
+ import { jsx as i } from "react/jsx-runtime";
5
+ //#region src/subscriberbot/components/procurement/ProcurementStatusPill.tsx
6
+ var a = ({ status: a, className: o }) => {
7
+ let s = t(), c = n[a];
8
+ return /* @__PURE__ */ i("span", {
9
+ "data-testid": "procurement-status",
10
+ "data-status": a,
11
+ className: e("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", r(a), o),
12
+ children: s(c.key, c.fallback)
13
+ });
14
+ };
15
+ //#endregion
16
+ export { a as ProcurementStatusPill };
17
+
18
+ //# sourceMappingURL=ProcurementStatusPill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcurementStatusPill.js","names":[],"sources":["../../../../src/subscriberbot/components/procurement/ProcurementStatusPill.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useTr } from '../../hooks/useTr';\nimport { cn } from '../../utils/cn';\nimport type { SubProcurementStatus } from '../../types/procurement';\nimport { STATUS_LABEL, procurementStatusTone } from './labels';\n\nexport const ProcurementStatusPill: FC<{ status: SubProcurementStatus; className?: string }> = ({\n status,\n className,\n}) => {\n const tr = useTr();\n const label = STATUS_LABEL[status];\n return (\n <span\n data-testid=\"procurement-status\"\n data-status={status}\n className={cn(\n 'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium',\n procurementStatusTone(status),\n className\n )}\n >\n {tr(label.key, label.fallback)}\n </span>\n );\n};\n"],"mappings":";;;;;AAMA,IAAa,KAAmF,EAC9F,WACA,mBACI;CACJ,IAAM,IAAK,EAAM,GACX,IAAQ,EAAa;CAC3B,OACE,kBAAC,QAAD;EACE,eAAY;EACZ,eAAa;EACb,WAAW,EACT,2EACA,EAAsB,CAAM,GAC5B,CACF;YAEC,EAAG,EAAM,KAAK,EAAM,QAAQ;CACzB,CAAA;AAEV"}
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ import { SubProcurementEvent } from '../../types/procurement';
3
+
4
+ /**
5
+ * The request's message thread and timeline, oldest first. Internal desk notes
6
+ * only ever reach the desk (the API filters them for customers); they are
7
+ * highlighted so an expert never mistakes one for a customer-visible message.
8
+ */
9
+ export declare const ProcurementThread: FC<{
10
+ events: SubProcurementEvent[];
11
+ customerLabel?: string;
12
+ }>;
13
+ //# sourceMappingURL=ProcurementThread.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcurementThread.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/procurement/ProcurementThread.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AASnE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC;IAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAgD3F,CAAC"}