Fix agenda report and add MySQL sync for open requests

- 871 test.py: Switch auth from medevio_storage.json to token.txt,
  update MySQL port to 3306, add hyperlinks to Request_ID column,
  add better API error handling
- sync_open_requests.py: New script to sync doneAt/removedAt/updatedAt
  from Medevio API to MySQL for requests incorrectly marked as open
- check_request.py: Diagnostic script to inspect a single request via API
- check_mysql.py: Diagnostic script to inspect a single request in MySQL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 07:44:19 +01:00
parent 7c08ad8e35
commit be0d41ad01
4 changed files with 301 additions and 18 deletions

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Check one request in MySQL."""
import pymysql
import json
DB_CONFIG = {
"host": "192.168.1.76",
"port": 3306,
"user": "root",
"password": "Vlado9674+",
"database": "medevio",
"charset": "utf8mb4",
"cursorclass": pymysql.cursors.DictCursor,
}
REQUEST_ID = "6b46b5a8-b080-4821-86b0-39adabeec86b"
conn = pymysql.connect(**DB_CONFIG)
with conn.cursor() as cur:
cur.execute("SELECT * FROM pozadavky WHERE id = %s", (REQUEST_ID,))
row = cur.fetchone()
conn.close()
if row:
# Convert datetime objects to strings for JSON serialization
for k, v in row.items():
if hasattr(v, 'isoformat'):
row[k] = v.isoformat()
print(json.dumps(row, indent=2, ensure_ascii=False, default=str))
else:
print(f"Not found: {REQUEST_ID}")