Poprawki API i panelu admina

This commit is contained in:
2026-05-29 16:27:23 +02:00
parent 583021915a
commit 9b15131461
12 changed files with 390 additions and 58 deletions
+1
View File
@@ -3,6 +3,7 @@ CREATE TABLE IF NOT EXISTS guest_action_queue (
table_id VARCHAR(32) NOT NULL,
message_type ENUM('waiter_call', 'bill_request') NOT NULL,
message_text TEXT NOT NULL,
message_format ENUM('plain', 'html') NOT NULL DEFAULT 'plain' COMMENT 'deprecated — tylko plain; kolumna do usunięcia',
otwierajacy_imie VARCHAR(100) NULL,
otwierajacy_nazwisko VARCHAR(100) NULL,
api_sent TINYINT(1) NOT NULL DEFAULT 0,
@@ -0,0 +1,2 @@
ALTER TABLE guest_action_queue
ADD COLUMN message_format ENUM('plain', 'html') NOT NULL DEFAULT 'plain' AFTER message_text;
@@ -0,0 +1,14 @@
<?php
require_once __DIR__ . '/../config/database.php';
$pdo = getAnalyticsPdo();
$columns = $pdo->query("SHOW COLUMNS FROM guest_action_queue LIKE 'message_format'")->fetch();
if ($columns) {
echo "Kolumna message_format już istnieje.\n";
exit(0);
}
$sql = file_get_contents(__DIR__ . '/guest_action_queue_add_message_format.sql');
$pdo->exec($sql);
echo "Dodano kolumnę message_format.\n";
+2 -2
View File
@@ -38,14 +38,14 @@ $samples = [
[
'table_id' => '12',
'message_type' => 'waiter_call',
'message_text' => '[DEMO] Przywołanie kelnera',
'message_text' => "[DEMO] Przywołanie kelnera",
'otwierajacy_imie' => 'Jan',
'otwierajacy_nazwisko' => 'Kowalski',
],
[
'table_id' => 'taras 5',
'message_type' => 'bill_request',
'message_text' => '[DEMO] Prośba o rachunek | forma płatności: karta | dokument: paragon',
'message_text' => "[DEMO] Prośba o rachunek\nForma płatności: karta\nDokument: paragon",
'otwierajacy_imie' => 'Anna',
'otwierajacy_nazwisko' => 'Nowak',
],