)}
- {/* Empty state */}
- {!isLoading && !isError && !hasDocuments && (
-
-
-
+ {/* Empty state — shows all missing doc types */}
+ {!isFetching && !isError && !hasDocuments && (
+
+
+
+
+
+
+ No documents available
+
+
+ All {EXPECTED_SURVEY_DOC_TYPES.length} survey documents are
+ outstanding.
+
+
+
+
+ Missing Documents ({missingTypes.length})
+
+ {missingTypes.map((t) => (
+
+
+
+ {DOC_TYPE_LABELS[t] ?? t}
+
+
+ ))}
-
- No documents uploaded
-
-
- Survey documents will appear here once uploaded for this
- property.
-
)}
{/* Document groups */}
- {!isLoading &&
+ {!isFetching &&
!isError &&
hasDocuments &&
Object.entries(grouped).map(([category, docs]) => (
@@ -274,6 +312,35 @@ export default function PropertyDrawer({
))}
+
+ {/* Missing documents section — shown when some but not all docs are present */}
+ {!isFetching &&
+ !isError &&
+ hasDocuments &&
+ missingTypes.length > 0 && (
+
+
+ Missing Documents ({missingTypes.length})
+
+
+ {missingTypes.map((t) => (
+
+
+
+ {DOC_TYPE_LABELS[t] ?? t}
+
+
+ ))}
+
+
+ )}
{/* Footer */}
diff --git a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/transforms.ts b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/transforms.ts
index ab5916c..d8d6bf3 100644
--- a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/transforms.ts
+++ b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/transforms.ts
@@ -94,10 +94,11 @@ function resolveAfterAssessmentStage(
// Called when design is UPLOADED — resolves install / lodgement / completed
// -----------------------------------------------------------------------
function resolvePostDesignStage(deal: HubspotDeal): DisplayStage {
- if (deal.fullLodgementDate) return "Completed";
- if (deal.lodgementStatus) return "Lodgement";
+ if (deal.fullLodgementDate) return "Project Complete";
+ if (deal.measuresLodgementDate) return "At Post Survey";
+ if (deal.lodgementStatus) return "At Lodgement";
if (deal.actualMeasuresInstalled || deal.installerHandover) return "Installation Complete";
- return "Awaiting Install";
+ return "Installation in Progress";
}
// -----------------------------------------------------------------------
@@ -216,7 +217,7 @@ export function computeProjectProgress(
}
);
- const completedDeals = stageBuckets["Completed"] ?? [];
+ const completedDeals = stageBuckets["Project Complete"] ?? [];
const completedCount = completedDeals.length;
const completedPercentage =
nonQueryTotal > 0 ? (completedCount / nonQueryTotal) * 100 : 0;
@@ -224,15 +225,16 @@ export function computeProjectProgress(
const totalDeals = deals.length;
// Coordination phase:
- // completed = Design in Progress + Awaiting Install + Installation Complete + Lodgement + Completed
+ // completed = Design in Progress + Installation in Progress + Installation Complete + At Lodgement + At Post Survey + Project Complete
// in progress = Coordination in Progress
const coordCompletedDeals = deals.filter((d) =>
[
"Design in Progress",
- "Awaiting Install",
+ "Installation in Progress",
"Installation Complete",
- "Lodgement",
- "Completed",
+ "At Lodgement",
+ "At Post Survey",
+ "Project Complete",
].includes(d.displayStage)
);
const coordInProgressDeals = deals.filter(
@@ -252,14 +254,15 @@ export function computeProjectProgress(
};
// Design phase:
- // completed = Awaiting Install + Installation Complete + Lodgement + Completed
+ // completed = Installation in Progress + Installation Complete + At Lodgement + At Post Survey + Project Complete
// in progress = Design in Progress
const designCompletedDeals = deals.filter((d) =>
[
- "Awaiting Install",
+ "Installation in Progress",
"Installation Complete",
- "Lodgement",
- "Completed",
+ "At Lodgement",
+ "At Post Survey",
+ "Project Complete",
].includes(d.displayStage)
);
const designInProgressDeals = deals.filter(
@@ -279,10 +282,10 @@ export function computeProjectProgress(
};
// Install phase:
- // completed = Lodgement + Completed
+ // completed = At Lodgement + At Post Survey + Project Complete
// in progress = Installation Complete
const installCompletedDeals = deals.filter((d) =>
- ["Lodgement", "Completed"].includes(d.displayStage)
+ ["At Lodgement", "At Post Survey", "Project Complete"].includes(d.displayStage)
);
const installInProgressDeals = deals.filter(
(d) => d.displayStage === "Installation Complete"
@@ -301,10 +304,10 @@ export function computeProjectProgress(
};
// Lodgement phase:
- // completed = Completed
- // in progress = Lodgement
+ // completed = At Post Survey + Project Complete
+ // in progress = At Lodgement
const lodgementInProgressDeals = deals.filter(
- (d) => d.displayStage === "Lodgement"
+ (d) => d.displayStage === "At Lodgement"
);
const lodgement: WorkPhaseStats = {
diff --git a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/types.ts b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/types.ts
index c51e7d8..931413c 100644
--- a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/types.ts
+++ b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/types.ts
@@ -62,10 +62,11 @@ export type DisplayStage =
| "Assessment in Progress"
| "Coordination in Progress"
| "Design in Progress"
- | "Awaiting Install"
+ | "Installation in Progress"
| "Installation Complete"
- | "Lodgement"
- | "Completed"
+ | "At Lodgement"
+ | "At Post Survey"
+ | "Project Complete"
| "Queries"
| "Unknown Stage";
@@ -249,10 +250,11 @@ export const STAGE_ORDER: DisplayStage[] = [
"Assessment in Progress",
"Coordination in Progress",
"Design in Progress",
- "Awaiting Install",
+ "Installation in Progress",
"Installation Complete",
- "Lodgement",
- "Completed",
+ "At Lodgement",
+ "At Post Survey",
+ "Project Complete",
];
// -----------------------------------------------------------------------
@@ -275,10 +277,10 @@ export const STAGE_COLORS: Record<
dot: "bg-sky-400",
},
"Assessment in Progress": {
- bg: "bg-violet-50",
- text: "text-violet-700",
- border: "border-violet-200",
- dot: "bg-violet-400",
+ bg: "bg-blue-100",
+ text: "text-blue-900",
+ border: "border-blue-400",
+ dot: "bg-blue-700",
},
"Coordination in Progress": {
bg: "bg-indigo-50",
@@ -292,11 +294,11 @@ export const STAGE_COLORS: Record<
border: "border-blue-200",
dot: "bg-blue-400",
},
- "Awaiting Install": {
- bg: "bg-purple-50",
- text: "text-purple-700",
- border: "border-purple-200",
- dot: "bg-purple-400",
+ "Installation in Progress": {
+ bg: "bg-indigo-50",
+ text: "text-indigo-600",
+ border: "border-indigo-200",
+ dot: "bg-indigo-300",
},
"Installation Complete": {
bg: "bg-teal-50",
@@ -304,13 +306,19 @@ export const STAGE_COLORS: Record<
border: "border-teal-200",
dot: "bg-teal-400",
},
- Lodgement: {
+ "At Lodgement": {
bg: "bg-cyan-50",
text: "text-cyan-700",
border: "border-cyan-200",
dot: "bg-cyan-400",
},
- Completed: {
+ "At Post Survey": {
+ bg: "bg-violet-50",
+ text: "text-violet-700",
+ border: "border-violet-200",
+ dot: "bg-violet-400",
+ },
+ "Project Complete": {
bg: "bg-emerald-50",
text: "text-emerald-700",
border: "border-emerald-200",