C# Class BudgetAnalyser.Engine.Services.ReconciliationService

Inheritance: IReconciliationService, ISupportsModelPersistence
显示文件 Open project: Benrnz/BudgetAnalyser

Public Methods

Method Description
BeforeReconciliationValidation ( LedgerBook book, StatementModel model ) : void

An optional validation method the UI can call before invoking MonthEndReconciliation to test for validation warnings. If validation fails a new ValidationWarningException is thrown; otherwise the method returns.

CancelBalanceAdjustment ( LedgerEntryLine entryLine, System.Guid transactionId ) : void
Close ( ) : void

Closes the currently loaded file. No warnings will be raised if there is unsaved data.

CreateAsync ( ApplicationDatabase applicationDatabase ) : System.Threading.Tasks.Task

Create a new file specific for that service's data.

CreateBalanceAdjustment ( LedgerEntryLine entryLine, decimal amount, string narrative, Account account ) : LedgerTransaction
CreateLedgerTransaction ( LedgerEntryLine reconciliation, LedgerEntry ledgerEntry, decimal amount, string narrative ) : LedgerTransaction
LoadAsync ( ApplicationDatabase applicationDatabase ) : System.Threading.Tasks.Task

Loads a data source with the provided database reference data asynchronously.

MonthEndReconciliation ( LedgerBook ledgerBook, System.DateTime reconciliationDate, IBudgetCurrencyContext budgetContext, StatementModel statement, bool ignoreWarnings ) : LedgerEntryLine
ReconciliationService ( [ reconciliationManager ) : System
RemoveTransaction ( LedgerEntry ledgerEntry, System.Guid transactionId ) : void
SaveAsync ( ApplicationDatabase applicationDatabase ) : System.Threading.Tasks.Task

Saves the application database asynchronously. This may be called using a background worker thread.

SavePreview ( ) : void

Called before Save is called. This will be called on the UI Thread. Objects can optionally add some context data that will be passed to the ISupportsModelPersistence.SaveAsync method call. This can be used to finalise any edits or prompt the user for closing data, ie, a "what-did-you-change" comment; this can't be done during save as it may not be called using the UI Thread.

TransferFunds ( LedgerEntryLine reconciliation, TransferFundsCommand transferDetails ) : void

Transfer funds from one ledger bucket to another. This is only possible if the current ledger reconciliation is unlocked. This is usually used during reconciliation.

UnlockCurrentMonth ( LedgerBook ledgerBook ) : LedgerEntryLine
UpdateRemarks ( LedgerEntryLine entryLine, string remarks ) : void
ValidateModel ( StringBuilder messages ) : bool

Validates the model owned by the service.

Method Details

BeforeReconciliationValidation() public method

An optional validation method the UI can call before invoking MonthEndReconciliation to test for validation warnings. If validation fails a new ValidationWarningException is thrown; otherwise the method returns.
public BeforeReconciliationValidation ( LedgerBook book, StatementModel model ) : void
book BudgetAnalyser.Engine.Ledger.LedgerBook
model BudgetAnalyser.Engine.Statement.StatementModel
return void

CancelBalanceAdjustment() public method

public CancelBalanceAdjustment ( LedgerEntryLine entryLine, System.Guid transactionId ) : void
entryLine BudgetAnalyser.Engine.Ledger.LedgerEntryLine
transactionId System.Guid
return void

Close() public method

Closes the currently loaded file. No warnings will be raised if there is unsaved data.
public Close ( ) : void
return void

CreateAsync() public method

Create a new file specific for that service's data.
public CreateAsync ( ApplicationDatabase applicationDatabase ) : System.Threading.Tasks.Task
applicationDatabase BudgetAnalyser.Engine.Persistence.ApplicationDatabase
return System.Threading.Tasks.Task

CreateBalanceAdjustment() public method

public CreateBalanceAdjustment ( LedgerEntryLine entryLine, decimal amount, string narrative, Account account ) : LedgerTransaction
entryLine BudgetAnalyser.Engine.Ledger.LedgerEntryLine
amount decimal
narrative string
account BudgetAnalyser.Engine.BankAccount.Account
return BudgetAnalyser.Engine.Ledger.LedgerTransaction

CreateLedgerTransaction() public method

public CreateLedgerTransaction ( LedgerEntryLine reconciliation, LedgerEntry ledgerEntry, decimal amount, string narrative ) : LedgerTransaction
reconciliation BudgetAnalyser.Engine.Ledger.LedgerEntryLine
ledgerEntry BudgetAnalyser.Engine.Ledger.LedgerEntry
amount decimal
narrative string
return BudgetAnalyser.Engine.Ledger.LedgerTransaction

LoadAsync() public method

Loads a data source with the provided database reference data asynchronously.
public LoadAsync ( ApplicationDatabase applicationDatabase ) : System.Threading.Tasks.Task
applicationDatabase BudgetAnalyser.Engine.Persistence.ApplicationDatabase
return System.Threading.Tasks.Task

MonthEndReconciliation() public method

public MonthEndReconciliation ( LedgerBook ledgerBook, System.DateTime reconciliationDate, IBudgetCurrencyContext budgetContext, StatementModel statement, bool ignoreWarnings ) : LedgerEntryLine
ledgerBook BudgetAnalyser.Engine.Ledger.LedgerBook
reconciliationDate System.DateTime
budgetContext IBudgetCurrencyContext
statement BudgetAnalyser.Engine.Statement.StatementModel
ignoreWarnings bool
return BudgetAnalyser.Engine.Ledger.LedgerEntryLine

ReconciliationService() public method

public ReconciliationService ( [ reconciliationManager ) : System
reconciliationManager [
return System

RemoveTransaction() public method

public RemoveTransaction ( LedgerEntry ledgerEntry, System.Guid transactionId ) : void
ledgerEntry BudgetAnalyser.Engine.Ledger.LedgerEntry
transactionId System.Guid
return void

SaveAsync() public method

Saves the application database asynchronously. This may be called using a background worker thread.
public SaveAsync ( ApplicationDatabase applicationDatabase ) : System.Threading.Tasks.Task
applicationDatabase BudgetAnalyser.Engine.Persistence.ApplicationDatabase
return System.Threading.Tasks.Task

SavePreview() public method

Called before Save is called. This will be called on the UI Thread. Objects can optionally add some context data that will be passed to the ISupportsModelPersistence.SaveAsync method call. This can be used to finalise any edits or prompt the user for closing data, ie, a "what-did-you-change" comment; this can't be done during save as it may not be called using the UI Thread.
public SavePreview ( ) : void
return void

TransferFunds() public method

Transfer funds from one ledger bucket to another. This is only possible if the current ledger reconciliation is unlocked. This is usually used during reconciliation.
public TransferFunds ( LedgerEntryLine reconciliation, TransferFundsCommand transferDetails ) : void
reconciliation BudgetAnalyser.Engine.Ledger.LedgerEntryLine /// The reconciliation line that this transfer will be created in. A transfer can only occur /// between two ledgers in the same reconciliation. ///
transferDetails BudgetAnalyser.Engine.Ledger.TransferFundsCommand The details of the requested transfer.
return void

UnlockCurrentMonth() public method

public UnlockCurrentMonth ( LedgerBook ledgerBook ) : LedgerEntryLine
ledgerBook BudgetAnalyser.Engine.Ledger.LedgerBook
return BudgetAnalyser.Engine.Ledger.LedgerEntryLine

UpdateRemarks() public method

public UpdateRemarks ( LedgerEntryLine entryLine, string remarks ) : void
entryLine BudgetAnalyser.Engine.Ledger.LedgerEntryLine
remarks string
return void

ValidateModel() public method

Validates the model owned by the service.
public ValidateModel ( StringBuilder messages ) : bool
messages StringBuilder
return bool