Skip to content

Phase 2A-1: Update ItemTag schema to Rails API v2#29

Merged
dadachi merged 1 commit intosubstrate-v2from
substrate-v2--phase2a-1-ios-paid-itemtag-schema
Apr 24, 2026
Merged

Phase 2A-1: Update ItemTag schema to Rails API v2#29
dadachi merged 1 commit intosubstrate-v2from
substrate-v2--phase2a-1-ios-paid-itemtag-schema

Conversation

@dadachi
Copy link
Copy Markdown
Contributor

@dadachi dadachi commented Apr 24, 2026

Summary

  • Free-Android port of nativeapptemplate/NativeAppTemplate-Android#38.
  • Updates Android to the Rails API v2 ItemTag schema (name, description, position; removes queue_number, scan_state, customer_read_at, already_completed).
  • Data layer only — Scan/NFC code is kept and adapted to compile against the new schema. Full Scan/NFC deletion is Phase 2A-2, UI rewrite is 2A-3, further test work is 2A-4.
  • Mirrors iOS PR nativeapptemplate/NativeAppTemplate-iOS#49.

Key changes

  • item_tag_data.proto: queue_numbername; add description, position; reserve fields 5/7/11 (scan_state/customer_read_at/already_completed).
  • Model: Attributes/Data/ItemTag/Shop/ItemTagData/ItemTagBodyDetail renamed queueNumbername; added description/position; dropped scanState, customerReadAt, alreadyCompleted, displayShopServerPath.
  • Meta.maximumQueueNumberLength default 0256 so the meta field is optional (matches iOS).
  • ItemTagCreateViewModel / ItemTagEditViewModel: queueNumbername; hasInvalidDataQueueNumberhasInvalidDataName; updateQueueNumberupdateName.
  • Removed production call sites of deleted fields in ShowTagInfoScanResultView, ScanViewModel, ShopDetailCardView, ShopDetailView — each flagged with a // TODO: removed in Phase 2A-2 marker so reviewers can trace the intentional behavior regression back to the schema change.
  • Deleted NumberTagsWebpageListView(Model) entirely and removed the navigation wiring / ShopSettings entry.
  • Updated test fixtures (item_tag.json, item_tags.json) and affected unit tests. ScanViewModelTest deleted ahead of 2A-2. NumberTagsWebpageListViewModelTest removed.

Test plan

  • ./gradlew assembleDebugBUILD SUCCESSFUL
  • ./gradlew testBUILD SUCCESSFUL
  • ./gradlew spotlessCheckBUILD SUCCESSFUL
  • Manual smoke test: launch app, browse ItemTag list / detail / create / edit — no crash
  • ./gradlew lint

🤖 Generated with Claude Code

Free-Android port of [nativeapptemplate/NativeAppTemplate-Android#38](nativeapptemplate/NativeAppTemplate-Android#38).

Updates the ItemTag schema to match the Rails API v2:
- rename queue_number -> name
- add description, position
- remove scan_state, customer_read_at, already_completed, display_shop_server_path

Data layer only — Scan/NFC code is kept and adapted to compile against
the new schema. Full Scan/NFC deletion is Phase 2A-2, UI rewrite is
2A-3, further test work is 2A-4.

Key changes
- item_tag_data.proto: queue_number -> name; reserve 5/7/11; add
  description and position.
- Model (Attributes/Data/ItemTag/Shop/ItemTagData/ItemTagBodyDetail):
  field renames; added getName/getDescription/getPosition; dropped
  getScanState/getCustomerReadAt/getAlreadyCompleted/getDisplayShopServerPath.
- Meta.maximumQueueNumberLength default 0 -> 256 so the meta field is
  optional (matches iOS).
- ItemTagCreateViewModel / ItemTagEditViewModel: queueNumber -> name;
  hasInvalidDataQueueNumber -> hasInvalidDataName; updateQueueNumber ->
  updateName.
- Removed production call sites of deleted fields in
  ShowTagInfoScanResultView, ScanViewModel, ShopDetailCardView,
  ShopDetailView — each flagged with a // TODO: removed in Phase 2A-2
  marker.
- Deleted NumberTagsWebpageListView(Model) entirely and removed the
  navigation wiring / ShopSettings entry.
- Updated test fixtures (item_tag.json, item_tags.json) and affected
  unit tests. ScanViewModelTest deleted ahead of 2A-2.
  NumberTagsWebpageListViewModelTest removed.

Verified locally: ./gradlew assembleDebug, test, spotlessCheck all
BUILD SUCCESSFUL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dadachi dadachi merged commit ba89b56 into substrate-v2 Apr 24, 2026
1 check passed
@dadachi dadachi deleted the substrate-v2--phase2a-1-ios-paid-itemtag-schema branch April 24, 2026 22:22
dadachi added a commit that referenced this pull request Apr 25, 2026
* Phase 2A-1: Update ItemTag schema to Rails API v2 (#29)

Free-Android port of [nativeapptemplate/NativeAppTemplate-Android#38](nativeapptemplate/NativeAppTemplate-Android#38).

Updates the ItemTag schema to match the Rails API v2:
- rename queue_number -> name
- add description, position
- remove scan_state, customer_read_at, already_completed, display_shop_server_path

Data layer only — Scan/NFC code is kept and adapted to compile against
the new schema. Full Scan/NFC deletion is Phase 2A-2, UI rewrite is
2A-3, further test work is 2A-4.

Key changes
- item_tag_data.proto: queue_number -> name; reserve 5/7/11; add
  description and position.
- Model (Attributes/Data/ItemTag/Shop/ItemTagData/ItemTagBodyDetail):
  field renames; added getName/getDescription/getPosition; dropped
  getScanState/getCustomerReadAt/getAlreadyCompleted/getDisplayShopServerPath.
- Meta.maximumQueueNumberLength default 0 -> 256 so the meta field is
  optional (matches iOS).
- ItemTagCreateViewModel / ItemTagEditViewModel: queueNumber -> name;
  hasInvalidDataQueueNumber -> hasInvalidDataName; updateQueueNumber ->
  updateName.
- Removed production call sites of deleted fields in
  ShowTagInfoScanResultView, ScanViewModel, ShopDetailCardView,
  ShopDetailView — each flagged with a // TODO: removed in Phase 2A-2
  marker.
- Deleted NumberTagsWebpageListView(Model) entirely and removed the
  navigation wiring / ShopSettings entry.
- Updated test fixtures (item_tag.json, item_tags.json) and affected
  unit tests. ScanViewModelTest deleted ahead of 2A-2.
  NumberTagsWebpageListViewModelTest removed.

Verified locally: ./gradlew assembleDebug, test, spotlessCheck all
BUILD SUCCESSFUL.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Phase 2A-2: Remove NFC / QR / Scan

Mirrors NativeAppTemplate-Android PR #39 (which itself mirrors iOS PR #50).
After this, the app is a generic CRUD shell with Shops and Settings tabs;
ItemTagDetailView is a placeholder (name, description, state, completedAt).

### Deletions
- NfcError; ItemTagWriteView/VM + test
- ui/scan/* (ScanView, ScanViewModel, DoScanView, DoScanViewModel,
  CompleteScanResultView, ShowTagInfoScanResultView, ScanNavigation)
  + DoScanViewModelTest
- Models: CompleteScanResult, CompleteScanResultType, ShowTagInfoScanResult,
  ShowTagInfoScanResultType, ItemTagInfoFromNdefMessage, ItemTagType,
  ScanState, ItemTagData
- Proto schemas: scan_result.proto, item_tag_data.proto,
  item_tag_info_from_ndef_message.proto
- res/raw/nfc_reader.json

### Strip / rewrite
- MainActivity: dropped NFC imports, onNewIntent, ACTION_NDEF_DISCOVERED
  handling, singleTask launch mode
- MainActivityViewModel: rewritten minimal (logout + permissions refresh +
  didShowTapShopBelowTip)
- NatAppState / NatNavHost / TopLevelDestination: dropped SCAN_TAB,
  shouldNavigateToScanView flow, navigateToScan helper, scan nav graph
- ShopDetailView / VM: dropped queue instructions block, ReadInstructionsTip,
  didShowReadInstructionsTip; renamed resetItemTag -> idleItemTag and swipe
  action "Reset" -> "Idle" (width 64dp -> 96dp)
- ShopSettingsView / VM: removed the "Reset Number Tags" section, resetShop
  flow
- ItemTagDetailView / VM: placeholder (name, description, state, completedAt)
- LoginRepository (+ Impl) / NatPreferencesDataSource: dropped scan-related
  setters/getters, didShowReadInstructionsTip
- ShopRepository / ShopApi / Impl: dropped resetShop
- ItemTagApi / Repository / Impl: renamed resetItemTag (/reset) ->
  idleItemTag (/idle)
- Utility: dropped scanUri(), extractItemTagInfoFrom(), NFC imports
- NatConstants: dropped SCAN_PATH, SCAN_PATH_CUSTOMER
- UserData: dropped didShowReadInstructionsTip,
  scanViewSelectedTabIndex, shouldFetchItemTagForShowTagInfoScan,
  shouldCompleteItemTagForCompleteScan
- shopSettingsNavigation: dropped ItemTagWriteRoute / itemTagWriteView
- Demo / test repos updated to match trimmed interfaces; obsolete tests
  removed (UtilityTest scanUri, CodedErrorTest NfcError, ItemTagDetailVMTest
  isLock, ShopDetailVMTest reset/didShowReadInstructionsTip)

### Config
- AndroidManifest.xml: removed NFC permission, android.hardware.nfc feature,
  NDEF_DISCOVERED intent-filter, singleTask launch mode
- build.gradle.kts / libs.versions.toml: removed compose-qr-code, capturable,
  lottie-compose
- user_preferences.proto: removed scan fields
- strings.xml: removed ~25 scan/NFC/QR strings; onboarding descriptions 1-13
  rewritten to generic "Welcome to the app." placeholder so OnboardingView
  still compiles (worth redesigning or deleting in a follow-up)

### Test plan
- [x] ./gradlew assembleDebug passes
- [x] ./gradlew test passes
- [x] ./gradlew spotlessCheck passes
- [x] ./gradlew lint passes
- [x] ./gradlew buildHealth passes
- [ ] Manual smoke test on device/emulator: 2 tabs visible (Shops /
  Settings), no Scan tab; sign-in works; ItemTag create / view detail
  placeholder / edit / delete flows work

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant