C# Class Unipluss.TransactionService.DAL.SearchRepository

Inheritance: ISearchRepository
ファイルを表示 Open project: unipluss/invoicetransactions Class Usage Examples

Private Properties

Property Type Description
EnsureTotalsIndex System.Threading.Tasks.Task
EnsureTransactionIndex System.Threading.Tasks.Task

Public Methods

Method Description
AddOrUpdateTotalsItem ( ) : void
AddToIndex ( ) : void

Adds transaction items to search index or updates existing items. When transaction amount is > 1, adds multiple items to search index for facet queries. Converts all entities to batches of up to 1000 to efficiently update search index. Throws exception when search index operation fails.

AddToIndex ( Transaction t ) : void

Adds the transaction item to search index. Can also be used for updating existing items by specifying the Transaction.ID value. Throws exception when item is not valid, resolving customer external ID failed or if search index operation fails.

DeleteFromIndex ( int mvanumber, System.Guid id ) : void

Removes the transaction from search index that matches the mva number and ID. Can delete multiple index items when transaction amount was > 1.

DeleteOldTransactions ( ) : void
DeleteTotalsItemWithID ( ) : void
EnsureStorageCreated ( ) : System.Threading.Tasks.Task
GetTotalsItemsForCustomer ( System.Guid customerInternalID, string productID, int dateVal ) : IEnumerable
GetTransactionById ( int mvanumber, System.Guid id ) : List

Gets the transaction item(s) matching the mva number and ID from search index. Can return multiple items if transaction Amount > 1.

GetTransactionCountsForTopCustomers ( int mvanumber, string productID, int startDateVal, int endDateVal ) : List

Finds top 10 customers who have the highest amount of transactions for a specific product inside the time period. Also returns a 11th item that contains the amount of transactions for the rest of the customers that didn't make it into the top 10.

GetTransactionCountsPerMonthForProduct ( int mvanumber, string productID, int startDateVal, int endDateVal ) : List

Finds transaction counts for a specific product in every month.

GetTransactionCountsPerMonthPerProduct ( int mvanumber, string customerInternalID, int startDateVal, int endDateVal ) : List

Finds customer's transaction counts per product per month.

GetUniqueProductIDs ( int mvanumber ) : List

Gets the names of all the products for given mva number that have transactions added to the search index.

Private Methods

Method Description
EnsureTotalsIndex ( ) : System.Threading.Tasks.Task
EnsureTransactionIndex ( ) : System.Threading.Tasks.Task

Method Details

AddOrUpdateTotalsItem() public method

public AddOrUpdateTotalsItem ( ) : void
return void

AddToIndex() public method

Adds transaction items to search index or updates existing items. When transaction amount is > 1, adds multiple items to search index for facet queries. Converts all entities to batches of up to 1000 to efficiently update search index. Throws exception when search index operation fails.
public AddToIndex ( ) : void
return void

AddToIndex() public method

Adds the transaction item to search index. Can also be used for updating existing items by specifying the Transaction.ID value. Throws exception when item is not valid, resolving customer external ID failed or if search index operation fails.
public AddToIndex ( Transaction t ) : void
t Transaction
return void

DeleteFromIndex() public method

Removes the transaction from search index that matches the mva number and ID. Can delete multiple index items when transaction amount was > 1.
public DeleteFromIndex ( int mvanumber, System.Guid id ) : void
mvanumber int
id System.Guid
return void

DeleteOldTransactions() public method

public DeleteOldTransactions ( ) : void
return void

DeleteTotalsItemWithID() public method

public DeleteTotalsItemWithID ( ) : void
return void

EnsureStorageCreated() public method

public EnsureStorageCreated ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

GetTotalsItemsForCustomer() public method

public GetTotalsItemsForCustomer ( System.Guid customerInternalID, string productID, int dateVal ) : IEnumerable
customerInternalID System.Guid
productID string
dateVal int
return IEnumerable

GetTransactionById() public method

Gets the transaction item(s) matching the mva number and ID from search index. Can return multiple items if transaction Amount > 1.
public GetTransactionById ( int mvanumber, System.Guid id ) : List
mvanumber int
id System.Guid
return List

GetTransactionCountsForTopCustomers() public method

Finds top 10 customers who have the highest amount of transactions for a specific product inside the time period. Also returns a 11th item that contains the amount of transactions for the rest of the customers that didn't make it into the top 10.
public GetTransactionCountsForTopCustomers ( int mvanumber, string productID, int startDateVal, int endDateVal ) : List
mvanumber int required
productID string required
startDateVal int required
endDateVal int required
return List

GetTransactionCountsPerMonthForProduct() public method

Finds transaction counts for a specific product in every month.
public GetTransactionCountsPerMonthForProduct ( int mvanumber, string productID, int startDateVal, int endDateVal ) : List
mvanumber int required
productID string required
startDateVal int required
endDateVal int required
return List

GetTransactionCountsPerMonthPerProduct() public method

Finds customer's transaction counts per product per month.
public GetTransactionCountsPerMonthPerProduct ( int mvanumber, string customerInternalID, int startDateVal, int endDateVal ) : List
mvanumber int required
customerInternalID string required
startDateVal int required
endDateVal int required
return List

GetUniqueProductIDs() public method

Gets the names of all the products for given mva number that have transactions added to the search index.
public GetUniqueProductIDs ( int mvanumber ) : List
mvanumber int required
return List