ISI ZIP (UPDATED):
- hypesearch.sql
- sql_patch_device_flow.sql
- config.php
- helpers.php
- device_types.php
- device_check.php
- tasks.php
- order_search_update_flag.php
- coordinate_get.php
- coordinate_update.php
- task_update.php

FLOW BARU APLIKASI:
1. Ambil device type dulu:
   GET /device_types.php

2. Check device / registrasi device:
   - Check saja:
     GET /device_check.php?device_id=DEVICE123
   - Kalau belum ada, insert:
     POST /device_check.php
     {
       "device_id": "DEVICE123",
       "device_name": "Samsung A15",
       "device_type_id": 1
     }

3. Ambil task berdasarkan mapping order_search:
   GET /tasks.php?device_id=DEVICE123
   atau
   GET /tasks.php?device_db_id=5

   Default hanya ambil pending task:
   - flag = 0
   - execute_date <= NOW()

4. Update flag order_search ketika task berhasil dijalankan:
   POST /order_search_update_flag.php
   {
     "id": 10,
     "flag": 1
   }

5. Ambil coordinate berdasarkan device_type:
   GET /coordinate_get.php?device_id=DEVICE123
   atau
   GET /coordinate_get.php?device_type_id=1
   atau
   GET /coordinate_get.php?device_type_id=1&coordinate_name=start

6. Update coordinate berdasarkan device_type:
   POST /coordinate_update.php
   {
     "device_type_id": 1,
     "coordinate_name": "start",
     "x": 177,
     "y": 496
   }

CATATAN PENTING:
- Jalankan sql_patch_device_flow.sql karena tabel device default belum punya device_type_id.
- Endpoint tasks.php sekarang SUDAH ambil dari order_search, bukan dari keyword_tasks langsung.
- keyword_tasks tetap dipakai sebagai master keyword + interval.
- order_search jadi tabel mapping device <-> keyword + jadwal eksekusi.
