FOSSredder 0.5.0
Loading...
Searching...
No Matches
TransactionPolicy.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <string>
9#include <vector>
10#include <algorithm>
11#include <cctype>
12#include <utility>
13
16
18
24std::string trimCopy(std::string value);
25
31bool hasValidBookingDate(const std::string& value);
32
38bool hasValidAmount(double value);
39
45bool hasStatementAssignment(const std::string& statementId);
46
52std::string normalizeText(std::string value);
53
59std::string normalizeId(std::string value);
60
65void normalizeIds(std::vector<std::string>& values);
66
74bool canFinalizeFromDraft(const std::string& bookingDate,
75 double amount,
76 const std::string& statementId);
77
84bool statusCanAdvance(int current, int next);
85
91bool hasPropertyIds(const std::vector<std::string>& propertyIds);
92
93} // namespace core::domain::policies::transaction
Value object for normalized booking dates.
Value object for monetary transaction amounts.
bool hasStatementAssignment(const std::string &statementId)
Checks whether a statement id is assigned.
bool statusCanAdvance(int current, int next)
Checks whether a transaction status may advance.
void normalizeIds(std::vector< std::string > &values)
Normalizes and deduplicates relation ids.
bool hasValidBookingDate(const std::string &value)
Checks whether a booking date value is valid.
bool canFinalizeFromDraft(const std::string &bookingDate, double amount, const std::string &statementId)
Checks whether a draft transaction can be finalized.
bool hasValidAmount(double value)
Checks whether a transaction amount value is valid.
bool hasPropertyIds(const std::vector< std::string > &propertyIds)
Checks whether a transaction has any property ids.
std::string normalizeId(std::string value)
Normalizes a relation id.
std::string trimCopy(std::string value)
Trims leading and trailing whitespace from text.
std::string normalizeText(std::string value)
Normalizes free-form transaction text.