7.6 KiB
Server contract: qt_settings
Purpose
qt_settings is a general-purpose key→JSON-value table that the price management
application uses to push configuration into QuoteForge clients. QF reads it during
component sync and caches the result in local_qt_settings (SQLite).
Required MariaDB changes (implemented by server-side agent)
CREATE TABLE IF NOT EXISTS qt_settings (
name VARCHAR(100) NOT NULL PRIMARY KEY,
value TEXT NOT NULL -- JSON-encoded value
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
GRANT SELECT ON RFQ_LOG.qt_settings TO 'qfs_user'@'%';
Settings consumed by QuoteForge
All values are JSON. Missing or unparseable entries are silently skipped; QF falls back to hardcoded defaults for each missing key.
config_types
Defines the available device configuration types, their localized names, and the category codes that are allowed for each type. QF uses this for:
- the new-config modal (button list + labels);
- the configurator's category filter per
config_type.
Value format: JSON array of objects.
[
{
"code": "server",
"name_ru": "Сервер",
"display_order": 10,
"categories": [
"MB","CPU","MEM","RAID",
"SSD","HDD","M2","EDSFF","HHHL",
"GPU","NIC","HCA","DPU","HBA",
"PSU","PS","ACC","RISERS","CARD","BB","SFP"
]
},
{
"code": "storage",
"name_ru": "СХД",
"display_order": 20,
"categories": [
"DKC","CPU","MEM","PS",
"SSD","HDD","M2","EDSFF","HHHL",
"NIC","HBA","HCA","ACC","CARD","SFP"
]
}
]
Fields:
| Field | Type | Description |
|---|---|---|
code |
string | Identifier stored on qt_configurations.config_type. Must be stable. |
name_ru |
string | Display name in Russian for the QF UI. |
display_order |
int | Sort order for the modal button list. |
categories |
string[] | Allowlist of LOT category codes visible in this config type. A category absent from ALL entries is visible in all types. |
tab_config
Defines the configurator tab layout: which tabs exist, which categories each tab contains, optional sub-sections within a tab, and whether the tab uses single-select mode.
Value format: JSON array of tab objects (ordered — defines tab bar order).
[
{
"key": "base",
"label": "Base",
"single_select": true,
"categories": ["MB","CPU","MEM","ENC","DKC","CTL"],
"sections": null
},
{
"key": "storage",
"label": "Storage",
"single_select": false,
"categories": ["RAID","M2","SSD","HDD","EDSFF","HHHL"],
"sections": [
{ "title": "RAID Контроллеры", "categories": ["RAID"] },
{ "title": "Диски", "categories": ["M2","SSD","HDD","EDSFF","HHHL"] }
]
},
{
"key": "pci",
"label": "PCI",
"single_select": false,
"categories": ["GPU","DPU","NIC","HCA","HBA","HIC"],
"sections": [
{ "title": "GPU / DPU", "categories": ["GPU","DPU"] },
{ "title": "NIC / HCA", "categories": ["NIC","HCA"] },
{ "title": "HBA", "categories": ["HBA"] },
{ "title": "HIC", "categories": ["HIC"] }
]
},
{ "key": "power", "label": "Power", "single_select": false, "categories": ["PS","PSU"] },
{
"key": "accessories",
"label": "Accessories",
"single_select": false,
"categories": ["ACC","CARD","SFP"],
"sections": [
{ "title": "Аксессуары", "categories": ["ACC","CARD"] },
{ "title": "Трансиверы", "categories": ["SFP"] }
]
},
{ "key": "sw", "label": "SW", "single_select": false, "categories": ["SW"] }
]
The QF frontend always appends an "other" tab for any categories not listed here.
always_visible_tabs
Tab keys that are always shown in the configurator regardless of whether they contain any items. Other tabs are hidden when empty.
Value format: JSON string array.
["base"]
"Empty" is evaluated after the per-config_type category filter, so with only
base listed a tab such as Storage/PCI shows for a server configuration (its
categories have components) and hides for a type whose allowlist excludes all of
its categories (e.g. networking). Listing a tab here forces it visible for every
config type.
required_categories
Category codes that must have at least one LOT selected for a configuration to
be considered complete. Keyed by config_type code. QF uses this to show a
badge on the tab label when required categories are missing.
Value format: JSON object mapping config_type code → string array.
{
"server": ["CPU", "MEM", "BB"],
"storage": ["DKC", "CPU", "MEM"]
}
support_pricing
Price data from "Регламент расчёта стоимости технической поддержки серверов", used by the Base tab's support-level picker to display a computed price next to the chosen support code. This is reference/quoting data only — QF never adds it as a cart line or configuration cost; see 02-architecture.md.
x86 is a percent of sale price (QF approximates sale price as the configuration's Estimate
total). HGX platforms (any GPU category component present, classified by chip generation via
lot_name substring) use a fixed multi-year price instead. Both are keyed level -> duration in years (as a JSON string key) -> value; a combination absent from the table is not offered by
the regulation and the picker won't show it.
Value format:
{
"x86_percent": {
"W": {"3": 0.06},
"B": {"1": 0.05, "3": 0.10, "5": 0.14},
"S": {"1": 0.07, "3": 0.13, "5": 0.18},
"P": {"1": 0.12, "3": 0.20, "5": 0.45}
},
"hgx_price": {
"HGX-H200": {
"B": {"1": 28000, "3": 77000, "5": 112000},
"S": {"1": 39500, "3": 98000, "5": 140000},
"P": {"1": 88500, "3": 147000}
},
"HGX-B200": {
"B": {"1": 158500, "3": 230500, "5": 284500},
"S": {"1": 176500, "3": 266500, "5": 332500},
"P": {"1": 232000, "3": 322000}
},
"HGX-B300": {
"B": {"1": 192000, "3": 270000, "5": 328500},
"S": {"1": 211500, "3": 309000, "5": 380500},
"P": {"1": 286000, "3": 383500}
}
}
}
Editing this setting in MariaDB (no QF release needed) changes the price shown by the picker immediately on the next component sync — this is the intended way to keep support pricing current as the regulation evolves.
Backward compatibility
- If
qt_settingsdoes not exist (old server): QF logsWarnduring sync and leaveslocal_qt_settingsempty.GET /api/configurator-settingsthen serves the Go-side defaults (internal/handlers/component.go,default*()) for every setting. No crash, no data loss. - If a specific key is absent from
qt_settings: the same Go-side default is served for that key only. - The Go-side defaults are the only fallback and are not kept in step with the
server — change tabs/categories in
qt_settings, not in code. The configurator page has no JS copy:TAB_CONFIG(except "Other") and the tab buttons are built from the servedtab_config; a config type with noconfig_typesallowlist sees all categories. - Old QF clients that do not know about
local_qt_settingscontinue to use their hardcoded JS constants unchanged.
Note on qt_categories
qt_categories.name and qt_categories.name_ru are being removed.
QF runtime does not depend on them — GetCategories derives Name from the
category code string stored in local_components.