public StoredBalanceSetDto CalculateBalanceSet(string accountsChartUID, string balanceSetUID)
        {
            StoredBalanceSet balanceSet = ParseBalanceSet(accountsChartUID, balanceSetUID);

            balanceSet.Calculate();

            return(StoredBalanceSetMapper.MapWithBalances(balanceSet));
        }
        public FixedList <StoredBalanceSetDto> BalanceSetsList(string accountsChartUID)
        {
            Assertion.AssertObject(accountsChartUID, "accountsChartUID");

            var accountsChart = AccountsChart.Parse(accountsChartUID);

            FixedList <StoredBalanceSet> list = StoredBalanceSet.GetList(accountsChart);

            return(StoredBalanceSetMapper.Map(list));
        }
        public StoredBalanceSetDto CreateOrGetBalanceSet(string accountsChartUID,
                                                         BalanceStorageCommand command)
        {
            Assertion.AssertObject(accountsChartUID, "accountsChartUID");
            Assertion.AssertObject(command, "command");

            var accountsChart = AccountsChart.Parse(accountsChartUID);

            var storedBalanceSet = StoredBalanceSet.CreateOrGetBalanceSet(accountsChart, command.BalancesDate);

            storedBalanceSet.Save();

            return(StoredBalanceSetMapper.Map(storedBalanceSet));
        }