20#ifndef ORES_DQ_API_MESSAGING_PUBLISH_BUNDLE_PROTOCOL_HPP
21#define ORES_DQ_API_MESSAGING_PUBLISH_BUNDLE_PROTOCOL_HPP
26#include <rfl/json.hpp>
27#include "ores.dq.api/domain/publication_mode.hpp"
29namespace ores::dq::messaging {
31struct lei_parties_params {
35struct publish_bundle_params {
36 std::vector<std::string> opted_in_datasets;
37 std::optional<lei_parties_params> lei_parties;
38 std::optional<std::string> party_id;
41inline std::string build_params_json(
const publish_bundle_params& params) {
42 return rfl::json::write(params);
45struct bundle_dataset_result {
46 std::string dataset_code;
48 std::string error_message;
49 int records_inserted = 0;
50 int records_updated = 0;
51 int records_skipped = 0;
52 int records_deleted = 0;
55struct publish_bundle_request {
56 using response_type =
struct publish_bundle_response;
57 static constexpr std::string_view nats_subject =
"dq.v1.bundles.publish";
58 std::string bundle_code;
59 ores::dq::domain::publication_mode mode =
60 ores::dq::domain::publication_mode::upsert;
61 std::string published_by;
63 std::string params_json;
66struct publish_bundle_response {
68 std::string error_message;
69 int datasets_succeeded = 0;
70 int total_records_inserted = 0;
71 int total_records_updated = 0;
72 std::vector<bundle_dataset_result> dataset_results;