Split inspection date and time into separate Reports Hub columns
Objective
- Export Inspection Date and Inspection Time as separate columns in Reports Hub on Inspections and Quotes, so finance can filter, sort, and pivot by date and time of day without parsing a combined datetime string in Excel.
- Provide date-only and time-only values formatted for spreadsheet normalization (consistent, predictable strings per row) — not the current combined
YYYY-MM-DD HH:mmexport. - Keep the existing combined
datetimecolumn unchanged for backward compatibility; new columns are additive.
Background
- Finance feedback (Andy/Erin session, parent epic Reports Hub update for Finance) calls for scheduling columns separate from revenue fields.
- Erin: when users pick date fields in exports, values download as a timestamp-style datetime (
YYYY-MM-DD HH:mm) and must be cleaned up manually before sorting or manipulating in spreadsheets. Andy noted CSV as a workaround; the underlying need is a plain date field (and separate time). - Today Inspections expose a single
datetimefield labeled Inspection Date inexportFieldDefinitions.ts;formatting.tsrenders alldatetypes asYYYY-MM-DD HH:mmwhen company timezone is set (runDataExportJob.ts→getExportTimeZone). There is no date-only or time-only export today. - Quotes expose
datetimeas Requested Date (mapped tocreatedAtinexportFieldDefinitions.ts) — split date/time applies here too in v1. - Template reference (not a separate deliverable): Email/SMS/agreement templates split scheduling via
inspectionDateandinspectionTimeintemplatingData.ts(company timezone). Reports Hub should expose the same semantic split (date column + time column from one instant). Export formats are locked below and happen to match those template formats. - Prebuilt Inspection Summary only includes
datetimeamong scheduling fields (prebuiltReports.ts). - Consolidated duplicate: ATT-1860 — same deliverable; tracked here.
- Out of scope: county, client name, address (ATT-1858); End Time split columns (no user ask).
Locked product decisions (v1)
- Entities: Inspections and Quotes (quote split applies to the scheduling datetime field exposed today — Requested Date /
createdAtmapping). - Export formats: Date →
M/D/YYYY; Time →h:mm A(12-hour with AM/PM), in company timezone. - Primary goal: Normalization-friendly for spreadsheets — stable string output suitable for downstream imports and pivot workflows (not locale-pretty-only rendering that varies row to row).
- Backward compatibility: Existing combined
datetimecolumn stays as-is (YYYY-MM-DD HH:mm); new date-only and time-only columns are added alongside it. - End Time: Out of scope — no split columns for
endtimein v1. - Template parity (clarified): Semantic — separate date and time from the same scheduling instant, like template variables. Format — locked to
M/D/YYYYandh:mm A(same asinspectionDate/inspectionTimeintemplatingData.ts).
Done when
- Inspection Date (date-only) and Inspection Time (time-only) appear in the Reports Hub column picker for Inspections and Quotes.
- Exported values use
M/D/YYYYandh:mm Ain company timezone; date column never includes time; time column never includes date. - Combined
datetimecolumn behavior is unchanged on existing saved reports. - Users can add the new columns to saved reports, preview them, and export CSV/XLSX.
Scope
Backend
attik-backend/src/config/exportFieldDefinitions.ts— register date-only and time-only fields on inspections and quotes (computed fromdatetime; quotes continue to source fromcreatedAtper existingdatetimemapping unless dev chooses clearer field keys).attik-backend/src/util/functions/dataExports/formatting.ts— format new fields asM/D/YYYY/h:mm AviaTZDayjs/ company timezone; do not reuseformatDateForExport(YYYY-MM-DD HH:mm) for these columns.attik-backend/src/util/functions/dataExports/documentResolution.tsand/orrunDataExportJob.ts— resolve split values when columns selected; timezone passthrough same as current date exports.
Frontend
- Reports Hub column picker and preview (
CreateReportForm.tsx,ReportPreviewSection.tsx) — surface new fields when backend exposes them viaGET /data-exports/fields/inspectionsand.../quotes.
Out of scope
- End Time (
endtime) date/time split. - Changing or removing the existing combined
datetimecolumn. - County, client name, address (ATT-1858).
- Finance prebuilt template updates (optional follow-up after ATT-1856).
References
- Parent epic: Reporting updates for Finance (ATT-1862)
- Duplicate consolidated: ATT-1860 — Add date-only field to inspections collection exports
- Field defs:
attik-backend/src/config/exportFieldDefinitions.ts(datetime,endtimeon inspections; quotesdatetime→createdAt) - Date formatting:
attik-backend/src/util/functions/dataExports/formatting.ts - Template variable reference:
attik-frontend/src/components/conditions/templatingData.ts(inspectionDate,inspectionTime)
Status: Planned
Log in to comment and vote
No comments yet
Be the first to share your thoughts.