diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index 38bd544..cff13e3 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -68,9 +68,10 @@ export type ConversionFunnel = { /** * Aggregate KPIs over a date window. Replaces the - * `get_reports_summary` SECURITY DEFINER RPC from - * `supabase/migrations/031_reports_v1_rpcs.sql`. Returns zeroed metrics - * if the caller is unauthenticated or no orders exist in the window. + * `get_reports_summary` SECURITY DEFINER RPC (originally from the now- + * archived supabase migrations; consolidated into + * `db/migrations/0001_init.sql`). Returns zeroed metrics if the caller + * is unauthenticated or no orders exist in the window. */ async function getReportsSummary( brandId: string | null, diff --git a/src/actions/import-orders.ts b/src/actions/import-orders.ts index 2e16dea..6a61de0 100644 --- a/src/actions/import-orders.ts +++ b/src/actions/import-orders.ts @@ -11,8 +11,9 @@ export type ImportOrdersResult = /** * Bulk-import orders. Replaces the legacy `create_order_with_items` SECURITY - * DEFINER RPC (`supabase/migrations/021_shipping_only_brand.sql`). The new - * `orders` schema doesn't have `subtotal`, `customer_name`, `customer_email`, + * DEFINER RPC (originally from the now-archived supabase migrations; + * consolidated into `db/migrations/0001_init.sql`). The new `orders` + * schema doesn't have `subtotal`, `customer_name`, `customer_email`, * `customer_phone`, or `stop_id` columns — totals are stored in * `total_cents` and customers are referenced by `customer_id`. For each * imported order we upsert a `customers` row keyed on email+tenant, then diff --git a/src/actions/reports.ts b/src/actions/reports.ts index ab67ffb..456d073 100644 --- a/src/actions/reports.ts +++ b/src/actions/reports.ts @@ -73,7 +73,8 @@ export type CampaignActivityRow = { // ── Helpers ────────────────────────────────────────────────────────────────── // // The reports V1 RPCs (`get_reports_summary`, `get_orders_by_stop_report`, etc.) -// from `supabase/migrations/031_reports_v1_rpcs.sql` reference legacy columns +// (originally from the now-archived supabase migrations; consolidated +// into `db/migrations/0001_init.sql`) reference legacy columns // (`orders.subtotal`, `stops.city/state/date`, `communication_contacts`). // The SaaS rebuild has a different `orders` schema (`total_cents`, no // `stop_id`/`city`/`state` columns on `stops`) and a different contacts table diff --git a/src/actions/route-trace/lots.ts b/src/actions/route-trace/lots.ts index b3b1380..e1efa28 100644 --- a/src/actions/route-trace/lots.ts +++ b/src/actions/route-trace/lots.ts @@ -4,12 +4,13 @@ import { getAdminUser } from "@/lib/admin-permissions"; import { getActiveBrandId, assertBrandAccess } from "@/lib/brand-scope"; // TODO(migration): the `harvest_lots` / `harvest_lot_events` / `lot_orders` -// tables from the route-trace feature (defined across -// supabase/migrations/143_enable_route_trace.sql and friends) were retired -// from the SaaS rebuild — they don't exist in `db/schema/`. The functions -// below all return empty results so the public trace page and FSMA reports -// 404 gracefully. If route-trace comes back, re-introduce the tables in -// `db/schema/` and replace these stubs with real Drizzle queries. +// tables from the route-trace feature (originally defined in the now- +// archived supabase migrations; consolidated into +// `db/migrations/0001_init.sql`) were retired from the SaaS rebuild — +// they don't exist in `db/schema/`. The functions below all return empty +// results so the public trace page and FSMA reports 404 gracefully. If +// route-trace comes back, re-introduce the tables in `db/schema/` and +// replace these stubs with real Drizzle queries. export interface HarvestLot { id: string; diff --git a/src/actions/shipping.ts b/src/actions/shipping.ts index 323f5e0..c633515 100644 --- a/src/actions/shipping.ts +++ b/src/actions/shipping.ts @@ -10,10 +10,10 @@ export type UpdateShippingStatusResult = // TODO(migration): shipping is dormant in the SaaS rebuild. The legacy // `shipments` table (with `tracking_number`, `fedex_shipment_id`, etc.), // the `shipping_status` column on `orders`, and the `update_shipping_order` -// RPC from `supabase/migrations/040_shipping_fulfillment_rpcs.sql` are -// gone. The functions below stub to "not configured" so the admin -// shipping tab renders gracefully. Re-introduce shipping in -// `db/schema/` when the feature is reactivated. +// RPC (originally from the now-archived supabase migrations) are gone. +// The functions below stub to "not configured" so the admin shipping +// tab renders gracefully. Re-introduce shipping in `db/schema/` when +// the feature is reactivated. export async function updateShippingStatus( _orderId: string, diff --git a/src/actions/shipping/fedex-labels.ts b/src/actions/shipping/fedex-labels.ts index f6c16f7..f25a741 100644 --- a/src/actions/shipping/fedex-labels.ts +++ b/src/actions/shipping/fedex-labels.ts @@ -93,8 +93,9 @@ async function loadShippingSettingsForBrand(brandId: string): Promise { try { diff --git a/src/actions/shipping/fedex-rates.ts b/src/actions/shipping/fedex-rates.ts index 0644d9d..e3db3c5 100644 --- a/src/actions/shipping/fedex-rates.ts +++ b/src/actions/shipping/fedex-rates.ts @@ -11,12 +11,12 @@ * * TODO(migration): shipping is dormant in the SaaS rebuild. The * legacy `shipping_settings` table (with the FedEx credential columns - * this file needs) is still present in the database — see - * supabase/migrations/083_shipping_settings.sql — but the new - * `db/schema/` does not declare it. The data reads below hit the - * legacy table directly via `pool.query`. When shipping comes back, - * declare the table in `db/schema/shipping.ts` and switch the reads - * to Drizzle. + * this file needs) is still present in the database — originally from + * the now-archived supabase migrations, consolidated into + * `db/migrations/0001_init.sql` — but the new `db/schema/` does not + * declare it. The data reads below hit the legacy table directly via + * `pool.query`. When shipping comes back, declare the table in + * `db/schema/shipping.ts` and switch the reads to Drizzle. */ import { getAdminUser } from "@/lib/admin-permissions"; diff --git a/src/actions/shipping/settings.ts b/src/actions/shipping/settings.ts index bc9b9a2..53c703e 100644 --- a/src/actions/shipping/settings.ts +++ b/src/actions/shipping/settings.ts @@ -4,12 +4,12 @@ * Shipping settings CRUD + FedEx connection test. * * TODO(migration): shipping is dormant in the SaaS rebuild. The - * `shipping_settings` table is still part of the legacy schema (see - * supabase/migrations/083_shipping_settings.sql) — the FedEx integration - * continues to read/write it via raw `pool.query` SQL rather than the - * Supabase REST gateway or Drizzle. When shipping is reactivated, move - * the table declaration into `db/schema/shipping.ts` and switch the - * reads to typed Drizzle queries. + * `shipping_settings` table is still part of the legacy schema + * (originally from the now-archived supabase migrations; consolidated + * into `db/migrations/0001_init.sql`) — the FedEx integration continues + * to read/write it via raw `pool.query` SQL rather than Drizzle. When + * shipping is reactivated, move the table declaration into + * `db/schema/shipping.ts` and switch the reads to typed Drizzle queries. */ import { getAdminUser } from "@/lib/admin-permissions"; diff --git a/src/actions/stops/manage-stop-products.ts b/src/actions/stops/manage-stop-products.ts index f7590ee..7badcc8 100644 --- a/src/actions/stops/manage-stop-products.ts +++ b/src/actions/stops/manage-stop-products.ts @@ -4,12 +4,13 @@ * Assign / unassign a product to a stop. * * TODO(migration): the `assign_product_to_stop` and - * `unassign_product_from_stop` SECURITY DEFINER RPCs live in - * supabase/migrations/030. The RPCs still exist in the database and - * are called via `pool.query` rather than the Supabase REST gateway. - * When stops/products are re-platformed on the SaaS rebuild, replace - * these with direct inserts/deletes on the new `db/schema/stops.ts` - * `stopProducts` table. + * `unassign_product_from_stop` SECURITY DEFINER RPCs (originally from + * the now-archived supabase migrations; consolidated into + * `db/migrations/0001_init.sql`). The RPCs still exist in the + * database and are called via `pool.query`. When stops/products are + * re-platformed on the SaaS rebuild, replace these with direct + * inserts/deletes on the new `db/schema/stops.ts` `stopProducts` + * table. */ import { getAdminUser } from "@/lib/admin-permissions"; diff --git a/src/actions/tax.ts b/src/actions/tax.ts index d755d9d..49380af 100644 --- a/src/actions/tax.ts +++ b/src/actions/tax.ts @@ -152,12 +152,12 @@ async function getBrandTaxSettings(brandId: string): Promise