Added IdRole for the server generated UUID of the items.

This commit is contained in:
2026-01-29 09:27:50 +01:00
parent bc96a805f8
commit 08c2e3a093
5 changed files with 38 additions and 14 deletions

View File

@ -16,20 +16,21 @@ enum UserRoles {
AmountRole,
FactorRole,
/// helper roles
ToStringRole
ToStringRole,
IdRole
};
static UserRoles DEFAULT_ROLE = NameRole;
static UserRoles DEFAULT_ROLE = NameRole;
// TODO ?rename USER_FACING_ROLES -> MAIN_ROLES ?
static QList<UserRoles> USER_FACING_ROLES = {NameRole, DescriptionRole, InfoRole, AmountRole,
FactorRole};
static QHash<int, QByteArray> ROLE_NAMES = {{NameRole, "Name"},
{DescriptionRole, "Description"},
{InfoRole, "Info"},
{AmountRole, "Amount"},
{FactorRole, "Factor"}};
static QList<UserRoles> STRING_ROLES = {NameRole, DescriptionRole, InfoRole};
static QList<UserRoles> INT_ROLES = {AmountRole};
static QList<UserRoles> DOUBLE_ROLES = {FactorRole};
static QHash<int, QByteArray> ROLE_NAMES = {
{NameRole, "Name"}, {DescriptionRole, "Description"}, {InfoRole, "Info"},
{AmountRole, "Amount"}, {FactorRole, "Factor"}, {ToStringRole, "ToString"},
{IdRole, "id"}};
static QList<UserRoles> STRING_ROLES = {NameRole, DescriptionRole, InfoRole, IdRole};
static QList<UserRoles> INT_ROLES = {AmountRole};
static QList<UserRoles> DOUBLE_ROLES = {FactorRole};
/// JSON keys
static const QString ITEM_KEY_STRING = "items";