11#include "reusex/core/ProjectDB.hpp"
12#include "reusex/core/survey.hpp"
22std::map<int64_t, EnvironmentStatus>
30std::vector<ProjectDB::SurveyPartRecord>
32std::vector<TypeTotals>
Wire form of one stored report PDF version — the ReportPdfVersion schema in ruxd's API contract (docs...
EnvironmentStatus environment_status_of(const ProjectDB &db, int64_t type_id)
ProjectDB::SampleRecord update_sample_checked(ProjectDB &db, int64_t id, const ProjectDB::SamplePatch &patch)
Sample edit with the stage/result rule enforced (validate_sample_state on the merged state).
std::map< int64_t, EnvironmentStatus > environment_statuses(const ProjectDB &db)
SurveySyncReport sync_survey(ProjectDB &db, const SurveySyncOptions &opts={})
Fill survey_types / survey_parts from the instances table: one type per semantic class,...
constexpr std::string_view kDefaultInstanceCloud
Default name of the instance-label cloud sync_survey reads from, and the default SurveySyncOptions::i...
ProjectDB::SurveyTypeRecord set_review_status(ProjectDB &db, int64_t type_id, ReviewStatus status)
Approving a type whose miljøstatus is afventer throws SamplePendingError.
std::vector< ReportSurveyRow > report_survey_rows(const ProjectDB &db)
One row per reportable survey type, in id order, for the PDF report's survey section ("kun godkendte ...
std::vector< ProjectDB::SurveyPartRecord > set_type_quantity(ProjectDB &db, int64_t type_id, double total)
Scales the type's parts to sum to total (redistribute_quantity).
std::vector< TypeTotals > type_totals(const ProjectDB &db)
One survey type as the PDF report's Kortlægning section lists it.
EnvironmentStatus environment
std::optional< double > mass_t
Options for sync_survey — the cloud names it reads from.
std::string semantic_cloud
std::string instances_cloud
Counts of what sync_survey changed.
std::size_t parts_existing
std::size_t links_restored
Instance links put back: instance-backed parts that own a passport (survey_parts.passport_guid) but w...
std::size_t parts_dismissed
Instances skipped because the user deleted their part (tombstoned in survey_dismissed_instances,...
std::size_t parts_orphaned
Parts whose instance_guid no longer resolves to an instance row (the instance was dropped,...
std::vector< std::string > orphaned_codes
std::size_t parts_created
std::size_t instances_seen
Instance rows considered: parts_created + parts_existing + parts_dismissed.
std::size_t types_created
std::size_t instances_backfilled
Instance rows sync wrote first because the cloud had labels but no instances rows: a cloud from befor...