Files
toanhoang 8ac95c974b
CI / test (push) Failing after 8s
Add ExpectedAsset CSV import + bot search/pick for pre-known inventory
Lets the operator upload a CSV of already-known assets (asset tag, model,
serial, old area/assignee) before an office-move walk, via a new
session-authed /inventory-scans/import page. The Telegram bot gains a
"tim trong list" search step at the asset-tag prompt: picking a match
pre-fills tag/serial and offers one-tap "giu nguyen" buttons for the
old area/assignee, then marks that row matched once the scan is created.

Follows the same-day decision to turn off local OCR (qwen2.5vl via Ollama)
for this feature -- see CLAUDE.md and the ITAM/Ollama vault notes for the
accuracy/speed numbers behind that call.

Deviates from repo convention same as the InventoryScan work above: no
Vitest coverage (manual smoke test only, via simulated webhook calls),
hand-written migration, not through the ba->pm->feature-implementer->
test-runner->code-reviewer pipeline. tsc/lint are clean.
2026-08-21 08:59:18 -04:00

20 lines
794 B
SQL

-- Hand-written (same deviation as the other 2026-08-20 migrations in this
-- feature -- see CLAUDE.md "Việc còn dở"), not `prisma migrate dev`.
CREATE TABLE "expected_assets" (
"id" UUID NOT NULL,
"asset_tag" TEXT,
"model_text" TEXT NOT NULL,
"serial_number" TEXT,
"old_area_text" TEXT,
"old_assignee_text" TEXT,
"matched_scan_id" UUID,
"created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "expected_assets_pkey" PRIMARY KEY ("id")
);
CREATE UNIQUE INDEX "expected_assets_matched_scan_id_key" ON "expected_assets"("matched_scan_id");
ALTER TABLE "expected_assets" ADD CONSTRAINT "expected_assets_matched_scan_id_fkey"
FOREIGN KEY ("matched_scan_id") REFERENCES "inventory_scans"("id") ON DELETE SET NULL ON UPDATE CASCADE;