Esempio n. 1
0
 public AccountService(AccountRepository repository, AccountGroupRepository accountGroupRepository, AccountTypeRepository accountTypeRepository, OrganizationService organizationService, ILogger <AccountService> logger)
 {
     this.repository             = repository;
     this.accountGroupRepository = accountGroupRepository;
     this.accountTypeRepository  = accountTypeRepository;
     this.organizationService    = organizationService;
     this.logger = logger;
 }
Esempio n. 2
0
        public void Initialize(string filename)
        {
            IDatabaseFactory databaseFactory = new DatabaseFactory();
            IUnitOfWork unitOfWork = new UnitOfWork(databaseFactory);
            IAccountRepository accountRepository = new AccountRepository(databaseFactory);
            ITransactionRepository transactionRepository = new TransactionRepository(databaseFactory);
            ICategoryRepository categoryRepository = new CategoryRepository(databaseFactory);
            IVendorRepository vendorRepository = new VendorRepository(databaseFactory);
            ICategoryGroupRepository categoryGroupRepository = new CategoryGroupRepository(databaseFactory);
            IBillRepository billRepository = new BillRepository(databaseFactory);
            IBillTransactionRepository billTransactionRepository = new BillTransactionRepository(databaseFactory);
            IBillGroupRepository billGroupRepository = new BillGroupRepository(databaseFactory);
            IBudgetCategoryRepository budgetCategoryRepository = new BudgetCategoryRepository(databaseFactory);
            IAccountGroupRepository accountGroupRepository = new AccountGroupRepository(databaseFactory);
            IImportDescriptionVendorMapRepository importDescriptionVendorMapRepository = new ImportDescriptionVendorMapRepository(databaseFactory);
            IAccountService accountService = new AccountService(unitOfWork, accountRepository, transactionRepository, categoryRepository, vendorRepository, billRepository, billTransactionRepository, billGroupRepository, categoryGroupRepository, budgetCategoryRepository, importDescriptionVendorMapRepository);
            TransactionImporter importer = new TransactionImporter(unitOfWork, accountService, accountRepository, transactionRepository, vendorRepository, categoryGroupRepository, accountGroupRepository, importDescriptionVendorMapRepository);

            importer.Import(filename);
        }
Esempio n. 3
0
        public static AccountGroupRepository GetPopulatedAccountGroupRepository()
        {
            var accountGroupRepository = new AccountGroupRepository(new NoSqlTableInMemory <AccountGroupEntity>());

            var groups = new List <AccountGroup>
            {
                new AccountGroup
                {
                    TradingConditionId = TradingConditionId,
                    BaseAssetId        = "USD",
                    MarginCall         = 1.25M,
                    StopOut            = 1.05M
                },
                new AccountGroup
                {
                    TradingConditionId = TradingConditionId,
                    BaseAssetId        = "EUR",
                    MarginCall         = 1.25M,
                    StopOut            = 1.05M
                },
                new AccountGroup
                {
                    TradingConditionId = TradingConditionId,
                    BaseAssetId        = "CHF",
                    MarginCall         = 1.25M,
                    StopOut            = 1.05M
                }
            };

            foreach (var group in groups)
            {
                accountGroupRepository.AddOrReplaceAsync(group).Wait();
            }

            return(accountGroupRepository);
        }
Esempio n. 4
0
 public AccountGroupServices()
 {
     _accountGroupRepository = new AccountGroupRepository();
 }