diff --git a/CHANGELOG.md b/CHANGELOG.md index af674bb..e8346d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ Format mengikuti [Keep a Changelog](https://keepachangelog.com/) dan [Semantic Versioning](https://semver.org/). +## [0.6.10] — 2026-11-06 — "acs-lookup" + +### Diperbaiki +- Lookup perangkat GenieACS kini punya fallback lewat data pelanggan (ID, nomor HP, PPPoE, tag ACS, MAC), sehingga perangkat lebih cepat ditemukan dan dashboard tidak menggantung saat tag/ID tidak cocok. + ## [0.6.9] — 2026-11-06 — "acs-wifi-rx" ### Diperbaiki diff --git a/README.md b/README.md index 1a17282..94e0c1c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@
-
+
diff --git a/package.json b/package.json
index 5b380bc..355a21d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "open-isp",
- "version": "0.6.9",
+ "version": "0.6.10",
"description": "OPEN-ISP \u2014 sistem billing & manajemen ISP open-source (PWA pelanggan, multi-OLT, RADIUS, WhatsApp, QRIS)",
"main": "app-customer.js",
"scripts": {
diff --git a/services/customerDeviceService.js b/services/customerDeviceService.js
index 4ae7b8c..1c86acb 100644
--- a/services/customerDeviceService.js
+++ b/services/customerDeviceService.js
@@ -112,6 +112,34 @@ async function resolveDeviceToken(input) {
const found = await findDeviceWithTagVariants(token);
if (found && found.device && found.device._id) return found.device;
+ // Fallback: cari lewat data pelanggan (ID, HP, PPPoE, tag ACS, atau MAC).
+ try {
+ const db = require('../config/database');
+ const cust = db.prepare(`
+ SELECT pppoe_username, genieacs_tag, mac_address, phone
+ FROM customers
+ WHERE phone = ? OR id = ? OR pppoe_username = ? OR genieacs_tag = ? OR mac_address = ?
+ LIMIT 1
+ `).get(token, token, token, token, token);
+
+ if (cust) {
+ const candidates = Array.from(new Set([
+ cust.pppoe_username, cust.genieacs_tag, cust.mac_address, cust.phone
+ ].map(v => String(v || '').trim()).filter(v => v && v !== token)));
+
+ for (const cand of candidates) {
+ const byPppoe = await findDeviceByPppoe(cand);
+ if (byPppoe && byPppoe._id) return byPppoe;
+ const byTag = await findDeviceByTag(cand);
+ if (byTag && byTag._id) return byTag;
+ const variant = await findDeviceWithTagVariants(cand);
+ if (variant && variant.device && variant.device._id) return variant.device;
+ }
+ }
+ } catch (e) {
+ logger.debug(`[resolveDeviceToken] Customer DB fallback error: ${e.message}`);
+ }
+
return null;
}
diff --git a/version.txt b/version.txt
index 1864002..b976b13 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-0.6.9
\ No newline at end of file
+0.6.10
\ No newline at end of file