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;
40inline std::string build_params_json(
const publish_bundle_params& params) {
41 return rfl::json::write(params);
44struct bundle_dataset_result {
45 std::string dataset_code;
47 std::string error_message;
48 int records_inserted = 0;
49 int records_updated = 0;
50 int records_skipped = 0;
51 int records_deleted = 0;
54struct publish_bundle_request {
55 using response_type =
struct publish_bundle_response;
56 static constexpr std::string_view nats_subject =
"dq.v1.bundles.publish";
57 std::string bundle_code;
58 ores::dq::domain::publication_mode mode =
59 ores::dq::domain::publication_mode::upsert;
60 std::string published_by;
62 std::string params_json;
65struct publish_bundle_response {
67 std::string error_message;
68 int datasets_succeeded = 0;
69 int total_records_inserted = 0;
70 int total_records_updated = 0;
71 std::vector<bundle_dataset_result> dataset_results;