Introduced new logging system with QInstallMessageHandler. Refactored NetworkService for better modularity and added new methods to handle transaction data. Updated database schema and TransactionDAO to support external transaction ID. Cleaned up and streamlined transaction processing in GetLastDaysHistoryScript.
70 lines
2.0 KiB
SQL
70 lines
2.0 KiB
SQL
CREATE TABLE IF NOT EXISTS devices
|
|
(
|
|
id TEXT PRIMARY KEY,
|
|
status TEXT,
|
|
name TEXT,
|
|
android TEXT,
|
|
screen_width INTEGER,
|
|
screen_height INTEGER,
|
|
battery INTEGER,
|
|
update_time DATETIME,
|
|
timestamp DATETIME DEFAULT (strftime('%d.%m.%Y %H:%M:%S', 'now')),
|
|
image BLOB
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS applications
|
|
(
|
|
id TEXT PRIMARY KEY,
|
|
device_id TEXT,
|
|
pin_code TEXT,
|
|
name TEXT,
|
|
package TEXT,
|
|
status TEXT,
|
|
comment TEXT,
|
|
image BLOB,
|
|
FOREIGN KEY (device_id) REFERENCES devices (id) ON DELETE CASCADE,
|
|
UNIQUE (device_id, name)
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS accounts
|
|
(
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
device_id TEXT,
|
|
app_name TEXT,
|
|
numbers TEXT,
|
|
last_numbers TEXT,
|
|
description TEXT,
|
|
amount REAL,
|
|
update_time DATETIME DEFAULT (strftime('%d.%m.%Y %H:%M:%S', 'now')),
|
|
status TEXT,
|
|
FOREIGN KEY (device_id) REFERENCES devices (id) ON DELETE CASCADE,
|
|
UNIQUE (device_id, app_name, last_numbers)
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS transactions
|
|
(
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
account_id INTEGER,
|
|
external_id INTEGER,
|
|
|
|
amount REAL,
|
|
fee REAL,
|
|
status TEXT,
|
|
type TEXT,
|
|
phone TEXT,
|
|
name TEXT,
|
|
|
|
short_description TEXT,
|
|
updated_short_description TEXT,
|
|
description TEXT,
|
|
updated_description TEXT,
|
|
|
|
bank_name TEXT,
|
|
bank_time TEXT,
|
|
bank_tr_external_id TEXT,
|
|
|
|
update_time DATETIME,
|
|
complete_time DATETIME,
|
|
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
FOREIGN KEY (account_id) REFERENCES accounts (id) ON DELETE CASCADE
|
|
); |