mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 23:40:40 +02:00
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "token.h"
|
|
#include "subject.h"
|
|
|
|
// constants for output design
|
|
constexpr auto equals = "==================================================================";
|
|
constexpr auto underscore = "__________________________________________________________________";
|
|
constexpr auto dash = "------------------------------------------------------------------";
|
|
constexpr auto tab = "\t";
|
|
|
|
|
|
class Message
|
|
{
|
|
public:
|
|
static QString massageTemplate(QString action, QString item, QString source, QString itemInfo)
|
|
{
|
|
return action + " " + item + " in " + source + ", " + item + ": '" + itemInfo + "'";
|
|
}
|
|
};
|
|
|
|
class Data
|
|
{
|
|
friend class ColnodAPI;
|
|
friend class DatabaseAPI;
|
|
public:
|
|
Data() = default;
|
|
|
|
void clear();
|
|
|
|
void loadTokensFromJson(const QByteArray &data);
|
|
void loadSubjectsFormJson(const QByteArray &data);
|
|
|
|
QHash<QString, std::shared_ptr<Token>> updatedTokens;
|
|
QList<QString> deletedTokens;
|
|
QHash<QString, std::shared_ptr<Subject>> updatedSubjects;
|
|
QList<QString> deletedSubjects;
|
|
};
|
|
|
|
struct PreparedData
|
|
{
|
|
// TODO: make unique_ptr ( neeed because of ColnodAPI )
|
|
std::shared_ptr<Data> databaseData;
|
|
std::shared_ptr<Data> colnodData;
|
|
};
|