ORE Studio 0.0.4
Loading...
Searching...
No Matches
report_instance.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_REPORTING_DOMAIN_REPORT_INSTANCE_HPP
21#define ORES_REPORTING_DOMAIN_REPORT_INSTANCE_HPP
22
23#include <chrono>
24#include <cstdint>
25#include <optional>
26#include <string>
27#include <boost/uuid/uuid.hpp>
28#include "ores.utility/uuid/tenant_id.hpp"
29
30namespace ores::reporting::domain {
31
44struct report_instance final {
48 int version = 0;
49
54
58 boost::uuids::uuid id;
59
63 std::string name;
64
68 std::string description;
69
73 boost::uuids::uuid party_id;
74
78 boost::uuids::uuid definition_id;
79
83 std::optional<boost::uuids::uuid> fsm_state_id;
84
88 std::int64_t trigger_run_id;
89
93 std::string output_message;
94
98 std::optional<std::chrono::system_clock::time_point> started_at;
99
103 std::optional<std::chrono::system_clock::time_point> completed_at;
104
108 std::string modified_by;
109
113 std::string performed_by;
114
121
125 std::string change_commentary;
126
130 std::chrono::system_clock::time_point recorded_at;
131};
132
133}
134
135#endif
A single execution of a report definition.
Definition report_instance.hpp:44
std::string modified_by
Username of the person who last modified this report instance.
Definition report_instance.hpp:108
std::string change_commentary
Free-text commentary explaining the change.
Definition report_instance.hpp:125
std::string description
Description copied from the report definition at creation time.
Definition report_instance.hpp:68
std::string output_message
Execution log or error message.
Definition report_instance.hpp:93
std::int64_t trigger_run_id
Scheduler trigger run ID that caused this instance to be created.
Definition report_instance.hpp:88
std::optional< std::chrono::system_clock::time_point > completed_at
When execution completed. NULL while running or before start.
Definition report_instance.hpp:103
std::optional< std::chrono::system_clock::time_point > started_at
When execution began. NULL if cancelled before starting.
Definition report_instance.hpp:98
boost::uuids::uuid party_id
Party that owns this report instance (inherited from the definition).
Definition report_instance.hpp:73
std::chrono::system_clock::time_point recorded_at
Timestamp when this version of the record was recorded.
Definition report_instance.hpp:130
std::string name
Human-readable name copied from the report definition at creation time.
Definition report_instance.hpp:63
boost::uuids::uuid definition_id
The report definition that produced this instance.
Definition report_instance.hpp:78
boost::uuids::uuid id
UUID uniquely identifying this report instance.
Definition report_instance.hpp:58
std::optional< boost::uuids::uuid > fsm_state_id
Current FSM state (FK to ores_dq_fsm_states_tbl).
Definition report_instance.hpp:83
int version
Version number for optimistic locking and change tracking.
Definition report_instance.hpp:48
std::string performed_by
Username of the account that performed this action.
Definition report_instance.hpp:113
utility::uuid::tenant_id tenant_id
Tenant identifier for multi-tenancy isolation.
Definition report_instance.hpp:53
std::string change_reason_code
Code identifying the reason for the change.
Definition report_instance.hpp:120
A strongly-typed wrapper around a UUID representing a tenant identifier.
Definition tenant_id.hpp:66
static tenant_id system()
Creates a tenant_id representing the system tenant.
Definition tenant_id.cpp:41