public void CreateCollateralTest() { string user = "******"; string pass = "******"; string bankId = "84"; string ObligorNumber = "0040776246"; string itemNumber = ""; string luw = Constants.CREATE_COLL_LUW_ID;//"L010"; string batchId = "L01"; var collateralCommand = new CreateCollateralCommand(user, pass, bankId, ObligorNumber, batchId, "", "", "", "", itemNumber, luw, ""); //input fields collateralCommand.x1501_FUNCTION_TYPE = "001"; collateralCommand.x1501_CUSIP_NBR = ""; collateralCommand.x1501_COLL_TYPE = "610"; collateralCommand.x1501_ADVANCE_PCT = "0.00"; collateralCommand.x1501_REG_U_ADV_PCT = ""; collateralCommand.x1501_NBR_UNITS = "1"; collateralCommand.x1501_UNIT_PRICE = "9578.26"; collateralCommand.x1501_NBR_PIECES = "1"; collateralCommand.x1501_DESCRIPTION1 = "2015 BIG TEX 16VDX1621F3079153"; collateralCommand.x1501_DESCRIPTION2 = "VIN"; collateralCommand.x1501_LOCATION_RCVD = "82950"; collateralCommand.x1501_LOCATION_HELD = "82950"; collateralCommand.x1501_EFF_DATE = "040115"; collateralCommand.x1501_DATE_RCVD = "040115"; collateralCommand.x1501_EXPIRE_DATE = ""; collateralCommand.x1501_SAFEKEEPING_CD = "0"; collateralCommand.x1501_MAX_LEND_VALUE = "0.00"; collateralCommand.x1501_DDA_1 = ""; collateralCommand.x1508_COUPON_FREQ = ""; collateralCommand.x1508_NEXT_COUPON_DATE = ""; collateralCommand.x1508_FIRST_COUPON_AMT = ""; collateralCommand.x1508_REGULAR_COUPON_AMT = ""; collateralCommand.x1508_GEOTRAC_NBR = "000000000000000"; collateralCommand.x1508_GEOTRAC_IND = "N"; var task = commandBus.ExecuteAsync(collateralCommand); task.GetAwaiter().GetResult(); Assert.IsTrue(collateralCommand.Errors.Length < 1, collateralCommand.Errors); Assert.IsTrue(collateralCommand.ItemNumber.Length > 1); }
/// <summary> /// Creates the collateral. /// </summary> /// <param name="request">The request.</param> public void CreateCollateral(CreateCollateralCommand request) { ClientContext ctx = GetClientContext(request.User, request.Password); CreateCollateralInDocument doc = new CreateCollateralInDocument { LUW_BANK = request.BankId, LUW_BATCH_ID = request.BatchID, LUW_ERROR_MESSAGES = request.Errors, LUW_HEADER_RESTRICTIONS = Constants.LUW_HEADER_REST_CALL_APPL, LUW_ID = request.Luw, LUW_ITEM_NBR = request.ItemNumber, LUW_LENGTH = request.DataLength, LUW_OBLIGATION = request.ObligationNumber, LUW_OBLIGOR = request.ObligorNumber, LUW_REQUEST_CODE = request.RestartRequestCode, SEG_COUNTER = request.Segment, x1501_ADVANCE_PCT = request.x1501_ADVANCE_PCT, x1501_COLL_TYPE = request.x1501_COLL_TYPE, x1501_CUSIP_NBR = request.x1501_CUSIP_NBR, x1501_DATE_RCVD = request.x1501_DATE_RCVD, x1501_DDA_1 = request.x1501_DDA_1, x1501_DESCRIPTION1 = request.x1501_DESCRIPTION1, x1501_DESCRIPTION2 = request.x1501_DESCRIPTION2, x1501_EFF_DATE = request.x1501_EFF_DATE, x1501_EXPIRE_DATE = request.x1501_EXPIRE_DATE, x1501_FUNCTION_TYPE = request.x1501_FUNCTION_TYPE, x1501_LOCATION_HELD = request.x1501_LOCATION_HELD, x1501_LOCATION_RCVD = request.x1501_LOCATION_RCVD, x1501_MAX_LEND_VALUE = request.x1501_MAX_LEND_VALUE, x1501_NBR_PIECES = request.x1501_NBR_PIECES, x1501_NBR_UNITS = request.x1501_NBR_UNITS, x1501_REG_U_ADV_PCT = request.x1501_REG_U_ADV_PCT, x1501_SAFEKEEPING_CD = request.x1501_SAFEKEEPING_CD, x1501_UNIT_PRICE = request.x1501_UNIT_PRICE, x1508_COUPON_FREQ = request.x1508_COUPON_FREQ, x1508_FIRST_COUPON_AMT = request.x1508_FIRST_COUPON_AMT, x1508_GEOTRAC_IND = request.x1508_GEOTRAC_IND, x1508_GEOTRAC_NBR = request.x1508_GEOTRAC_NBR, x1508_NEXT_COUPON_DATE = request.x1508_NEXT_COUPON_DATE, x1508_REGULAR_COUPON_AMT = request.x1508_REGULAR_COUPON_AMT }; try { srv.CreateCollateral(ref doc.LUW_ID, ref doc.LUW_REQUEST_CODE, ref doc.LUW_BATCH_ID, ref doc.LUW_BANK, ref doc.LUW_OBLIGOR, ref doc.LUW_OBLIGATION, ref doc.LUW_ITEM_NBR, ref doc.SEG_COUNTER, ref doc.LUW_HEADER_RESTRICTIONS, ref doc.LUW_LENGTH, ref doc.LUW_ERROR_MESSAGES, ref doc.x1501_FUNCTION_TYPE, ref doc.x1501_CUSIP_NBR, ref doc.x1501_COLL_TYPE, ref doc.x1501_ADVANCE_PCT, ref doc.x1501_REG_U_ADV_PCT, ref doc.x1501_NBR_UNITS, ref doc.x1501_UNIT_PRICE, ref doc.x1501_NBR_PIECES, ref doc.x1501_DESCRIPTION1, ref doc.x1501_DESCRIPTION2, ref doc.x1501_LOCATION_RCVD, ref doc.x1501_LOCATION_HELD, ref doc.x1501_EFF_DATE, ref doc.x1501_DATE_RCVD, ref doc.x1501_EXPIRE_DATE, ref doc.x1501_SAFEKEEPING_CD, ref doc.x1501_MAX_LEND_VALUE, ref doc.x1501_DDA_1, ref doc.x1508_COUPON_FREQ, ref doc.x1508_NEXT_COUPON_DATE, ref doc.x1508_FIRST_COUPON_AMT, ref doc.x1508_REGULAR_COUPON_AMT, ref doc.x1508_GEOTRAC_NBR, ref doc.x1508_GEOTRAC_IND, ref ctx); request.Errors = doc.LUW_ERROR_MESSAGES; request.ItemNumber = doc.LUW_ITEM_NBR; } catch (CustomTIException Ex) { HandleHISException<CreateCollateralCommand>(request, Ex, "CreateCollateral"); } catch (Exception ee) { string msg = ee.Message; request.Errors = msg; throw; } }