Class FinancialDateCalculator
A helper class responsible for retrieving, and caching, the financial date to use for a given date taking into account entity IEntityPeriodClosing
Inheritance
Inherited Members
Namespace: LemonEdge.API.Processors
Assembly: API.dll
Syntax
public class FinancialDateCalculator
Constructors
FinancialDateCalculator(IEntityRetriever)
Creates a new financial date calculator using the specified retriever
Declaration
public FinancialDateCalculator(IEntityRetriever retriever)
Parameters
Type | Name | Description |
---|---|---|
IEntityRetriever | retriever | A context enabling querying of the entire system |
Methods
GetFinancialDate(Guid, DateTime)
Retrieves a valid financial date for the specified entity id and transaction date
If the given entity has no IEntityPeriodClosing associated with it then this returns the transactionDate
transactionDate
then the returned date is one day after the latest period closing for that entity. In other words the next available open data for that entity.
Declaration
public Task<DateTime> GetFinancialDate(Guid entityID, DateTime transactionDate)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | entityID | The entity to retrieve a valid financial date for |
System.DateTime | transactionDate | The transaction date that we need to retrieve a financial date for |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.DateTime> | A valid open financial date for the given entity and date |
GetFinancialDate(Guid, DateTime, Nullable<DateTime>)
Retrieves a valid financial date for the specified entity id and transaction date
If the given entity has no IEntityPeriodClosing associated with it then this returns the transactionDate
unless the provided matchFinancialDateIfPrior
is greater in which case that is returned
transactionDate
then the returned date is one day after the latest period closing for that entity. In other words the next available open data for that entity.
Declaration
public Task<DateTime> GetFinancialDate(Guid entityID, DateTime transactionDate, DateTime? matchFinancialDateIfPrior)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | entityID | The entity to retrieve a valid financial date for |
System.DateTime | transactionDate | The transaction date that we need to retrieve a financial date for |
System.Nullable<System.DateTime> | matchFinancialDateIfPrior | If null then and there are no period closings then the |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.DateTime> | A valid open financial date for the given entity and date |
GetFinancialDate(Guid, DateTime, Nullable<DateTimeOffset>)
Retrieves a valid financial date for the specified entity id and transaction date
If the given entity has no IEntityPeriodClosing associated with it then this returns the transactionDate
unless the provided matchFinancialDateIfPrior
is greater in which case that is returned
transactionDate
then the returned date is one day after the latest period closing for that entity. In other words the next available open data for that entity.
Declaration
public Task<DateTime> GetFinancialDate(Guid entityID, DateTime transactionDate, DateTimeOffset? matchFinancialDateIfPrior)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | entityID | The entity to retrieve a valid financial date for |
System.DateTime | transactionDate | The transaction date that we need to retrieve a financial date for |
System.Nullable<System.DateTimeOffset> | matchFinancialDateIfPrior | If null then and there are no period closings then the |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.DateTime> | A valid open financial date for the given entity and date |