38 void rename(std::string value);
49 void setType(std::string value);
115 void recordAliasHit(std::string value, std::string timestamp = {});
121 [[nodiscard]]
bool hasName() const noexcept;
128 [[nodiscard]]
bool hasAlias(const std::
string& value) const;
134 [[nodiscard]] std::
size_t aliasCount() const noexcept;
140 [[nodiscard]]
bool hasAliases() const noexcept;
195 [[nodiscard]] std::
size_t actorCount() const noexcept;
207 [[nodiscard]]
bool hasType() const noexcept;
228 static
void normalizeIds(std::vector<std::
string>& values) {
229 std::vector<std::string> unique;
230 unique.reserve(values.size());
231 for (
auto& value : values) {
233 if (value.empty())
continue;
234 if (std::find(unique.begin(), unique.end(), value) != unique.end())
continue;
235 unique.push_back(value);
237 values = std::move(unique);
243 std::string allocatableMode_ =
"mixed";
244 std::vector<std::string> actorIds_;
245 std::vector<std::string> propertyIds_;
246 std::vector<Alias> aliases_;
247 std::string createdAt_;
248 std::string updatedAt_;
252 [[nodiscard]]
const std::string&
id() const noexcept;
253 [[nodiscard]] const std::
string&
name() const noexcept;
254 [[nodiscard]] const std::
string&
type() const noexcept;
256 [[nodiscard]] const std::vector<std::
string>&
actorIds() const noexcept;
257 [[nodiscard]] const std::vector<std::
string>&
propertyIds() const noexcept;
258 [[nodiscard]] const std::vector<Alias>&
aliases() const noexcept;
259 [[nodiscard]] const std::
string&
createdAt() const noexcept;
260 [[nodiscard]] const std::
string&
updatedAt() const noexcept;
263 void setId(std::
string value);
Domain model for entity aliases.
Shared alias normalization and ranking helpers for core entities.
Value object for contract type labels.
Small value object for normalized entity display names.
void setAliases(std::vector< Alias > value)
std::size_t relationCount() const noexcept
Returns the total number of linked relations.
bool hasAlias(const std::string &value) const
Checks whether an alias exists on the contract.
Contract(Contract &&)=delete
Contract(const Contract &)=delete
const std::vector< Alias > & aliases() const noexcept
bool hasRelations() const noexcept
Checks whether the contract has any relations.
void setType(ContractType value)
Sets the contract type from a normalized value object.
std::size_t propertyCount() const noexcept
Returns the number of linked properties.
bool hasName() const noexcept
Checks whether the contract has a name.
bool hasActorRelations() const noexcept
Checks whether any actor relations exist.
void clearAliases()
Clears all aliases from the contract.
void addAlias(Alias value)
Adds a normalized alias when it is not already present.
void setId(std::string value)
std::size_t actorCount() const noexcept
Returns the number of linked actors.
bool containsActorId(const std::string &value) const
Checks whether an actor id exists.
bool hasType() const noexcept
Checks whether the contract has a type.
bool containsPropertyId(const std::string &value) const
Checks whether a property id exists.
void removeAlias(std::string value)
Removes an alias.
void addActorId(std::string value)
Adds an actor id when it is not already present.
void removePropertyId(const std::string &value)
Removes a property id from the contract.
void clearPropertyIds()
Clears all linked property ids.
bool isConfigured() const noexcept
Checks whether the contract is fully configured.
void clearActorIds()
Clears all linked actor ids.
const std::string & name() const noexcept
void setCreatedAt(std::string value)
Contract & operator=(const Contract &)=delete
const std::string & allocatableMode() const noexcept
void setActorIds(std::vector< std::string > value)
Replaces the linked actor ids with normalized values.
void removeActorId(const std::string &value)
Removes an actor id from the contract.
const std::string & id() const noexcept
bool hasPropertyRelations() const noexcept
Checks whether any property relations exist.
Contract & operator=(Contract &&)=delete
void setUpdatedAt(std::string value)
void setPropertyIds(std::vector< std::string > value)
Replaces the linked property ids with normalized values.
void addPropertyId(std::string value)
Adds a property id when it is not already present.
bool isMatchingReady() const noexcept
Checks whether the contract is ready for matching.
void recordAliasHit(std::string value, std::string timestamp={})
Records a usage hit for an alias.
std::size_t aliasCount() const noexcept
Returns the number of aliases.
const std::string & updatedAt() const noexcept
bool hasAliases() const noexcept
Checks whether the contract has any aliases.
const std::string & type() const noexcept
void rename(EntityName value)
Renames the contract with normalized entity text.
bool hasSingleActor() const noexcept
Checks whether the contract has exactly one actor.
void setAllocatableMode(std::string value)
const std::vector< std::string > & actorIds() const noexcept
bool isStandalone() const noexcept
Checks whether the contract has no actor or property links.
const std::string & createdAt() const noexcept
const std::vector< std::string > & propertyIds() const noexcept
std::string trimCopy(std::string value)
Trims leading and trailing whitespace from text.