public static Task <List <ExpenseReport> > GetAllAsync(this IExpenseReports expenseReports, string?approvalCode = null, string?startDate = null, string?endDate = null, string?batchId = null, uint?processed = null, string?reimbursed = null, string?reimbursedstartdate = null, string?reimbursedenddate = null) => CertifyClient.GetAllAsync(async(pageNumber) => { var actualPage = await expenseReports .GetPageAsync( approvalCode, startDate, endDate, batchId, pageNumber, processed, reimbursed, reimbursedstartdate, reimbursedenddate) .ConfigureAwait(false); return(new GenericPage <ExpenseReport> { TotalPageCount = actualPage.TotalPageCount, TotalRecordCount = actualPage.TotalRecordCount, Items = actualPage.ExpenseReports }); });
public static Task <List <Expense> > GetAllAsync(this IExpenses expenses, string?startDate = null, string?endDate = null, string?batchId = null, uint?processed = null, uint?includeDisapproved = null ) => CertifyClient.GetAllAsync(async(pageNumber) => { var actualPage = await expenses .GetPageAsync( startDate, endDate, batchId, processed, pageNumber, includeDisapproved) .ConfigureAwait(false); return(new GenericPage <Expense> { TotalPageCount = actualPage.TotalPageCount, TotalRecordCount = actualPage.TotalRecordCount, Items = actualPage.Expenses }); });
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { CertifyClient.Dispose(); } disposedValue = true; } }
public TestConfig(ILogger logger) { logger.LogDebug("Loading config..."); var location = typeof(TestConfig).GetTypeInfo().Assembly.Location; var dirPath = Path.Combine(Path.GetDirectoryName(location) ?? string.Empty, "../../.."); var builder = new ConfigurationBuilder() .SetBasePath(dirPath) .AddJsonFile("appsettings.json"); var configuration = builder.Build(); logger.LogDebug("Creating client..."); CertifyClient = new CertifyClient(configuration["Config:Credentials:ApiKey"], configuration["Config:Credentials:ApiSecret"]); Logger = logger; }
public CertifyConnectedSystemManager( ConnectedSystem connectedSystem, State state, TimeSpan maxFileAge, ILoggerFactory loggerFactory) : base(connectedSystem, state, maxFileAge, loggerFactory.CreateLogger <CertifyConnectedSystemManager>()) { _certifyClient = new CertifyClient(connectedSystem.Credentials.PublicText, connectedSystem.Credentials.PrivateText, new CertifyClientOptions { Timeout = TimeSpan.FromMinutes(2) }); // FixerSharp for exchange rate conversion, if configured if (connectedSystem.Configuration.ContainsKey(FixerApiKey)) { var fixerApiKey = connectedSystem.Configuration[FixerApiKey]; Fixer.SetApiKey(fixerApiKey); } }
public static Task <List <User> > GetAllAsync(this IUsers users, string?username = null, uint?active = null, string?role = null) => CertifyClient.GetAllAsync(async(pageNumber) => { var actualPage = await users .GetPageAsync( username, active, role, pageNumber) .ConfigureAwait(false); return(new GenericPage <User> { TotalPageCount = actualPage.TotalPageCount, TotalRecordCount = actualPage.TotalRecordCount, Items = actualPage.Users }); });
public static Task <List <ExpenseReportGld> > GetAllAsync(this IExpenseReportGlds expenseReportGlds, uint index, string?name = null, string?code = null, uint?active = null) => CertifyClient.GetAllAsync(async(pageNumber) => { var actualPage = await expenseReportGlds .GetPageAsync( index, name, code, active, pageNumber) .ConfigureAwait(false); return(new GenericPage <ExpenseReportGld> { TotalPageCount = actualPage.TotalPageCount, TotalRecordCount = actualPage.TotalRecordCount, Items = actualPage.ExpenseReportGlds }); });
internal async Task <Preferences> GetPreferences() { return(await CertifyClient.GetPreferences()); }