13#include "reusex/core/ProjectDB.hpp"
14#include "reusex/core/materialepas_traits.hpp"
72std::vector<ResourceKey>
73key_catalogue(
const std::vector<ProjectDB::PropertyDefinition> &columns);
84 : std::invalid_argument(message), key_(std::move(
key)) {}
85 const std::string &
key() const noexcept {
return key_; }
106std::optional<std::string>
108 const std::optional<std::string> &value);
KeyValueError(std::string key, const std::string &message)
const std::string & key() const noexcept
PropertyType
Property type enumeration for MaterialPassport serialization.
Wire form of one stored report PDF version — the ReportPdfVersion schema in ruxd's API contract (docs...
std::vector< ResourceKey > builtin_keys()
the 11 sys: keys, spec order
KeySource
Where a key's value lives.
std::vector< ResourceKey > key_catalogue(const std::vector< ProjectDB::PropertyDefinition > &columns)
Built-in, then leksikon, then user columns (in the given order) — the "catalogue order" template cate...
constexpr std::string_view kBuiltinCategory
std::optional< std::string > normalise_value(const ResourceKey &key, const std::optional< std::string > &value)
Validate value for key and return it normalised for storage (numbers with '.
const ResourceKey * find_key(const std::vector< ResourceKey > &catalogue, std::string_view id)
nullptr when id is not in catalogue.
auto to_string(Material value) -> std::string_view
Convert Material enum to its string identifier.
std::vector< std::string > leksikon_categories()
Distinct categories of leksikon_fields(), in order.
KeyScope
What a write changes: the survey type (all its parts) or the one part.
std::vector< ResourceKey > leksikon_keys()
constexpr std::string_view kColumnCategory
ResourceKey column_key(const ProjectDB::PropertyDefinition &def)
std::vector< LeksikonField > leksikon_fields()
Nested object-array fields (dangerous substances, emissions) are skipped: they are rows,...
std::optional< double > parse_number(std::string_view text)
Finite number with '.
std::string format_number(double v)
Shortest round-trip text: 290.0 -> "290", 0.1 -> "0.1".
A user-defined column in the Notion-like material editor.
One top-level leksikon property, in leksikon (MaterialEPAS section) order.
traits::PropertyType type
std::string category
== property_definitions.category
std::string field_name
== property_definitions.name_en
std::string guid
leksikon GUID == property_definitions.leksikon_guid
bool integer
Number keys that only take whole numbers (leksikon Integer fields).
std::string unit
"" when none
std::vector< std::string > options
enum / multiselect choices
std::string field
Storage name: the sys name ("quantity"), the leksikon field name_en ("width_mm") or the user column's...
std::string data_type
text | number | enum | multiselect | boolean | date.
std::string id
"sys:<name>" | "lex:<leksikon_guid>" | "col:<column id>"