Files
Project_Velocity/.Agent Context/Sayan's Docs/Sayan's Ipad docs/Agent_Message.txt
sayan eeb684b46c feat: Ipad app production readiness, Colony orchestration, Social posting (#44)
#38 Ipad app production readiness, Colony orchestration, Social posting

Co-authored-by: Sayan Datta <sayan@Sayans-MacBook-Air.local>
Reviewed-on: sagnik/Project_Velocity#44
2026-05-03 18:30:38 +05:30

98 lines
5.4 KiB
Plaintext

I audited iOS/velocity-ipad/velocity for mock/demo/static/fallback data paths. Good news: I did not find hard-coded fake CRM people, fake properties, fake opportunities, fake calendar events, or fake comms threads being rendered as normal production data. The app is mostly live-backed.
That said, there are still several hard-coded or locally synthesized data paths you should decide whether to move fully behind backend/database contracts.
Production-Risk Mock Or Synthetic Data
SimulatorSunOverlayView.swift (line 8)
Uses fake simulator-only location: San Francisco 37.7749, -122.4194.
Uses mock heading: 0.
Wrapped in #if targetEnvironment(simulator), so it should not run on physical iPad, but it is still mock data in app code.
InventoryView.swift (line 941)
If Building.usdz / Building.scn fails to load, Dollhouse falls back to a procedural synthetic building.
The fallback creates hard-coded rooms, walls, colors, and dimensions at InventoryView.swift (line 975).
For production, this should probably fail closed or fetch a real model reference from backend inventory metadata.
Building.usda (line 1) and Building.usdz
Bundled local 3D building asset with hard-coded cube geometry: Podium, TowerA, TowerB, AmenityDeck, Courtyard.
This is not backend/database-backed property inventory. It is a static app asset.
Frontend-Derived Fallback Data
VelocityAPIClient.swift (line 1538)
VelocityClient360DTO.minimal(from:) fabricates a Client 360 snapshot from a contact when richer Client 360 data is unavailable.
It creates local QD overview fields, empty opportunities/interactions/tasks/interests, and note "Derived from the CRM client-data endpoint."
VelocityAPIClient.swift (line 2725)
If Client 360 decode fails with invalidResponse, the app fetches contacts and builds the minimal local snapshot instead of failing.
VelocityAPIClient.swift (line 1905)
If backend gives QD scores but no recommended actions, the app generates: Review {scoreType} score at {displayScore}.
This is local advisory text, not backend intelligence.
AppStore.swift (line 873)
Dashboard metrics fall back to locally computed canonicalDashboardMetrics(...) if /api/dashboard/metrics fails.
The app computes lead count, whale count, property count, today calendar count, pending insights, etc. locally at AppStore.swift (line 902).
AppStore.swift (line 857)
If contact fetch returns 404, app reuses cached contacts instead of treating backend as source-of-truth unavailable.
AppStore.swift (line 869)
Several failed backend calls silently fall back to empty arrays: kanban, opportunities, properties.
This can make missing backend data look like “zero production data.”
Local Offline Data That Becomes Temporary UI Truth
10. AppStore.swift (line 607)
Offline calendar create generates local IDs like local-{UUID} and local createdAt.
The event is merged into UI before backend confirmation.
AppStore.swift (line 436)
If task mutation happens offline and the task cannot be resolved, app fabricates a local task title: "Queued CRM task" and default priority "normal".
OfflineReplayStore.swift (line 16)
App stores offline replay mutations in local Core Data OfflineReplay.sqlite.
This is valid offline architecture, but if you require strict backend-only truth, this should be treated as a write queue only and clearly marked as “pending sync.”
Hard-Coded Business Vocabularies
13. ClientsView.swift (line 35)
Hard-coded lead statuses: new, contacted, qualified, site_visit_scheduled, etc.
ClientsView.swift (line 48)
Hard-coded urgency values: low, medium, high, critical.
ClientsView.swift (line 49)
Hard-coded buyer types: end_user, hni_end_user, nri_investor, family_office, etc.
ClientsView.swift (line 59)
Hard-coded task priorities: low, normal, high, urgent.
OracleView.swift (line 1001)
Hard-coded canonical lead stages.
OracleView.swift (line 1016)
Hard-coded opportunity stages: prospect, qualified, proposal, site_visit, etc.
ImportsView.swift (line 26)
Hard-coded duplicate policies: create_new, update_existing, skip_duplicate.
InventoryView.swift (line 501)
Hard-coded Dream Weaver room types: bedroom, living room, bathroom, kitchen, etc.
These are sent to the backend as room_type.
Hard-Coded Defaults Affecting Created Backend Data
21. VelocityAPIClient.swift (line 2579)
Communications task creation defaults priority to "normal".
VelocityAPIClient.swift (line 2969)
CSV import upload defaults source_system to "ipad_csv_upload".
CalendarView.swift (line 1118)
Calendar create adds local metadata: created_from = ipad_calendar, surface = velocity_ipad.
Config And Environment Defaults
24. SessionConfiguration.swift (line 16)
Default endpoint prompt/value: https://velocity.desineuron.in/api.
SessionConfiguration.swift (line 17)
Default Dream Weaver endpoint: https://dreamweaver.desineuron.in.
SessionConfigurationPanel.swift (line 74)
Placeholder operator email: operator@desineuron.in.
Verdict
The highest-priority removals for true production purity are:
Remove Dollhouse procedural fallback or move model selection to backend inventory metadata.
Replace hard-coded CRM vocabularies/stages with /api/crm/vocabularies or similar.
Remove Client 360 minimal fallback so malformed/missing backend data fails visibly.
Stop silently converting failed backend reads into empty arrays.
Keep offline replay only as a pending-write queue, not as “truth” without clear pending-sync labeling.
Replace simulator fake Sunseeker data with unavailable-state only, if simulator mock paths must be totally absent.