feat(app): scan-mode sync, confirmation-gated documents, single-pass product classification

Fixes reported from APK field testing: DO/Product scan mode was inconsistent
between the camera drawer and documents screen (now one shared provider,
with an orange/green color cue); unconfirmed scans leaked into history with
placeholder data before the user tapped confirm (backend now gates
GET /documents on a new `confirmed` column, flipped only by PUT); and
Product Scan ran the GPU classifier twice, once at upload and again on
review (now a single pass at upload, persisted and read directly by the
editor). Also removes the unused "Hubungkan ke PO" field and fabricated
PO/SO/DO placeholder values from the Product Scan flow, closes out the
per-document-polling and save-recovery tasks (6.1/6.3), and splits several
touched files to stay under the repo's 256-line guideline.

Full detail in docs/iteration-log.md and backend/docs/iteration-log.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Rafhan Mazaya FathurrahmanandClaude Sonnet 5 committed 2026-07-10 15:19:32 +07:00
1 parent 2febe0c886
commit ada6488592
67 files changed
+5705 -1142

No files matched your search

+11 -2
View File
@@ -1,9 +1,9 @@
import 'dart:io';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class AppConfig {
// ─── API Configuration ────────────────────────────────────────────────────
// ─── API Configuration ────────────────────────────────────────────────────
//
// Dual-Mode Configuration, tried in this order at every app startup:
// 1. Local/LAN backend (fast, low-latency - the common case when the phone
@@ -91,6 +91,8 @@ class AppConfig {
static const String loginEndpoint = '/auth/login';
static const String uploadDocumentEndpoint = '/documents/upload';
static const String fetchDocumentsEndpoint = '/documents';
static const String masterSkusEndpoint = '/master/skus';
static const String scanProductEndpoint = '/scan-product';
// App Constants
@@ -105,6 +107,12 @@ class AppConfig {
static const Color surfaceColor = Colors.white;
static const Color errorColor = Color(0xFFD32F2F);
static const Color successColor = Color(0xFF388E3C);
// DO mode color — orange cue used throughout for the DO Scan mode:
// document_card.dart top-label, documents_tab_switcher.dart active DO tab,
// camera_drawer_mode_toggle.dart DO segment decoration. Formalized as a
// shared constant so all three call sites pull from one place (was an
// ad-hoc Colors.orange.shade700 inline in document_card.dart).
static const Color doModeColor = Color(0xFFF57C00); // == Colors.orange.shade700
// Text Colors
static const Color textPrimary = Color(0xFF212121);
@@ -220,3 +228,4 @@ class AppConfig {
);
}
}