13#include "reusex/core/ProjectDB.hpp"
14#include "reusex/core/resource_keys.hpp"
28 std::optional<std::string>
value;
46 const std::optional<std::vector<std::string>> &keys = std::nullopt);
50 const std::optional<std::vector<std::string>> &keys = std::nullopt);
54 std::optional<std::string>
value;
70 const std::vector<ResourceWrite> &writes,
71 const std::optional<std::vector<std::string>> &keys = std::nullopt);
78 const std::optional<std::string> &name = std::nullopt);
101 std::optional<std::vector<std::string>>
options;
Wire form of one stored report PDF version — the ReportPdfVersion schema in ruxd's API contract (docs...
std::optional< std::string > value_of(const Resource &r, std::string_view key)
The value stored under key in r, or nullopt (absent or unset).
ResourcePatchResult patch_resource(ProjectDB &db, std::string_view code, const std::vector< ResourceWrite > &writes, const std::optional< std::vector< std::string > > &keys=std::nullopt)
Validate every write (normalise_value), then apply them in one transaction: type-scoped keys to the s...
SurveyTypeDeletion delete_survey_type(ProjectDB &db, int64_t type_id)
constexpr std::string_view kDesignationField
The leksikon field a hand-added resource's name is stored under.
void delete_column(ProjectDB &db, const std::string &id)
Delete a user column and, in the same transaction, every value stored under its name (logged at warn ...
Resource create_resource(ProjectDB &db, int64_t type_id, const std::optional< std::string > &name=std::nullopt)
A manual part with the next RX code; name becomes its designation.
ProjectDB::PropertyDefinition create_column(ProjectDB &db, ProjectDB::PropertyDefinition def)
Add a user column (def.id is ignored and returned filled in).
std::vector< Resource > list_resources(const ProjectDB &db, const std::optional< std::vector< std::string > > &keys=std::nullopt)
One per survey part, by code.
void delete_resource(ProjectDB &db, std::string_view code)
Delete a part — manual or instance-backed — in one transaction.
ProjectDB::PropertyDefinition update_column(ProjectDB &db, const std::string &id, const ColumnPatch &patch)
A rename moves the stored values in the same transaction.
Resource resource(const ProjectDB &db, std::string_view code, const std::optional< std::vector< std::string > > &keys=std::nullopt)
A user-defined column in the Notion-like material editor.
Sparse update of a user column definition.
std::optional< std::vector< std::string > > options
std::optional< std::string > type
std::optional< int > width
std::optional< std::string > name
std::optional< int > sort_order
std::vector< Resource > siblings
The type's other parts, when a type-scoped key was written (they changed too); empty otherwise.
std::optional< std::string > value
nullopt: not set
std::optional< std::string > value
nullopt clears
bool manual
added by hand: no instance behind it
std::vector< ResourceValue > values
Delete a survey type and every part in it, with delete_resource's rules for each part (tombstones,...
std::size_t instances_dismissed
scan-backed parts, now tombstoned
std::size_t parts_deleted