20#ifndef ORES_ACCOUNTS_REPOSITORY_LOGIN_INFO_REPOSITORY_HPP
21#define ORES_ACCOUNTS_REPOSITORY_LOGIN_INFO_REPOSITORY_HPP
25#include <boost/uuid/uuid.hpp>
26#include <sqlgen/postgres.hpp>
27#include "ores.utility/log/make_logger.hpp"
28#include "ores.database/domain/context.hpp"
29#include "ores.accounts/domain/login_info.hpp"
31namespace ores::accounts::repository {
38 inline static std::string_view logger_name =
39 "ores.accounts.repository.login_info_repository";
41 [[nodiscard]]
static auto& lg() {
43 static auto instance = make_logger(logger_name
60 void write(
const std::vector<domain::login_info>& login_infos);
71 std::vector<domain::login_info>
read();
72 std::vector<domain::login_info>
read(
const boost::uuids::uuid& account_id);
78 void remove(
const boost::uuids::uuid& account_id);
Implements logging for ORE Studio.
Definition lifecycle_manager.hpp:30
Represents login tracking and security information for an account.
Definition login_info.hpp:32
Reads and writes login tracking information off of data storage.
Definition login_info_repository.hpp:36
std::vector< domain::login_info > read()
Reads login information, possibly filtered by account ID.
Definition login_info_repository.cpp:84
void update(const domain::login_info &login_info)
Updates existing login information in database.
Definition login_info_repository.cpp:60
void write(const std::vector< domain::login_info > &login_infos)
Writes login information to database (insert only).
Definition login_info_repository.cpp:46
std::string sql()
Returns the SQL created by sqlgen to construct the table.
Definition login_info_repository.cpp:38
void remove(const boost::uuids::uuid &account_id)
Removes login information for a specific account.
Definition login_info_repository.cpp:112
Context for the operations on a postgres database.
Definition context.hpp:30