Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Groovy Online

import groovy.json.JsonBuilder
import groovy.json.JsonSlurper

def discountData = new JsonSlurper().parseText('''
{
 	"SolutionData": {
 		"SolutionType": "New/MACD/ Replace/Reprice",
 		"Activity": "Save/Retrieve",
 		"externalSolId": "4",
 		"externalPsId": "2",
 		"activityType": "pageload",
 		"msPSIId": "",
 		"discAuthLvl": "",
 		"fmrInd": "",
 		"promocd": "",
 		"segment": "",
 		"roleId": "",
 		"strata": "",
 		"billerId": "",
 		"priceplanDetails": [{
 			"PricePlanId": "",
 			"marc": "",
 			"term": "",
 			"RateLetterExpDate": "",
 			"CoterminousIndicator": "",
 			"BundledServiceName": "",
 			"BundledMarcYN": "",
 			"CoterminousExpDate": "",
 			"isbBilled": "",
 			"overrideYN": "",
 			"extendedTermId": "",
 			"pricingSourceId": "",
 			"IcbDiscAppliedByGcsYn": "",
 			"DiscountDetails": {
 				"beid": "",
 				"discountId": "",
 				"discountRefId": "",
 				"offer": {
 					"offercd": "",
 					"country": "",
 					"regioncd": "",
 					"ratePlanId": "",
 					"category": "",
 					"subcategory": ""
 				},
 				"SubGroupDetails": [{
 					"subGroupName": "",
 					"subGroupId": "",
 					"userId": "",
 					"catId": "",
 					"subCatid": "",
 					"sysDfnd": "",
 					"crtdDate": "",
 					"versionNum": "",

 					"activeYN": ""
 				}],
 				"PromoDetails": [{
 					"promocd": "",
 					"desc": "",
 					"regPromoInd": "",
 					"promoRegDataset": "",
 					"startDate": "",
 					"endDate": "",
 					"crtdId": "",
 					"crtdDate": "",
 					"mdfdId": "",
 					"mdfddate": "",
 					"termDatasetName": "",
 					"psocPromoId": ""
 				}]
 			},
 			"SOCList": {
 				"SOCID": "",
 				"SOCVersion": "",
 				"productcd": "",
 				"eRate": "",
 				"Active": "",
 				"effectiveDate": "",
 				"TransactionId": ""
 			},
 			"PriceScenario": [{
 				"PriceScenarioName": ""
 			}]
 		}]
 	}
 }''')

def getDiscountPromoRequest = new JsonBuilder()
def root = getDiscountPromoRequest{
   externalOfferID discountData.SolutionData.externalSolId
   externalPsId discountData.SolutionData.externalPsId
   externalDsgnId 0
   activityType discountData.SolutionData.activityType
   pricePlanDetails discountData.SolutionData.pricePlanDetails
}

println(new JsonBuilder(getDiscountPromoRequest).toPrettyString())




















Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.