Пример #1
0
 //Сохранение периода расчета в ControllerData, saveStartStop = true - сохраняются также время запуска расчета, время останова и т.д.
 private void SavePeriod(bool saveStartStop)
 {
     try
     {
         _lastErrorPos = saveStartStop || _lastErrorPos != 1 ? 0 : 2;
         UpdateTablo();
         _sysResult.PutSubValue("PeriodInfo", "PeriodBegin", PeriodBegin.ToString());
         _sysResult.PutSubValue("PeriodInfo", "PeriodEnd", PeriodEnd.ToString());
         if (_lastErrorTime == PeriodBegin)
         {
             _sysResult.PutSubValue("LastErrorInfo", "ErrorText", _lastErrorText);
             _sysResult.PutSubValue("LastErrorInfo", "ErrorPeriodBegin", _lastErrorTime.ToString());
         }
         if (saveStartStop)
         {
             _lastErrorPos = 0;
             _sysResult.PutSubValue("PeriodInfo", "CalcName", CalcName);
             _sysResult.PutSubValue("PeriodInfo", "StartMoment", StartMoment.ToString());
             _sysResult.PutSubValue("PeriodInfo", "StartTime", StartTime.ToString());
             _sysResult.PutSubValue("PeriodInfo", "StopTime", StopTime.ToString());
             _sysResult.PutSubValue("PeriodInfo", "IsStopTime", IsStopTime ? "True" : "False");
         }
     }
     catch (Exception ex)
     {
         AddError("Ошибка записи в SysTabl файла результатов", ex);
     }
 }
 private void AssertPeriodForDomainObject(CollectionPeriod period, PeriodEnd periodEnd)
 {
     Assert.AreEqual(period.Id, period.Id);
     Assert.AreEqual(period.CalendarMonth, periodEnd.CalendarPeriod.Month);
     Assert.AreEqual(period.CalendarYear, periodEnd.CalendarPeriod.Year);
     Assert.AreEqual(period.AccountDataValidAt, periodEnd.ReferenceData.AccountDataValidAt);
     Assert.AreEqual(period.CommitmentDataValidAt, periodEnd.ReferenceData.CommitmentDataValidAt);
     Assert.AreEqual(period.CompletionDateTime, periodEnd.CompletionDateTime);
 }
Пример #3
0
 public bool Equals(IrregularSalaryPeriod other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(PeriodStart.Equals(other.PeriodStart) && PeriodEnd.Equals(other.PeriodEnd) && SalaryAmount == other.SalaryAmount && CurrencyCode == other.CurrencyCode);
 }
Пример #4
0
 private static Models.Payments.PeriodEnd MapToDbPaymentPeriod(PeriodEnd paymentsPeriodEnd)
 {
     return(new Models.Payments.PeriodEnd
     {
         PeriodEndId = paymentsPeriodEnd.Id,
         CalendarPeriodMonth = paymentsPeriodEnd.CalendarPeriod?.Month ?? 0,
         CalendarPeriodYear = paymentsPeriodEnd.CalendarPeriod?.Year ?? 0,
         CompletionDateTime = paymentsPeriodEnd.CompletionDateTime,
         AccountDataValidAt = paymentsPeriodEnd.ReferenceData?.AccountDataValidAt,
         CommitmentDataValidAt = paymentsPeriodEnd.ReferenceData?.CommitmentDataValidAt,
         PaymentsForPeriod = paymentsPeriodEnd.Links?.PaymentsForPeriod ?? string.Empty
     });
 }
Пример #5
0
        private async Task LoadDatas()
        {
            Demo.WeaponFired = await _cacheService.GetDemoWeaponFiredAsync(Demo);

            CurrentRound     = Demo.Rounds.First(r => r.Number == RoundNumber);
            PeriodStart      = DateTime.Today;
            PeriodEnd        = DateTime.Today.AddSeconds(CurrentRound.Duration);
            VisibleStartTime = PeriodStart.AddSeconds(-5);
            VisibleEndTime   = PeriodEnd.AddSeconds(5);
            RoundEventList   = await _roundService.GetTimeLineEventList(Demo, CurrentRound);

            PlayersStats = await _playerService.GetPlayerRoundStatsListAsync(Demo, CurrentRound);
        }
        public Task CreateNewPeriodEnd(PeriodEnd periodEnd)
        {
            var parameters = new DynamicParameters();

            parameters.Add("@PeriodEndId", periodEnd.PeriodEndId, DbType.String);
            parameters.Add("@CalendarPeriodMonth", periodEnd.CalendarPeriodMonth, DbType.Int32);
            parameters.Add("@CalendarPeriodYear", periodEnd.CalendarPeriodYear, DbType.Int32);
            parameters.Add("@AccountDataValidAt", periodEnd.AccountDataValidAt, DbType.DateTime);
            parameters.Add("@CommitmentDataValidAt", periodEnd.CommitmentDataValidAt, DbType.DateTime);
            parameters.Add("@CompletionDateTime", periodEnd.CompletionDateTime, DbType.DateTime);
            parameters.Add("@PaymentsForPeriod", periodEnd.PaymentsForPeriod, DbType.String);

            return(_db.Value.Database.Connection.ExecuteAsync(
                       sql: "[employer_financial].[CreatePeriodEnd]",
                       param: parameters,
                       transaction: _db.Value.Database.CurrentTransaction.UnderlyingTransaction,
                       commandType: CommandType.StoredProcedure));
        }
Пример #7
0
        public void Arrange()
        {
            _eventService = new Mock <IProviderEventService>();
            _logger       = new Mock <ILog>();

            var periodEnd = new PeriodEnd {
                Id = "33"
            };

            _expectedPeriodEnds = new List <PeriodEnd> {
                periodEnd
            };

            _eventService.Setup(x => x.GetUnprocessedPeriodEnds <Payment>()).ReturnsAsync(_expectedPeriodEnds);

            _collector = new PaymentEventCollector(_eventService.Object, _logger.Object, new DataConfiguration {
                PaymentsEnabled = true
            });
        }
Пример #8
0
        private async Task ProcessPaymentPeriod(PeriodEnd paymentsPeriodEnd, IMessageHandlerContext context)
        {
            Models.Payments.PeriodEnd periodEnd = MapToDbPaymentPeriod(paymentsPeriodEnd);

            _logger.Info($"Creating period end {periodEnd.PeriodEndId}");
            await _mediator.SendAsync(new CreateNewPeriodEndCommand { NewPeriodEnd = periodEnd });

            if (!periodEnd.AccountDataValidAt.HasValue || !periodEnd.CommitmentDataValidAt.HasValue)
            {
                return;
            }

            _logger.Info($"Creating process period end queue message for period end ref: '{paymentsPeriodEnd.Id}'");

            await context.SendLocal(new ProcessPeriodEndPaymentsCommand
            {
                PeriodEndRef = paymentsPeriodEnd.Id
            });
        }
        public async Task CreateNewPeriodEnd(PeriodEnd periodEnd)
        {
            await WithConnection(async c =>
            {
                var parameters = new DynamicParameters();
                parameters.Add("@PeriodEndId", periodEnd.Id, DbType.String);
                parameters.Add("@CalendarPeriodMonth", periodEnd.CalendarPeriodMonth, DbType.Int32);
                parameters.Add("@CalendarPeriodYear", periodEnd.CalendarPeriodYear, DbType.Int32);
                parameters.Add("@AccountDataValidAt", periodEnd.AccountDataValidAt, DbType.DateTime);
                parameters.Add("@CommitmentDataValidAt", periodEnd.CommitmentDataValidAt, DbType.DateTime);
                parameters.Add("@CompletionDateTime", periodEnd.CompletionDateTime, DbType.DateTime);
                parameters.Add("@PaymentsForPeriod", periodEnd.PaymentsForPeriod, DbType.String);

                return(await c.ExecuteAsync(
                           sql: "[CreatePeriodEnd]",
                           param: parameters,
                           commandType: CommandType.StoredProcedure));
            });
        }
Пример #10
0
        //Определяет, нужно ли ждать и ждет, если нужно
        private void Waiting()
        {
            DateTime start = DateTime.Now;

            FinishCycleTime = PeriodEnd.AddMinutes(SourcesLate);
            if (FinishCycleTime.Subtract(start).TotalSeconds < 1)
            {
                CalcMode = "Выравнивание";
                if (RushWaitingTime > 0)
                {
                    Wait(DateTime.Now.AddMinutes(RushWaitingTime), Atom.Wait);
                }
                if (State == State.FinishWaiting)
                {
                    return;
                }
            }
            else
            {
                CalcMode = "Синхронный";
                using (StartView(ViewAtom.Waiting, false))
                    Wait(FinishCycleTime, Atom.Wait);
                if (State == State.FinishWaiting)
                {
                    return;
                }
            }
            if ((!StartAtom(Atom.ReadTime, ReadTime) || FinishCycleTime.AddMinutes(-SourcesLate) > SourcesEnd))
            {
                if (State == State.FinishWaiting)
                {
                    return;
                }
                State = State.Waiting;
                using (StartView(ViewAtom.ErrorWaiting, false))
                    Wait(start.AddMinutes(Math.Max(1, SourcesLate)), Atom.ErrorWait);
                if (State != State.FinishWaiting)
                {
                    StartAtom(Atom.ReadTime, ReadTime);
                }
            }
        }
Пример #11
0
        public override int GetHashCode()
        {
            if (!string.IsNullOrEmpty(SourceFactId))
            {
                return(SourceFactId.GetHashCode());
            }
            else
            {
                unchecked // Overflow is fine, just wrap
                {
                    int hash = 117;

                    hash = hash * 123 + Title.GetHashCode();
                    hash = hash * 123 + PeriodStart.GetHashCode();
                    hash = hash * 123 + PeriodEnd.GetHashCode();

                    return(hash);
                }
            }
        }
        public void Arrange()
        {
            _configuration = new PaymentsEventsApiConfiguration
            {
                ApiBaseUrl  = "some-url/",
                ClientToken = "super_secure_token"
            };

            _periodEnd1 = new PeriodEnd
            {
                Id             = "1617-R01",
                CalendarPeriod = new CalendarPeriod
                {
                    Month = 9,
                    Year  = 2016
                },
                ReferenceData = new ReferenceDataDetails
                {
                    AccountDataValidAt    = new DateTime(2016, 9, 1),
                    CommitmentDataValidAt = new DateTime(2016, 9, 2)
                },
                CompletionDateTime = new DateTime(2016, 10, 3),
                Links = new PeriodEndLinks
                {
                    PaymentsForPeriod = "some-other-url"
                }
            };

            _httpClient = new Mock <SecureHttpClient>();
            _httpClient.Setup(c => c.GetAsync(It.IsAny <string>()))
            .Returns(Task.FromResult(JsonConvert.SerializeObject(new[]
            {
                _periodEnd1
            })));

            _client = new Client.PaymentsEventsApiClient(_configuration, _httpClient.Object);
        }
        public void Arrange()
        {
            _configuration = new Mock <IPaymentsEventsApiConfiguration>();
            _configuration.Setup(m => m.ApiBaseUrl).Returns(ExpectedApiBaseUrl);
            _configuration.Setup(m => m.ClientToken).Returns(ClientToken);

            _periodEnd1 = new PeriodEnd
            {
                Id             = "1617-R01",
                CalendarPeriod = new CalendarPeriod
                {
                    Month = 9,
                    Year  = 2016
                },
                ReferenceData = new ReferenceDataDetails
                {
                    AccountDataValidAt    = new DateTime(2016, 9, 1),
                    CommitmentDataValidAt = new DateTime(2016, 9, 2)
                },
                CompletionDateTime = new DateTime(2016, 10, 3),
                Links = new PeriodEndLinks
                {
                    PaymentsForPeriod = "some-other-url"
                }
            };

            _httpMessageHandlerMock = SetupHttpMessageHandler(JsonConvert.SerializeObject(
                                                                  new[]
            {
                _periodEnd1
            }));

            // use real http client with mocked handler
            var httpClient = new HttpClient(_httpMessageHandlerMock.Object);

            _client = new Client.PaymentsEventsApiClient(_configuration.Object, httpClient);
        }
Пример #14
0
        private void RunCalc()
        {
            bool e;

            using (StartView(ViewAtom.Calc, true))
            {
                if (Form != null)
                {
                    Form.Invoke(new FormDelegate(UpdateFormTime));
                }
                //Подготовка рачета
                Start(PrepareCalc, 0, 25);
                //Расчет
                if (!Start(Cycle, 25) && !IsPeriodic)
                {
                    using (StartAtom(Atom.Stop)) { }
                }
                e = Command.IsError;
            }

            //Периодический расчет
            if (IsPeriodic)
            {
                while (!e && PeriodEnd.AddSeconds(1) < StopTime)
                {
                    PeriodBegin = PeriodBegin.AddMinutes(PeriodLength);
                    if (Form != null)
                    {
                        Form.Invoke(new FormDelegate(UpdateFormTime));
                    }
                    using (StartAtom(Atom.Next)) { }
                    StartView(ViewAtom.Calc, Cycle, true);
                    e |= Command.IsError;
                }
            }
        }
 public override string ToString()
 {
     return(PeriodEnd.ToShortDateString() + " " + Open + " " + High + " " + Low + " " + Close);
 }
Пример #16
0
        //Чтение значений из провайдера
        protected override ValuesCount ReadProviderValues()
        {
            var vcount = new ValuesCount();

            AddEvent("Чтение среза значений");
            using (Start(10, PeriodBegin == PeriodEnd ? 90 : 40))
                vcount += ReadCut();
            foreach (ListSignal sig in SourceConnect.InitialSignals.Values)
            {
                vcount.WriteCount += sig.MakeBegin();
            }
            AddEvent("Срез значений получен", vcount.ToString());
            if (vcount.Status == VcStatus.Fail)
            {
                return(vcount);
            }

            //Чтение изменений
            if (PeriodBegin < PeriodEnd)
            {
                AddEvent("Чтение изменений значений");
                var ts  = PeriodEnd.Subtract(PeriodBegin).Subtract(new TimeSpan(0, 0, 0, 0, 1));
                var tts = new TimeSpan(0);
                int n   = 0;
                while (tts < ts)
                {
                    tts = tts.Add(PeriodLimit);
                    n++;
                }

                var changes = new ValuesCount();
                using (Start(40, 85))
                {
                    DateTime beg  = PeriodBegin;
                    DateTime en   = Static.MinDate;
                    double   proc = 0;
                    while (en < PeriodEnd)
                    {
                        using (Start(proc, proc += 100.0 / n))
                        {
                            en = beg.Add(PeriodLimit);
                            if (PeriodEnd < en)
                            {
                                en = PeriodEnd;
                            }
                            changes = changes + ReadChanges(beg, en);
                            beg     = en;
                        }
                    }
                }
                foreach (ListSignal sig in SourceConnect.InitialSignals.Values)
                {
                    changes.WriteCount += sig.MakeEnd();
                }
                AddEvent("Изменения значений получены", changes.ToString());
                vcount += changes;
                if (vcount.IsFail)
                {
                    return(vcount);
                }
                Procent = 90;
            }
            return(vcount);
        }
Пример #17
0
 //Обновление времени в форме индикатора
 private void UpdateFormTime()
 {
     Form.PeriodBegin.Text = PeriodBegin.ToString();
     Form.PeriodEnd.Text   = PeriodEnd.ToString();
     Form.Refresh();
 }
Пример #18
0
 public override string ToString()
 {
     return(PeriodStart.ToShortDateString() + " - " + PeriodEnd.ToShortDateString() + " " + Value);
 }
Пример #19
0
        public override bool Equals(object obj)
        {
            StatementRecord other = obj as StatementRecord;

            if (other != null)
            {
                return((!string.IsNullOrEmpty(SourceFactId) && SourceFactId.Equals(other.SourceFactId)) ||
                       (Title.Equals(other.Title) && PeriodStart.Equals(other.PeriodStart) && PeriodEnd.Equals(other.PeriodEnd) && (FactId != null && FactId.Equals(other.FactId))));
            }
            else
            {
                return(false);
            }
        }
        public RuntimeProperties(ServiceConfigParameters ConfigParameters)
        {
            _ServiceConfigParameters = ConfigParameters;
            //personal
            _Staff_ID = new StaffID();
            _Full_Name = new FullName();
            _Country = new Country();
            _ContractType = new ContractType();
            _ContractTypeForReports = new ContractTypeForReports();
            _Position = new Position();
            _DateOfTREnd = new DateOfTREnd();
            _DateOfTRStart = new DateOfTRStart();
            _DateOfEntrance = new DateOfEntrance();
            _CalendarName = new CalendarName();
            _TemplateFilter = new TemplateFilter();
            _ArePropReadyPersonal = new ArePropReady();
            _BusinessUnitInfo = new BusinessUnitInfo();
            _PMSA = new PMSA();
            _PMSAItem = new PMSAItem();
            _Gender = new Gender();
            _ActivityCodeInfo = new ActivityCodeInfo();
            _OfficialLS = new OfficialLS();
            _PhoneDirOnly = new PhoneDirOnly();
            //update
            _SelectedDate = new SelectedDate();
            _SelectedDateStatus = new SelectedDateStatus();
            _SelectedDateTransactionStatus = new SelectedDateTransactionStatus();
            _SelectedDateType = new SelectedDateType();
            _SelectedDateisOptional = new SelectedDateisOptional();
            _PercentPerDay = new PercentPerDay();
            _SelectedJob = new SelectedJob();
            _MaxHoursDaily = new MaxHoursDaily();
            _ArePropReadyTRUpdate = new ArePropReady();
            _TRInputListClient = new TRInputListClient();
            _LastOpenDay = new LastOpenDay();

            //submit
            _SumOfHours = new SumOfHours();
            _TRInputList = new TRInputList();
            _WorkingHoursWeekly = new WorkingHoursWeekly();
            _MinHoursDaily = new MinHoursDaily();
            _FirstSubmitableDay = new FirstSubmitableDay();
            _SelectedActivityCode = new SelectedActivityCode();
            _Description = new Description();
            _Location = new Location();
            _BusinessUnit = new BusinessUnit();
            _ReasonCode = new ReasonCode();
            _ArePropReadyTRSubmit = new ArePropReady();
            _PeriodEnd = new PeriodEnd();
            //reports

            _PeriodStarting = new PeriodStarting();
            _ArePropReadyReports = new ArePropReady();
            _ReportIntervalFrom = new ReportIntervalFrom();
            _ReportIntervalTo = new ReportIntervalTo();
            _UserIDList = new UserIDList();
            _SelectedReportTemplate = new SelectedReportTemplate();
            _SelectedReportType = new SelectedReportType();

            //külön queryk-ben/Getparameters-ben kap értéket

            _LastSubmittedDay = new LastSubmittedDay();
            _JobCh = new JobCH();
            _InsertedHour = new InstertedHour();
            _ValidationConstraint = new ValidationConstraint();
            _JobFilter = new JobFilter();
            _ActivityCodeFilter = new ActivityCodeFilter();
            _UserGroup = new UserGroup();
            _ReasonCodeFilter = new ReasonCodeFilter();
        }
Пример #21
0
        private void FormReportWin_Load(object sender, EventArgs e)
        {
            _book = GeneralRep.ActiveBook;
            var sys = _book.SysPage;

            using (_book.StartAtom("Открытие формы построения отчета"))
            {
                try
                {
                    _book.AddEvent("Настройка внешнего вида");
                    panelPeriod.Visible      = !_book.OnlyAbsolute;
                    butSaveHandInput.Visible = _book.HandInputProjects.Count > 0;

                    //Загрузка данных с SysPage
                    IntervalName.Text = sys.GetValue("DefaultCalcName");
                    if (IntervalName.Text.IsEmpty())
                    {
                        IntervalName.Text = sys.GetValue("CalcName");
                    }
                    FillPages.Text        = sys.GetValue("FillPages");
                    SaveToArchive.Checked = sys.GetBoolValue("SaveToArchive");
                    PeriodEnd.Enabled     = PeriodEndPicker.Enabled = _book.DifferentLength != DifferentLength.Equals;
                    string s = "";
                    int    d = sys.GetIntValue("DayLength");
                    if (d != 0)
                    {
                        s += d + " сут ";
                    }
                    d = sys.GetIntValue("HourLength");
                    if (d != 0)
                    {
                        s += d + " час ";
                    }
                    d = sys.GetIntValue("MinuteLength");
                    if (d != 0)
                    {
                        s += d + " мин ";
                    }
                    PeriodLength.Text           = s;
                    butPreviousInterval.Enabled = butNextInterval.Enabled = s != "";

                    switch (_book.DefaultPeriod)
                    {
                    case "Previous":
                        _book.SysPage.GetControl(PeriodBegin);
                        _book.SysPage.GetControl(PeriodEnd);
                        PeriodBegin.ChangePickerValue(PeriodBeginPicker);
                        PeriodEnd.ChangePickerValue(PeriodEndPicker);
                        break;

                    case "Now":
                        SetNowPeriod();
                        break;
                    }
                    UpdateSourcesTime();
                }
                catch (Exception ex)
                {
                    GeneralRep.ShowError("Ошибка при открытии формы построения отчетов", ex);
                }
            }
        }
Пример #22
0
 private void PeriodEnd_Validated(object sender, EventArgs e)
 {
     PeriodEnd.ChangePickerValue(PeriodEndPicker);
 }
Пример #23
0
        public void Assign()
        {
            _db = new Mock <EmployerFinanceDbContext>();

            _periodEnd = new PeriodEnd
            {
                Id                    = 1,
                PeriodEndId           = PeriodEnd,
                AccountDataValidAt    = DateTime.Now.AddDays(-2),
                CalendarPeriodMonth   = 2,
                CalendarPeriodYear    = 2018,
                CommitmentDataValidAt = DateTime.Now.AddDays(-1),
                CompletionDateTime    = DateTime.Now,
                PaymentsForPeriod     = "Test"
            };

            _senderTranferTransaction = new TransactionLineEntity
            {
                AccountId = SenderAccountId,
                TransferSenderAccountId   = SenderAccountId,
                TransferReceiverAccountId = ReceiverAccountId,
                PeriodEnd       = PeriodEnd,
                DateCreated     = DateTime.Now.AddDays(-2),
                TransactionType = TransactionItemType.Transfer
            };

            _recieverTranferTransaction = new TransactionLineEntity
            {
                AccountId = ReceiverAccountId,
                PeriodEnd = PeriodEnd,
                TransferSenderAccountId   = SenderAccountId,
                TransferReceiverAccountId = ReceiverAccountId,
                DateCreated     = DateTime.Now.AddDays(-1),
                TransactionType = TransactionItemType.Transfer
            };

            _publicHashingService = new Mock <IPublicHashingService>();

            _query = new GetTransferTransactionDetailsQuery
            {
                AccountId = ReceiverAccountId,
                TargetAccountPublicHashedId = SenderPublicHashedId,
                PeriodEnd = PeriodEnd
            };

            _response = new GetTransferTransactionDetailsResponse();

            _handler = new GetTransferTransactionDetailsQueryHandler(_db.Object, _publicHashingService.Object);

            _transfers = new List <AccountTransfer>
            {
                new AccountTransfer
                {
                    SenderAccountId     = SenderAccountId,
                    SenderAccountName   = SenderAccountName,
                    ReceiverAccountId   = ReceiverAccountId,
                    ReceiverAccountName = ReceiverAccountName,
                    ApprenticeshipId    = 1,
                    CourseName          = FirstCourseName,
                    Amount    = 123.4567M,
                    PeriodEnd = PeriodEnd
                },
                new AccountTransfer
                {
                    SenderAccountId     = SenderAccountId,
                    SenderAccountName   = SenderAccountName,
                    ReceiverAccountId   = ReceiverAccountId,
                    ReceiverAccountName = ReceiverAccountName,
                    ApprenticeshipId    = 2,
                    CourseName          = SecondCourseName,
                    Amount    = 346.789M,
                    PeriodEnd = PeriodEnd
                },
                new AccountTransfer
                {
                    SenderAccountId     = SenderAccountId,
                    SenderAccountName   = SenderAccountName,
                    ReceiverAccountId   = ReceiverAccountId,
                    ReceiverAccountName = ReceiverAccountName,
                    ApprenticeshipId    = 3,
                    CourseName          = SecondCourseName,
                    Amount    = 234.56M,
                    PeriodEnd = PeriodEnd
                }
            };

            _db.Setup(d => d.SqlQueryAsync <AccountTransfer>(
                          It.IsAny <string>(), SenderAccountId, ReceiverAccountId, PeriodEnd))
            .ReturnsAsync(_transfers);

            _db.Setup(d => d.SqlQueryAsync <AccountTransfer>(
                          It.IsAny <string>(), ReceiverAccountId, SenderAccountId, PeriodEnd))
            .ReturnsAsync(_transfers);

            _db.Setup(x => x.PeriodEnds).Returns(() => new DbSetStub <PeriodEnd>(_periodEnd));

            _db.Setup(x => x.Transactions).Returns(() => new DbSetStub <TransactionLineEntity>(
                                                       _senderTranferTransaction,
                                                       _recieverTranferTransaction));

            _publicHashingService.Setup(x => x.DecodeValue(SenderPublicHashedId))
            .Returns(SenderAccountId);

            _publicHashingService.Setup(x => x.DecodeValue(ReceiverPublicHashedId))
            .Returns(ReceiverAccountId);

            _publicHashingService.Setup(x => x.HashValue(SenderAccountId))
            .Returns(SenderPublicHashedId);

            _publicHashingService.Setup(x => x.HashValue(ReceiverAccountId))
            .Returns(ReceiverPublicHashedId);
        }