feat(manual-batch): require plate number at manual mode start
ci / smoke (push) Canceled after 0s

Legacy manual batch start locked until plate entered:
- POST /api/batch/start manual branch returns 400 missing_plate when
  plate empty (strip + uppercase, no format regex)
- operator + monitoring start modals gain required plate input,
  confirm button disabled until filled
- operator plate tile also shows for manual batches (was do_manual only)
- do_manual unchanged (plate from DOs)
This commit is contained in:
andrew committed 2026-10-02 15:10:13 +07:00
1 parent f621ae86fb
commit 7ad995d8d1
6 files changed
+118 -6

No files matched your search

+11
View File
@@ -472,6 +472,17 @@ def api_batch_start():
expected_sack = sum(int(d.get("expected_sack") or 0) for d in dos)
expected_box = sum(int(d.get("expected_box") or 0) for d in dos)
elif mode == "manual":
# Legacy manual mode: batch start locked until plate entered.
req_data = request.get_json(silent=True) or request.form or {}
plate = str(req_data.get("plate", "")).strip().upper()
if not plate:
return jsonify({
"success": False,
"reason": "missing_plate",
"error": "Plat nomor wajib diisi sebelum batch dimulai.",
}), 400
counting_date = get_counting_date()
batch_num = get_next_batch_number(counting_date)
now_iso = datetime.now().isoformat()