Admin tools
One-shot maintenance jobs. These are safe to run multiple times — each tool is idempotent (it skips records that are already up to date) and won't overwrite data the admin has explicitly set.
Seed profile chips on the Job Board pipeline
Adds the default colored panel-profile chips (Snap 1.0", Snap 1.5",
Lock variants, Standing Seam, G-Rib) to the ops_pipelines/main
document so the kanban + job-detail pages can render the second chip
on each card. Skips silently if profiles are already configured.
Run this once after upgrading to v0.1.3.
Upgrade profiles to siding + work-type scoping
For pipelines created before profile chips became work-type-aware
(v0.1.5 and earlier). This:
(1) Adds workTypes: ['re-roof','new-construction'] to the
existing roofing profiles (Snap, Lock, Standing Seam, G-Rib) so they only
show on roofing jobs.
(2) Adds three new siding profiles —
Board and Batten, Cottage Panel,
G-Rib Siding — scoped to the siding
work type.
Existing custom profiles are left exactly as-is. Idempotent — safe
to click again.
Backfill panel profile on imported jobs
Scans every job, and for any job missing
panelProfile and roofType, copies those
values from the yutzybid snapshot stored in the job's
private/main sub-document. After this runs, the colored
profile chip will appear on every imported job that had a recognizable
profile in yutzybid. Jobs without a snapshot (manually added, or older
imports that didn't capture one) are left untouched.
Re-pull attachments from yutzybid
Fixes two problems in one pass:
(a) Jobs with copyFailed attachment records
(auto-import couldn't copy the PDFs server-side because of an
IAM gap on the Cloud Functions runtime). This tool re-copies
them from the browser using your admin credentials, then
replaces the failure record with a successful one.
(b) Jobs that came over with no PDFs at all
because the source estimate hadn't generated them yet at import
time (e.g. Holcomb). For each yutzybid-imported job, looks up
the live source estimate and copies any
estimatePdfStoragePath /
financialReportStoragePath /
attachments[] that aren't already on the ops job.
Idempotent — files already present (matched by source path)
are skipped.
Failed attachment diagnostic
Scans every job for attachments whose copy from yutzybid failed. Groups them by job and shows the exact error message + the original yutzybid storage path each one was trying to copy from. Use this to figure out WHY a PDF didn't come over — common causes are the source file having been deleted in yutzybid, a malformed legacy URL, or a bucket-permission hiccup. Read-only.