ORE Studio 0.0.4
Loading...
Searching...
No Matches
account_party_service.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_IAM_SERVICE_ACCOUNT_PARTY_SERVICE_HPP
21#define ORES_IAM_SERVICE_ACCOUNT_PARTY_SERVICE_HPP
22
23#include <string>
24#include <vector>
25#include <boost/uuid/uuid.hpp>
26#include "ores.logging/make_logger.hpp"
27#include "ores.database/domain/context.hpp"
28#include "ores.iam.api/domain/account_party.hpp"
29#include "ores.iam.core/repository/account_party_repository.hpp"
30
31namespace ores::iam::service {
32
40private:
41 inline static std::string_view logger_name =
42 "ores.iam.service.account_party_service";
43
44 [[nodiscard]] static auto& lg() {
45 using namespace ores::logging;
46 static auto instance = make_logger(logger_name);
47 return instance;
48 }
49
50public:
52
58 explicit account_party_service(context ctx);
59
63 std::vector<domain::account_party> list_account_parties();
64
70 std::vector<domain::account_party>
71 list_account_parties_by_account(const boost::uuids::uuid& account_id);
72
78 void save_account_party(const domain::account_party& account_party);
79
86 void remove_account_party(const boost::uuids::uuid& account_id,
87 const boost::uuids::uuid& party_id);
88
89private:
91};
92
93}
94
95#endif
Service layer for the IAM module.
Definition auth_session_service.hpp:32
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Context for the operations on a postgres database.
Definition context.hpp:47
Links an IAM account to a party.
Definition account_party.hpp:36
Reads and writes account parties to data storage.
Definition account_party_repository.hpp:36
Service for managing account parties.
Definition account_party_service.hpp:39
std::vector< domain::account_party > list_account_parties()
Lists all account parties.
Definition account_party_service.cpp:32
void save_account_party(const domain::account_party &account_party)
Saves a account party (creates or updates).
Definition account_party_service.cpp:43
void remove_account_party(const boost::uuids::uuid &account_id, const boost::uuids::uuid &party_id)
Removes a account party.
Definition account_party_service.cpp:57
std::vector< domain::account_party > list_account_parties_by_account(const boost::uuids::uuid &account_id)
Lists account parties for a specific account.
Definition account_party_service.cpp:38