Admin Panel

Connected to live API

Matching Workflow & DB

Operational reference for how OCR price tags move through ingestion, Gemini OCR, matching, review, and catalog learning, plus the core table relations behind that flow.

Process / Data Workflow

Operational flow from submission capture to review outcome and alias learning.

Ingestion / UploadOCR / GeminiParsing / MatchingReview / ModerationCore Product DB
INGESTION

Submission

User or Telegram session starts capture

Retail, store, channel, and operator context are attached here.

INGESTION

Photo Upload

1..N price-tag photos arrive into submission

Unreadable photos can be flagged for resend before completion.

INGESTION

matching.pt_batches

One processing batch per uploaded photo

Tracks batch status, source, submission link, and OCR lifecycle.

INGESTION

matching.pt_photos

Photo metadata and storage object key

Original file stays in storage; preview can be delivered separately.

OCR

Gemini OCR

Extract text and item regions from the tag

Produces raw item candidates with bbox, text, barcode, price, and unit.

OCR

matching.pt_raw_items

OCR output saved per detected item

Stores raw text, barcode, price, promo price, unit text, and category hints.

MATCHING

matching.pt_parsed_items

Normalize and parse matching signals

Text normalization, brand cleanup, size parsing, type and variant tokens.

MATCHING

Barcode / Shortlist / Score

Exact barcode match first, then candidate shortlist

Rule-based scoring compares barcode, size, brand, token overlap, and category.

OCR

Gemini Rerank

Second opinion for ambiguous cases

LLM suggests the most likely candidate and whether human review is needed.

MATCHING

matching.pt_matches

Persist shortlist and final machine decision

Stores top candidate, score, decision source, and match status.

REVIEW

Review Queue

Only uncertain or policy-sensitive items surface here

Operator sees photo, OCR extraction, candidates, and decision metadata.

REVIEW

Admin Decision

Operator confirms or rejects the match

Manual review can resolve borderline cases and improve future quality.

REVIEW

Confirmed / Rejected

Final human moderation state

Confirmed items reinforce product links; rejected items stay out of auto-match.

MATCHING

matching.product_aliases

Alias learning for future OCR variants

Confirmed mappings can create aliases to improve later recognition accuracy.

Status Legend

Key state groups used by operations during ingestion, OCR, and moderation.

Submission statuses
DRAFTCOLLECTING_PHOTOSSUBMITTEDPROCESSINGNEEDS_REVIEWCOMPLETEDREJECTED
Gemini / OCR statuses
PENDINGOKERRORUNREADABLE
Match statuses
AUTO_MATCHEDNEED_REVIEWNOT_FOUNDCONFIRMEDREJECTED

Operational Notes

High-signal summary for staff who need the process, not backend code.

  • 1. Submission is the business container. It captures retail, store, user/channel, and completion state.
  • 2. Each uploaded photo creates one batch. One batch can yield multiple OCR raw items from one price tag scene.
  • 3. Matching tries barcode exact match first. If that fails, it builds a shortlist and scores candidates.
  • 4. Gemini rerank is advisory. It helps with ambiguous cases but does not replace admin confirmation.
  • 5. Confirmed decisions can feed alias learning so later OCR variants match faster and with less manual effort.