20#ifndef ORES_DQ_MESSAGING_PUBLISH_BUNDLE_PROTOCOL_HPP
21#define ORES_DQ_MESSAGING_PUBLISH_BUNDLE_PROTOCOL_HPP
27#include "ores.comms/messaging/message_types.hpp"
28#include "ores.comms/messaging/message_traits.hpp"
29#include "ores.dq/domain/publication_mode.hpp"
31namespace ores::dq::messaging {
37 std::string dataset_code;
38 std::string dataset_name;
40 std::uint64_t records_inserted = 0;
41 std::uint64_t records_updated = 0;
42 std::uint64_t records_skipped = 0;
43 std::uint64_t records_deleted = 0;
44 std::string error_message;
46 std::vector<std::byte> serialize()
const;
47 static std::expected<bundle_dataset_result, ores::utility::serialization::error_code>
48 deserialize(std::span<const std::byte>& data);
75 domain::publication_mode
mode = domain::publication_mode::upsert;
101 std::vector<std::byte>
serialize()
const;
107 ores::utility::serialization::error_code>
193 std::vector<std::byte>
serialize()
const;
199 ores::utility::serialization::error_code>
216 static constexpr message_type request_message_type =
217 message_type::publish_bundle_request;
Contains messaging related infrastructure in the comms library.
Definition assets_protocol.hpp:122
Traits template for mapping request types to their response types and message type enum values.
Definition message_traits.hpp:66
Result for a single dataset within a bundle publication.
Definition publish_bundle_protocol.hpp:36
Request to publish all datasets in a bundle.
Definition publish_bundle_protocol.hpp:61
std::string published_by
Username of person initiating publication.
Definition publish_bundle_protocol.hpp:80
std::string bundle_code
Code of the bundle to publish (e.g., 'base', 'solvaris').
Definition publish_bundle_protocol.hpp:65
std::vector< std::byte > serialize() const
Serialize request to bytes.
Definition publish_bundle_protocol.cpp:98
bool atomic
If true, first failure causes entire bundle to rollback.
Definition publish_bundle_protocol.hpp:88
static std::expected< publish_bundle_request, ores::utility::serialization::error_code > deserialize(std::span< const std::byte > data)
Deserialize request from bytes.
Definition publish_bundle_protocol.cpp:108
domain::publication_mode mode
Publication mode.
Definition publish_bundle_protocol.hpp:75
Response containing results of bundle publication.
Definition publish_bundle_protocol.hpp:116
std::uint32_t datasets_succeeded
Number of datasets successfully published.
Definition publish_bundle_protocol.hpp:138
std::uint64_t total_records_deleted
Total records deleted across all datasets.
Definition publish_bundle_protocol.hpp:168
static std::expected< publish_bundle_response, ores::utility::serialization::error_code > deserialize(std::span< const std::byte > data)
Deserialize response from bytes.
Definition publish_bundle_protocol.cpp:164
std::vector< std::byte > serialize() const
Serialize response to bytes.
Definition publish_bundle_protocol.cpp:139
std::uint32_t datasets_processed
Number of datasets processed.
Definition publish_bundle_protocol.hpp:133
std::uint32_t datasets_skipped
Number of datasets skipped.
Definition publish_bundle_protocol.hpp:148
bool success
Overall success flag.
Definition publish_bundle_protocol.hpp:123
std::uint64_t total_records_inserted
Total records inserted across all datasets.
Definition publish_bundle_protocol.hpp:153
std::uint64_t total_records_updated
Total records updated across all datasets.
Definition publish_bundle_protocol.hpp:158
std::string error_message
Error message if overall publication failed.
Definition publish_bundle_protocol.hpp:128
std::uint64_t total_records_skipped
Total records skipped across all datasets.
Definition publish_bundle_protocol.hpp:163
std::uint32_t datasets_failed
Number of datasets that failed.
Definition publish_bundle_protocol.hpp:143
std::vector< bundle_dataset_result > dataset_results
Per-dataset publication results.
Definition publish_bundle_protocol.hpp:173