public async Task ShouldFindBillByInvoiceNumberAndAgencyCodeSuccess(string invoiceNumbers, string agencyCode)
        {
            var result = await _sut.FindBillByInvoiceNumberAndAgencyCode(invoiceNumbers, agencyCode);

            Assert.NotNull(result);
            Assert.IsType <BillInfo>(result);
        }
Beispiel #2
0
        public async Task <bool> UpdateBulkBillsStatus(List <BillModel> billModel)
        {
            try
            {
                foreach (var item in billModel)
                {
                    var bill = await _billQueries.FindBillByInvoiceNumberAndAgencyCode(item.BillInvoiceNumber, item.AgencyCode);

                    bill.UpdateActionStatus((BillActionStatus)item.ActionStatus);
                    if (item.ActionStatus == (int)Enums.BillActionStatus.CancelBill)
                    {
                        bill.UpdateActionReason(item.ActionReason);
                    }
                    await _billCommands.UpdateWithoutSave(bill);
                }
                await _billCommands.Save();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }