Class FinancialDateCalculator
A helper class responsible for retrieving, and caching, the financial date to use for a given date taking into
account entity IEntity
Implements
Inherited Members
Namespace: LemonEdge .API.Core.FinancialServices .Processors
Assembly: LemonEdge.API.Core.FinancialServices.dll
Syntax
public class FinancialDateCalculator : IFinancialDateCalculator
Constructors
FinancialDateCalculator(IReadOnlyCache)
Creates a new financial date calculator using the specified retriever
Declaration
public FinancialDateCalculator(IReadOnlyCache cache)
Parameters
Type | Name | Description |
---|---|---|
IRead |
cache |
Methods
GetFinancialDate(Guid, DateTime)
Retrieves a valid financial date for the specified entity id and transaction date
If the given entity has no IEntitytransactionDate
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 |
---|---|---|
Guid | entityID | The entity to retrieve a valid financial date for |
Date |
transactionDate | The transaction date that we need to retrieve a financial date for |
Returns
GetFinancialDate(Guid, DateTime, DateTimeOffset?)
Retrieves a valid financial date for the specified entity id and transaction date
If the given entity has no IEntitytransactionDate
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 |
---|---|---|
Guid | entityID | The entity to retrieve a valid financial date for |
Date |
transactionDate | The transaction date that we need to retrieve a financial date for |
Date |
matchFinancialDateIfPrior | If null then and there are no period closings then the
|
Returns
GetFinancialDate(Guid, DateTime, DateTime?)
Retrieves a valid financial date for the specified entity id and transaction date
If the given entity has no IEntitytransactionDate
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 |
---|---|---|
Guid | entityID | The entity to retrieve a valid financial date for |
Date |
transactionDate | The transaction date that we need to retrieve a financial date for |
Date |
matchFinancialDateIfPrior | If null then and there are no period closings then the
|