@burdenoff/microfe-proserviceworld 2026.1013.1 → 2026.1015.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/generated/wspace-types.d.ts +98750 -26838
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/proserviceworld/ProServiceWorldRoot.d.ts.map +1 -1
- package/dist/proserviceworld/ProServiceWorldRoot.js +6 -0
- package/dist/proserviceworld/ProServiceWorldRoot.js.map +1 -1
- package/dist/proserviceworld/ProServiceWorldRoutes.d.ts.map +1 -1
- package/dist/proserviceworld/ProServiceWorldRoutes.js +42 -35
- package/dist/proserviceworld/ProServiceWorldRoutes.js.map +1 -1
- package/dist/proserviceworld/components/CredentialDirectory.d.ts +3 -0
- package/dist/proserviceworld/components/CredentialDirectory.d.ts.map +1 -0
- package/dist/proserviceworld/components/CredentialDirectory.js +253 -0
- package/dist/proserviceworld/components/CredentialDirectory.js.map +1 -0
- package/dist/proserviceworld/components/CredentialEvidencePicker.d.ts +9 -0
- package/dist/proserviceworld/components/CredentialEvidencePicker.d.ts.map +1 -0
- package/dist/proserviceworld/components/CredentialEvidencePicker.js +161 -0
- package/dist/proserviceworld/components/CredentialEvidencePicker.js.map +1 -0
- package/dist/proserviceworld/components/CredentialRecordForm.d.ts +24 -0
- package/dist/proserviceworld/components/CredentialRecordForm.d.ts.map +1 -0
- package/dist/proserviceworld/components/CredentialRecordForm.js +251 -0
- package/dist/proserviceworld/components/CredentialRecordForm.js.map +1 -0
- package/dist/proserviceworld/components/CredentialReferencePicker.d.ts +22 -0
- package/dist/proserviceworld/components/CredentialReferencePicker.d.ts.map +1 -0
- package/dist/proserviceworld/components/CredentialReferencePicker.js +122 -0
- package/dist/proserviceworld/components/CredentialReferencePicker.js.map +1 -0
- package/dist/proserviceworld/components/CredentialReminderPanel.d.ts +5 -0
- package/dist/proserviceworld/components/CredentialReminderPanel.d.ts.map +1 -0
- package/dist/proserviceworld/components/CredentialReminderPanel.js +141 -0
- package/dist/proserviceworld/components/CredentialReminderPanel.js.map +1 -0
- package/dist/proserviceworld/components/credentialFormDefinitions.d.ts +4 -0
- package/dist/proserviceworld/components/credentialFormDefinitions.d.ts.map +1 -0
- package/dist/proserviceworld/components/credentialFormDefinitions.js +344 -0
- package/dist/proserviceworld/components/credentialFormDefinitions.js.map +1 -0
- package/dist/proserviceworld/hooks/credentialWrites.d.ts +16 -0
- package/dist/proserviceworld/hooks/credentialWrites.d.ts.map +1 -0
- package/dist/proserviceworld/hooks/credentialWrites.js +38 -0
- package/dist/proserviceworld/hooks/credentialWrites.js.map +1 -0
- package/dist/proserviceworld/hooks/usePractitionerCredentials.d.ts +41 -0
- package/dist/proserviceworld/hooks/usePractitionerCredentials.d.ts.map +1 -0
- package/dist/proserviceworld/hooks/usePractitionerCredentials.js +105 -0
- package/dist/proserviceworld/hooks/usePractitionerCredentials.js.map +1 -0
- package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts +9 -0
- package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts.map +1 -1
- package/dist/proserviceworld/hooks/useProServiceWorldApi.js +24 -15
- package/dist/proserviceworld/hooks/useProServiceWorldApi.js.map +1 -1
- package/dist/proserviceworld/pages/CompliancePage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/CompliancePage.js +136 -118
- package/dist/proserviceworld/pages/CompliancePage.js.map +1 -1
- package/dist/proserviceworld/pages/ConflictsPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/ConflictsPage.js +87 -71
- package/dist/proserviceworld/pages/ConflictsPage.js.map +1 -1
- package/dist/proserviceworld/pages/DocumentsPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/DocumentsPage.js +104 -86
- package/dist/proserviceworld/pages/DocumentsPage.js.map +1 -1
- package/dist/proserviceworld/pages/InvoicesPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/InvoicesPage.js +122 -104
- package/dist/proserviceworld/pages/InvoicesPage.js.map +1 -1
- package/dist/proserviceworld/pages/PractitionerCredentialsPage.d.ts +2 -0
- package/dist/proserviceworld/pages/PractitionerCredentialsPage.d.ts.map +1 -0
- package/dist/proserviceworld/pages/PractitionerCredentialsPage.js +268 -0
- package/dist/proserviceworld/pages/PractitionerCredentialsPage.js.map +1 -0
- package/dist/proserviceworld/pages/TimePage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/TimePage.js +132 -114
- package/dist/proserviceworld/pages/TimePage.js.map +1 -1
- package/dist/proserviceworld/pages/TrustPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/TrustPage.js +226 -207
- package/dist/proserviceworld/pages/TrustPage.js.map +1 -1
- package/dist/proserviceworld/utils/credentialSourceLink.d.ts +3 -0
- package/dist/proserviceworld/utils/credentialSourceLink.d.ts.map +1 -0
- package/dist/proserviceworld/utils/credentialSourceLink.js +17 -0
- package/dist/proserviceworld/utils/credentialSourceLink.js.map +1 -0
- package/package.json +21 -5
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { useProServiceWorld as e } from "../providers/ProServiceWorldProvider.js";
|
|
2
|
+
import { pswQuery as t } from "../hooks/useProServiceWorldApi.js";
|
|
3
|
+
import { useState as n } from "react";
|
|
4
|
+
import { useQuery as r } from "@tanstack/react-query";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Button as o } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
//#region src/proserviceworld/components/CredentialReferencePicker.tsx
|
|
8
|
+
var s = {
|
|
9
|
+
practitioner: {
|
|
10
|
+
field: "pswPractitioners",
|
|
11
|
+
fields: "id revision displayName practiceArea"
|
|
12
|
+
},
|
|
13
|
+
issuer: {
|
|
14
|
+
field: "pswIssuingBodies",
|
|
15
|
+
fields: "id revision displayName jurisdiction credentialCategory"
|
|
16
|
+
},
|
|
17
|
+
credential: {
|
|
18
|
+
field: "pswPractitionerCredentials",
|
|
19
|
+
fields: "id revision identifier practitionerId issuingBodyId jurisdiction practiceScope validityKind validFrom expiresAt sourceTimezone renewalDueAt"
|
|
20
|
+
},
|
|
21
|
+
obligation: {
|
|
22
|
+
field: "pswComplianceObligations",
|
|
23
|
+
fields: "id revision title practitionerId credentialId kind policySourceUrl policyDescription periodStart periodEnd dueAt sourceTimezone requiredUnits unitKind unitLabel category"
|
|
24
|
+
},
|
|
25
|
+
credit: {
|
|
26
|
+
field: "pswEducationCredits",
|
|
27
|
+
fields: "id revision provider activityReference amount category unitKind unitLabel"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
function c({ kind: c, label: l, value: u, optional: d, disabled: f, obligationId: p, onSelect: m }) {
|
|
31
|
+
let { tenantId: h, workspaceId: g, currentUser: _ } = e(), [v, y] = n(0), b = s[c], x = !!(h && g && _?.id && (c !== "credit" || p)), S = r({
|
|
32
|
+
queryKey: [
|
|
33
|
+
"proserviceworld",
|
|
34
|
+
"credentialReference",
|
|
35
|
+
h,
|
|
36
|
+
g,
|
|
37
|
+
_?.id,
|
|
38
|
+
c,
|
|
39
|
+
p,
|
|
40
|
+
v
|
|
41
|
+
],
|
|
42
|
+
enabled: x,
|
|
43
|
+
queryFn: async () => {
|
|
44
|
+
let e = c === "credit";
|
|
45
|
+
return (await t(`query PswCredentialReferenceChoices($limit: Int!, $offset: Int!${e ? ", $obligationId: ID!" : ""}) {
|
|
46
|
+
${b.field}(limit: $limit, offset: $offset${e ? ", obligationId: $obligationId" : ""}) {
|
|
47
|
+
items { ${b.fields} } hasMore
|
|
48
|
+
}
|
|
49
|
+
}`, {
|
|
50
|
+
limit: 25,
|
|
51
|
+
offset: v,
|
|
52
|
+
...e ? { obligationId: p } : {}
|
|
53
|
+
}))[b.field];
|
|
54
|
+
}
|
|
55
|
+
}), C = S.data?.items ?? [];
|
|
56
|
+
return /* @__PURE__ */ a("div", {
|
|
57
|
+
className: "min-w-0 text-sm",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ a("label", {
|
|
60
|
+
className: "mb-1 block font-medium",
|
|
61
|
+
children: [
|
|
62
|
+
l,
|
|
63
|
+
d ? " (optional)" : "",
|
|
64
|
+
/* @__PURE__ */ a("select", {
|
|
65
|
+
className: "mt-1 w-full rounded border border-border bg-bg-surface p-2",
|
|
66
|
+
value: C.some((e) => e.id === u) ? u : "",
|
|
67
|
+
disabled: f || !x || S.isFetching || S.isError,
|
|
68
|
+
required: !d,
|
|
69
|
+
onChange: (e) => m(C.find((t) => t.id === e.target.value) ?? null),
|
|
70
|
+
children: [/* @__PURE__ */ i("option", {
|
|
71
|
+
value: "",
|
|
72
|
+
children: S.isFetching ? "Loading…" : "Choose a saved record…"
|
|
73
|
+
}), C.map((e) => /* @__PURE__ */ i("option", {
|
|
74
|
+
value: e.id,
|
|
75
|
+
children: e.displayName ?? e.identifier ?? e.title ?? `${e.provider ?? "Education"} · ${e.activityReference ?? e.id}`
|
|
76
|
+
}, e.id))]
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
}),
|
|
80
|
+
S.isError && /* @__PURE__ */ i("p", {
|
|
81
|
+
role: "alert",
|
|
82
|
+
children: "Records unavailable. Refresh before choosing a record."
|
|
83
|
+
}),
|
|
84
|
+
c === "credit" && !p && /* @__PURE__ */ i("p", { children: "Choose an obligation first." }),
|
|
85
|
+
x && !S.isFetching && !S.isError && C.length === 0 && /* @__PURE__ */ i("p", { children: "No saved records on this page." }),
|
|
86
|
+
/* @__PURE__ */ a("div", {
|
|
87
|
+
className: "mt-1 flex gap-2",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ i(o, {
|
|
90
|
+
type: "button",
|
|
91
|
+
variant: "outline",
|
|
92
|
+
disabled: f || S.isFetching || v === 0,
|
|
93
|
+
onClick: () => {
|
|
94
|
+
m(null), y((e) => Math.max(0, e - 25));
|
|
95
|
+
},
|
|
96
|
+
children: "Previous"
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ i(o, {
|
|
99
|
+
type: "button",
|
|
100
|
+
variant: "outline",
|
|
101
|
+
disabled: f || S.isFetching || S.isError || !S.data?.hasMore,
|
|
102
|
+
onClick: () => {
|
|
103
|
+
m(null), y((e) => e + 25);
|
|
104
|
+
},
|
|
105
|
+
children: "Next"
|
|
106
|
+
}),
|
|
107
|
+
S.isError && /* @__PURE__ */ i(o, {
|
|
108
|
+
type: "button",
|
|
109
|
+
variant: "outline",
|
|
110
|
+
disabled: f,
|
|
111
|
+
onClick: () => void S.refetch(),
|
|
112
|
+
children: "Refresh records"
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { c as CredentialReferencePicker };
|
|
121
|
+
|
|
122
|
+
//# sourceMappingURL=CredentialReferencePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialReferencePicker.js","names":[],"sources":["../../../src/proserviceworld/components/CredentialReferencePicker.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useProServiceWorld } from '../providers/ProServiceWorldProvider';\nimport { pswQuery } from '../hooks/useProServiceWorldApi';\n\nexport type CredentialReferenceKind =\n | 'practitioner'\n | 'issuer'\n | 'credential'\n | 'obligation'\n | 'credit';\nexport interface CredentialReference {\n id: string;\n revision: number;\n displayName?: string;\n identifier?: string;\n title?: string;\n provider?: string;\n activityReference?: string;\n [field: string]: string | number | boolean | null | undefined;\n}\nconst SOURCES = {\n practitioner: { field: 'pswPractitioners', fields: 'id revision displayName practiceArea' },\n issuer: {\n field: 'pswIssuingBodies',\n fields: 'id revision displayName jurisdiction credentialCategory',\n },\n credential: {\n field: 'pswPractitionerCredentials',\n fields:\n 'id revision identifier practitionerId issuingBodyId jurisdiction practiceScope validityKind validFrom expiresAt sourceTimezone renewalDueAt',\n },\n obligation: {\n field: 'pswComplianceObligations',\n fields:\n 'id revision title practitionerId credentialId kind policySourceUrl policyDescription periodStart periodEnd dueAt sourceTimezone requiredUnits unitKind unitLabel category',\n },\n credit: {\n field: 'pswEducationCredits',\n fields: 'id revision provider activityReference amount category unitKind unitLabel',\n },\n} as const;\n\n/** Choices come from the owning gateway query; callers never supply a GraphQL field name. */\nexport function CredentialReferencePicker({\n kind,\n label,\n value,\n optional,\n disabled,\n obligationId,\n onSelect,\n}: {\n kind: CredentialReferenceKind;\n label: string;\n value: string;\n optional?: boolean;\n disabled: boolean;\n obligationId?: string;\n onSelect: (record: CredentialReference | null) => void;\n}) {\n const { tenantId, workspaceId, currentUser } = useProServiceWorld();\n const [offset, setOffset] = useState(0);\n const source = SOURCES[kind];\n const ready = Boolean(\n tenantId && workspaceId && currentUser?.id && (kind !== 'credit' || obligationId)\n );\n const query = useQuery({\n queryKey: [\n 'proserviceworld',\n 'credentialReference',\n tenantId,\n workspaceId,\n currentUser?.id,\n kind,\n obligationId,\n offset,\n ],\n enabled: ready,\n queryFn: async () => {\n const credit = kind === 'credit';\n const data = await pswQuery<\n Record<string, { items: CredentialReference[]; hasMore: boolean }>\n >(\n `query PswCredentialReferenceChoices($limit: Int!, $offset: Int!${credit ? ', $obligationId: ID!' : ''}) {\n ${source.field}(limit: $limit, offset: $offset${credit ? ', obligationId: $obligationId' : ''}) {\n items { ${source.fields} } hasMore\n }\n }`,\n { limit: 25, offset, ...(credit ? { obligationId } : {}) }\n );\n return data[source.field];\n },\n });\n const choices = query.data?.items ?? [];\n return (\n <div className=\"min-w-0 text-sm\">\n <label className=\"mb-1 block font-medium\">\n {label}\n {optional ? ' (optional)' : ''}\n <select\n className=\"mt-1 w-full rounded border border-border bg-bg-surface p-2\"\n value={choices.some((item) => item.id === value) ? value : ''}\n disabled={disabled || !ready || query.isFetching || query.isError}\n required={!optional}\n onChange={(event) =>\n onSelect(choices.find((item) => item.id === event.target.value) ?? null)\n }\n >\n <option value=\"\">{query.isFetching ? 'Loading…' : 'Choose a saved record…'}</option>\n {choices.map((item) => (\n <option key={item.id} value={item.id}>\n {item.displayName ??\n item.identifier ??\n item.title ??\n `${item.provider ?? 'Education'} · ${item.activityReference ?? item.id}`}\n </option>\n ))}\n </select>\n </label>\n {query.isError && <p role=\"alert\">Records unavailable. Refresh before choosing a record.</p>}\n {kind === 'credit' && !obligationId && <p>Choose an obligation first.</p>}\n {ready && !query.isFetching && !query.isError && choices.length === 0 && (\n <p>No saved records on this page.</p>\n )}\n <div className=\"mt-1 flex gap-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={disabled || query.isFetching || offset === 0}\n onClick={() => {\n onSelect(null);\n setOffset((old) => Math.max(0, old - 25));\n }}\n >\n Previous\n </Button>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={disabled || query.isFetching || query.isError || !query.data?.hasMore}\n onClick={() => {\n onSelect(null);\n setOffset((old) => old + 25);\n }}\n >\n Next\n </Button>\n {query.isError && (\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n onClick={() => void query.refetch()}\n >\n Refresh records\n </Button>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAsBA,IAAM,IAAU;CACd,cAAc;EAAE,OAAO;EAAoB,QAAQ;CAAuC;CAC1F,QAAQ;EACN,OAAO;EACP,QAAQ;CACV;CACA,YAAY;EACV,OAAO;EACP,QACE;CACJ;CACA,YAAY;EACV,OAAO;EACP,QACE;CACJ;CACA,QAAQ;EACN,OAAO;EACP,QAAQ;CACV;AACF;AAGA,SAAgB,EAA0B,EACxC,SACA,UACA,UACA,aACA,aACA,iBACA,eASC;CACD,IAAM,EAAE,aAAU,gBAAa,mBAAgB,EAAmB,GAC5D,CAAC,GAAQ,KAAa,EAAS,CAAC,GAChC,IAAS,EAAQ,IACjB,IAAQ,GACZ,KAAY,KAAe,GAAa,OAAO,MAAS,YAAY,KAEhE,IAAQ,EAAS;EACrB,UAAU;GACR;GACA;GACA;GACA;GACA,GAAa;GACb;GACA;GACA;EACF;EACA,SAAS;EACT,SAAS,YAAY;GACnB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ACR,UAAU,KAAY,EAAM,cAAc,MAAW;MACrD,eAAe;OAEb,AADA,EAAS,IAAI,GACb,GAAW,MAAQ,KAAK,IAAI,GAAG,IAAM,EAAE,CAAC;MAC1C;gBACD;KAEO,CAAA;KACR,kBAAC,GAAD;MACE,MAAK;MACL,SAAQ;MACR,UAAU,KAAY,EAAM,cAAc,EAAM,WAAW,CAAC,EAAM,MAAM;MACxE,eAAe;OAEb,AADA,EAAS,IAAI,GACb,GAAW,MAAQ,IAAM,EAAE;MAC7B;gBACD;KAEO,CAAA;KACP,EAAM,WACL,kBAAC,GAAD;MACE,MAAK;MACL,SAAQ;MACE;MACV,eAAe,KAAK,EAAM,QAAQ;gBACnC;KAEO,CAAA;IAEP;;EACF;;AAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialReminderPanel.d.ts","sourceRoot":"","sources":["../../../src/proserviceworld/components/CredentialReminderPanel.tsx"],"names":[],"mappings":"AAgBA,6EAA6E;AAC7E,wBAAgB,uBAAuB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,+BA+I9E"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { useProServiceWorld as e } from "../providers/ProServiceWorldProvider.js";
|
|
2
|
+
import { pswQuery as t } from "../hooks/useProServiceWorldApi.js";
|
|
3
|
+
import { ErrorState as n, SectionCard as r, humanize as i } from "./ui.js";
|
|
4
|
+
import { writeCredential as a } from "../hooks/credentialWrites.js";
|
|
5
|
+
import { useRef as o, useState as s } from "react";
|
|
6
|
+
import { useQuery as c } from "@tanstack/react-query";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { Button as d } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
//#region src/proserviceworld/components/CredentialReminderPanel.tsx
|
|
10
|
+
var f = "id obligationId obligationRevision credentialRevision revision recipientId\n consentGrantedAt consentRevokedAt scheduledAt state scheduleId notificationId notificationStatus attemptStartedAt", p = `mutation PswScheduleReminder($id: ID!) { pswScheduleObligationReminder(id: $id) { ${f} } }`, m = `mutation PswRefreshReminder($id: ID!) { pswRefreshObligationReminderStatus(id: $id) { ${f} } }`, h = `mutation PswRevokeReminder($id: ID!, $expectedRevision: Int!) { pswRevokeObligationReminderConsent(id: $id, expectedRevision: $expectedRevision) { ${f} } }`;
|
|
11
|
+
function g({ preparedId: g }) {
|
|
12
|
+
let { workspaceId: _, tenantId: v, currentUser: y } = e(), [b, x] = s(g ?? ""), [S, C] = s(g ?? ""), [w, T] = s(""), [E, D] = s(!1), [O, k] = s(!1), A = o(!1), j = c({
|
|
13
|
+
queryKey: [
|
|
14
|
+
"proserviceworld",
|
|
15
|
+
"credentialReminder",
|
|
16
|
+
v,
|
|
17
|
+
_,
|
|
18
|
+
y?.id,
|
|
19
|
+
S
|
|
20
|
+
],
|
|
21
|
+
enabled: !!(S && v && _ && y?.id),
|
|
22
|
+
queryFn: async () => (await t(`query PswReminder($id: ID!) { pswObligationReminder(id: $id) { ${f} } }`, { id: S })).pswObligationReminder
|
|
23
|
+
}), M = j.data, N = !!(M && M.recipientId === y?.id);
|
|
24
|
+
async function P(e) {
|
|
25
|
+
if (!(!M || !N || A.current || O || j.isError) && !(e === "schedule" && M.state !== "PREPARED")) {
|
|
26
|
+
A.current = !0, D(!0), T("");
|
|
27
|
+
try {
|
|
28
|
+
await a(e === "schedule" ? p : e === "refresh" ? m : h, e === "revoke" ? {
|
|
29
|
+
id: S,
|
|
30
|
+
expectedRevision: M.revision
|
|
31
|
+
} : { id: S }), T("Request acknowledged. Read the retained state below; an acknowledgment is not proof of recipient delivery.");
|
|
32
|
+
} catch {
|
|
33
|
+
k(!0), T("Request outcome unconfirmed. Read retained status before taking another action.");
|
|
34
|
+
} finally {
|
|
35
|
+
let e = await j.refetch();
|
|
36
|
+
k(!!e.error), A.current = !1, D(!1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return /* @__PURE__ */ u(r, {
|
|
41
|
+
title: "My in-app reminder status",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ l("p", {
|
|
44
|
+
className: "mb-3 text-sm",
|
|
45
|
+
children: "Prepare a reminder with your own consent first. Its acknowledged or reconciled save opens here automatically. Unknown attempts are retained without automatic resend."
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ u("form", {
|
|
48
|
+
className: "mb-4 flex flex-wrap gap-2",
|
|
49
|
+
onSubmit: (e) => {
|
|
50
|
+
e.preventDefault(), C(b.trim()), T("");
|
|
51
|
+
},
|
|
52
|
+
children: [/* @__PURE__ */ u("label", {
|
|
53
|
+
className: "min-w-0 flex-1 text-sm",
|
|
54
|
+
children: ["Reminder record ID", /* @__PURE__ */ l("input", {
|
|
55
|
+
required: !0,
|
|
56
|
+
maxLength: 100,
|
|
57
|
+
className: "block w-full rounded border border-border bg-bg-surface p-2",
|
|
58
|
+
value: b,
|
|
59
|
+
onChange: (e) => x(e.target.value)
|
|
60
|
+
})]
|
|
61
|
+
}), /* @__PURE__ */ l(d, {
|
|
62
|
+
type: "submit",
|
|
63
|
+
disabled: E,
|
|
64
|
+
children: "Read reminder"
|
|
65
|
+
})]
|
|
66
|
+
}),
|
|
67
|
+
j.error && /* @__PURE__ */ l(n, {
|
|
68
|
+
error: j.error,
|
|
69
|
+
onRetry: () => void j.refetch()
|
|
70
|
+
}),
|
|
71
|
+
S && /* @__PURE__ */ l(d, {
|
|
72
|
+
variant: "outline",
|
|
73
|
+
disabled: E || j.isFetching,
|
|
74
|
+
onClick: () => {
|
|
75
|
+
j.refetch().then((e) => k(!!e.error));
|
|
76
|
+
},
|
|
77
|
+
children: "Read retained status"
|
|
78
|
+
}),
|
|
79
|
+
S && !j.isFetching && j.data === null && /* @__PURE__ */ l("p", { children: "Reminder not found in this workspace." }),
|
|
80
|
+
M && /* @__PURE__ */ u("div", {
|
|
81
|
+
className: "space-y-2",
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ u("p", { children: [
|
|
84
|
+
i(M.state),
|
|
85
|
+
" · Scheduled ",
|
|
86
|
+
M.scheduledAt,
|
|
87
|
+
" · Revision",
|
|
88
|
+
" ",
|
|
89
|
+
M.revision
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ u("p", { children: ["Notification status: ", M.notificationStatus ?? "Not observed"] }),
|
|
92
|
+
/* @__PURE__ */ u("p", {
|
|
93
|
+
className: "break-all text-xs",
|
|
94
|
+
children: [
|
|
95
|
+
"Schedule: ",
|
|
96
|
+
M.scheduleId ?? "Not acknowledged",
|
|
97
|
+
" · Notification:",
|
|
98
|
+
" ",
|
|
99
|
+
M.notificationId ?? "Not acknowledged"
|
|
100
|
+
]
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ l("p", {
|
|
103
|
+
className: "text-sm",
|
|
104
|
+
children: "Revoking consent suppresses future dispatch. An already in-flight notification cannot be recalled."
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ u("div", {
|
|
107
|
+
className: "flex flex-wrap gap-2",
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ l(d, {
|
|
110
|
+
disabled: !N || E || j.isFetching || O || j.isError || M.state !== "PREPARED",
|
|
111
|
+
onClick: () => void P("schedule"),
|
|
112
|
+
children: "Schedule my reminder"
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ l(d, {
|
|
115
|
+
variant: "outline",
|
|
116
|
+
disabled: !N || E || j.isFetching || O || j.isError,
|
|
117
|
+
onClick: () => void P("refresh"),
|
|
118
|
+
children: "Refresh provider status"
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ l(d, {
|
|
121
|
+
variant: "outline",
|
|
122
|
+
disabled: !N || E || j.isFetching || !!M.consentRevokedAt,
|
|
123
|
+
onClick: () => void P("revoke"),
|
|
124
|
+
children: "Revoke my consent"
|
|
125
|
+
})
|
|
126
|
+
]
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}),
|
|
130
|
+
w && /* @__PURE__ */ l("p", {
|
|
131
|
+
role: "status",
|
|
132
|
+
className: "mt-3 break-words",
|
|
133
|
+
children: w
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
export { g as CredentialReminderPanel };
|
|
140
|
+
|
|
141
|
+
//# sourceMappingURL=CredentialReminderPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialReminderPanel.js","names":[],"sources":["../../../src/proserviceworld/components/CredentialReminderPanel.tsx"],"sourcesContent":["import type { PswObligationReminder } from '../../generated/wspace-types';\nimport { useRef, useState } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useProServiceWorld } from '../providers/ProServiceWorldProvider';\nimport { pswQuery } from '../hooks/useProServiceWorldApi';\nimport { writeCredential } from '../hooks/credentialWrites';\nimport { ErrorState, SectionCard, humanize } from './ui';\n\ntype Reminder = Omit<PswObligationReminder, '__typename'>;\nconst FIELDS = `id obligationId obligationRevision credentialRevision revision recipientId\n consentGrantedAt consentRevokedAt scheduledAt state scheduleId notificationId notificationStatus attemptStartedAt`;\nconst SCHEDULE = `mutation PswScheduleReminder($id: ID!) { pswScheduleObligationReminder(id: $id) { ${FIELDS} } }`;\nconst REFRESH = `mutation PswRefreshReminder($id: ID!) { pswRefreshObligationReminderStatus(id: $id) { ${FIELDS} } }`;\nconst REVOKE = `mutation PswRevokeReminder($id: ID!, $expectedRevision: Int!) { pswRevokeObligationReminderConsent(id: $id, expectedRevision: $expectedRevision) { ${FIELDS} } }`;\n\n/** Scheduling is explicit; this view never sends a notification directly. */\nexport function CredentialReminderPanel({ preparedId }: { preparedId?: string }) {\n const { workspaceId, tenantId, currentUser } = useProServiceWorld();\n const [draftId, setDraftId] = useState(preparedId ?? '');\n const [id, setId] = useState(preparedId ?? '');\n const [message, setMessage] = useState('');\n const [busy, setBusy] = useState(false);\n const [uncertain, setUncertain] = useState(false);\n const lock = useRef(false);\n const query = useQuery({\n queryKey: ['proserviceworld', 'credentialReminder', tenantId, workspaceId, currentUser?.id, id],\n enabled: Boolean(id && tenantId && workspaceId && currentUser?.id),\n queryFn: async () => {\n const data = await pswQuery<{ pswObligationReminder: Reminder | null }>(\n `query PswReminder($id: ID!) { pswObligationReminder(id: $id) { ${FIELDS} } }`,\n { id }\n );\n return data.pswObligationReminder;\n },\n });\n const reminder = query.data;\n const ownRecipient = Boolean(reminder && reminder.recipientId === currentUser?.id);\n async function act(kind: 'schedule' | 'refresh' | 'revoke') {\n if (!reminder || !ownRecipient || lock.current || uncertain || query.isError) return;\n if (kind === 'schedule' && reminder.state !== 'PREPARED') return;\n lock.current = true;\n setBusy(true);\n setMessage('');\n try {\n await writeCredential<Record<string, unknown>>(\n kind === 'schedule' ? SCHEDULE : kind === 'refresh' ? REFRESH : REVOKE,\n kind === 'revoke' ? { id, expectedRevision: reminder.revision } : { id }\n );\n setMessage(\n 'Request acknowledged. Read the retained state below; an acknowledgment is not proof of recipient delivery.'\n );\n } catch {\n setUncertain(true);\n setMessage('Request outcome unconfirmed. Read retained status before taking another action.');\n } finally {\n const fresh = await query.refetch();\n setUncertain(Boolean(fresh.error));\n lock.current = false;\n setBusy(false);\n }\n }\n return (\n <SectionCard title=\"My in-app reminder status\">\n <p className=\"mb-3 text-sm\">\n Prepare a reminder with your own consent first. Its acknowledged or reconciled save opens\n here automatically. Unknown attempts are retained without automatic resend.\n </p>\n <form\n className=\"mb-4 flex flex-wrap gap-2\"\n onSubmit={(event) => {\n event.preventDefault();\n setId(draftId.trim());\n setMessage('');\n }}\n >\n <label className=\"min-w-0 flex-1 text-sm\">\n Reminder record ID\n <input\n required\n maxLength={100}\n className=\"block w-full rounded border border-border bg-bg-surface p-2\"\n value={draftId}\n onChange={(event) => setDraftId(event.target.value)}\n />\n </label>\n <Button type=\"submit\" disabled={busy}>\n Read reminder\n </Button>\n </form>\n {query.error && <ErrorState error={query.error} onRetry={() => void query.refetch()} />}\n {id && (\n <Button\n variant=\"outline\"\n disabled={busy || query.isFetching}\n onClick={() => {\n void query.refetch().then((fresh) => setUncertain(Boolean(fresh.error)));\n }}\n >\n Read retained status\n </Button>\n )}\n {id && !query.isFetching && query.data === null && (\n <p>Reminder not found in this workspace.</p>\n )}\n {reminder && (\n <div className=\"space-y-2\">\n <p>\n {humanize(reminder.state)} · Scheduled {reminder.scheduledAt} · Revision{' '}\n {reminder.revision}\n </p>\n <p>Notification status: {reminder.notificationStatus ?? 'Not observed'}</p>\n <p className=\"break-all text-xs\">\n Schedule: {reminder.scheduleId ?? 'Not acknowledged'} · Notification:{' '}\n {reminder.notificationId ?? 'Not acknowledged'}\n </p>\n <p className=\"text-sm\">\n Revoking consent suppresses future dispatch. An already in-flight notification cannot be\n recalled.\n </p>\n <div className=\"flex flex-wrap gap-2\">\n <Button\n disabled={\n !ownRecipient ||\n busy ||\n query.isFetching ||\n uncertain ||\n query.isError ||\n reminder.state !== 'PREPARED'\n }\n onClick={() => void act('schedule')}\n >\n Schedule my reminder\n </Button>\n <Button\n variant=\"outline\"\n disabled={!ownRecipient || busy || query.isFetching || uncertain || query.isError}\n onClick={() => void act('refresh')}\n >\n Refresh provider status\n </Button>\n <Button\n variant=\"outline\"\n disabled={\n !ownRecipient || busy || query.isFetching || Boolean(reminder.consentRevokedAt)\n }\n onClick={() => void act('revoke')}\n >\n Revoke my consent\n </Button>\n </div>\n </div>\n )}\n {message && (\n <p role=\"status\" className=\"mt-3 break-words\">\n {message}\n </p>\n )}\n </SectionCard>\n );\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAS,mMAET,IAAW,qFAAqF,EAAO,OACvG,IAAU,yFAAyF,EAAO,OAC1G,IAAS,sJAAsJ,EAAO;AAG5K,SAAgB,EAAwB,EAAE,iBAAuC;CAC/E,IAAM,EAAE,gBAAa,aAAU,mBAAgB,EAAmB,GAC5D,CA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,KAAa,EAAM;QAC1E,eAAe,KAAK,EAAI,SAAS;kBAClC;OAEO,CAAA;OACR,kBAAC,GAAD;QACE,SAAQ;QACR,UACE,CAAC,KAAgB,KAAQ,EAAM,cAAc,EAAQ,EAAS;QAEhE,eAAe,KAAK,EAAI,QAAQ;kBACjC;OAEO,CAAA;MACL;;IACF;;GAEN,KACC,kBAAC,KAAD;IAAG,MAAK;IAAS,WAAU;cACxB;GACA,CAAA;EAEM;;AAEjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentialFormDefinitions.d.ts","sourceRoot":"","sources":["../../../src/proserviceworld/components/credentialFormDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAuB,MAAM,wBAAwB,CAAC;AAsH5F,eAAO,MAAM,gBAAgB,EAAE,SAAS,wBAAwB,EA0L/D,CAAC"}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
//#region src/proserviceworld/components/credentialFormDefinitions.ts
|
|
2
|
+
var e = (e, t, n = !1) => ({
|
|
3
|
+
name: e,
|
|
4
|
+
label: t,
|
|
5
|
+
optional: n
|
|
6
|
+
}), t = (e, t, n = !1) => ({
|
|
7
|
+
name: e,
|
|
8
|
+
label: `${t} (UTC ISO instant)`,
|
|
9
|
+
optional: n,
|
|
10
|
+
kind: "datetime"
|
|
11
|
+
}), n = {
|
|
12
|
+
name: "expectedRevision",
|
|
13
|
+
label: "Current revision",
|
|
14
|
+
kind: "integer"
|
|
15
|
+
}, r = [
|
|
16
|
+
e("fileId", "Readable evidence file ID"),
|
|
17
|
+
e("versionId", "Exact readable evidence version ID"),
|
|
18
|
+
e("sha256", "Exact evidence SHA-256")
|
|
19
|
+
];
|
|
20
|
+
function i(e) {
|
|
21
|
+
return {
|
|
22
|
+
fileId: e.fileId,
|
|
23
|
+
versionId: e.versionId,
|
|
24
|
+
sha256: e.sha256
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
var a = [
|
|
28
|
+
e("practitionerId", "Practitioner ID"),
|
|
29
|
+
e("issuingBodyId", "Issuing body ID"),
|
|
30
|
+
e("identifier", "Credential identifier"),
|
|
31
|
+
e("jurisdiction", "Jurisdiction"),
|
|
32
|
+
e("practiceScope", "Recorded practice scope"),
|
|
33
|
+
{
|
|
34
|
+
name: "validityKind",
|
|
35
|
+
label: "Recorded validity",
|
|
36
|
+
options: [
|
|
37
|
+
"UNKNOWN",
|
|
38
|
+
"REPORTED_INTERVAL",
|
|
39
|
+
"NO_EXPIRY_REPORTED"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
t("validFrom", "Valid from", !0),
|
|
43
|
+
t("expiresAt", "Exclusive expiry", !0),
|
|
44
|
+
e("sourceTimezone", "Declared source time zone"),
|
|
45
|
+
t("renewalDueAt", "Renewal due", !0)
|
|
46
|
+
], o = [
|
|
47
|
+
e("practitionerId", "Practitioner ID"),
|
|
48
|
+
e("credentialId", "Credential ID", !0),
|
|
49
|
+
{
|
|
50
|
+
name: "kind",
|
|
51
|
+
label: "Obligation kind",
|
|
52
|
+
options: ["LICENCE_RENEWAL", "CE_CPE"]
|
|
53
|
+
},
|
|
54
|
+
e("title", "Obligation title"),
|
|
55
|
+
e("policySourceUrl", "Policy source HTTPS URL"),
|
|
56
|
+
e("policyDescription", "Source-specific policy description"),
|
|
57
|
+
t("periodStart", "Period start"),
|
|
58
|
+
t("periodEnd", "Exclusive period end"),
|
|
59
|
+
t("dueAt", "Due date"),
|
|
60
|
+
e("sourceTimezone", "Declared source time zone"),
|
|
61
|
+
e("requiredUnits", "Required units (decimal, up to 4 places)"),
|
|
62
|
+
{
|
|
63
|
+
name: "unitKind",
|
|
64
|
+
label: "Unit kind",
|
|
65
|
+
options: [
|
|
66
|
+
"HOURS",
|
|
67
|
+
"CREDITS",
|
|
68
|
+
"OTHER"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
e("unitLabel", "Source unit label"),
|
|
72
|
+
e("category", "Source-specific category")
|
|
73
|
+
];
|
|
74
|
+
function s(e, t) {
|
|
75
|
+
return Object.fromEntries(t.map(({ name: t }) => [t, e[t]]));
|
|
76
|
+
}
|
|
77
|
+
var c = [
|
|
78
|
+
{
|
|
79
|
+
operation: "ARCHIVE_PRACTITIONER",
|
|
80
|
+
title: "Archive practitioner",
|
|
81
|
+
field: "pswArchivePractitioner"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
operation: "ARCHIVE_ISSUING_BODY",
|
|
85
|
+
title: "Archive issuing body",
|
|
86
|
+
field: "pswArchiveIssuingBody"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
operation: "ARCHIVE_CREDENTIAL",
|
|
90
|
+
title: "Archive credential",
|
|
91
|
+
field: "pswArchivePractitionerCredential"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
operation: "ARCHIVE_OBLIGATION",
|
|
95
|
+
title: "Archive obligation",
|
|
96
|
+
field: "pswArchiveComplianceObligation"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
operation: "ARCHIVE_EDUCATION_CREDIT",
|
|
100
|
+
title: "Archive education credit",
|
|
101
|
+
field: "pswArchiveEducationCredit"
|
|
102
|
+
}
|
|
103
|
+
].map(({ operation: t, title: r, field: i }) => ({
|
|
104
|
+
operation: t,
|
|
105
|
+
title: r,
|
|
106
|
+
fields: [
|
|
107
|
+
e("id", "Record ID"),
|
|
108
|
+
n,
|
|
109
|
+
{
|
|
110
|
+
name: "confirmArchive",
|
|
111
|
+
label: "I confirm archiving this record",
|
|
112
|
+
options: ["true"],
|
|
113
|
+
kind: "boolean"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
query: `mutation PswArchiveRecord($id: ID!, $expectedRevision: Int!, $requestKey: String!) { ${i}(id: $id, expectedRevision: $expectedRevision, requestKey: $requestKey) }`,
|
|
117
|
+
variables: (e, t) => ({
|
|
118
|
+
id: e.id,
|
|
119
|
+
expectedRevision: e.expectedRevision,
|
|
120
|
+
requestKey: t
|
|
121
|
+
})
|
|
122
|
+
})), l = [
|
|
123
|
+
{
|
|
124
|
+
title: "Add practitioner",
|
|
125
|
+
operation: "CREATE_PRACTITIONER",
|
|
126
|
+
fields: [e("displayName", "Practitioner name"), e("practiceArea", "Practice area")],
|
|
127
|
+
query: "mutation PswCreatePractitioner($input: PswCreatePractitionerInput!) { pswCreatePractitioner(input: $input) { id displayName practiceArea revision } }",
|
|
128
|
+
variables: (e, t) => ({ input: {
|
|
129
|
+
...e,
|
|
130
|
+
requestKey: t
|
|
131
|
+
} })
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
title: "Add issuing body",
|
|
135
|
+
operation: "CREATE_ISSUING_BODY",
|
|
136
|
+
fields: [
|
|
137
|
+
e("displayName", "Issuing body name"),
|
|
138
|
+
e("jurisdiction", "Jurisdiction"),
|
|
139
|
+
e("sourceUrl", "Official source HTTPS URL"),
|
|
140
|
+
e("credentialCategory", "Credential category")
|
|
141
|
+
],
|
|
142
|
+
query: "mutation PswCreateIssuingBody($input: PswCreateIssuingBodyInput!) { pswCreateIssuingBody(input: $input) { id displayName credentialCategory revision } }",
|
|
143
|
+
variables: (e, t) => ({ input: {
|
|
144
|
+
...e,
|
|
145
|
+
requestKey: t
|
|
146
|
+
} })
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
title: "Add credential",
|
|
150
|
+
operation: "CREATE_CREDENTIAL",
|
|
151
|
+
fields: a,
|
|
152
|
+
query: "mutation PswCreateCredential($input: PswCredentialFactsInput!, $requestKey: String!) { pswCreatePractitionerCredential(input: $input, requestKey: $requestKey) { id revision } }",
|
|
153
|
+
variables: (e, t) => ({
|
|
154
|
+
input: e,
|
|
155
|
+
requestKey: t
|
|
156
|
+
})
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
title: "Correct credential facts",
|
|
160
|
+
operation: "UPDATE_CREDENTIAL",
|
|
161
|
+
fields: [
|
|
162
|
+
e("id", "Credential ID"),
|
|
163
|
+
n,
|
|
164
|
+
...a
|
|
165
|
+
],
|
|
166
|
+
query: "mutation PswUpdateCredential($id: ID!, $expectedRevision: Int!, $input: PswCredentialFactsInput!, $requestKey: String!) { pswUpdatePractitionerCredential(id: $id, expectedRevision: $expectedRevision, input: $input, requestKey: $requestKey) { id revision } }",
|
|
167
|
+
variables: (e, t) => ({
|
|
168
|
+
id: e.id,
|
|
169
|
+
expectedRevision: e.expectedRevision,
|
|
170
|
+
input: s(e, a),
|
|
171
|
+
requestKey: t
|
|
172
|
+
})
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
title: "Record source review",
|
|
176
|
+
operation: "RECORD_CREDENTIAL_REVIEW",
|
|
177
|
+
fields: [
|
|
178
|
+
e("id", "Credential ID"),
|
|
179
|
+
n,
|
|
180
|
+
{
|
|
181
|
+
name: "observation",
|
|
182
|
+
label: "Observed source status",
|
|
183
|
+
options: [
|
|
184
|
+
"UNKNOWN",
|
|
185
|
+
"CURRENT_STATUS_REPORTED",
|
|
186
|
+
"INACTIVE_STATUS_REPORTED",
|
|
187
|
+
"CONFLICTING"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
t("checkedAt", "Source checked at"),
|
|
191
|
+
e("sourceUrl", "Official source HTTPS URL"),
|
|
192
|
+
e("note", "Review note"),
|
|
193
|
+
...r
|
|
194
|
+
],
|
|
195
|
+
query: "mutation PswRecordReview($id: ID!, $input: PswRecordCredentialReviewInput!) { pswRecordCredentialReview(id: $id, input: $input) { id credentialId credentialRevision sequence } }",
|
|
196
|
+
variables: (e, t) => ({
|
|
197
|
+
id: e.id,
|
|
198
|
+
input: {
|
|
199
|
+
expectedRevision: e.expectedRevision,
|
|
200
|
+
observation: e.observation,
|
|
201
|
+
checkedAt: e.checkedAt,
|
|
202
|
+
sourceUrl: e.sourceUrl,
|
|
203
|
+
note: e.note,
|
|
204
|
+
evidence: i(e),
|
|
205
|
+
requestKey: t
|
|
206
|
+
}
|
|
207
|
+
})
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
title: "Add sourced obligation",
|
|
211
|
+
operation: "CREATE_OBLIGATION",
|
|
212
|
+
fields: o,
|
|
213
|
+
query: "mutation PswCreateObligation($input: PswObligationFactsInput!, $requestKey: String!) { pswCreateComplianceObligation(input: $input, requestKey: $requestKey) { id revision category } }",
|
|
214
|
+
variables: (e, t) => ({
|
|
215
|
+
input: e,
|
|
216
|
+
requestKey: t
|
|
217
|
+
})
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
title: "Correct obligation policy",
|
|
221
|
+
operation: "UPDATE_OBLIGATION",
|
|
222
|
+
fields: [
|
|
223
|
+
e("id", "Obligation ID"),
|
|
224
|
+
n,
|
|
225
|
+
...o
|
|
226
|
+
],
|
|
227
|
+
query: "mutation PswUpdateObligation($id: ID!, $expectedRevision: Int!, $input: PswObligationFactsInput!, $requestKey: String!) { pswUpdateComplianceObligation(id: $id, expectedRevision: $expectedRevision, input: $input, requestKey: $requestKey) { id revision } }",
|
|
228
|
+
variables: (e, t) => ({
|
|
229
|
+
id: e.id,
|
|
230
|
+
expectedRevision: e.expectedRevision,
|
|
231
|
+
input: s(e, o),
|
|
232
|
+
requestKey: t
|
|
233
|
+
})
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
title: "Record or correct education credit",
|
|
237
|
+
operation: "RECORD_EDUCATION_CREDIT",
|
|
238
|
+
fields: [
|
|
239
|
+
e("obligationId", "Obligation ID"),
|
|
240
|
+
{
|
|
241
|
+
...n,
|
|
242
|
+
name: "expectedObligationRevision",
|
|
243
|
+
label: "Current obligation revision"
|
|
244
|
+
},
|
|
245
|
+
e("predecessorId", "Credit being corrected", !0),
|
|
246
|
+
{
|
|
247
|
+
...n,
|
|
248
|
+
name: "expectedPredecessorRevision",
|
|
249
|
+
label: "Current predecessor revision",
|
|
250
|
+
optional: !0
|
|
251
|
+
},
|
|
252
|
+
e("amount", "Units (decimal, up to 4 places)"),
|
|
253
|
+
{
|
|
254
|
+
name: "unitKind",
|
|
255
|
+
label: "Unit kind",
|
|
256
|
+
options: [
|
|
257
|
+
"HOURS",
|
|
258
|
+
"CREDITS",
|
|
259
|
+
"OTHER"
|
|
260
|
+
]
|
|
261
|
+
},
|
|
262
|
+
e("unitLabel", "Source unit label"),
|
|
263
|
+
e("category", "Source-specific category"),
|
|
264
|
+
e("provider", "Education provider"),
|
|
265
|
+
e("activityReference", "Provider-specific course/activity reference"),
|
|
266
|
+
t("completedAt", "Completed at"),
|
|
267
|
+
...r
|
|
268
|
+
],
|
|
269
|
+
query: "mutation PswRecordCredit($obligationId: ID!, $input: PswRecordEducationCreditInput!) { pswRecordEducationCredit(obligationId: $obligationId, input: $input) { id revision duplicateReviewRequired } }",
|
|
270
|
+
variables: (e, t) => ({
|
|
271
|
+
obligationId: e.obligationId,
|
|
272
|
+
input: {
|
|
273
|
+
expectedObligationRevision: e.expectedObligationRevision,
|
|
274
|
+
predecessorId: e.predecessorId,
|
|
275
|
+
expectedPredecessorRevision: e.expectedPredecessorRevision,
|
|
276
|
+
amount: e.amount,
|
|
277
|
+
unitKind: e.unitKind,
|
|
278
|
+
unitLabel: e.unitLabel,
|
|
279
|
+
category: e.category,
|
|
280
|
+
provider: e.provider,
|
|
281
|
+
activityReference: e.activityReference,
|
|
282
|
+
completedAt: e.completedAt,
|
|
283
|
+
evidence: i(e),
|
|
284
|
+
requestKey: t
|
|
285
|
+
}
|
|
286
|
+
})
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
title: "Review education credit",
|
|
290
|
+
operation: "REVIEW_EDUCATION_CREDIT",
|
|
291
|
+
fields: [
|
|
292
|
+
e("id", "Education credit ID"),
|
|
293
|
+
n,
|
|
294
|
+
{
|
|
295
|
+
name: "accept",
|
|
296
|
+
label: "Accept credit for the recorded policy",
|
|
297
|
+
kind: "boolean",
|
|
298
|
+
options: ["false", "true"]
|
|
299
|
+
},
|
|
300
|
+
e("note", "Review note")
|
|
301
|
+
],
|
|
302
|
+
query: "mutation PswReviewCredit($id: ID!, $input: PswReviewEducationCreditInput!) { pswReviewEducationCredit(id: $id, input: $input) { id revision reviewState } }",
|
|
303
|
+
variables: (e, t) => ({
|
|
304
|
+
id: e.id,
|
|
305
|
+
input: {
|
|
306
|
+
expectedRevision: e.expectedRevision,
|
|
307
|
+
accept: e.accept,
|
|
308
|
+
note: e.note,
|
|
309
|
+
requestKey: t
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
title: "Prepare my in-app reminder",
|
|
315
|
+
operation: "PREPARE_REMINDER",
|
|
316
|
+
fields: [
|
|
317
|
+
e("obligationId", "Obligation ID"),
|
|
318
|
+
n,
|
|
319
|
+
{
|
|
320
|
+
name: "consent",
|
|
321
|
+
label: "I consent to an in-app reminder for myself",
|
|
322
|
+
options: ["true"],
|
|
323
|
+
kind: "boolean"
|
|
324
|
+
},
|
|
325
|
+
t("scheduledAt", "Reminder time")
|
|
326
|
+
],
|
|
327
|
+
query: "mutation PswPrepareReminder($obligationId: ID!, $input: PswPrepareObligationReminderInput!) { pswPrepareObligationReminder(obligationId: $obligationId, input: $input) { id revision state } }",
|
|
328
|
+
variables: (e, t) => ({
|
|
329
|
+
obligationId: e.obligationId,
|
|
330
|
+
input: {
|
|
331
|
+
expectedRevision: e.expectedRevision,
|
|
332
|
+
recipientId: e.recipientId,
|
|
333
|
+
consent: e.consent,
|
|
334
|
+
scheduledAt: e.scheduledAt,
|
|
335
|
+
requestKey: t
|
|
336
|
+
}
|
|
337
|
+
})
|
|
338
|
+
},
|
|
339
|
+
...c
|
|
340
|
+
];
|
|
341
|
+
//#endregion
|
|
342
|
+
export { l as CREDENTIAL_FORMS };
|
|
343
|
+
|
|
344
|
+
//# sourceMappingURL=credentialFormDefinitions.js.map
|