StatementValidator
public enum StatementValidator
Validates all statements are present in the file system based on meta data in a ledger
-
Gets the root folder from a settings of a ledger
Declaration
Swift
public static func getRootFolder(from ledger: Ledger) throws -> String
Parameters
ledger
ledger to read
Return Value
string with the root folder. Returns nil if none found
-
validate(_:
AsynchronoussecurityScopedRootURL: includeClosedAccounts: includeStartEndDateWarning: includeCurrentStatementWarning: ) Validates all account in a ledger
Declaration
Swift
public static func validate( _ ledger: Ledger, securityScopedRootURL: URL, includeClosedAccounts: Bool, includeStartEndDateWarning: Bool, includeCurrentStatementWarning: Bool ) async throws -> [AccountName: AccountResult]
Parameters
ledger
ledger to get accounts and meta data from
securityScopedRootURL
correctly security scoped root URL. Retrive the security URL with getRootFolder first, get the security scope and then pass it in.
includeClosedAccounts
if accounts already closed in the ledger should be included in the result
includeStartEndDateWarning
if the account opening date from the ledger should be verified against the date of the earliest statement
includeCurrentStatementWarning
if open accounts should be checked for a statement of the last closed period
Return Value
Dictionary of AccountNames to the corresponding AccountResult