@using Heuristics.Library.Extensions
@{
var ptiId = Model.GetAttributeValue("PTI ID");
var clientCandidateId = ptiId.Replace("PTINIGPCPP", "");
var clientAuthorizationId = "PTINIGPLB" + ("00000000000" + Model.Instance.WriteToItemId.ToString()).Right(11);
var examCode = Model.GetAttributeValue("Exam Code");
var activityStartDate = Model.GetAttributeValue("Activity Start Date");
var activityEndDate = Model.GetAttributeValue("Activity End Date");
var address = Model.Member.DefaultMemberAddress;
var phone = Model.Member.DefaultPhone;
var country = address.Country.ToUpper();
country =
country == "UNITED STATES" ? "USA" :
country == "CANADA" ? "CAN" :
country.IsNull() ? "" : (country+"XXX").Substring(0,3);
var zip = address.MailCode;
zip = zip.IsNull() ? "" : (zip+"00000").Substring(0,5);
}
{
"TestAdministrationId": "@examCode",
"PearsonCandidate":
{
"ClientCandidateId": "@clientCandidateId",
"TestGroup": "NIGP"
},
"PearsonAuthorization": {
"TestAdministrationId": "@examCode",
"StartDate": "@activityStartDate",
"EndDate": "@activityEndDate",
"ClientAuthorizationId": "@clientAuthorizationId",
"AuthorizationCount": 1
},
"FamilyName": "@Model.Member.LastName",
"GivenName": "@Model.Member.FirstName",
"Address":
{
"AddressLine1": "@address.Street1",
"AddressLine2": "@address.Street2",
"AddressLine3": "@address.Street3",
"City": "@address.City",
"State": "@address.State",
"Zip": "@zip",
"ZipExtension": null,
"Country": "@country"
},
"Phone":
{
"Number": "@phone",
"CountryCode": "1"
},
"Email":
{
"Address": "@Model.Member.Email",
"EmailType": "Work"
},
"object":
{
"identifier": "@clientAuthorizationId",
"objectType": "LearningBuilderXApiMessage",
"xApiHandler": "Prolydian",
"activityInstanceId": "@Model.Instance.WriteToItemId",
"ownerId": "@Model.Instance.OwnerId"
}
}