public DipsQueue CreateNewDipsQueue(
            DipsLocationType locationType,
            string batchNumber,
            string traceId,
            DateTime processingDate,
            string jobId)
        {
            var imagePath = string.Format(@"{0}\{1}", adapterConfiguration.ImagePath, batchNumber.Substring(0, 5));

            if (string.IsNullOrEmpty(jobId))
            {
                jobId = DipsJobIdType.NabChqPod.Value;
            }

            if (WorkTypeEnum.NABCHQ_POD.ToString().Equals(jobId))
            {
                jobId = DipsJobIdType.NabChqPod.Value;
            }
            else if (WorkTypeEnum.NABCHQ_LBOX.ToString().Equals(jobId))
            {
                jobId = DipsJobIdType.NabChqLBox.Value;
            }

            var output = new DipsQueue
            {
                //Dynamic DipsQueue Values
                S_BATCH      = batchNumber.PadLeft(8, '0'),
                S_TRACE      = traceId.PadLeft(9, '0'),
                S_SDATE      = processingDate.ToString("dd/MM/yy"),
                S_STIME      = processingDate.ToString("HH:mm:ss"),
                S_SELNSTRING = GenerateSelectionString(processingDate, batchNumber),
                S_JOB_ID     = jobId.PadRight(128, ' '),

                //Default DipsQueue Values
                S_LOCATION = locationType.Value.PadRight(33, ' '),
                S_PINDEX   = GeneratePriorityIndex(),
                S_LOCK     = "0".PadLeft(10, ' '),
                S_CLIENT   = DipsClientType.NabChq.Value.PadRight(80, ' '),
                S_MODIFIED = "0".PadLeft(5, ' '),
                S_COMPLETE = "0".PadLeft(5, ' '),
                S_PRIORITY = adapterConfiguration.DipsPriority.PadLeft(5, ' '),
                S_IMG_PATH = imagePath.PadRight(80, ' '),
                S_VERSION  = adapterConfiguration.Dbioff32Version.PadRight(32, ' '),

                //Ignored fields
                S_UTIME           = string.Empty.PadLeft(10, ' '),
                S_LOCKUSER        = string.Empty.PadLeft(17, ' '),
                S_LOCKMODULENAME  = string.Empty.PadLeft(17, ' '),
                S_LOCKUNITID      = string.Empty.PadLeft(10, ' '),
                S_LOCKMACHINENAME = string.Empty.PadLeft(17, ' '),
                S_LOCKTIME        = string.Empty.PadLeft(10, ' '),
                S_PROCDATE        = string.Empty.PadLeft(9, ' '),
                S_REPORTED        = string.Empty.PadLeft(5, ' '),
            };

            return(output);
        }
        private void InitializeTestData()
        {
            sampleGenerateCorrespondingVoucherRequest = new GenerateCorrespondingVoucherRequest
            {
                jobIdentifier   = "NCST-6e5bc63b-be84-4053-a4ce-191abbd69f27",
                generateVoucher = new VoucherInformation[]
                {
                    new VoucherInformation
                    {
                        voucherBatch = new VoucherBatch
                        {
                            scannedBatchNumber = string.Empty
                        },
                        voucherProcess = new VoucherProcess
                        {
                        },
                        voucher = new Voucher
                        {
                        }
                    }
                }
            };

            sampleDipsQueue = new DipsQueue
            {
                ResponseCompleted = false,
                S_LOCATION        = "GenerateCorrespondingVoucher",
                S_LOCK            = "0"
            };

            sampleDipsNabChqs = new List <DipsNabChq>
            {
                new DipsNabChq
                {
                },
                new DipsNabChq
                {
                }
            };

            sampleDipsDbIndexes = new List <DipsDbIndex>
            {
                new DipsDbIndex
                {
                },
                new DipsDbIndex
                {
                }
            };
        }
Beispiel #3
0
        /// <summary>
        /// Long DRN’s need to be converted/regenerated to 9 digits
        /// </summary>
        /// <param name="queue"></param>
        /// <param name="vouchers"></param>
        /// <param name="dbIndexes"></param>
        private void UpdateVoucherDrns(DipsQueue queue, List <DipsNabChq> vouchers, List <DipsDbIndex> dbIndexes)
        {
            Dictionary <string, string> drnMap = GenerateDrnMap(vouchers);

            try
            {
                if (drnMap.ContainsKey(queue.S_TRACE))
                {
                    queue.S_TRACE = drnMap[queue.S_TRACE];
                }

                vouchers.ForEach(v =>
                {
                    if (drnMap.ContainsKey(v.doc_ref_num))
                    {
                        string shortDrn = drnMap[v.doc_ref_num];
                        v.S_TRACE       = shortDrn;
                        v.trace         = shortDrn;
                        v.doc_ref_num   = shortDrn;
                    }
                });

                dbIndexes.ForEach(d =>
                {
                    if (drnMap.ContainsKey(d.TRACE))
                    {
                        d.TRACE = drnMap[d.TRACE];
                    }
                });
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Error processing CorrectBatchCodelineRequest.UpdateVoucherDrns");
                throw;
            }
        }
 private void ExpectQueueMapperToReturnQueue(DipsQueue queue)
 {
     dipsQueueMapper
     .Setup(x => x.Map(It.IsAny <GenerateCorrespondingVoucherRequest>()))
     .Returns(queue);
 }
Beispiel #5
0
        private GenerateBulkCreditResponse[] GenerateBulkCreditResponse(DipsQueue completedBatch, List <DipsNabChq> vouchers)
        {
            var bulkCreditVouchers = vouchers.Where(v => v.doc_type.Trim().Equals(DocumentTypeEnum.CRT.ToString())).ToList();
            var debitVouchers      = vouchers.Where(v => v.doc_type.Trim().Equals(DocumentTypeEnum.DBT.ToString())).ToList();

            return(bulkCreditVouchers.Select(v => new GenerateBulkCreditResponse
            {
                associatedDebitVouchers = debitVouchers.Select(q => new Voucher
                {
                    accountNumber = ResponseHelper.TrimString(q.acc_num),
                    amount = ResponseHelper.ParseAmountField(q.amount),
                    auxDom = ResponseHelper.TrimString(q.ser_num),
                    bsbNumber = q.bsb_num,
                    documentReferenceNumber = ResponseHelper.TrimString(q.doc_ref_num),
                    documentType = ResponseHelper.ParseDocumentType(q.doc_type),
                    extraAuxDom = ResponseHelper.TrimString(q.ead),
                    processingDate =
                        DateTime.ParseExact(string.Format("{0}", q.proc_date), "yyyyMMdd",
                                            CultureInfo.InvariantCulture),
                    transactionCode = ResponseHelper.TrimString(q.trancode),
                }).ToArray(),

                customerLinkNumber = v.customerLinkNumber,

                bulkCreditVoucher = new VoucherInformation
                {
                    voucher = new Voucher
                    {
                        accountNumber = ResponseHelper.TrimString(v.acc_num),
                        amount = ResponseHelper.ParseAmountField(v.amount),
                        auxDom = ResponseHelper.TrimString(v.ser_num),
                        bsbNumber = v.bsb_num,
                        documentReferenceNumber = ResponseHelper.TrimString(v.doc_ref_num),
                        documentType = ResponseHelper.ParseDocumentType(v.doc_type),
                        extraAuxDom = ResponseHelper.TrimString(v.ead),
                        processingDate =
                            DateTime.ParseExact(string.Format("{0}", v.proc_date), "yyyyMMdd",
                                                CultureInfo.InvariantCulture),
                        transactionCode = ResponseHelper.TrimString(v.trancode),
                    },

                    voucherBatch = new VoucherBatch
                    {
                        batchAccountNumber = v.batchAccountNumber,
                        batchType = ResponseHelper.TrimString(v.batch_type),
                        captureBsb = v.captureBSB,
                        collectingBank = v.collecting_bank,
                        processingState =
                            ResponseHelper.ParseState(ResponseHelper.TrimString(v.processing_state)),
                        scannedBatchNumber = completedBatch.S_BATCH,
                        unitID = bulkCreditVouchers.First().unit_id,
                        workType =
                            ResponseHelper.ParseWorkType(
                                ResponseHelper.TrimString(completedBatch.S_JOB_ID)),
                        subBatchType = ResponseHelper.TrimString(v.sub_batch_type),
                    },

                    voucherProcess = new VoucherProcess
                    {
                        adjustedFlag = ResponseHelper.ParseStringAsBool(v.adjustedFlag),
                        highValueFlag = ResponseHelper.ParseStringAsBool(v.highValueFlag),
                        isGeneratedVoucher = ResponseHelper.ParseStringAsBool(v.isGeneratedVoucher),
                        manualRepair = ResponseHelper.ParseStringAsInt(v.man_rep_ind),
                        preAdjustmentAmount = ResponseHelper.ParseAmountField(v.orig_amount),
                        presentationMode = ResponseHelper.TrimString(v.presentationMode),
                        rawMICR = ResponseHelper.TrimString(v.raw_micr),
                        rawOCR = ResponseHelper.TrimString(v.raw_ocr),
                        repostFromDRN = ResponseHelper.TrimString(v.repostFromDRN),
                        repostFromProcessingDate =
                            ResponseHelper.ParseDateField(v.repostFromProcessingDate),
                        surplusItemFlag = ResponseHelper.ParseStringAsBool(v.surplusItemFlag),
                        suspectFraud = ResponseHelper.ParseStringAsBool(v.micr_suspect_fraud_flag),
                        //thirdPartyCheckFailed = ResponseHelper.ParseTpcResult(v.tpcResult),
                        thirdPartyMixedDepositReturnFlag =
                            ResponseHelper.ParseStringAsBool(v.tpcMixedDepRet),
                        thirdPartyPoolFlag =
                            ResponseHelper.ParseStringAsBool(v.fxa_tpc_suspense_pool_flag),
                        transactionLinkNumber = ResponseHelper.TrimString(v.transactionLinkNumber),
                        unencodedECDReturnFlag =
                            ResponseHelper.ParseStringAsBool(v.fxa_unencoded_ECD_return),
                        unprocessable = ResponseHelper.ParseStringAsBool(v.unproc_flag),
                        voucherDelayedIndicator = ResponseHelper.TrimString(v.voucherIndicatorField),
                        operatorId = ResponseHelper.TrimString(v.op_id),
                        adjustedBy = ResponseHelper.TrimString(v.op_id),
                        adjustmentLetterRequired =
                            ResponseHelper.ParseStringAsBool(v.adjustmentLetterRequired),
                        forValueType = ForValueTypeEnum.Inward_Non_For_Value,
                        postTransmissionQaAmountFlag =
                            ResponseHelper.ParseStringAsBool(v.fxaPtQAAmtFlag),
                        postTransmissionQaCodelineFlag =
                            ResponseHelper.ParseStringAsBool(v.fxaPtQACodelineFlag),
                        adjustmentReasonCode =
                            ResponseHelper.ParseStringAsInt(v.adjustmentReasonCode),
                        adjustmentDescription = ResponseHelper.TrimString(v.adjustmentDescription),
                        alternateAccountNumber = ResponseHelper.TrimString(v.alt_acc_num),
                        alternateAuxDom = ResponseHelper.TrimString(v.alt_ser_num),
                        alternateBsbNumber = ResponseHelper.TrimString(v.alt_bsb_num),
                        alternateExAuxDom = ResponseHelper.TrimString(v.alt_ead),
                        alternateTransactionCode = ResponseHelper.TrimString(v.alt_trancode),
                        customerLinkNumber = v.customerLinkNumber,
                        isGeneratedBulkCredit = ResponseHelper.ParseStringAsBool(v.isGeneratedBulkCredit),
                        creditNoteFlag = false,
                        insertedCreditType = ResponseHelper.ParseInsertedCreditType(v.insertedCreditType)
                    },
                },
            }).ToArray());
        }
Beispiel #6
0
        public void TestInitialize()
        {
            adapterConfiguration = new Mock <IAdapterConfiguration>();
            dateTimeProvider     = new Mock <IDateTimeProvider>();

            dipsBatchMapHelper = new BatchCodelineRequestMapHelper(dateTimeProvider.Object,
                                                                   adapterConfiguration.Object);

            sampleValidateBatchCodelineRequest = new ValidateBatchCodelineRequest
            {
                voucherBatch = new VoucherBatch
                {
                    scannedBatchNumber = "58300013",
                    workType           = WorkTypeEnum.NABCHQ_POD,
                    processingState    = StateEnum.VIC,
                    collectingBank     = "123456",
                    unitID             = "123",
                    batchType          = "testing",
                    subBatchType       = "tst123",
                },
                voucher = new[]
                {
                    new ValidateCodelineRequest
                    {
                        auxDom                  = "001193",
                        bsbNumber               = "013812",
                        accountNumber           = "256902729",
                        transactionCode         = "50",
                        documentReferenceNumber = "583000026",
                        capturedAmount          = "45.67",
                        documentType            = DocumentTypeEnum.DBT,
                        processingDate          = new DateTime(2015, 4, 16, 14, 14, 14),
                    },
                    new ValidateCodelineRequest
                    {
                        auxDom                  = "001193",
                        bsbNumber               = "092002",
                        accountNumber           = "814649",
                        transactionCode         = "50",
                        documentReferenceNumber = "583000027",
                        capturedAmount          = "2341.45",
                        documentType            = DocumentTypeEnum.CRT,
                        processingDate          = new DateTime(2015, 4, 16, 14, 14, 14)
                    }
                }
            };

            sampleDipsQueue = new DipsQueue
            {
                ConcurrencyToken  = null,
                CorrelationId     = null,
                ResponseCompleted = false,
                S_BATCH           = "58300013",
                S_CLIENT          = "NabChq                                                                          ",
                S_COMPLETE        = "    0",
                S_IMG_PATH        = "C:\\Lombard\\Data\\ClientImages\\58300                                              ",
                S_JOB_ID          = "NabChqPod                                                                                                                       ",
                S_LOCATION        = "CodelineValidation               ",
                S_LOCK            = "         0",
                S_LOCKMACHINENAME = "                 ",
                S_LOCKMODULENAME  = "                 ",
                S_LOCKTIME        = "          ",
                S_LOCKUNITID      = "          ",
                S_LOCKUSER        = "******",
                S_MODIFIED        = "    0",
                S_PINDEX          = "05-1504161414140",
                S_PRIORITY        = "    5",
                S_PROCDATE        = "         ",
                S_REPORTED        = "     ",
                S_SDATE           = "16/04/15",
                S_SELNSTRING      = "16/04/15 58300013 NabChqPod                                                                                                     ",
                S_STIME           = "14:14:14",
                S_TRACE           = "583000026",
                S_USERNAME        = null,
                S_UTIME           = "          ",
                S_VERSION         = "4.0.2.152                       "
            };

            sampleDipsNabChqs = new List <DipsNabChq>
            {
                new DipsNabChq
                {
                    acc_num                  = "256902729",
                    adj_code                 = "  ",
                    adj_desc                 = "                              ",
                    adjustmentReasonCode     = "  ",
                    adjustmentDescription    = "                                                            ",
                    adjustedBy               = "               ",
                    adjustedFlag             = " ",
                    adjustmentLetterRequired = " ",
                    adjustmentType           = "         ",
                    amount                   = "45.67",
                    batch                    = "58300013",
                    batch_type               = "testing",
                    bsb_num                  = "013812",
                    collecting_bank          = "123456",
                    delay_ind                = " ",
                    doc_ref_num              = "583000026",
                    doc_type                 = "DBT",
                    ead                      = " ",
                    fv_exchange              = " ",
                    fv_ind                   = " ",
                    held_ind                 = " ",
                    host_trans_no            = "   ",
                    ie_transaction_id        = "            ",
                    img_front                = "        ",
                    img_location             = "                                                                                ",
                    img_rear                 = "        ",
                    job_id                   = "NabChqPod      ",
                    man_rep_ind              = "",
                    manual_repair            = "     ",
                    micr_flag                = " ",
                    micr_suspect_fraud_flag  = " ",
                    micr_unproc_flag         = " ",
                    op_id                    = "               ",
                    @override                = "     ",
                    payee_name               = "                                                                                                                                                                                                                                                ",
                    pocket                   = " 0",
                    presentationMode         = " ",
                    proc_date                = "20150416",
                    proc_time                = "    ",
                    processing_state         = "VIC",
                    proof_seq                = "            ",
                    raw_micr                 = "                                                                ",
                    raw_ocr                  = "                                                                ",
                    rec_type_id              = "    ",
                    receiving_bank           = "   ",
                    repostFromDRN            = "",
                    repostFromProcessingDate = "00010101",
                    S_BALANCE                = "     0",
                    S_BATCH                  = "58300013",
                    S_COMMITTED              = "    0",
                    S_COMPLETE               = "    0",
                    S_DEL_IND                = "    0",
                    S_IMG1_LEN               = "        0",
                    S_IMG1_OFF               = "        0",
                    S_IMG1_TYP               = "    0",
                    S_IMG2_LEN               = "        0",
                    S_IMG2_OFF               = "        0",
                    S_IMG2_TYP               = "    0",
                    S_LENGTH                 = "01025",
                    S_MODIFIED               = "    0",
                    S_REPORTED               = "    0",
                    S_REPROCESS              = "    0",
                    S_SEQUENCE               = "0000 ",
                    S_STATUS1                = "        0",
                    S_STATUS2                = "        0",
                    S_STATUS3                = "        0",
                    S_STATUS4                = "        0",
                    S_TRACE                  = "583000026",
                    S_TYPE                   = "    0",
                    ser_num                  = "001193",
                    sub_batch_type           = "tst123",
                    sys_date                 = "20150416",
                    trace                    = "583000026",
                    trancode                 = "50",
                    trans_seq                = "     ",
                    unit_id                  = "123",
                    volume                   = "        ",
                    creditNoteFlag           = "0"
                },
                new DipsNabChq
                {
                    acc_num                  = "814649",
                    adj_code                 = "  ",
                    adj_desc                 = "                              ",
                    adjustmentReasonCode     = "  ",
                    adjustmentDescription    = "                                                            ",
                    adjustedBy               = "               ",
                    adjustedFlag             = " ",
                    adjustmentLetterRequired = " ",
                    adjustmentType           = "         ",
                    amount                   = "2341.45",
                    batch                    = "58300013",
                    batch_type               = "testing",
                    bsb_num                  = "092002",
                    collecting_bank          = "123456",
                    delay_ind                = " ",
                    doc_ref_num              = "583000027",
                    doc_type                 = "CRT",
                    ead                      = " ",
                    fv_exchange              = " ",
                    fv_ind                   = " ",
                    held_ind                 = " ",
                    host_trans_no            = "   ",
                    ie_transaction_id        = "            ",
                    img_front                = "        ",
                    img_location             = "                                                                                ",
                    img_rear                 = "        ",
                    job_id                   = "NabChqPod      ",
                    man_rep_ind              = "",
                    manual_repair            = "     ",
                    micr_flag                = " ",
                    micr_suspect_fraud_flag  = " ",
                    micr_unproc_flag         = " ",
                    op_id                    = "               ",
                    @override                = "     ",
                    payee_name               = "                                                                                                                                                                                                                                                ",
                    pocket                   = " 0",
                    presentationMode         = " ",
                    proc_date                = "20150416",
                    proc_time                = "    ",
                    processing_state         = "VIC",
                    proof_seq                = "            ",
                    raw_micr                 = "                                                                ",
                    raw_ocr                  = "                                                                ",
                    rec_type_id              = "    ",
                    receiving_bank           = "   ",
                    repostFromDRN            = "",
                    repostFromProcessingDate = "00010101",
                    S_BALANCE                = "     0",
                    S_BATCH                  = "58300013",
                    S_COMMITTED              = "    0",
                    S_COMPLETE               = "    0",
                    S_DEL_IND                = "    0",
                    S_IMG1_LEN               = "        0",
                    S_IMG1_OFF               = "        0",
                    S_IMG1_TYP               = "    0",
                    S_IMG2_LEN               = "        0",
                    S_IMG2_OFF               = "        0",
                    S_IMG2_TYP               = "    0",
                    S_LENGTH                 = "01025",
                    S_MODIFIED               = "    0",
                    S_REPORTED               = "    0",
                    S_REPROCESS              = "    0",
                    S_SEQUENCE               = "0000 ",
                    S_STATUS1                = "        0",
                    S_STATUS2                = "        0",
                    S_STATUS3                = "        0",
                    S_STATUS4                = "        0",
                    S_TRACE                  = "583000027",
                    S_TYPE                   = "    0",
                    ser_num                  = "001193",
                    sub_batch_type           = "tst123",
                    sys_date                 = "20150416",
                    trace                    = "583000027",
                    trancode                 = "50",
                    trans_seq                = "     ",
                    unit_id                  = "123",
                    volume                   = "        ",
                    creditNoteFlag           = "0"
                }
            };

            sampleDipsDbIndexes = new List <DipsDbIndex>
            {
                new DipsDbIndex
                {
                    BATCH    = "58300013",
                    DEL_IND  = "    0",
                    REC_NO   = "0         ",
                    SEQUENCE = "0000 ",
                    TABLE_NO = "    0",
                    TRACE    = "583000026"
                },
                new DipsDbIndex
                {
                    BATCH    = "58300013",
                    DEL_IND  = "    0",
                    REC_NO   = "0         ",
                    SEQUENCE = "0000 ",
                    TABLE_NO = "    0",
                    TRACE    = "583000027"
                }
            };

            ExpectAdapterConfigurationToReturnValues("5", "4.0.2.152", @"C:\Lombard\Data\ClientImages");
            ExpectDateTimeProviderToReturnCurrentTimeInAustralianEasternTimeZone(new DateTime(2015, 4, 16, 14, 14, 14));
        }
 private void ExpectQueueMapperToReturnQueue(DipsQueue queue)
 {
     dipsQueueMapper
     .Setup(x => x.Map(It.IsAny <ValidateBatchTransactionRequest>()))
     .Returns(queue);
 }
        public void TestInitialize()
        {
            lifetimeScope     = new Mock <ILifetimeScope>();
            dipsDbContext     = new Mock <IDipsDbContext>();
            dipsQueueMapper   = new Mock <IMapper <ValidateBatchTransactionRequest, DipsQueue> >();
            dipsVoucherMapper = new Mock <IMapper <ValidateBatchTransactionRequest, IEnumerable <DipsNabChq> > >();
            dipsDbIndexMapper = new Mock <IMapper <ValidateBatchTransactionRequest, IEnumerable <DipsDbIndex> > >();
            transaction       = new Mock <IDipsDbContextTransaction>();
            logger            = new Mock <ILogger>();

            Log.Logger = logger.Object;

            dipsQueueSet   = new InMemoryDbSet <DipsQueue>(true);
            dipsNabChqSet  = new InMemoryDbSet <DipsNabChq>(true);
            dipsDbIndexSet = new InMemoryDbSet <DipsDbIndex>(true);

            sampleValidateBatchTransactionRequest = new ValidateBatchTransactionRequest
            {
                voucherBatch = new VoucherBatch
                {
                    scannedBatchNumber = "5800013"
                },
                voucher = new[]
                {
                    new ValidateTransactionRequest
                    {
                        unprocessable = false,
                        voucher       = new Voucher {
                            auxDom                  = "001193",
                            bsbNumber               = "013812",
                            accountNumber           = "256902729",
                            transactionCode         = "50",
                            documentReferenceNumber = "583000026",
                            amount                  = "45.67"
                        }
                    },
                    new ValidateTransactionRequest
                    {
                        unprocessable = false,
                        voucher       = new Voucher {
                            auxDom                  = "001193",
                            bsbNumber               = "092002",
                            accountNumber           = "814649",
                            transactionCode         = "50",
                            documentReferenceNumber = "583000027",
                            amount                  = "2341.45"
                        }
                    }
                }
            };

            sampleDipsQueue = new DipsQueue
            {
                ResponseCompleted = false,
                S_LOCATION        = "TransactionValidation",
                S_LOCK            = "0",
                S_SDATE           = "01/01/15",
                S_STIME           = "12:12:12",
                S_BATCH           = "58300013"
            };

            sampleDipsNabChqs = new List <DipsNabChq>
            {
                new DipsNabChq
                {
                    amount      = "45.67",
                    acc_num     = "256902729",
                    bsb_num     = "013812",
                    batch       = "58300013",
                    doc_ref_num = "583000026",
                    ser_num     = "001193",
                    trancode    = "50"
                },
                new DipsNabChq
                {
                    amount      = "2341.45",
                    acc_num     = "814649",
                    bsb_num     = "092002",
                    batch       = "58300013",
                    doc_ref_num = "583000027",
                    ser_num     = "001193",
                    trancode    = "50"
                }
            };

            sampleDipsDbIndexes = new List <DipsDbIndex>
            {
                new DipsDbIndex
                {
                    BATCH = "58300013",
                    TRACE = "583000026"
                },
                new DipsDbIndex
                {
                    BATCH = "58300013",
                    TRACE = "583000027"
                }
            };
        }
 private void ExpectQueueMapperToReturnQueue(DipsQueue queue)
 {
     dipsQueueMapper
     .Setup(x => x.Map(It.IsAny <CheckThirdPartyBatchRequest>()))
     .Returns(queue);
 }
        private void InitializeTestData()
        {
            sampleCheckThirdPartyBatchRequest = new CheckThirdPartyBatchRequest
            {
                voucher = new[]
                {
                    new CheckThirdPartyRequest
                    {
                        voucher = new Voucher
                        {
                            processingDate = DateTime.Now
                        }
                    }
                },
                voucherBatch = new VoucherBatch
                {
                    scannedBatchNumber = "58300013",
                },
            };

            sampleDipsQueue = new DipsQueue
            {
                ResponseCompleted = false,
                S_LOCATION        = "CodelineCorrection",
                S_LOCK            = "0",
                S_SDATE           = "01/01/15",
                S_STIME           = "12:12:12",
                S_BATCH           = "58300013"
            };

            sampleDipsNabChqs = new List <DipsNabChq>
            {
                new DipsNabChq
                {
                    amount      = "45.67",
                    acc_num     = "256902729",
                    bsb_num     = "013812",
                    batch       = "58300013",
                    doc_ref_num = "583000026",
                    ser_num     = "001193",
                    trancode    = "50",
                    tpcRequired = "Y",
                    tpcResult   = "F",
                    fxa_unencoded_ECD_return   = "1",
                    tpcMixedDepRet             = "1",
                    fxa_tpc_suspense_pool_flag = "1",
                    highValueFlag = "1"
                },
                new DipsNabChq
                {
                    amount      = "2341.45",
                    acc_num     = "814649",
                    bsb_num     = "092002",
                    batch       = "58300013",
                    doc_ref_num = "583000027",
                    ser_num     = "001193",
                    trancode    = "50",
                    tpcRequired = "Y",
                    tpcResult   = "F",
                    fxa_unencoded_ECD_return   = "1",
                    tpcMixedDepRet             = "1",
                    fxa_tpc_suspense_pool_flag = "1",
                    highValueFlag = "1"
                }
            };

            sampleDipsDbIndexes = new List <DipsDbIndex>
            {
                new DipsDbIndex
                {
                    BATCH = "58300013",
                    TRACE = "583000026"
                },
                new DipsDbIndex
                {
                    BATCH = "58300013",
                    TRACE = "583000027"
                }
            };
        }
Beispiel #11
0
        public DipsQueue CreateNewDipsQueue(
            DipsLocationType locationType,
            string batchNumber,
            string documentReferenceNumber,
            DateTime processingDate,
            string jobIdentifier,
            string jobId)
        {
            if (string.IsNullOrEmpty(batchNumber))
            {
                randomBatchNumber = GenerateBatchNumber();
                batchNumber       = randomBatchNumber.ToString();
            }

            documentReferenceNumber = RequestHelper.ResolveDocumentReferenceNumber(documentReferenceNumber);

            var imagePath = string.Format(@"{0}\{1}", adapterConfiguration.ImagePath, batchNumber.Substring(0, 5));

            if (string.IsNullOrEmpty(jobId))
            {
                jobId = DipsJobIdType.NabChqPod.Value;
            }

            if (WorkTypeEnum.NABCHQ_POD.ToString().Equals(jobId))
            {
                jobId = DipsJobIdType.NabChqPod.Value;
            }

            // temporary fix to enable for value testing - uncomment if required
            //if (WorkTypeEnum.BQL_POD.ToString().Equals(jobId))
            //{
            //    jobId = WorkTypeEnum.NABCHQ_INWARDFV.ToString();
            //}

            var output = new DipsQueue
            {
                //Dynamic DipsQueue Values
                S_BATCH      = batchNumber.PadLeft(8, '0'),
                S_TRACE      = documentReferenceNumber.PadLeft(9, '0'),
                S_SDATE      = processingDate.ToString("dd/MM/yy"),
                S_STIME      = processingDate.ToString("HH:mm:ss"),
                S_SELNSTRING = GenerateSelectionString(processingDate, batchNumber),

                //Default DipsQueue Values
                S_LOCATION = locationType.Value.PadRight(33, ' '),
                S_PINDEX   = GeneratePriorityIndex(),
                S_LOCK     = "0".PadLeft(10, ' '),
                S_CLIENT   = DipsClientType.NabChq.Value.PadRight(80, ' '),
                //S_JOB_ID = DipsJobIdType.NabChqPod.Value.PadRight(128, ' '),
                S_JOB_ID   = jobId.PadRight(128, ' '),
                S_MODIFIED = "0".PadLeft(5, ' '),
                S_COMPLETE = "0".PadLeft(5, ' '),
                S_PRIORITY = adapterConfiguration.DipsPriority.PadLeft(5, ' '),
                S_IMG_PATH = imagePath.PadRight(80, ' '),
                S_VERSION  = adapterConfiguration.Dbioff32Version.PadRight(32, ' '),

                //Ignored fields
                S_UTIME           = string.Empty.PadLeft(10, ' '),
                S_LOCKUSER        = string.Empty.PadLeft(17, ' '),
                S_LOCKMODULENAME  = string.Empty.PadLeft(17, ' '),
                S_LOCKUNITID      = string.Empty.PadLeft(10, ' '),
                S_LOCKMACHINENAME = string.Empty.PadLeft(17, ' '),
                S_LOCKTIME        = string.Empty.PadLeft(10, ' '),
                S_PROCDATE        = string.Empty.PadLeft(9, ' '),
                S_REPORTED        = string.Empty.PadLeft(5, ' '),
            };

            return(output);
        }
Beispiel #12
0
        private void InitializeTestData()
        {
            sampleGenerateBatchBulkCreditRequest = new GenerateBatchBulkCreditRequest
            {
                jobIdentifier    = "NECL-47887b18-e731-4839-b77a-d48c00003328/NGBC-04d91de6-5051-4a17-ab70-b296bb1c4cc4",
                maxDebitVouchers = 10,
                vouchers         = new VoucherGroupCriteria[]
                {
                    new VoucherGroupCriteria
                    {
                        captureBsb = "085384",
                        documentReferenceNumber = "895214001",
                        processingDate          = Convert.ToDateTime("2015/10/20")
                    },
                    new VoucherGroupCriteria
                    {
                        captureBsb = "085385",
                        documentReferenceNumber = "895214003",
                        processingDate          = Convert.ToDateTime("2015/10/20")
                    }
                }
            };

            sampleDipsQueue = new DipsQueue
            {
                ResponseCompleted = false,
                S_LOCATION        = "CodelineCorrection",
                S_LOCK            = "0",
                S_SDATE           = "01/01/15",
                S_STIME           = "12:12:12",
                S_BATCH           = "58300013"
            };

            sampleDipsNabChqs = new List <DipsNabChq>
            {
                new DipsNabChq
                {
                    amount      = "45.67",
                    acc_num     = "256902729",
                    bsb_num     = "013812",
                    batch       = "58300013",
                    doc_ref_num = "583000026",
                    ser_num     = "001193",
                    trancode    = "50",
                    tpcRequired = "Y",
                    tpcResult   = "F",
                    fxa_unencoded_ECD_return   = "1",
                    tpcMixedDepRet             = "1",
                    fxa_tpc_suspense_pool_flag = "1",
                    highValueFlag = "1"
                },
                new DipsNabChq
                {
                    amount      = "2341.45",
                    acc_num     = "814649",
                    bsb_num     = "092002",
                    batch       = "58300013",
                    doc_ref_num = "583000027",
                    ser_num     = "001193",
                    trancode    = "50",
                    tpcRequired = "Y",
                    tpcResult   = "F",
                    fxa_unencoded_ECD_return   = "1",
                    tpcMixedDepRet             = "1",
                    fxa_tpc_suspense_pool_flag = "1",
                    highValueFlag = "1"
                }
            };

            sampleDipsDbIndexes = new List <DipsDbIndex>
            {
                new DipsDbIndex
                {
                    BATCH = "58300013",
                    TRACE = "583000026"
                },
                new DipsDbIndex
                {
                    BATCH = "58300013",
                    TRACE = "583000027"
                }
            };

            sampleVoucherInformation = new VoucherInformation[]
            {
                new VoucherInformation()
                {
                    voucherBatch = new VoucherBatch()
                    {
                        scannedBatchNumber = string.Empty
                    }
                },
                new VoucherInformation()
                {
                    voucherBatch = new VoucherBatch()
                    {
                        scannedBatchNumber = string.Empty
                    }
                }
            };
        }
Beispiel #13
0
 private void ExpectQueueMapperToReturnQueue(DipsQueue queue)
 {
     dipsQueueMapper
     .Setup(x => x.Map(It.IsAny <VoucherInformation[]>()))
     .Returns(queue);
 }
Beispiel #14
0
        private void InitializeLongDrnTestData()
        {
            sampleCorrectBatchCodelineRequest = new CorrectBatchCodelineRequest
            {
                jobIdentifier = "NSBDFGSLA",

                voucherBatch = new VoucherBatch
                {
                    scannedBatchNumber = "58300013"
                },

                voucher = new[]
                {
                    new CorrectCodelineRequest
                    {
                        auxDom                  = "001193",
                        bsbNumber               = "013812",
                        accountNumber           = "256902729",
                        transactionCode         = "50",
                        documentReferenceNumber = "000583000026",
                        capturedAmount          = "45.67"
                    },
                    new CorrectCodelineRequest
                    {
                        auxDom                  = "001193",
                        bsbNumber               = "092002",
                        accountNumber           = "814649",
                        transactionCode         = "50",
                        documentReferenceNumber = "000583000027",
                        capturedAmount          = "2341.45"
                    }
                }
            };

            sampleDipsQueue = new DipsQueue
            {
                ResponseCompleted = false,
                S_LOCATION        = "CodelineCorrection",
                S_LOCK            = "0",
                S_SDATE           = "01/01/15",
                S_STIME           = "12:12:12",
                S_BATCH           = "58300013",
                S_TRACE           = "000583000027"
            };

            sampleDipsNabChqs = new List <DipsNabChq>
            {
                new DipsNabChq
                {
                    amount      = "45.67",
                    acc_num     = "256902729",
                    bsb_num     = "013812",
                    batch       = "58300013",
                    doc_ref_num = "000583000027",
                    trace       = "000583000027",
                    S_TRACE     = "000583000027",
                    ser_num     = "001193",
                    trancode    = "50",
                    tpcRequired = "Y",
                    tpcResult   = "F",
                    fxa_unencoded_ECD_return   = "1",
                    tpcMixedDepRet             = "1",
                    fxa_tpc_suspense_pool_flag = "1",
                    highValueFlag = "1"
                },
                new DipsNabChq
                {
                    amount      = "2341.45",
                    acc_num     = "814649",
                    bsb_num     = "092002",
                    batch       = "58300013",
                    doc_ref_num = "000583000028",
                    trace       = "000583000028",
                    S_TRACE     = "000583000028",
                    ser_num     = "001193",
                    trancode    = "50",
                    tpcRequired = "Y",
                    tpcResult   = "F",
                    fxa_unencoded_ECD_return   = "1",
                    tpcMixedDepRet             = "1",
                    fxa_tpc_suspense_pool_flag = "1",
                    highValueFlag = "1"
                }
            };

            sampleDipsDbIndexes = new List <DipsDbIndex>
            {
                new DipsDbIndex
                {
                    BATCH = "58300013",
                    TRACE = "000583000028"
                },
                new DipsDbIndex
                {
                    BATCH = "58300013",
                    TRACE = "000583000028"
                }
            };
        }
Beispiel #15
0
 private void ExpectQueueMapperToReturnQueue(DipsQueue queue)
 {
     dipsQueueMapper
     .Setup(x => x.Map(It.IsAny <CorrectBatchCodelineRequest>()))
     .Returns(queue);
 }