FOSSredder 0.5.0
Loading...
Searching...
No Matches
IContractRepository.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <memory>
9#include <optional>
10#include <string>
11#include <vector>
12
13namespace core::domain {
14class Contract;
15}
16
18
20public:
24 virtual ~IContractRepository() = default;
25
30 virtual void addContract(const std::shared_ptr<core::domain::Contract>& contract) = 0;
31
36 virtual std::vector<std::shared_ptr<core::domain::Contract>> getContracts() const = 0;
37
43 virtual std::optional<std::shared_ptr<core::domain::Contract>> getContractById(const std::string& id) const = 0;
44
49 virtual void removeContract(const std::string& id) = 0;
50
55 virtual void updateContract(const std::shared_ptr<core::domain::Contract>& contract) = 0;
56
61 virtual void upsertContract(const std::shared_ptr<core::domain::Contract>& contract) = 0;
62
66 virtual void clearContracts() = 0;
67
73 virtual std::vector<std::shared_ptr<core::domain::Contract>> getContractsForActor(const std::string& actorId) const = 0;
74
80 virtual std::vector<std::shared_ptr<core::domain::Contract>> getContractsForProperty(const std::string& propertyId) const = 0;
81
87 virtual std::vector<std::string> getActorIdsForContract(const std::string& contractId) const = 0;
88
94 virtual std::vector<std::string> getPropertyIdsForContract(const std::string& contractId) const = 0;
95};
96
97} // namespace core::ports::repositories
virtual std::vector< std::string > getPropertyIdsForContract(const std::string &contractId) const =0
Retrieve property identifiers linked to a contract.
virtual void upsertContract(const std::shared_ptr< core::domain::Contract > &contract)=0
Insert or update a contract.
virtual std::vector< std::shared_ptr< core::domain::Contract > > getContractsForActor(const std::string &actorId) const =0
Retrieve contracts associated with a given actor.
virtual std::vector< std::shared_ptr< core::domain::Contract > > getContracts() const =0
Retrieve all contracts.
virtual std::vector< std::string > getActorIdsForContract(const std::string &contractId) const =0
Retrieve actor identifiers linked to a contract.
virtual std::optional< std::shared_ptr< core::domain::Contract > > getContractById(const std::string &id) const =0
Retrieve a contract by identifier.
virtual void removeContract(const std::string &id)=0
Remove a contract by identifier.
virtual void clearContracts()=0
Remove all contracts.
virtual ~IContractRepository()=default
Destroy the contract repository interface.
virtual void updateContract(const std::shared_ptr< core::domain::Contract > &contract)=0
Update an existing contract.
virtual void addContract(const std::shared_ptr< core::domain::Contract > &contract)=0
Add a new contract.
virtual std::vector< std::shared_ptr< core::domain::Contract > > getContractsForProperty(const std::string &propertyId) const =0
Retrieve contracts associated with a given property.