Class TransactionValueExtensions
A helper class used for translating values held against an ITransactionValue
This is because transactions and transaction allocated records store their values in different value fields depending on the configuration of the ITransactionCode
Inherited Members
Namespace: LemonEdge.API.Entities.FinancialServices.Transactions.Helpers
Assembly: LemonEdge.API.Entities.FinancialServices.dll
Syntax
public static class TransactionValueExtensions
Methods
GetFuncValue(ITransactionValue, short)
Returns the functional value for the specified transaction allocated record given the specified sequence which corresponds to a Sequence
Declaration
public static decimal GetFuncValue(this ITransactionValue transaction, short sequence)
Parameters
Type | Name | Description |
---|---|---|
ITransactionValue | transaction | The record to return the specified functional value from |
short | sequence | The sequence indicating the value to be retrieved as defined by the Sequence against the transactions transaction code |
Returns
Type | Description |
---|---|
decimal | The functional value for the specified transaction allocated record given the specified sequence which corresponds to a Sequence |
GetManualChange(ITransactionValue, short)
Returns if the specified value for the specified transaction allocated record was manually modified or calculated automatically
Declaration
public static bool GetManualChange(this ITransactionValue transaction, short sequence)
Parameters
Type | Name | Description |
---|---|---|
ITransactionValue | transaction | The record to see if the value was manually modified on |
short | sequence | The sequence indicating if the value was manually updated as defined by the Sequence against the transactions transaction code |
Returns
Type | Description |
---|---|
bool | True if the value was manually updated, or false if it was done so automatically |
GetReportingValue(ITransactionValue, short)
Returns the reporting value for the specified transaction allocated record given the specified sequence which corresponds to a Sequence
Declaration
public static decimal GetReportingValue(this ITransactionValue transaction, short sequence)
Parameters
Type | Name | Description |
---|---|---|
ITransactionValue | transaction | The record to return the specified reporting value from |
short | sequence | The sequence indicating the value to be retrieved as defined by the Sequence against the transactions transaction code |
Returns
Type | Description |
---|---|
decimal | The reporting value for the specified transaction allocated record given the specified sequence which corresponds to a Sequence |
GetValues(ITransactionValue, short)
Declaration
public static (decimal Local, decimal Func, decimal Reporting) GetValues(this ITransactionValue transaction, short sequence)
Parameters
Type | Name | Description |
---|---|---|
ITransactionValue | transaction | |
short | sequence |
Returns
Type | Description |
---|---|
(decimal ReportingValue, decimal FuncValue, decimal LocalValue) |
HasManualChange(ITransactionValue)
Returns true if any of the values have been manually updated by the user rather than all having been automatically calculated
Declaration
public static bool HasManualChange(this ITransactionValue transaction)
Parameters
Type | Name | Description |
---|---|---|
ITransactionValue | transaction | The record to see if it has any manual changes |
Returns
Type | Description |
---|---|
bool | True if any of the values have been manually updated by the user rather than all having been automatically calculated |
SetFuncValue(ITransactionValue, short, decimal)
Sets the functional value for the specified transaction allocated record given the specified sequence which corresponds to a Sequence
Declaration
public static void SetFuncValue(this ITransactionValue transaction, short sequence, decimal value)
Parameters
Type | Name | Description |
---|---|---|
ITransactionValue | transaction | The record to modify the specified functional value of |
short | sequence | The sequence indicating the value to be updated as defined by the Sequence against the transactions transaction code |
decimal | value | The value to update the functional value against the transaction allocated record with |
SetManualChange(ITransactionValue, short, bool)
Sets if the specified value for the specified transaction allocated record was manually modified or calculated automatically
Declaration
public static void SetManualChange(this ITransactionValue transaction, short sequence, bool value)
Parameters
Type | Name | Description |
---|---|---|
ITransactionValue | transaction | The record to update if the value was manually modified on |
short | sequence | The sequence to indicate if the value was manually updated as defined by the Sequence against the transactions transaction code |
bool | value |
SetReportingValue(ITransactionValue, short, decimal)
Sets the reporting value for the specified transaction allocated record given the specified sequence which corresponds to a Sequence
Declaration
public static void SetReportingValue(this ITransactionValue transaction, short sequence, decimal value)
Parameters
Type | Name | Description |
---|---|---|
ITransactionValue | transaction | The record to modify the specified reporting value of |
short | sequence | The sequence indicating the value to be updated as defined by the Sequence against the transactions transaction code |
decimal | value | The value to update the reporting value against the transaction allocated record with |
SetValues(ITransactionValue, short, decimal, decimal, decimal)
Declaration
public static void SetValues(this ITransactionValue transactionValue, short sequence, decimal localValue, decimal funcValue, decimal reportingValue)
Parameters
Type | Name | Description |
---|---|---|
ITransactionValue | transactionValue | |
short | sequence | |
decimal | localValue | |
decimal | funcValue | |
decimal | reportingValue |