# Catalog Platform TODO

- [x] Implement Stock Replenishment through receiving and discrepancy closure.
- [ ] Complete physical tablet happy-path and variance QA before release artifacts.

- Connect the authoritative accounting ledger and enforce `credit limit - authoritative outstanding` through the customer credit service boundary.

## Completed

- [x] Documentation folder
- [x] Backup scripts
- [x] Removed old .bak files
- [x] Mobile API routes
- [x] Mobile login API
- [x] Mobile token authentication
- [x] Mobile dashboard API
- [x] Mobile boxes API
- [x] Mobile box items API
- [x] Mobile barcode product lookup API

## Next - Flutter

- [ ] Connect Flutter login to /api/mobile/login
- [ ] Store mobile token securely
- [ ] Auto-login if token exists
- [ ] Load dashboard stats from /api/mobile/dashboard
- [ ] Load boxes from /api/mobile/boxes
- [ ] Load box items from /api/mobile/boxes/{id}/items
- [ ] Add barcode scanner

## Later

- [ ] Offline mode
- [ ] Order picking
- [ ] Customer orders
- [ ] Push notifications
- [ ] GPS tracking

## Next - Inventory Check Flutter

- [ ] Build Flutter Inventory Check page.
- [ ] Start inventory check from mobile.
- [ ] Mark item correct/wrong/missing.
- [ ] Show progress percentage.
- [ ] Finish check from mobile.

<!-- SNYT_TODO_BASELINE_START -->

## Current Approved Development Queue - 2026-08-08

### 1. RMA / Customer Returns

- [ ] Document the real operational workflow before coding
- [ ] Define statuses and permissions
- [ ] Separate RMA from sellable stock
- [ ] Define warehouse handover
- [ ] Define export / PDF requirements
- [ ] Laravel implementation
- [ ] Flutter implementation
- [ ] Testing
- [ ] Documentation update

### 2. Incremental Warehouse Stock Receiving

- [ ] Review warehouse PDF format
- [ ] Define manual receiving
- [ ] Define PDF-assisted receiving
- [ ] Define product matching review
- [ ] Define duplicate receipt protection
- [ ] Confirm stock movement behavior
- [ ] Laravel implementation
- [ ] Flutter implementation
- [ ] Testing
- [ ] Documentation update

### 3. Cash / On Account Pricing

- [ ] Add invoice type
- [ ] Add Laravel Cash-discount setting
- [ ] Add enable / disable option
- [ ] Add configurable percentage
- [ ] Current intended default: 5%
- [ ] Exclude Clearance
- [ ] Preserve historical pricing snapshot
- [ ] Verify VAT-inclusive calculations
- [ ] Testing
- [ ] Documentation update

### 4. Invoice Editing

- [ ] Define editable statuses
- [ ] Add products
- [ ] Remove products
- [ ] Change quantities
- [ ] Apply stock differences only
- [ ] Prevent duplicate deduction / reversal
- [ ] Preserve revision history
- [ ] Testing
- [ ] Documentation update

### 5. Flutter Release Builder

- [ ] Semantic version increment
- [ ] Build-number increment
- [ ] APK
- [ ] AAB
- [ ] IPA / unsigned IPA as applicable
- [ ] Android signing verification
- [ ] Checksums
- [ ] Release report / QA checklist
- [ ] Previous release archive
- [ ] Source rollback archive
- [ ] Duplicate-version protection
- [ ] Documentation update

## Known Issues / Continuous Review

- [ ] Keep API documentation synchronized with `routes/api.php`.
- [ ] Keep database documentation synchronized with migrations.
- [ ] Keep the Flutter documentation snapshot synchronized after important Flutter changes.
- [ ] Continue phone and tablet responsive testing.
- [ ] Continue validating mixed-fulfillment item counts in print and My Orders.

<!-- SNYT_TODO_BASELINE_END -->

<!-- SNYT_RETURNS_RMA_TODO_V1_START -->
## Returns / RMA QA Queue

- [ ] Run Laravel migration in production after backup.
- [ ] Confirm RMA stock never appears as sellable catalog stock.
- [ ] Confirm resellable return does not increase sellable stock before accountant approval.
- [ ] Confirm accountant approval increases resellable stock exactly once.
- [ ] Confirm direct exchange adds the defective unit to RMA and deducts replacement stock exactly once.
- [ ] Confirm opening RMA reclassification keeps physical total unchanged.
- [ ] Confirm edited returns correctly reverse/reapply stock effects.
- [ ] Confirm handover dispatch removes RMA from in-van RMA stock.
- [ ] Confirm rejected warehouse quantity returns to salesman RMA stock.
- [ ] Confirm A4 PDF grouping/signatures on real printer.
- [ ] Run `flutter analyze` and device tests on Android phone + tablet.
<!-- SNYT_RETURNS_RMA_TODO_V1_END -->
## Returns / RMA

- [x] Correct selected-item warehouse handover contract.
- [x] Require saved customer for standard returns.
- [x] Validate accounting items and customer invoice ownership.
- [ ] Add automated feature coverage for all Returns stock workflows.
- [ ] Add explicit Draft / Submit / Reject actions and RMA stock list API.
## Explicit Return workflow validation

- [x] Add focused PHPUnit test source for eight workflow safety scenarios.
- [ ] Run PHPUnit in a development installation containing Composer dev dependencies; production intentionally has no `artisan test` command.
## RMA Stock verification

- [x] Add focused feature test source.
- [ ] Run `RmaStockApiTest` in a development installation with Composer dev dependencies.
## Future mobile one-hand UX review

Evaluate the Stock Receipts scan → quantity → add → immediate next-scan pattern for Inventory Check, Returns, Orders, Product scanning, and Stock Replenishment in a separate approved phase. No global navigation refactor is part of Stock Receipts v1.
- [ ] Future: integrate operational Visit Collections with the authoritative Customer Ledger when that module is approved.
- [ ] Future: add Smart Route optimization/geofencing/live tracking; v1 intentionally uses manual ordering and optional GPS only.
