ORE Studio 0.0.4
Loading...
Searching...
No Matches
data_organization_protocol.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_DQ_API_MESSAGING_DATA_ORGANIZATION_PROTOCOL_HPP
21#define ORES_DQ_API_MESSAGING_DATA_ORGANIZATION_PROTOCOL_HPP
22
23#include <string>
24#include <string_view>
25#include <vector>
26#include "ores.dq.api/domain/catalog.hpp"
27#include "ores.dq.api/domain/data_domain.hpp"
28#include "ores.dq.api/domain/methodology.hpp"
29#include "ores.dq.api/domain/subject_area.hpp"
30#include "ores.dq.api/domain/nature_dimension.hpp"
31#include "ores.dq.api/domain/origin_dimension.hpp"
32#include "ores.dq.api/domain/treatment_dimension.hpp"
33
34namespace ores::dq::messaging {
35
36// =============================================================================
37// Catalog Protocol
38// =============================================================================
39
40struct get_catalogs_request {
41 using response_type = struct get_catalogs_response;
42 static constexpr std::string_view nats_subject = "dq.v1.catalogs.list";
43 int offset = 0;
44 int limit = 100;
45};
46
47struct get_catalogs_response {
48 std::vector<ores::dq::domain::catalog> catalogs;
49 int total_available_count = 0;
50};
51
52struct save_catalog_request {
53 using response_type = struct save_catalog_response;
54 static constexpr std::string_view nats_subject = "dq.v1.catalogs.save";
56};
57
58struct save_catalog_response {
59 bool success = false;
60 std::string message;
61};
62
63struct delete_catalog_request {
64 using response_type = struct delete_catalog_response;
65 static constexpr std::string_view nats_subject = "dq.v1.catalogs.delete";
66 std::vector<std::string> codes;
67};
68
69struct delete_catalog_response {
70 bool success = false;
71 std::string message;
72};
73
74struct get_catalog_history_request {
75 using response_type = struct get_catalog_history_response;
76 static constexpr std::string_view nats_subject = "dq.v1.catalogs.history";
77 std::string code;
78};
79
80struct get_catalog_history_response {
81 bool success = false;
82 std::string message;
83 std::vector<ores::dq::domain::catalog> history;
84};
85
86// =============================================================================
87// Data Domain Protocol
88// =============================================================================
89
90struct get_data_domains_request {
91 using response_type = struct get_data_domains_response;
92 static constexpr std::string_view nats_subject = "dq.v1.data-domains.list";
93 int offset = 0;
94 int limit = 100;
95};
96
97struct get_data_domains_response {
98 std::vector<ores::dq::domain::data_domain> domains;
99 int total_available_count = 0;
100};
101
102struct save_data_domain_request {
103 using response_type = struct save_data_domain_response;
104 static constexpr std::string_view nats_subject = "dq.v1.data-domains.save";
106};
107
108struct save_data_domain_response {
109 bool success = false;
110 std::string message;
111};
112
113struct delete_data_domain_request {
114 using response_type = struct delete_data_domain_response;
115 static constexpr std::string_view nats_subject = "dq.v1.data-domains.delete";
116 std::vector<std::string> names;
117};
118
119struct delete_data_domain_response {
120 bool success = false;
121 std::string message;
122};
123
124struct get_data_domain_history_request {
125 using response_type = struct get_data_domain_history_response;
126 static constexpr std::string_view nats_subject = "dq.v1.data-domains.history";
127 std::string name;
128};
129
130struct get_data_domain_history_response {
131 bool success = false;
132 std::string message;
133 std::vector<ores::dq::domain::data_domain> history;
134};
135
136// =============================================================================
137// Methodology Protocol
138// =============================================================================
139
140struct get_methodologies_request {
141 using response_type = struct get_methodologies_response;
142 static constexpr std::string_view nats_subject = "dq.v1.methodologies.list";
143 int offset = 0;
144 int limit = 100;
145};
146
147struct get_methodologies_response {
148 std::vector<ores::dq::domain::methodology> methodologies;
149 int total_available_count = 0;
150};
151
152struct save_methodology_request {
153 using response_type = struct save_methodology_response;
154 static constexpr std::string_view nats_subject = "dq.v1.methodologies.save";
156};
157
158struct save_methodology_response {
159 bool success = false;
160 std::string message;
161};
162
163struct delete_methodology_request {
164 using response_type = struct delete_methodology_response;
165 static constexpr std::string_view nats_subject = "dq.v1.methodologies.delete";
166 std::vector<std::string> codes;
167};
168
169struct delete_methodology_response {
170 bool success = false;
171 std::string message;
172};
173
174struct get_methodology_history_request {
175 using response_type = struct get_methodology_history_response;
176 static constexpr std::string_view nats_subject = "dq.v1.methodologies.history";
177 std::string code;
178};
179
180struct get_methodology_history_response {
181 bool success = false;
182 std::string message;
183 std::vector<ores::dq::domain::methodology> history;
184};
185
186// =============================================================================
187// Subject Area Protocol
188// =============================================================================
189
190struct subject_area_key {
191 std::string name;
192 std::string domain_name;
193};
194
195struct get_subject_areas_request {
196 using response_type = struct get_subject_areas_response;
197 static constexpr std::string_view nats_subject = "dq.v1.subject-areas.list";
198 int offset = 0;
199 int limit = 100;
200};
201
202struct get_subject_areas_response {
203 std::vector<ores::dq::domain::subject_area> subject_areas;
204 int total_available_count = 0;
205};
206
207struct save_subject_area_request {
208 using response_type = struct save_subject_area_response;
209 static constexpr std::string_view nats_subject = "dq.v1.subject-areas.save";
211};
212
213struct save_subject_area_response {
214 bool success = false;
215 std::string message;
216};
217
218struct delete_subject_area_request {
219 using response_type = struct delete_subject_area_response;
220 static constexpr std::string_view nats_subject = "dq.v1.subject-areas.delete";
221 std::vector<subject_area_key> keys;
222};
223
224struct delete_subject_area_response {
225 bool success = false;
226 std::string message;
227};
228
229struct get_subject_area_history_request {
230 using response_type = struct get_subject_area_history_response;
231 static constexpr std::string_view nats_subject = "dq.v1.subject-areas.history";
232 subject_area_key key;
233};
234
235struct get_subject_area_history_response {
236 bool success = false;
237 std::string message;
238 std::vector<ores::dq::domain::subject_area> history;
239};
240
241// =============================================================================
242// Nature Dimension Protocol
243// =============================================================================
244
245struct get_nature_dimensions_request {
246 using response_type = struct get_nature_dimensions_response;
247 static constexpr std::string_view nats_subject = "dq.v1.nature-dimensions.list";
248 int offset = 0;
249 int limit = 100;
250};
251
252struct get_nature_dimensions_response {
253 std::vector<ores::dq::domain::nature_dimension> nature_dimensions;
254 int total_available_count = 0;
255};
256
257struct save_nature_dimension_request {
258 using response_type = struct save_nature_dimension_response;
259 static constexpr std::string_view nats_subject = "dq.v1.nature-dimensions.save";
261};
262
263struct save_nature_dimension_response {
264 bool success = false;
265 std::string message;
266};
267
268struct delete_nature_dimension_request {
269 using response_type = struct delete_nature_dimension_response;
270 static constexpr std::string_view nats_subject = "dq.v1.nature-dimensions.delete";
271 std::vector<std::string> codes;
272};
273
274struct delete_nature_dimension_response {
275 bool success = false;
276 std::string message;
277};
278
279struct get_nature_dimension_history_request {
280 using response_type = struct get_nature_dimension_history_response;
281 static constexpr std::string_view nats_subject = "dq.v1.nature-dimensions.history";
282 std::string code;
283};
284
285struct get_nature_dimension_history_response {
286 bool success = false;
287 std::string message;
288 std::vector<ores::dq::domain::nature_dimension> history;
289};
290
291// =============================================================================
292// Origin Dimension Protocol
293// =============================================================================
294
295struct get_origin_dimensions_request {
296 using response_type = struct get_origin_dimensions_response;
297 static constexpr std::string_view nats_subject = "dq.v1.origin-dimensions.list";
298 int offset = 0;
299 int limit = 100;
300};
301
302struct get_origin_dimensions_response {
303 std::vector<ores::dq::domain::origin_dimension> origin_dimensions;
304 int total_available_count = 0;
305};
306
307struct save_origin_dimension_request {
308 using response_type = struct save_origin_dimension_response;
309 static constexpr std::string_view nats_subject = "dq.v1.origin-dimensions.save";
311};
312
313struct save_origin_dimension_response {
314 bool success = false;
315 std::string message;
316};
317
318struct delete_origin_dimension_request {
319 using response_type = struct delete_origin_dimension_response;
320 static constexpr std::string_view nats_subject = "dq.v1.origin-dimensions.delete";
321 std::vector<std::string> codes;
322};
323
324struct delete_origin_dimension_response {
325 bool success = false;
326 std::string message;
327};
328
329struct get_origin_dimension_history_request {
330 using response_type = struct get_origin_dimension_history_response;
331 static constexpr std::string_view nats_subject = "dq.v1.origin-dimensions.history";
332 std::string code;
333};
334
335struct get_origin_dimension_history_response {
336 bool success = false;
337 std::string message;
338 std::vector<ores::dq::domain::origin_dimension> history;
339};
340
341// =============================================================================
342// Treatment Dimension Protocol
343// =============================================================================
344
345struct get_treatment_dimensions_request {
346 using response_type = struct get_treatment_dimensions_response;
347 static constexpr std::string_view nats_subject = "dq.v1.treatment-dimensions.list";
348 int offset = 0;
349 int limit = 100;
350};
351
352struct get_treatment_dimensions_response {
353 std::vector<ores::dq::domain::treatment_dimension> treatment_dimensions;
354 int total_available_count = 0;
355};
356
357struct save_treatment_dimension_request {
358 using response_type = struct save_treatment_dimension_response;
359 static constexpr std::string_view nats_subject = "dq.v1.treatment-dimensions.save";
361};
362
363struct save_treatment_dimension_response {
364 bool success = false;
365 std::string message;
366};
367
368struct delete_treatment_dimension_request {
369 using response_type = struct delete_treatment_dimension_response;
370 static constexpr std::string_view nats_subject = "dq.v1.treatment-dimensions.delete";
371 std::vector<std::string> codes;
372};
373
374struct delete_treatment_dimension_response {
375 bool success = false;
376 std::string message;
377};
378
379struct get_treatment_dimension_history_request {
380 using response_type = struct get_treatment_dimension_history_response;
381 static constexpr std::string_view nats_subject = "dq.v1.treatment-dimensions.history";
382 std::string code;
383};
384
385struct get_treatment_dimension_history_response {
386 bool success = false;
387 std::string message;
388 std::vector<ores::dq::domain::treatment_dimension> history;
389};
390
391}
392
393#endif
Represents a logical grouping of related datasets.
Definition catalog.hpp:39
Represents a high-level classification of data within the system.
Definition data_domain.hpp:41
Describes a methodology for data processing or transformation.
Definition methodology.hpp:33
Classifies datasets by their data nature (actual vs. synthetic).
Definition nature_dimension.hpp:40
Classifies datasets by their origin or source type.
Definition origin_dimension.hpp:40
Represents a subdivision within a data domain.
Definition subject_area.hpp:39
Classifies datasets by their processing treatment level.
Definition treatment_dimension.hpp:41