Skip to content

Monthly Coverage Report

Each month we deliver the prior calendar month's coverage report to the insurance carrier (Safe Store). The deliverable is a single landscape PDF with one section per location. Generating the PDF and emailing it to the carrier are the two steps that matter; saving a copy to Drive is durability for resends.

Cadence

On or after the 2nd of each month for the prior month's billing period. The nightly month close stores the prior month's roster on the 2nd (ADR-038), and the export refuses a finished month until it is stored. (Confirm with the carrier and update this line once locked.)

The report is a coverage roster, not a collections statement. Once a month is stored, every pull of it returns the same rows.

Source of truth

analytics.insurance_coverage_activity view: the monthly roster of insured studios. It has one row for each lockout whose insurance premium was paid in the month, including a member who moved out during it. Stored months come from analytics.insurance_roster_close_lines.

The roster follows the reporting rules in ADR-044, amendment "Insurer Roster from Paid Premiums":

  • Test accounts are left out.
  • A member is listed in a month when their insurance premium was paid in it, at the amount paid. A prorated first month shows the prorated amount. Coverage starts when the premium is paid (Safestor, 2026-11-03), so insurance added mid-month first appears in the month its premium is paid.
  • A payment that arrives after its month closed counts in the month it arrived, and so does its share of the carrier remittance in insurance_monthly.
  • Each row shows the studio the member held at the end of that month.
  • New marks a month with no row the month before. Cancelled marks the month the member moved out or removed insurance.
  • A stored month never changes. If a stored month must change after a ruling, re-store it with a note: pnpm tsx scripts/bookkeeping.ts close-month YYYY-MM-01 --insurance-roster --restate --note="why" (to store a finished month the nightly job missed, drop --restate and --note).
  • Half the roster premium total per location equals carrier_remit_cents in insurance_monthly, except for insurance refunds and payments that arrive after a member moved out.

The view feeds three callers. The export script and the staff-only GET /api/insurance/coverage-report route both read it via InsuranceCoverageReportService (apps/api/src/services/insurance/) — the route returns the roster + totals as JSON. The export_insurance_coverage_report staff MCP tool calls that route and renders the PDF itself (pdfkit runs in the staff-mcp runtime; Vercel never renders it).

Procedure

1. Generate the deliverable PDF

Preferred: the staff MCP tool

With the Metrognome staff and Google Workspace tools connected, ask the assistant: "export the insurance coverage report for YYYY-MM". It calls export_insurance_coverage_report, which generates the PDF on the homelab, saves it under the shared export volume, and returns the file path plus a per-location summary. No production-env pull is needed — the tool reads production through the staff API with your delegated, audited identity.

The next two steps — delivering the PDF to the carrier (step 2) and saving the canonical copy to Drive (step 3) — are both required. The MCP tool can handle the Drive save automatically via create_drive_file; you handle the carrier email yourself.

Fallback: the export script

Use this if the MCP is unavailable.

cd apps/api
pnpm tsx scripts/export-insurance-coverage-reports.ts --month=YYYY-MM --production

YYYY-MM is the billing period — e.g. 2026-04 for the April filing.

Reading production data only — script is read-only. Standard production access flow: pull env, run, clean up. See project root CLAUDE.md "Environment" section.

The script:

  • reads the target month's roster through InsuranceCoverageReportService, so it refuses a finished month that is not stored yet
  • groups rows by location (mg_id + name)
  • writes a single landscape PDF to apps/api/scripts/.local/insurance-coverage/YYYY-MM/coverage-report-YYYY-MM.pdf
  • each location starts on a new page with its own header (name, address, billing period), coverage table, and totals row
  • adds a PDF outline (bookmark per location) for navigation
  • prints a per-location row count summary on completion

2. Deliver to the carrier

This is the actual handoff — Safe Store needs the PDF for the month to be filed.

Email the PDF to the carrier with subject Coverage Report — {Month YYYY}. Treat this step as not-done until the email is sent; the PDF on disk is not the deliverable, the email to Safe Store is.

3. Save the canonical copy to Drive

Save the same PDF you delivered to the shared Drive under Insurance / Monthly Coverage Reports / YYYY-MM /. This is the authoritative record of what was filed for the month — used to resend if the carrier asks, and to audit historical filings.

The MCP tool does this automatically via create_drive_file (into the folder configured as INSURANCE_DRIVE_FOLDER_ID in the staff MCP). When using the script fallback, upload to the same folder manually.

What's in the PDF

Header (per page):

  • Location name (mg_id + name)
  • Location address
  • Billing period (e.g., April 2026)

Coverage table columns:

Column Source
Customer Member name on the reservation
Unit Studio held at the end of the month
Coverage Tier label, e.g. $2,000 Coverage, $100 Deductible
Start date Payment date that began the member's current run of coverage; empty for months filed before Nov 2026
Premium What the member paid for insurance that month
New Y when the member had no row the month before
Cancelled Y in the month they moved out or removed insurance

Totals row sums Premium across the location's units.

When something looks wrong

  • Row missing for a member you know is insured: check these, in order. If all look right and the row still doesn't appear, file a bug.
  • Is the member marked as a test account? Test accounts are left out.
  • Was the insurance premium paid in that month? A month whose bill was not paid has no row; a late payment appears in the month it was paid.
  • Does the member hold the lockout that month? A payment after a move-out is collected but not listed. The Stripe subscription status does not matter: a paid premium on a trialing subscription is listed.

See also