;
+};
+
+export function CompDocDialog({
+ row,
+ open,
+ onOpenChange,
+ data,
+ onSave,
+ onDateCompletedChange,
+}: CompDocDialogProps) {
+ const {
+ site,
+ notes,
+ setNotes,
+ docState,
+ generatedAt,
+ editAddress,
+ setEditAddress,
+ editDateCompleted,
+ setEditDateCompleted,
+ amazonRep,
+ seaRep,
+ cfg,
+ isNotRequired,
+ isGenerated,
+ handleMarkNotRequired,
+ handleUndo,
+ handleSaveDraft,
+ handleGenerate,
+ handleDownloadPdf,
+ } = useCompDocDialog({ row, open, data, onSave, onDateCompletedChange });
+
+ return (
+
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-draft-toast.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-draft-toast.tsx
new file mode 100644
index 00000000..910b7227
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-draft-toast.tsx
@@ -0,0 +1,29 @@
+import { CheckCircle2 } from "lucide-react";
+import { toast } from "react-toastify";
+
+export function showCompDocDraftSavedToast() {
+ toast(
+
+ Draft saved
+
,
+ {
+ position: "bottom-center",
+ autoClose: 3000,
+ hideProgressBar: true,
+ closeButton: false,
+ icon: false,
+ className: "!min-h-0 !bg-transparent !p-0 !shadow-none",
+ },
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-editable-row.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-editable-row.tsx
new file mode 100644
index 00000000..8e9261e2
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-editable-row.tsx
@@ -0,0 +1,54 @@
+import type { CSSProperties } from "react";
+
+const COMP_DOC_INPUT_CLS = "w-full rounded-md px-2.5 py-1.5 focus:outline-none focus:ring-1";
+
+const COMP_DOC_INPUT_STYLE: CSSProperties = {
+ fontSize: 13,
+ border: "1px solid var(--color-border)",
+ color: "var(--color-text-primary)",
+ background: "var(--color-bg-surface)",
+};
+
+const COMP_DOC_INPUT_DISABLED_STYLE: CSSProperties = {
+ opacity: 0.6,
+ cursor: "default",
+ pointerEvents: "none",
+};
+
+type CompDocEditableRowProps = {
+ label: string;
+ value: string;
+ onChange: (value: string) => void;
+ type?: string;
+ placeholder?: string;
+ disabled?: boolean;
+};
+
+export function CompDocEditableRow({
+ label,
+ value,
+ onChange,
+ type = "text",
+ placeholder = "",
+ disabled = false,
+}: CompDocEditableRowProps) {
+ return (
+
+
+ {label}
+
+
onChange(e.target.value)}
+ readOnly={disabled}
+ placeholder={placeholder}
+ className={COMP_DOC_INPUT_CLS}
+ style={{
+ ...COMP_DOC_INPUT_STYLE,
+ ...(disabled ? COMP_DOC_INPUT_DISABLED_STYLE : {}),
+ }}
+ />
+
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-footer-btn-sx.ts b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-footer-btn-sx.ts
new file mode 100644
index 00000000..f5c0f2ba
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-footer-btn-sx.ts
@@ -0,0 +1,8 @@
+export const COMP_DOC_FOOTER_BTN_SX = {
+ minHeight: 28,
+ height: 28,
+ fontSize: 12,
+ px: 1.25,
+ py: 0.5,
+ gap: 0.75,
+} as const;
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-not-required-stamp.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-not-required-stamp.tsx
new file mode 100644
index 00000000..ab3cbf04
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-not-required-stamp.tsx
@@ -0,0 +1,25 @@
+import { Ban } from "lucide-react";
+
+export function CompDocNotRequiredStamp() {
+ return (
+
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-notes-field.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-notes-field.tsx
new file mode 100644
index 00000000..f6deb5e5
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-notes-field.tsx
@@ -0,0 +1,50 @@
+type CompDocNotesFieldProps = {
+ notes: string;
+ onNotesChange: (value: string) => void;
+ isGenerated: boolean;
+};
+
+export function CompDocNotesField({ notes, onNotesChange, isGenerated }: CompDocNotesFieldProps) {
+ return (
+
+
+
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-badge.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-badge.tsx
new file mode 100644
index 00000000..9df6c499
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-badge.tsx
@@ -0,0 +1,32 @@
+import { CheckCircle2, FileText } from "lucide-react";
+
+type CompDocPreviewBadgeProps = {
+ isGenerated: boolean;
+};
+
+export function CompDocPreviewBadge({ isGenerated }: CompDocPreviewBadgeProps) {
+ return (
+
+
+ {isGenerated ? (
+
+ ) : (
+
+ )}
+ {isGenerated ? "Generated document" : "Preview — not yet generated"}
+
+
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-header.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-header.tsx
new file mode 100644
index 00000000..3fdeb30a
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-header.tsx
@@ -0,0 +1,36 @@
+import { Building2, Mail, MapPin, Phone, Printer } from "lucide-react";
+import { SEAHAVEN_HEADER } from "@/domain/work-orders/utils/completion-doc-html";
+import { CompDocCoLine } from "./comp-doc-co-line";
+
+export function CompDocPreviewHeader() {
+ return (
+ <>
+
+
+

+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-procedure.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-procedure.tsx
new file mode 100644
index 00000000..871468fc
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-procedure.tsx
@@ -0,0 +1,87 @@
+import { Text } from "@/components/ui/text";
+import type { WorkOrderTableRow } from "@/domain/work-orders/types/work-order-table-row";
+import { procedureFor, SAFETY_BULLETS } from "@/domain/work-orders/utils/completion-doc-procedures";
+import { CompDocProcedureList } from "./comp-doc-procedure-list";
+
+type CompDocPreviewProcedureProps = {
+ row: WorkOrderTableRow;
+ notes: string;
+};
+
+export function CompDocPreviewProcedure({ row, notes }: CompDocPreviewProcedureProps) {
+ const proc = procedureFor(row.pm);
+
+ return (
+ <>
+
+ {SAFETY_BULLETS.map((b, i) => (
+ -
+ {b}
+
+ ))}
+
+
+
+ {proc.heading}
+
+
+ {proc.intro}
+
+
+
+ {notes.length > 0 && (
+ <>
+
+ PM Comments
+
+
+ {notes}
+
+ >
+ )}
+ >
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-summary.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-summary.tsx
new file mode 100644
index 00000000..c9716b8d
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview-summary.tsx
@@ -0,0 +1,96 @@
+import { CheckCircle2 } from "lucide-react";
+import { Text } from "@/components/ui/text";
+import type { CompDocSiteInfo } from "@/domain/work-orders/types/completion-doc";
+import type { WorkOrderTableRow } from "@/domain/work-orders/types/work-order-table-row";
+import { serviceTitle } from "@/domain/work-orders/utils/completion-doc-service-title";
+
+type CompDocPreviewSummaryProps = {
+ row: WorkOrderTableRow;
+ site: CompDocSiteInfo;
+ generatedAt: string;
+ isGenerated: boolean;
+};
+
+export function CompDocPreviewSummary({
+ row,
+ site,
+ generatedAt,
+ isGenerated,
+}: CompDocPreviewSummaryProps) {
+ return (
+ <>
+ {isGenerated && (
+
+ Generated · {generatedAt} · v1
+
+ )}
+
+
+ {serviceTitle(row).toUpperCase()}
+
+
+ WO# {row.woNumber}
+
+
+
+
+ Site ID — {row.site}
+
+
+ Amazon.com Services LLC {row.site}
+
+
+ {site.street},
+
+
+ {site.label}
+
+
+
+
+ Vendor / Technician:
+ {row.tech || "—"}
+ {row.company ? ` · ${row.company}` : ""}
+
+ >
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview.tsx
new file mode 100644
index 00000000..64e167bc
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-preview.tsx
@@ -0,0 +1,89 @@
+import type { CompDocSiteInfo } from "@/domain/work-orders/types/completion-doc";
+import type { WorkOrderTableRow } from "@/domain/work-orders/types/work-order-table-row";
+import { CompDocNotRequiredStamp } from "./comp-doc-not-required-stamp";
+import { CompDocPreviewBadge } from "./comp-doc-preview-badge";
+import { CompDocPreviewHeader } from "./comp-doc-preview-header";
+import { CompDocPreviewProcedure } from "./comp-doc-preview-procedure";
+import { CompDocPreviewSummary } from "./comp-doc-preview-summary";
+
+type CompDocPreviewProps = {
+ row: WorkOrderTableRow;
+ site: CompDocSiteInfo;
+ notes: string;
+ generatedAt: string;
+ isGenerated: boolean;
+ isNotRequired: boolean;
+};
+
+export function CompDocPreview({
+ row,
+ site,
+ notes,
+ generatedAt,
+ isGenerated,
+ isNotRequired,
+}: CompDocPreviewProps) {
+ return (
+
+
+
+
+
+
+
+ {isNotRequired &&
}
+
+
+
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-procedure-list.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-procedure-list.tsx
new file mode 100644
index 00000000..a16fbbbe
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-procedure-list.tsx
@@ -0,0 +1,35 @@
+import type { Procedure } from "@/domain/work-orders/utils/completion-doc-procedures";
+
+type CompDocProcedureListProps = {
+ proc: Procedure;
+};
+
+export function CompDocProcedureList({ proc }: CompDocProcedureListProps) {
+ return (
+
+ {proc.steps.map((st, i) => {
+ const subSteps = st.sub ?? [];
+ return (
+ -
+ {st.text}
+ {subSteps.length > 0 && (
+
+ {subSteps.map((x, j) => (
+ -
+ {x}
+
+ ))}
+
+ )}
+
+ );
+ })}
+
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-sidebar.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-sidebar.tsx
new file mode 100644
index 00000000..a48499c4
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-sidebar.tsx
@@ -0,0 +1,60 @@
+import type { CompDocSiteInfo, DocState } from "@/domain/work-orders/types/completion-doc";
+import type { WorkOrderTableRow } from "@/domain/work-orders/types/work-order-table-row";
+import { CompDocDetailsSection } from "./comp-doc-details-section";
+import { CompDocNotesField } from "./comp-doc-notes-field";
+import { CompDocStatusCard } from "./comp-doc-status-card";
+
+type CompDocSidebarProps = {
+ row: WorkOrderTableRow;
+ site: CompDocSiteInfo;
+ docState: DocState;
+ generatedAt: string;
+ notes: string;
+ editAddress: string;
+ onAddressChange: (value: string) => void;
+ editDateCompleted: string;
+ amazonRep: string;
+ seaRep: string;
+ isGenerated: boolean;
+ onNotesChange: (value: string) => void;
+ onDateCompletedChange: (value: string) => void;
+};
+
+export function CompDocSidebar({
+ row,
+ site,
+ docState,
+ generatedAt,
+ notes,
+ editAddress,
+ onAddressChange,
+ editDateCompleted,
+ amazonRep,
+ seaRep,
+ isGenerated,
+ onNotesChange,
+ onDateCompletedChange,
+}: CompDocSidebarProps) {
+ return (
+
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-status-card.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-status-card.tsx
new file mode 100644
index 00000000..b2aaf7d7
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-status-card.tsx
@@ -0,0 +1,61 @@
+import type { DocState } from "@/domain/work-orders/types/completion-doc";
+import {
+ DOC_STATE_CFG,
+ docStatusCardDescription,
+} from "@/domain/work-orders/utils/completion-doc-state";
+
+type CompDocStatusCardProps = {
+ docState: DocState;
+ generatedAt: string;
+};
+
+export function CompDocStatusCard({ docState, generatedAt }: CompDocStatusCardProps) {
+ const cfg = DOC_STATE_CFG[docState];
+ const StateIcon = cfg.icon;
+
+ return (
+
+
+
+
+
+
+ {cfg.cardTitle}
+
+
+ {docStatusCardDescription(docState, generatedAt)}
+
+
+
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/list/table/cells/comp-doc-cell.tsx b/src/app/(protected)/workorders/_components/list/table/cells/comp-doc-cell.tsx
index 43f258c3..78a62e61 100644
--- a/src/app/(protected)/workorders/_components/list/table/cells/comp-doc-cell.tsx
+++ b/src/app/(protected)/workorders/_components/list/table/cells/comp-doc-cell.tsx
@@ -1,6 +1,7 @@
import { Ban, FileText, Image as ImageIcon } from "lucide-react";
import type { CompletionDocStatus } from "@/domain/work-orders/types/work-order-table-row";
import type { WOType } from "@/domain/work-orders/types/work-order-wizard";
+import { hasCompletionDocService } from "@/domain/work-orders/utils/completion-doc-service-gate";
function isMediaWO(type: WOType | ""): boolean {
return type === "Emergency" || type === "Reactive";
@@ -9,6 +10,8 @@ function isMediaWO(type: WOType | ""): boolean {
type CompDocCellProps = {
status: CompletionDocStatus;
woType: WOType | "";
+ /** Primary service (`pm`). Required before CompDoc can open. */
+ pm?: string;
mediaCount?: number;
/** Omit until completion-doc slice mounts CompDocDialog. */
onOpen?: () => void;
@@ -18,6 +21,7 @@ type CompDocCellProps = {
export function CompDocCell({
status,
woType,
+ pm = "",
mediaCount = 0,
onOpen,
onOpenMedia,
@@ -43,6 +47,20 @@ export function CompDocCell({
return null;
}
+ if (!hasCompletionDocService(pm)) {
+ return (
+
+
+ Select service
+
+ );
+ }
+
const generated = status === "Yes";
const notRequired = status === "NN";
const color = generated ? "var(--color-success)" : "var(--color-text-muted)";
diff --git a/src/app/(protected)/workorders/_components/list/table/wo-table-row-service-cells.tsx b/src/app/(protected)/workorders/_components/list/table/wo-table-row-service-cells.tsx
index 0ae6032b..143cc46a 100644
--- a/src/app/(protected)/workorders/_components/list/table/wo-table-row-service-cells.tsx
+++ b/src/app/(protected)/workorders/_components/list/table/wo-table-row-service-cells.tsx
@@ -1,3 +1,4 @@
+import type { CSSProperties } from "react";
import type { VendorDropdownItem } from "@/domain/work-orders/types/work-order";
import type { WorkOrderTableRow } from "@/domain/work-orders/types/work-order-table-row";
import { ApptTimeCell } from "./cells/appt-time-cell";
@@ -12,7 +13,7 @@ type WoTableRowServiceCellsProps = {
vendors: VendorDropdownItem[];
pmTypes: string[];
search?: string;
- mutationCellStyle?: React.CSSProperties;
+ mutationCellStyle?: CSSProperties;
handlers: WoTableRowHandlers;
onPatchRow: (patch: Partial) => void;
};
@@ -95,6 +96,7 @@ export function WoTableRowServiceCells({
handlers.onOpenCompDoc!(row) : undefined}
onOpenMedia={() => handlers.onOpenMedia(row)}
diff --git a/src/app/(protected)/workorders/_components/list/work-orders-list-overlays.tsx b/src/app/(protected)/workorders/_components/list/work-orders-list-overlays.tsx
new file mode 100644
index 00000000..a38542d6
--- /dev/null
+++ b/src/app/(protected)/workorders/_components/list/work-orders-list-overlays.tsx
@@ -0,0 +1,90 @@
+import { CompDocDialog } from "@/app/(protected)/workorders/_components/comp-doc/comp-doc-dialog";
+import { MediaUploadModal } from "@/app/(protected)/workorders/_components/media/media-upload-modal";
+import { WorkOrdersAdvancedSearchSheet } from "@/app/(protected)/workorders/_components/list/advanced-search/work-orders-advanced-search-sheet";
+import { NewWoWizard } from "@/app/(protected)/workorders/_components/wizard/new-wo-wizard";
+import type { CompDocData, CompDocSaveStatus } from "@/domain/work-orders/types/completion-doc";
+import type { WorkOrderAdvancedFilters } from "@/domain/work-orders/types/work-order-advanced-filters";
+import type { LocationOption } from "@/domain/work-orders/types/work-order-common";
+import type { WorkOrderUser } from "@/domain/work-orders/types/work-order-list";
+import type { WorkOrderTableRow } from "@/domain/work-orders/types/work-order-table-row";
+
+type WorkOrdersListOverlaysProps = {
+ wizardOpen: boolean;
+ onWizardOpenChange: (open: boolean) => void;
+ users: WorkOrderUser[];
+ sites: LocationOption[];
+ pmTypes: string[];
+ vendorTechs: string[];
+ advOpen: boolean;
+ onAdvOpenChange: (open: boolean) => void;
+ advInitial: WorkOrderAdvancedFilters;
+ onApplyAdvanced: (next: WorkOrderAdvancedFilters) => void;
+ onClearAdvanced: () => void;
+ activeDocRow: WorkOrderTableRow | null;
+ onDocOpenChange: (open: boolean) => void;
+ completionDocs: Record;
+ onSaveCompDoc: (data: CompDocData, status: CompDocSaveStatus) => void | Promise;
+ onDateCompletedChange: (date: string) => void | Promise;
+ activeMediaRow: WorkOrderTableRow | null;
+ onMediaOpenChange: (open: boolean) => void;
+};
+
+export function WorkOrdersListOverlays({
+ wizardOpen,
+ onWizardOpenChange,
+ users,
+ sites,
+ pmTypes,
+ vendorTechs,
+ advOpen,
+ onAdvOpenChange,
+ advInitial,
+ onApplyAdvanced,
+ onClearAdvanced,
+ activeDocRow,
+ onDocOpenChange,
+ completionDocs,
+ onSaveCompDoc,
+ onDateCompletedChange,
+ activeMediaRow,
+ onMediaOpenChange,
+}: WorkOrdersListOverlaysProps) {
+ return (
+ <>
+
+
+
+
+ {activeDocRow != null && (
+
+ )}
+
+ {activeMediaRow != null && (
+
+ )}
+ >
+ );
+}
diff --git a/src/app/(protected)/workorders/_components/media/media-upload-modal.tsx b/src/app/(protected)/workorders/_components/media/media-upload-modal.tsx
index 779bdb28..79254c34 100644
--- a/src/app/(protected)/workorders/_components/media/media-upload-modal.tsx
+++ b/src/app/(protected)/workorders/_components/media/media-upload-modal.tsx
@@ -1,32 +1,65 @@
import { type MouseEvent } from "react";
-import { Dialog, DialogContent, DialogTitle } from "@mui/material";
+import { Dialog, DialogContent, DialogTitle, Skeleton, Stack } from "@mui/material";
import { Image as ImageIcon } from "lucide-react";
+import { toast } from "react-toastify";
import { Button } from "@/components/ui/button";
import { dialogBlurBackdropSlotProps } from "@/components/ui/dialog-blur-backdrop";
+import { LoadingRegion } from "@/components/ui/loading-region";
import { Text } from "@/components/ui/text";
-import type { MediaFile } from "@/domain/work-orders/types/work-order-media";
+import { MediaUploader } from "@/app/(protected)/workorders/_components/media/media-uploader";
+import { useMediaUploadSession } from "@/app/(protected)/workorders/_hooks/use-media-upload-session";
import type { WorkOrderTableRow } from "@/domain/work-orders/types/work-order-table-row";
-import { MediaUploader } from "./media-uploader";
+import { useWorkOrderBoardDetail } from "@/domain/work-orders/use-cases/use-work-order-detail";
+import {
+ useDeleteWorkOrderMedia,
+ useUpdateWorkOrderMediaCategory,
+ useUploadWorkOrderMedia,
+} from "@/domain/work-orders/use-cases/use-work-order-mutations";
+import { isWorkOrderDocumentsReadOnly } from "@/domain/work-orders/utils/work-order-media-limits";
+import { guardDialogClose } from "@/lib/dialog-guard";
type MediaUploadModalProps = {
row: WorkOrderTableRow;
open: boolean;
onOpenChange: (open: boolean) => void;
- uploads: MediaFile[];
- onChange: (next: MediaFile[]) => void;
};
-export function MediaUploadModal({
- row,
- open,
- onOpenChange,
- uploads,
- onChange,
-}: MediaUploadModalProps) {
+function resolveWorkOrderVersion(
+ detailRowVersion: string | null | undefined,
+ rowVersion: string | null | undefined,
+): string | null {
+ const version = detailRowVersion?.trim() || rowVersion?.trim() || "";
+ return version || null;
+}
+
+export function MediaUploadModal({ row, open, onOpenChange }: MediaUploadModalProps) {
+ const { data: detail, isLoading } = useWorkOrderBoardDetail(row.id, open);
+ const uploadMutation = useUploadWorkOrderMedia(row.id);
+ const categorizeMutation = useUpdateWorkOrderMediaCategory(row.id);
+ const deleteMutation = useDeleteWorkOrderMedia(row.id);
+ const isReadOnly = isWorkOrderDocumentsReadOnly(detail?.info.status ?? row.status);
+ const { uploads, startUploads, retryUpload, removeLocal, isLocal } = useMediaUploadSession(
+ detail,
+ (input) => uploadMutation.mutateAsync(input),
+ );
+
+ const pending =
+ uploadMutation.isPending || deleteMutation.isPending || categorizeMutation.isPending;
+ const handleClose = guardDialogClose(pending, () => onOpenChange(false));
+
+ const requireVersion = (): string | null => {
+ const version = resolveWorkOrderVersion(detail?.info.rowVersion, row.rowVersion);
+ if (!version) {
+ toast.error("Missing work order version. Refresh and try again.");
+ return null;
+ }
+ return version;
+ };
+
return (