ORE Studio 0.0.4
Loading...
Searching...
No Matches
coding_scheme_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_CODING_SCHEME_PROTOCOL_HPP
21#define ORES_DQ_API_MESSAGING_CODING_SCHEME_PROTOCOL_HPP
22
23#include <string>
24#include <string_view>
25#include <vector>
26#include "ores.dq.api/domain/coding_scheme.hpp"
27#include "ores.dq.api/domain/coding_scheme_authority_type.hpp"
28
29namespace ores::dq::messaging {
30
31// =============================================================================
32// Coding Scheme Authority Type Protocol
33// =============================================================================
34
35struct get_coding_scheme_authority_types_request {
36 using response_type = struct get_coding_scheme_authority_types_response;
37 static constexpr std::string_view nats_subject =
38 "dq.v1.coding-scheme-authority-types.list";
39 int offset = 0;
40 int limit = 100;
41};
42
43struct get_coding_scheme_authority_types_response {
44 std::vector<ores::dq::domain::coding_scheme_authority_type>
45 coding_scheme_authority_types;
46 int total_available_count = 0;
47};
48
49struct save_coding_scheme_authority_type_request {
50 using response_type = struct save_coding_scheme_authority_type_response;
51 static constexpr std::string_view nats_subject =
52 "dq.v1.coding-scheme-authority-types.save";
54};
55
56struct save_coding_scheme_authority_type_response {
57 bool success = false;
58 std::string message;
59};
60
61struct delete_coding_scheme_authority_type_request {
62 using response_type = struct delete_coding_scheme_authority_type_response;
63 static constexpr std::string_view nats_subject =
64 "dq.v1.coding-scheme-authority-types.delete";
65 std::vector<std::string> types;
66};
67
68struct delete_coding_scheme_authority_type_response {
69 bool success = false;
70 std::string message;
71};
72
73struct get_coding_scheme_authority_type_history_request {
74 using response_type = struct get_coding_scheme_authority_type_history_response;
75 static constexpr std::string_view nats_subject =
76 "dq.v1.coding-scheme-authority-types.history";
77 std::string type;
78};
79
80struct get_coding_scheme_authority_type_history_response {
81 bool success = false;
82 std::string message;
83 std::vector<ores::dq::domain::coding_scheme_authority_type> history;
84};
85
86// =============================================================================
87// Coding Scheme Protocol
88// =============================================================================
89
90struct get_coding_schemes_request {
91 using response_type = struct get_coding_schemes_response;
92 static constexpr std::string_view nats_subject =
93 "dq.v1.coding-schemes.list";
94 int offset = 0;
95 int limit = 100;
96};
97
98struct get_coding_schemes_response {
99 std::vector<ores::dq::domain::coding_scheme> coding_schemes;
100 int total_available_count = 0;
101};
102
103struct save_coding_scheme_request {
104 using response_type = struct save_coding_scheme_response;
105 static constexpr std::string_view nats_subject =
106 "dq.v1.coding-schemes.save";
108};
109
110struct save_coding_scheme_response {
111 bool success = false;
112 std::string message;
113};
114
115struct delete_coding_scheme_request {
116 using response_type = struct delete_coding_scheme_response;
117 static constexpr std::string_view nats_subject =
118 "dq.v1.coding-schemes.delete";
119 std::vector<std::string> codes;
120};
121
122struct delete_coding_scheme_response {
123 bool success = false;
124 std::string message;
125};
126
127struct get_coding_scheme_history_request {
128 using response_type = struct get_coding_scheme_history_response;
129 static constexpr std::string_view nats_subject =
130 "dq.v1.coding-schemes.history";
131 std::string code;
132};
133
134struct get_coding_scheme_history_response {
135 bool success = false;
136 std::string message;
137 std::vector<ores::dq::domain::coding_scheme> history;
138};
139
140}
141
142#endif
Defines a coding or identification standard used to identify entities.
Definition coding_scheme.hpp:36
Classifies coding schemes by the type of authority that defines them.
Definition coding_scheme_authority_type.hpp:41