5 Commits

Author SHA1 Message Date
shawn 6fd9238f79 fix: GPS never from seed — only from real check-ins
GPS (latitude/longitude) and photo_path are now NEVER set by seed
import pipelines, even if empty. GPS comes only from field tech
check-ins via the main app.

- db_writer.py: FIELDS_NEVER_FROM_SEED set, GPS always None in
  _extract_row_values, skipped in update mode
- sync.py: latitude/longitude set to None in asset_data
- FIELD_MAP.md: updated policy table
2026-06-02 22:56:04 -04:00
shawn 186a9d03f3 fix: seed import update mode fills gaps only — MSFS is primary
Changes  behavior: ALL fields now use ONLY_IF_EMPTY
policy for existing assets. Previously, AUTO fields (name, make, model,
company, place, building_name, floor, etc.) always overwrote existing
data, clobbering MSFS-synced and manually-cleaned records.

- db_writer.py: update() treats every field as 'skip if existing
  value non-null' — same as old PRESERVE behavior but universal
- sync.py: UPDATE path now fetches current values and only sets
  fields that are currently NULL/empty
- New assets (not found by machine_id) still insert with full seed data
- sync.py docstring and stats output updated to reflect new policy

Closes #13 — seed import no longer overwrites MSFS data
2026-06-02 22:51:01 -04:00
shawn 0205866e7a feat: add disney_area column and resort area mapping
- Add DISNEY_AREA_MAP in parser.py mapping 40+ Disney properties to 8 resort areas
- Add disney_area to parse_customer() output, resolver after disney_park
- Update db_writer.py schema: ORDERED_COLUMNS, AUTO_COLUMNS, COLUMN_TYPES
- Add /api/status endpoint query for by_disney_area distribution
- Add area row to web dashboard UI
- Auto-migration adds column to existing databases
2026-05-24 23:36:41 -04:00
shawn af566bc368 Add suite/room/trailer extraction + ID-based class correction
Parser enhancements:
- Add SUITE_PATTERNS: extract Suite, Ste, STE (case-insensitive)
- Add ROOM_PATTERNS: extract Room, RM, Mailroom, Showroom, etc.
- Add TRAILER_PATTERNS: extract Trailer, TRLR, MASH, Safari, etc.
- Add _extract_suite(), _extract_room(), _extract_trailer() functions
- Update _parse_pattern_a() to extract and strip new fields
- Update parse_place() result dict to include suite/room/trailer
- Add correct_class_by_machine_id() post-processing:
  - Bev model in Bev ID range with Snack class → fix to Bev
  - Unknown class in 9x range → set to Bev
  - Unknown class in 6x-7x range → set to Snack
- Update parse_excel() to include new fields and apply correction

DB writer:
- Add suite, room, trailer to ALL_COLUMNS and COLUMN_TYPES
- Add ALTER TABLE migration for existing databases
2026-05-24 23:22:35 -04:00
shawn 457e7794a0 🌱 Complete seed import tool — all 17 kanban tasks done
Modules:
- parser.py: Full Excel parser (1,848 machines, Disney mapping, Pattern A+B parsing)
- db_writer.py: SQLite writer with per-field update policy (seed + update modes)
- backup.py: GPS/photo backup, restore, and compare
- reporter.py: Comprehensive validation report generator
- main.py: CLI entry point

Database: assets.db with 1,848 machines across 36 columns
Handbook: reference_handbook.md v2.0 — all sections finalized
Report: validation_report.md — 184 OCR corrections, 143 unknown machines
2026-05-24 21:50:46 -04:00