Add coordination comments, damp/mould, and Domna survey columns to property table and CSV export

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-06-15 09:48:41 +00:00
parent 462cd36c3f
commit c72b7c1625
9 changed files with 92 additions and 0 deletions

View file

@ -64,6 +64,10 @@ const COLUMN_LABELS: Record<string, string> = {
epcPrn: "EPC Certificate Number",
batch: "Group",
batchDescription: "Group Description",
coordinationComments: "Coordination Comments",
dampAndMouldGrowth: "Damp and Mould Growth",
dampMouldAndRepairComments: "Dampm, Mould and Repair Comments",
domnaSurveyRequested: "Domna Survey Requested"
};
type DocFilter = "all" | "has_docs" | "incomplete" | "none";
@ -106,6 +110,10 @@ export default function PropertyTable({ data, onOpenDrawer, portfolioId = "", sh
epcPrn: false,
batch: false,
batchDescription: false,
coordinationComments: false,
dampAndMouldGrowth: false,
dampMouldAndRepairComments: false,
domnaSurveyRequested: false,
});
// Pre-filter by stage, doc status, and removal status before TanStack gets it

View file

@ -371,6 +371,74 @@ export function createPropertyTableColumns(
),
},
// ── Coordination comments ────────────────────────────────────────────
{
accessorKey: "coordinationComments",
id: "coordinationComments",
header: () => (
<span className="text-xs font-semibold uppercase tracking-wide text-gray-500">
Coordination Comments
</span>
),
cell: ({ row }) => (
<span className="text-xs text-gray-600 max-w-[220px] line-clamp-2 leading-snug">
{row.original.coordinationComments ?? <span className="text-gray-300"></span>}
</span>
),
},
// ── Damp and mould growth ────────────────────────────────────────────
{
id: "dampAndMouldGrowth",
accessorFn: (row) => row.dampMouldFlag,
header: () => (
<span className="text-xs font-semibold uppercase tracking-wide text-gray-500">
Damp &amp; Mould Growth
</span>
),
cell: ({ row }) => (
<span className="text-xs text-gray-600">
{row.original.dampMouldFlag ?? <span className="text-gray-300"></span>}
</span>
),
},
// ── Damp, mould and repair comments ─────────────────────────────────
{
accessorKey: "dampMouldAndRepairComments",
id: "dampMouldAndRepairComments",
header: () => (
<span className="text-xs font-semibold uppercase tracking-wide text-gray-500">
Damp, Mould &amp; Repair Comments
</span>
),
cell: ({ row }) => (
<span className="text-xs text-gray-600 max-w-[220px] line-clamp-2 leading-snug">
{row.original.dampMouldAndRepairComments ?? <span className="text-gray-300"></span>}
</span>
),
},
// ── Domna survey required ────────────────────────────────────────────
{
id: "domnaSurveyRequested",
accessorFn: (row) => row.domnasurveyRequired,
header: () => (
<span className="text-xs font-semibold uppercase tracking-wide text-gray-500">
Domna Survey Required
</span>
),
cell: ({ row }) => {
const val = row.original.domnasurveyRequired;
if (val === null || val === undefined) return <span className="text-gray-300"></span>;
return (
<span className={`text-xs font-medium ${val ? "text-amber-700" : "text-gray-500"}`}>
{val ? "Yes" : "No"}
</span>
);
},
},
];
if (showDocuments) {

View file

@ -36,6 +36,8 @@ export function mapDbRowToHubspotDeal(row: DealRow): HubspotDeal {
sharepointLink: d.sharepointLink,
dampMouldFlag: d.dampmouldGrowth,
dampMouldAndRepairComments: d.dampMouldAndRepairComments,
coordinationComments: d.coordination_comments,
domnasurveyRequired: d.domnasurveyRequired,
preSapScore: d.preSap,
coordinator: row.coordinator,
ioeV1Date: d.mtpCompletionDate,

View file

@ -60,6 +60,8 @@ function makeDeal(overrides: Partial<HubspotDeal> = {}): HubspotDeal {
domnaSurveyDate: null,
batch: null,
batchDescription: null,
coordinationComments: null,
domnasurveyRequired: null,
createdAt: new Date(),
updatedAt: new Date(),
...overrides,

View file

@ -59,6 +59,8 @@ function makeDeal(overrides: Partial<ClassifiedDeal> = {}): ClassifiedDeal {
domnaSurveyDate: null,
batch: null,
batchDescription: null,
coordinationComments: null,
domnasurveyRequired: null,
createdAt: new Date(),
updatedAt: new Date(),
displayStage: "Coordination in Progress",

View file

@ -59,6 +59,8 @@ function makeDeal(overrides: Partial<HubspotDeal> = {}): HubspotDeal {
domnaSurveyDate: null,
batch: null,
batchDescription: null,
coordinationComments: null,
domnasurveyRequired: null,
createdAt: new Date(),
updatedAt: new Date(),
...overrides,

View file

@ -26,6 +26,10 @@ export const PROPERTY_CSV_FIELDS: PropertyCsvField[] = [
{ key: "epcPrn", label: "EPC Certificate Number" },
{ key: "batch", label: "Group" },
{ key: "batchDescription", label: "Group Description" },
{ key: "coordinationComments", label: "Coordination Comments" },
{ key: "dampMouldFlag", label: "Damp and Mould Growth" },
{ key: "dampMouldAndRepairComments", label: "Damp Mould and Repair Comments" },
{ key: "domnasurveyRequired", label: "Domna Survey Required" },
];
export function escapeCsvCell(value: unknown): string {

View file

@ -66,6 +66,8 @@ function makeDeal(overrides: Partial<HubspotDeal> = {}): HubspotDeal {
domnaSurveyDate: null,
batch: null,
batchDescription: null,
coordinationComments: null,
domnasurveyRequired: null,
createdAt: new Date(),
updatedAt: new Date(),
...overrides,

View file

@ -30,6 +30,8 @@ export type HubspotDeal = {
sharepointLink: string | null;
dampMouldFlag: string | null; // coordinator-stage damp/mould flag
dampMouldAndRepairComments: string | null; // coordinator damp/mould comments
coordinationComments: string | null;
domnasurveyRequired: boolean | null;
preSapScore: string | null; // kept as text (HubSpot returns strings)
coordinator: string | null;
ioeV1Date: Date | null;