Tasks.md Format¶
Document structure¶
# Tasks: Add Barcode Scanning
## Phase 1: Backend (8h)
### 1.1 API Endpoint
- [x] Create endpoint `GET /api/v1/Product/barcode/{ean}`
- [x] Implement EAN validation
- [x] Add rate limiting
- [x] Write unit tests
### 1.2 Entity Updates
- [x] Add field `scannedAt` to StockReceiptItem
- [x] Add field `scannedById` to StockReceiptItem
- [ ] Database migration
## Phase 2: PWA Application (24h)
### 2.1 Setup
- [ ] Initialize PWA project
- [ ] Service worker for offline
- [ ] Manifest.json
### 2.2 Camera Integration
- [ ] Implement camera API
- [ ] Barcode detection library
- [ ] Permission handling
### 2.3 UI Components
- [ ] Scanner component
- [ ] Result display
- [ ] Error handling UI
- [ ] Sound feedback
### 2.4 Sync Logic
- [ ] Offline queue
- [ ] Sync on reconnect
- [ ] Conflict resolution
## Phase 3: Integration (8h)
### 3.1 EspoCRM Integration
- [ ] New "Scan" button on the form
- [ ] Modal with scanner
- [ ] Auto-fill product
### 3.2 Workflow
- [ ] Trigger after scan
- [ ] Logging for audit
## Phase 4: Testing (8h)
### 4.1 Unit Tests
- [ ] API endpoint tests
- [ ] Validation tests
- [ ] Service tests
### 4.2 E2E Tests
- [ ] Playwright tests (desktop)
- [ ] Mobile test scenarios
### 4.3 UAT
- [ ] Test with warehouse staff
- [ ] Performance test (100 scans/min)
## Phase 5: Documentation (4h)
- [ ] User guide
- [ ] Admin documentation
- [ ] API documentation
- [ ] CHANGELOG update
Progress tracking¶
Progress: ████████░░░░░░░░ 8/16 tasks (50%)
Phase 1: ████████████████ 4/4 (100%) ✅
Phase 2: ░░░░░░░░░░░░░░░░ 0/4 (0%)
Phase 3: ░░░░░░░░░░░░░░░░ 0/2 (0%)
Phase 4: ░░░░░░░░░░░░░░░░ 0/3 (0%)
Phase 5: ░░░░░░░░░░░░░░░░ 0/4 (0%)
Best practices¶
- Tasks are granular (max 4h per task)
- Every task has a clear output
- Mark
[x]immediately after completion - Update progress bar when anything changes
➡️ Continue to Design.md.