Class FinancialDateCalculator
A helper class responsible for retrieving, and caching, the financial date to use for a given date taking into account entity IEntityPeriodClosing
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 |
---|---|---|
IReadOnlyCache | cache |
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 |
---|---|---|
Guid | entityID | The entity to retrieve a valid financial date for |
DateTime | transactionDate | The transaction date that we need to retrieve a financial date for |
Returns
Type | Description |
---|---|
Task<DateTime> | A valid open financial date for the given entity and date |
GetFinancialDate(Guid, DateTime, 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 |
---|---|---|
Guid | entityID | The entity to retrieve a valid financial date for |
DateTime | transactionDate | The transaction date that we need to retrieve a financial date for |
DateTimeOffset? | matchFinancialDateIfPrior | If null then and there are no period closings then the
|
Returns
Type | Description |
---|---|
Task<DateTime> | A valid open financial date for the given entity and date |
GetFinancialDate(Guid, DateTime, 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 |
---|---|---|
Guid | entityID | The entity to retrieve a valid financial date for |
DateTime | transactionDate | The transaction date that we need to retrieve a financial date for |
DateTime? | matchFinancialDateIfPrior | If null then and there are no period closings then the
|
Returns
Type | Description |
---|---|
Task<DateTime> | A valid open financial date for the given entity and date |