# FFCSA dashboard recipe

Example: [2026 FFCSA dashboard](https://docs.google.com/spreadsheets/d/1ZQc0HYI150kKa6aiJ_bA4RLLhfJCL83QPeIPfEG0xXI/edit).
Current publisher: CSA Store, `apps/api/lib/dashboardPublisher.js` and
`docs/localline-automation.md`, at the catalog's reviewed `csa_store` revision.
The older `ffcsa_scripts/localline/publish_dashboard_auto26.js` is a legacy
reference; do not choose it based on the repository name alone.

## Layout and ownership

The main surfaces are `auto-weekly-summary` and `auto-monthly-summary`, with
Section, Metric, Entry Type and Source columns followed by totals and periods.
The publisher also manages employee-credit and pack-day views. It preserves the
editable `auto-gp-per-member` forecast. Source weekly/manual inputs remain in the
separate source workbook configured by the publisher.

Manual QA, delivery costs and other manual expenses currently survive publication
through label-based reads. Declare those as inputs and preserve them. Never clear
all tabs because their names begin with `auto-`. Inspect the owning exporter before
assigning any new generated range.

## Meaning and sources

| Measure | Interpretation |
| --- | --- |
| Subscribers | Period-end subscription state plus separately identified membership groups; not a sum of weekly counts |
| Product-order count | Eligible orders with actual product lines, with scope/status exclusions declared |
| Retail Sales in the existing workbook | Paid OPEN non-membership reporting-row subtotals; includes deposit rows and is before order-level discounts |
| Net product sales in the data bank | Discounts applied and membership funding/deposits separated; a different measure from that workbook row |
| Purchase cost | Saved historical vendor costs plus reviewed corrections, not current catalog cost |
| Task wages | Timesheets FFCSA wages plus fringe, with recorded/approved/paid scope identified |
| Pack / Delivery / Pickup minutes per order | Selected task minutes divided by compatible order count; total/quarter results use summed minutes divided by summed orders |
| Credit and cash rows | Issued credit, redemption, cash received and bank balance are separate flows/states |
| QBO rows | Separate cash-basis accounting reconciliation, not additional operational revenue |

The existing efficiency measure needs all required labor groups recorded for a
publishable week. Missing labor or zero-order weeks remain blank and are excluded
from its combined ratio. The pack-day scorecard uses different cycles and order
scope; do not substitute it for the calendar-week measure.

## Reproduce a bounded result

Use `local_line.product_orders`, joined by native order ID to
`csa_store.order_reference` when needed. Group complete weeks by fulfillment date,
retain explicit channel rules, exclude cancelled/refunded and non-product funding,
and separately report unknown/unreconciled values. The private pilot calculates
classified CSA product orders and product sales for September 7–27, 2026.

Compare against the workbook's Num Orders/Retail Sales rows for the same weeks.
The pilot preserves a separate comparison bridge that reproduces the publisher's
paid OPEN non-membership subtotals before order-level discounts, including deposit
rows and deposit-only orders. It explains a definition difference without changing
net product sales to make it match. Extraction time, refund detail and reviewed
historical corrections can cause further differences; keep those visible.

For a full dashboard, use the source-owned member-credit, subscriber, cost and QBO
calculations. The initial shared sales dataset alone cannot reproduce every row.
Use the source publisher's documented preview for validation; its live publish can
repair reporting caches and writes Google Sheets, so it is not a data-harvest step.
