ores.dq.badge_definition

Table of Contents

The badge catalogue. Each entry defines the complete visual presentation of a badge: display label, tooltip, background colour, text colour, severity level, and an optional Bootstrap CSS class hint for Wt.

Badge definitions are the single source of truth for all badge visual metadata across Qt and Wt. They are loaded at client startup as reference data and looked up at render time via BadgeCache.

Flags

Primary key

Unique badge definition code.

Examples: 'active', 'locked', 'fsm_draft', 'login_online'.

Natural keys

name

Display label shown inside the badge.

std::string(faker::word::adjective())

Columns

description

Tooltip text explaining what this badge represents.

std::string(faker::lorem::sentence())

background_colour

Badge background colour as a hex string.

Example: '#22c55e'.

std::string("#") + faker::string::hexadecimal(6, faker::HexCasing::Lower, faker::HexPrefix::NoPrefix)

text_colour

Badge text colour as a hex string.

Default is '#ffffff' (white). May vary for light-background badges.

std::string("#ffffff")

severity_code

Severity classification for this badge.

Soft FK to ores_dq_badge_severities_tbl. Bootstrap-aligned codes: secondary, info, success, warning, danger, primary.

std::string("secondary")

css_class

Optional Bootstrap CSS class hint for Wt rendering.

Example: 'badge bg-success'. Qt ignores this field. Nullable — Wt falls back to inline style from background_colour/text_colour when absent.

std::optional<std::string>{}

display_order

Order for UI display purposes.

faker::number::integer(1, 100)

SQL

Flags

C++

Flags

Repository

Domain includes

#include <chrono>
#include <optional>
#include <string>

Entity includes

#include <optional>
#include <string>
#include "sqlgen/Timestamp.hpp"

Conventions

Table display

column header
code Code
name Name
background_colour Background
text_colour Text
severity_code Severity
display_order Order
modified_by Modified By
version Version

Qt

Columns (Qt model)

enum_name field header type width
Code code Code string 150
Name name Name string 150
Description description Description string 250
BackgroundColour background_colour Background string 100
TextColour text_colour Text string 80
SeverityCode severity_code Severity string 100
DisplayOrder display_order Order int 80
Version version Version int 80
ModifiedBy modified_by Modified By string 120
RecordedAt recorded_at Recorded At timestamp 150

Custom repository methods

See also

  • ores.dq — component group overview.

Emacs 29.3 (Org mode 9.6.15)