Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
122 kB
1
Indexable
Never
/**
 * @description       : 
 * @author            : Andrea Bravaccino
 * @group             : 
 * @last modified on  : 08-24-2021
 * @last modified by  : Andrea Bravaccino
**/
@isTest 
private class CEP_SRV_CommunityUtilitiesTst {
    
    @TestSetup
    static void makeData(){

        wrts_prcgvr.InstallIntegration.install();
        insert TestDataCustomer.createPhaseManagerSettingCase();
        insert TestDataCustomer.createPhaseManagerSettingOpportunity();
        insert TestDataCustomer.createPhaseManagerSettingIntegrationCase();
        insert TestDataCustomer.createPhaseManagerSettingFileMetadata(); 
        
        wrts_prcgvr__PhaseTransition__c pt = new wrts_prcgvr__PhaseTransition__c(
            wrts_prcgvr__Code__c = 'code',
            wrts_prcgvr__Type__c = 'A',
            wrts_prcgvr__RecordTypeId__c = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_Communication').getRecordTypeId(),
            wrts_prcgvr__RecordTypeName__c = 'CEP_RT_Communication',
            wrts_prcgvr__OriginPhase__c = 'New',
            wrts_prcgvr__DestinationPhase__c = 'Errore Stampa',
            wrts_prcgvr__Tags__c = ''
             );
        insert pt;

        CityRegistry__c city = new CityRegistry__c();
        city.Province__c                = 'Bologna';
        city.Region__c                  = 'Emilia-Romagna';
        city.Name                       = 'Bol';
        city.ProvinceAbbreviation__c    = 'BO';
        city.City__c                    = 'Bologna';
        city.CadastralCode__c           = 'A944';
        city.IstatCode__c               = '037006';
        insert city;

        Individual individual = TestDataCustomer.individual().createIndividual().build();
        insert individual;

        Account acc = TestDataCustomer.account().physicalPersonAccount().build();        
        acc.CompanyName__c = 'TestCompanyName';
        acc.Segment__c = 'Mass Market';
        acc.Individual__c = individual.Id;
        acc.FiscalCode__c = '0318345058';
        acc.VATNumber__c = '0318345058';
        insert acc;

        Contact contact = TestDataCustomer.contact().createContact().build();
        contact.AccountId = acc.Id;
        contact.IndividualId = individual.Id;
        contact.NationalIdentityNumber__c = 'BNCPLA80A01F205C';
        insert contact;

        // AccountContactRelation acRelation = TestDataCustomer.AccountContactRelation().createAccountContactRelation(contact.Id, acc.Id).build();
        // insert acRelation;

        Lead l = new Lead();
        l.LastName = 'Verdi';
        l.LastName__c = 'Verdi';
        l.FirstName = 'Mario';
        l.FirstName__c = 'Mario';
        l.Gender__c = 'M';
        insert l;

        Interaction__c inter = new Interaction__c();   
        inter.Channel__c                = 'Teleselling';
        inter.SubChannel__c             = 'Posta';
        inter.Status__c                 = 'New';
        inter.PdcCode__c                = '100'; 
        inter.RecallDate__c             = Date.Today().addDays(10);
        inter.InterlocutorLastName__c   = acc.LastName__c;
        inter.InterlocutorFirstName__c  = acc.FirstName__c;
        inter.InterlocutorNationalIdentityNumber__c = acc.FiscalCode__c;
        inter.Gender__c                 = 'M';
        inter.CompanyName__c            = 'Test';
        inter.VatNumber__c              = acc.VatNumber__c;
        inter.MobilePhone__c            = acc.Phone;
        inter.CEP_Lead__c               = l.Id;
        inter.RecordTypeId              = Schema.SObjectType.Interaction__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_ConfirmationCall').getRecordTypeId();            
        insert inter; 

        Opportunity opty = new Opportunity();
        opty.AccountId          = acc.Id;
        opty.ConfirmationCall__c = inter.Id;
        opty.Name           = 'OptyPDC';
        opty.StageName      = 'Prospecting';
        opty.Channel__c     = 'Teleselling';
        opty.SubChannel__c  = 'Teleselling outbound';
        opty.CloseDate      = System.today();
        opty.ChannelDetail__c = 'Test';
        opty.RecordTypeId   = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('CEP_RT_PDC').getRecordTypeId();
        insert opty;    

        BillingProfile__c bL = TestDataCustomer.billingProfileBuilder().createBillingProfile().build();
        bL.PaymentMethod__c = 'Domiciliazione';
        bL.Account__c = acc.Id;
        insert bL;

        FileMetadata__c fm = new FileMetadata__c();
        fm.Link__c = 'https://www.google.com/';
        fm.FileType__c = '.pdf';
        fm.RecordId__c = opty.Id;
        fm.Opportunity__c = opty.Id;
        fm.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_Communication').getRecordTypeId();

        FileMetadata__c fmlu = new FileMetadata__c();
        fmlu.FileType__c    = '.pdf';
        fmlu.RecordId__c    = opty.Id;
        fmlu.Opportunity__c = opty.Id;
        fmlu.UploadType__c = 'Confirmation Call Teleselling';
        fmlu.UploadTypeDMS__c = 'Allegato';
        fmlu.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_LocalUpload').getRecordTypeId();
        insert new List<FileMetadata__c>{fm, fmlu};

        List<PDC_Mapping__c> listpdc= new List<PDC_Mapping__c>{
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationAt__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingAt',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationBuilding__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingBuilding',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationCity__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingCity',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationCountry__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingCountry',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationFloor__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingFloor',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationIstatCode__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingIstatCode',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationLocality__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingLocality',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationPostalCode__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingPostalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationProvince__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationStaircase__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingStaircase',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationStreetName__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingStreetName',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationStreetNumber__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingStreetNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationStreetNumberExtn__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingStreetNumberExtn',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='CommunicationStreetType__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MailingStreetType',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='DocumentExpirationDate__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Contact.DocumentExpirationDate',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='DocumentNumber__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Contact.DocumentNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='DocumentReleaseDate__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Contact.DocumentReleaseDate',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='DocumentReleasedBy__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Contact.DocumentReleasedBy',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='DocumentType__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Contact.DocumentType',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialAt__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialAt',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialBuilding__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialBuilding',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialCity__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialCity',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialCountry__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialCountry',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialFloor__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialFloor',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialIstatCode__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialIstatCode',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialLocality__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialLocality',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialPostalCode__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialPostalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialProvince__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialStaircase__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialStaircase',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialStreetName__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialStreetName',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialStreetNumber__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialStreetNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialStreetNumberExtn__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialStreetNumberExtn',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialStreetType__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialStreetType',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='AccountType__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.AccountType',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Code__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.Code',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Commodity__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.Commodity',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LoyaltyConsent__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.LoyaltyConsent',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Note__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.Note',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='PDCType__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.PDCType',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ProductFamily__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.ProductFamily',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ProfilingConsent__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.ProfilingConsent',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='RecipientCode__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.RecipientCode',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='SolicitationConsent__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.SolicitationConsent',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ThirdPartySolicitationConsent__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.ThirdPartySolicitationConsent',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BirthCity__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='RefContact.BirthCity',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Individual',Step__c=3,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerBirthCountry__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.BirthCountry',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BirthCountry__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='RefContact.BirthCountry',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Individual',Step__c=3,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerBirthDate__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.BirthDate',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BirthDate',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='RefContact.BirthDate',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Individual',Step__c=3,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BirthDate__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.BirthDate',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerBirthProvince__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.BirthProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BirthProvince__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='RefContact.BirthProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Individual',Step__c=3,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationAt__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationAt',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationBuilding__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationBuilding',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationCity__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationCity',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationCountry__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationCountry',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationFloor__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationFloor',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationIstatCode__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationIstatCode',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationLocality__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationLocality',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationPostalCode__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationPostalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationProvince__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationStaircase__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationStaircase',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationStreetName__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationStreetName',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='NationalIdentityNumber__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.FiscalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='FirstName',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='BillingProfile__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='billinProfileId',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='SignatureDate__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.SignatureDate',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='DateTime',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='PreferredContact__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.PreferredContact',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialAt__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialAt',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialBuilding__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialBuilding',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialCity__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialCity',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialCountry__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialCountry',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialFloor__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialFloor',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialIstatCode__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialIstatCode',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialLocality__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialLocality',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialPostalCode__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialPostalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialProvince__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialStaircase__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialStaircase',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialStreetName__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialStreetName',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialStreetNumber__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialStreetNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialStreetNumberExtn__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialStreetNumberExtn',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialStreetType__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialStreetType',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Segment__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.Segment',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='VATNumber__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.VatNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Test',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='VATNumber__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.VatNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthCity__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.BirthCity',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthDate__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.BirthDate',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='DocumentNumber__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Contact.DocumentNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='DocumentReleasedBy__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Contact.DocumentReleasedBy',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='DocumentReleasedDate__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Contact.DocumentReleaseDate',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='DocumentType__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Contact.DocumentType',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LegalContactFirstName__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LegalContactLastName__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LegalContactFiscalCode__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.NationalIdentityNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LegalContactDocReleaseDate__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.DocumentReleaseDate',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LegalContactDocumentNumber__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.DocumentNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LegalContactDocumentReleasedBy__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.DocumentReleasedBy',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LegalContactDocumentType__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.DocumentType',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CompanyName__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.CompanyName',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='VatNumber__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.VatNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Phone',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.MobilePhone',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Email',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.Email',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='PEC__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.PEC',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Phone__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.Phone',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Phone__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.Phone',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='MobilePhone__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.MobilePhone',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='MobilePhone__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.MobilePhone',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Email__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.Email',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Email__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.Email',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='PEC__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.PEC',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='PEC__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.PEC',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='PreferredContact__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.PreferredContact',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='LastName',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationStreetNumber__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationStreetNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationStreetNumberExtn__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationStreetNumberExtn',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationStreetType__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationStreetType',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerDocumentExpirationDate__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.DocumentExpirationDate',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='DocumentExpirationDate__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.DocumentExpirationDate',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerDocumentNumber__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.DocumentNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='DocumentNumber__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.DocumentNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerDocumentReleaseDate__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.DocumentReleaseDate',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='DocumentReleaseDate__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.DocumentReleaseDate',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerDocumentReleasedBy__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.DocumentReleasedBy',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='DocumentReleasedBy__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.DocumentReleasedBy',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerDocumentType__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.DocumentType',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='DocumentType__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.DocumentType',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Email',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.Email',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerFirstName__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='FirstName',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='RefContact.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Individual',Step__c=3,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='FirstName',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerGender__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.Gender',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Gender__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='RefContact.Gender',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Individual',Step__c=3,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Gender__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.Gender',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerLastName__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='LastName',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='RefContact.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Individual',Step__c=3,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='LastName',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerMobilePhone__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.MobilePhone',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='MobilePhone',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.MobilePhone',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerFiscalCode__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.NationalIdentityNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='NationalIdentityNumber__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='RefContact.NationalIdentityNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Individual',Step__c=3,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='NationalIdentityNumber__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.NationalIdentityNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ReferrerPec__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.PEC',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='PEC__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.PEC',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='PhoneReferent__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='RefContact.Phone',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Phone',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.Phone',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='BirthCity__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.BirthCity',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Test',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthCity__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.BirthCity',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthCity__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='Account.BirthCity',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Individual',Step__c=1,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthCountry__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.BirthCountry',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthCountry__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='Account.BirthCountry',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Individual',Step__c=1,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='BirthDate__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.BirthDate',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Date',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthDate__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.BirthDate',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Date',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthDate',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='Account.BirthDate',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Individual',Step__c=1,Type__c='Date',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthProvince__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.BirthProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthProvince__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='Account.BirthProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Individual',Step__c=1,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BusinessType__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.BusinessType',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Picklist',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Company',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.CompanyName',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Test',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CompanyName__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.CompanyName',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Email',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.Email',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Email__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.Email',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='FirstName__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='FirstName',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='FirstName__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='FirstName',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='Account.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Individual',Step__c=1,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='FiscalCode__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.FiscalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='FiscalCode__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.FiscalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='FiscalCode__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.FiscalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='NationalIdentityNumber__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='Account.FiscalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Individual',Step__c=1,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Gender__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.Gender',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Gender__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.Gender',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Gender__c',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='Account.Gender',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Individual',Step__c=1,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='GroupVATNumber__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.GroupVATNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='IndividualCompanyName__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.IndividualCompanyName',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LastName__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LastName',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='LastName__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='LastName',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='Account.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Individual',Step__c=1,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='LegalForm__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.LegalForm',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Picklist',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingAt__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingAt',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingBuilding__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingBuilding',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingCity__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingCity',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingCountry__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingCountry',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingFloor__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingFloor',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingIstatCode__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingIstatCode',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingLocality__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingLocality',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingPostalCode__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingPostalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingProvince__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingStaircase__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingStaircase',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingStreetName__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingStreetName',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingStreetNumber__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingStreetNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingStreetNumberExtn__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingStreetNumberExtn',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingStreetType__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingStreetType',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MarketType__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MarketType',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MobilePhone',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.MobilePhone',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MobilePhone__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MobilePhone',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='PEC__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.PEC',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Phone',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.Phone',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Phone',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.Phone',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='PreferredContact__c',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='Account.PreferredContact',SourceValue__c='',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Account',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='accountId',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Status',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='',SourceValue__c='Converted',SourceVariable__c='',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ConvertedAccountId',DestinationObject__c='Lead',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='AccountId',StepName__c='Lead',Step__c=8,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialAddressNormalized__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialAddressNormalized',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ResidentialAddressForced__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.ResidentialAddressForced',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingAddressNormalized__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingAddressNormalized',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='MailingAddressForced__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='Account.MailingAddressForced',SourceValue__c='',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BusinessType__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='',SourceValue__c='Persona fisica - ditta individuale',SourceVariable__c='',StepName__c='Account',Step__c=5,Type__c='Picklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Name',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='AccountName',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Key__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='AccountKey',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Type',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='AccountType',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='RecordType.Name',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='AccountRecordTypeId',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Individual__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='CustomerIndividualId',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Individual__c',DestinationObject__c='Account',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='RefIndividualId',StepName__c='Account',Step__c=5,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Individual',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='CustomerIndividualId',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='IsActive',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='True',SourceVariable__c='',StepName__c='Customer AccountContactRelation',Step__c=6,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='StartDate',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='TodayDate',StepName__c='Customer AccountContactRelation',Step__c=6,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='AccountId',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='AccountId',StepName__c='Customer AccountContactRelation',Step__c=6,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ContactId',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='CustomerContactId',StepName__c='Customer AccountContactRelation',Step__c=6,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Roles',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='Customer',SourceVariable__c='',StepName__c='Customer AccountContactRelation',Step__c=6,Type__c='MultiPicklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Individual',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='RefIndividualId',StepName__c='Administrative Contact',Step__c=4,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='IsActive',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='True',SourceVariable__c='',StepName__c='Administrative AccountContactRelation',Step__c=7,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='StartDate',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='TodayDate',StepName__c='Administrative AccountContactRelation',Step__c=7,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Roles',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='Amministratore/Rappresentante Legale',SourceVariable__c='',StepName__c='Administrative AccountContactRelation',Step__c=7,Type__c='MultiPicklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='AccountId',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='AccountId',StepName__c='Administrative AccountContactRelation',Step__c=7,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='ContactId',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='RefContactId',StepName__c='Administrative AccountContactRelation',Step__c=7,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='SubscriberContact__c',DestinationObject__c='BillingProfile__c',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='SubContactId',StepName__c='Billing Profile',Step__c=12,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='AdministrativeContact__c',DestinationObject__c='BillingProfile__c',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='RefContactId',StepName__c='Billing Profile',Step__c=12,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Individual',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='SubIndividualId',StepName__c='Subscriber Contact',Step__c=10,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='StartDate',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='TodayDate',StepName__c='Subscriber AccountContactRelation',Step__c=11,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='IsActive',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='True',SourceVariable__c='',StepName__c='Subscriber AccountContactRelation',Step__c=11,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='ContactId',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='SubContactId',StepName__c='Subscriber AccountContactRelation',Step__c=11,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='AccountId',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='',SourceVariable__c='AccountId',StepName__c='Subscriber AccountContactRelation',Step__c=11,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Roles',DestinationObject__c='AccountContactRelation',IsActive__c=true,SourceFieldName__c='',SourceValue__c='Sottoscrittore Domiciliazione',SourceVariable__c='',StepName__c='Subscriber AccountContactRelation',Step__c=11,Type__c='MultiPicklist',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Phone',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.Phone',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Phone',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='RecipientCode__c',DestinationObject__c='BillingProfile__c',IsActive__c=true,SourceFieldName__c='Opportunity.RecipientCode',SourceValue__c='',SourceVariable__c='',StepName__c='Billing Profile',Step__c=12,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Gender__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.Gender',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Text',NotUpdatable__c=true),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='Gender__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.Gender',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='Gender__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.Gender',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='BirthProvince__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.BirthProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BirthProvince__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.BirthProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='FirstName__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='LastName__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='FiscalCode__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.NationalIdentityNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BirthCity__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.BirthCity',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BirthProvince__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.BirthProvince',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='BirthDate__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.BirthDate',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='DocumentNumber__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.DocumentNumber',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='DocumentReleasedBy__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.DocumentReleasedBy',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='DocumentReleasedDate__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.DocumentReleaseDate',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Date',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='DocumentType__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='RefContact.DocumentType',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='FirstName__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.FirstName',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='LastName__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.LastName',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='FiscalCode__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Account.FiscalCode',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationAddressForced__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationAddressForced',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='PF',DestinationApiName__c='ResidentialAddressNormalized__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Account.ResidentialAddressNormalized',SourceValue__c='',SourceVariable__c='',StepName__c='Customer Contact',Step__c=2,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='ORG',DestinationApiName__c='CommunicationAddressNormalized__c',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='RefContact.CommunicationAddressNormalized',SourceValue__c='',SourceVariable__c='',StepName__c='Administrative Contact',Step__c=4,Type__c='Boolean',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='InvoiceTrackingCode__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.InvoiceTrackingCode',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='CompletionMode__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.CompletionMode',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Name',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.PdcCodeTeleselling',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Name',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.Code',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Code__c',DestinationObject__c='Opportunity',IsActive__c=true,SourceFieldName__c='Opportunity.PdcCodeTeleselling',SourceValue__c='',SourceVariable__c='',StepName__c='Opportunity',Step__c=13,Type__c='Text',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='Email',DestinationObject__c='Contact',IsActive__c=true,SourceFieldName__c='Subscriber.Email',SourceValue__c='',SourceVariable__c='',StepName__c='Subscriber Contact',Step__c=13,Type__c='Email',NotUpdatable__c=false),
        new PDC_Mapping__c(ClientType__c='CROSS',DestinationApiName__c='LastName',DestinationObject__c='Individual',IsActive__c=true,SourceFieldName__c='Subscriber.Email',SourceValue__c='',SourceVariable__c='',StepName__c='Subscriber Individual',Step__c=13,Type__c='Text',NotUpdatable__c=false)
        };
        insert listpdc; 

        Campaign c = new Campaign();
        c.IsActive  = true;
        c.Name      = 'TestCampaign';
        c.Object__c = 'Consensi';
        c.Status    = 'Attiva';
        c.Type      = 'Servizio';
        insert c; 

        CampaignMember cm = new CampaignMember();
        cm.CampaignId = c.Id;
        cm.ChannelDetail__c = 'CC Outbound';
        cm.ContactId = contact.Id;
        cm.Phase__c = 'Da Lavorare';
        insert cm;
        
    }

    @IsTest
    static void getLocationsTst(){
        
        Test.startTest();
        Map<String, Object> toReturn = CEP_SRV_CommunityUtilities.getLocations('Bologna');
        toReturn = CEP_SRV_CommunityUtilities.getLocations(null);
        Boolean error = (Boolean) toReturn.get('error');
            Map<String, Object> response = CEP_SRV_CommunityUtilities.getLocations('Ferrara');
            Boolean error2 = (Boolean) response.get('error');
            System.assert(toReturn != null);
        Test.stopTest();
        
    }

    @IsTest
    static void getLocationTst(){
        
        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.getLocation('Bologna');
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);
        Test.stopTest();
    
    }

    @IsTest
    static void createEntityTst(){

        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];

        Map<String,Object> mapDataIdValue = new Map<String,Object>{
            'OpportunityId'             => op.Id,
            'Opportunity.AccountType'   => 'Persona Fisica',
            'Account.FiscalCode'        => 'BNCPLA80A01F205C'
        };

        Test.startTest();

            Map<String, Object> response = CEP_SRV_CommunityUtilities.createEntity(JSON.serialize(mapDataIdValue));

            mapDataIdValue = new Map<String,Object>{
                'OpportunityId'             => op.Id,
                'Opportunity.AccountType'   => 'Organizzazione',
                'Account.VatNumber'         => '0318345058'
            };

            try{

                response = CEP_SRV_CommunityUtilities.createEntity(JSON.serialize(mapDataIdValue));
                
            }catch( Exception e ){

            }

            System.assert(response != null);
        Test.stopTest();
    }

    @IsTest
    static void createEntityOrgTst(){

        Opportunity op = [SELECT Id, Name FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];

        Map<String,Object> mapDataIdValue = new Map<String,Object>{
            'OpportunityId'             => op.Id,
            'Opportunity.AccountType'   => 'Organizzazione',
            'Account.VatNumber'         => '0318345058'
        };

        Test.startTest();
            //Map<String, Object> response = CEP_SRV_CommunityUtilities.createEntity(JSON.serialize(mapDataIdValue));
            insert new FileMetadata__c ( Opportunity__c = op.Id , RecordId__c = op.Id, Phase__c = 'Stampato' , DeliveryChannel__c='Adobe' , RecordTypeId = CEP_UTL_RecordType.getRecordTypeIdByDeveloperName('CEP_RT_Communication', 'FileMetadata__c') );
        
            Interaction__c i = new Interaction__c( PdcCode__c = op.Name, RecordTypeId = CEP_UTL_RecordType.getRecordTypeIdByDeveloperName('CEP_RT_ConfirmationCall', 'Interaction__c'));

            insert i;

            op.ConfirmationCall__c = i.Id;

            update op;

            CEP_SRV_CommunityUtilities.manageNonAccettata( new Opportunity( StageName = 'Non Accettata' ) );

            try{

                CEP_SRV_CommunityUtilities.canCallPrinting( op.Id );
            
            }catch( Exception e ){
                

            }
            try{

                CEP_SRV_CommunityUtilities.modifyCompletionToAdobe( op.Id );
            
            }catch( Exception e ){
                

            }
            try{

                CEP_SRV_CommunityUtilities.getContarctAccount( op.Id );
            
            }catch( Exception e ){
                

            }
            try{

                CEP_SRV_CommunityUtilities.sendReminder( op.Id );
            
            }catch( Exception e ){
                

            }
            try{

                CEP_SRV_CommunityUtilities.getInteraction( i.Id );
                CEP_SRV_CommunityUtilities.getInteraction( null );
            
            }catch( Exception e ){
                

            }

            try{

                CEP_SRV_CommunityUtilities.checkConfirmPdc( op.Id );
            
            }catch( Exception e ){
                

            }
            try{
                Map<String,String> params = new Map<String,String>();
                params.put('opptyId', op.Id);
                params.put('invoiceTracking', 'test1');
                params.put('invoicePhone', 'test1');
                params.put('agencyCode', 'test1');
                CEP_SRV_CommunityUtilities.callInv05( params );
            
            }catch( Exception e ){
                
                System.assert( e != null );

            }

        Test.stopTest();
    
    }

    @IsTest
    static void createEntityWithContractAccountTst(){
        Account firstAcc = [SELECT Id,FiscalCode__c,VATNumber__c FROM Account limit 1];
        Contact c = [SELECT Id FROM Contact limit 1];

        Account acc = TestDataCustomer.account().physicalPersonAccount().build();        
        acc.CompanyName__c = 'TestCompanyName1';
        acc.Name = 'Giovanni';
        acc.FirstName__c='Giovanni';
        acc.LastName__c='Lavito';
        acc.CompanyName__c ='compasrl';
        acc.Segment__c = 'Mass Market';
        acc.FiscalCode__c ='LVTGNN80A01F205R';
        acc.VATNumber__c = '0318345059';
        acc.Phone ='+333154665429';
        insert acc;

        Opportunity opty = new Opportunity();
        opty.AccountId          = acc.Id;
        
        opty.Name           = 'OptyPDC';
        opty.StageName      = 'Prospecting';
        opty.Channel__c     = 'Door to Door';
        opty.SubChannel__c  = 'Door to Door app';
        opty.CloseDate      = System.today();
        opty.ChannelDetail__c = 'Acea Energia';
        opty.CreditCheckFullStatus__c = 'In Corso';
        opty.RecordTypeId   = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('CEP_RT_PDC').getRecordTypeId();
        insert opty;
        
        AccountContactRelation acr = TestDataCustomer.AccountContactRelation().createAccountContactRelation(c.Id,acc.Id).build();
        acr.Roles = 'Customer;Amministratore/Rappresentante Legale;Sottoscrittore Domiciliazione';
        insert acr;
        
        Map<String,Object> mapDataIdValue = new Map<String,Object>{
            'OpportunityId'             => opty.Id,
            'Opportunity.AccountType'   => 'Persona Fisica',
            'Account.FiscalCode'        => firstAcc.FiscalCode__c,
            'Account.VATNumber'         => firstAcc.VATNumber__c,
            'RefContact.NationalIdentityNumber' => firstAcc.FiscalCode__c,
            'Subscriber.NationalIdentityNumber' => firstAcc.FiscalCode__c,
            'BillingProfile.PaymentMethod'  => 'Domiciliazione'
        };

        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.createEntity(JSON.serialize(mapDataIdValue));

            mapDataIdValue = new Map<String,Object>{
                'OpportunityId'             => opty.Id,
                'Opportunity.AccountType'   => 'Organizzazione',
                'Opportunity.CompanyName'   => 'Organizzazione',
                'Account.FiscalCode'        => firstAcc.FiscalCode__c,
                'Account.VATNumber'         => firstAcc.VATNumber__c,
                'RefContact.NationalIdentityNumber' => firstAcc.FiscalCode__c,
                'Subscriber.NationalIdentityNumber' => firstAcc.FiscalCode__c,
                'BillingProfile.PaymentMethod'  => 'Domiciliazione'
            };

            response = CEP_SRV_CommunityUtilities.createEntity(JSON.serialize(mapDataIdValue));

            System.assert(response != null);
        Test.stopTest();
    }
    
    @IsTest
    static void insertConfirmationCallTst(){

        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];

        Test.startTest();
            Map<String, Object> response  = CEP_SRV_CommunityUtilities.insertConfirmationCall(op.Id,'','');
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);

        Test.stopTest();
    
    }

    @IsTest
    static void getOpportunityTst(){

        Interaction__c i = [SELECT Id FROM Interaction__c WHERE RecordType.DeveloperName = 'CEP_RT_ConfirmationCall' LIMIT 1];

        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.getOpportunity('');
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);

            Map<String, Object> responseUser = CEP_SRV_CommunityUtilities.getUser(UserInfo.getUserId());
            Boolean errorUser = (Boolean) responseUser.get('error');
            //System.assert(errorUser == false);

            String leadId = CEP_SRV_CommunityUtilities.getLeadId(i.Id);
            System.assert(leadId != null);

        Test.stopTest();
    
    } 

    @IsTest
    static void insertConsentCaseTst(){

        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        Case cs = new Case(Opportunity__c = op.Id, Subject = 'Gestione Consensi');
        insert cs;
        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.insertConsentCase(op.Id);
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);
        Test.stopTest();    
    }

    @IsTest
    static void insertConsentCaseCatchTst(){

        Account acc = TestDataCustomer.account().physicalPersonAccount().build();        
        acc.CompanyName__c = 'TestCompanyName1';
        acc.Name = 'Giovanni';
        acc.FirstName__c='Giovanni';
        acc.LastName__c='Lavito';
        acc.CompanyName__c ='compasrl';
        acc.Segment__c = 'Mass Market';
        acc.FiscalCode__c ='LVTGNN80A01F205R';
        acc.VATNumber__c = '0318345059';
        acc.Phone ='+333154665429';
        insert acc;

        Opportunity opty = new Opportunity();
        opty.AccountId          = acc.Id;
        
        opty.Name           = 'OptyPDC';
        opty.StageName      = 'Prospecting';
        opty.Channel__c     = 'Teleselling';
        opty.SubChannel__c  = 'Teleselling outbound';
        opty.CloseDate      = System.today();
        opty.ChannelDetail__c = 'Test';
        opty.CreditCheckFullStatus__c = 'In Corso';
        opty.RecordTypeId   = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('CEP_RT_PDC').getRecordTypeId();
        insert opty;    

        
        Test.startTest();
        try{
            Map<String, Object> response = CEP_SRV_CommunityUtilities.insertConsentCase(opty.Id);
        }
        catch (Exception e){
            System.assert(e.getMessage() != '');
        }
        Test.stopTest();    
    }

    @IsTest
    static void checkFinalConfirmTst(){

        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];

        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'false', new Map<String,String>());
            response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'true', new Map<String,String>());
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);
        Test.stopTest();
    }

    @IsTest
    static void checkFinalConfirmIsd2dTst(){

        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        op.StageName='Non Lavorata';
        op.RethinkingRight__c = 'SI';
        update op;
        Map<String,String> consensi = new Map<String,String>();
        consensi.put('SolicitationConsent__c','NO');
        consensi.put('ThirdPartySolicitationConsent__c','NO');
        consensi.put('LoyaltyConsent__c','NO');
        consensi.put('ProfilingConsent__c','NO');

        FileMetadata__c fmlu = new FileMetadata__c();
        fmlu.FileType__c    = '.pdf';
        fmlu.Link__c        = 'https://www.google.com/';
        fmlu.RecordId__c    = op.Id;
        fmlu.Opportunity__c = op.Id;
        fmlu.UploadType__c  = 'Proposta di Contratto';
        fmlu.UploadTypeDMS__c = 'Allegato';
        fmlu.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_LocalUpload').getRecordTypeId();
        insert fmlu;

        FileMetadata__c fmlu1 = new FileMetadata__c();
        fmlu1.FileType__c   = '.pdf';
        fmlu1.Link__c       = 'https://www.google.com/';
        fmlu1.RecordId__c   = op.Id;
        fmlu1.Opportunity__c= op.Id;
        fmlu1.UploadType__c = 'Vocal Order Full';
        fmlu1.UploadTypeDMS__c = 'Allegato';
        fmlu1.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_LocalUpload').getRecordTypeId();
        insert fmlu1;

        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'false', consensi);
            response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'true', consensi);
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);
        Test.stopTest();

        /*Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        
        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'true', new Map<String,String>());
            response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'false', new Map<String,String>());
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);
        Test.stopTest();*/
    } 

    @IsTest
    static void checkFinalConfirmWithOsiTst(){

        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        
        Product2 product2 = TestDataCustomer.product2().build();
        product2.Resident__c='SI';
        insert product2;

        OpportunityServiceItem__c osi = TestDataCustomer.opportunityServiceItem().createOpportunityServiceItem().setOpportunity(op.Id).build();
        osi.RecordtypeId = Schema.SObjectType.OpportunityServiceItem__c.getRecordTypeInfosByDeveloperName().get('Electric').getRecordTypeId();
        osi.Product__c = product2.Id;
        insert osi;

        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'true', new Map<String,String>());
            response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'false', new Map<String,String>());
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);
        Test.stopTest();
    }

    @IsTest
    static void checkFinalConfirmWithOsi1Tst(){

        /* Account acc = [SELECT Id FROM Account limit 1];
        
        Opportunity opty = new Opportunity();
        opty.AccountId          = acc.Id;
        
        opty.Name           = 'OptyPDC';
        opty.StageName      = 'Prospecting';
        opty.Channel__c     = 'Teleselling';
        opty.SubChannel__c  = 'Teleselling outbound';
        opty.CloseDate      = System.today();
        opty.ChannelDetail__c = 'Test';
        opty.CreditCheckFullStatus__c = 'In Corso';
        opty.RecordTypeId   = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('CEP_RT_PDC').getRecordTypeId();
        insert opty;    

        FileMetadata__c fmlu = new FileMetadata__c();
        fmlu.FileType__c    = '.pdf';
        fmlu.RecordId__c    = opty.Id;
        fmlu.Opportunity__c = opty.Id;
        fmlu.UploadType__c = 'Proposta di Contratto';
        fmlu.UploadTypeDMS__c = 'Allegato';
        fmlu.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_LocalUpload').getRecordTypeId();
        insert fmlu;
                
        Product2 product2 = TestDataCustomer.product2().build();
        product2.Resident__c='SI';
        insert product2;

        OpportunityServiceItem__c osi = TestDataCustomer.opportunityServiceItem().createOpportunityServiceItem().setOpportunity(opty.Id).build();
        osi.RecordtypeId = Schema.SObjectType.OpportunityServiceItem__c.getRecordTypeInfosByDeveloperName().get('Electric').getRecordTypeId();
        osi.Product__c = product2.Id;
        insert osi;

        Test.startTest();
            try{
                Map<String, Object> response = CEP_SRV_CommunityUtilities.checkFinalConfirm(opty.Id, '', 'true', new Map<String,String>());
                Boolean error = (Boolean) response.get('error');
            }
            catch(Exception e){
                System.assert(e.getMessage() != '');
            }
        Test.stopTest(); */
    }  

    @IsTest
    static void checkBillingoProfileTst(){

        List<BillingProfile__c> bpList = [SELECT Id, PaymentMethod__c, IBAN__c, BillingStreetType__c, BillingStreetName__c, BillingCity__c, BillingProvince__c, BillingLocality__c, BillingPostalCode__c, BillingCountry__c FROM BillingProfile__c LIMIT 1]; 

        Map<String,Object> mapDataIdValue = new Map<String,Object>();
        mapDataIdValue.put('BillingProfile.PaymentMethod', 'Domiciliazione');
        mapDataIdValue.put('BillingProfile.IBAN', bpList[0].IBAN__c);
        mapDataIdValue.put('BillingProfile.BillingStreetType', 'via');
        bpList[0].BillingStreetType__c = 'via';
        mapDataIdValue.put('BillingProfile.BillingStreetName', 'vigna zega');
        bpList[0].BillingStreetName__c = 'vigna zega';
        mapDataIdValue.put('BillingProfile.BillingStreetNumber', '3');
        bpList[0].BillingStreetNumber__c = '3';
        mapDataIdValue.put('BillingProfile.BillingCity', 'Roma');
        bpList[0].BillingCity__c = 'Roma';
        mapDataIdValue.put('BillingProfile.BillingProvince', 'RM');
        bpList[0].BillingProvince__c = 'RM';
        mapDataIdValue.put('BillingProfile.BillingLocality', '123');
        bpList[0].BillingLocality__c = '123';
        mapDataIdValue.put('BillingProfile.BillingPostalCode', '00148');
        bpList[0].BillingPostalCode__c = '00148';
        mapDataIdValue.put('BillingProfile.BillingCountry', 'Italy');
        bpList[0].BillingCountry__c = 'Italy';

        Test.startTest();
            String response = CEP_SRV_CommunityUtilities.checkBillingoProfile(bpList,mapDataIdValue); 
            System.assert(response != null);
        Test.stopTest();
    }
    
    @IsTest
    static void invokeDCSTst(){
        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];

        FileMetadata__c fm = new FileMetadata__c();
        fm.Link__c = 'https://www.google.com/';
        fm.FileType__c = '.pdf';
        fm.RecordId__c = op.Id;
        fm.Opportunity__c = op.Id;
        fm.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_Communication').getRecordTypeId();
        insert fm;

        Test.startTest();
        Map<String, Object> response;
        try{
            response = CEP_SRV_CommunityUtilities.invokeDCS(op.Id);
            Boolean error = (Boolean) response.get('error');
            System.assertEquals(true, response!=null);
        }catch(Exception e){
            System.assertEquals(true, response==null);
        }

        Test.stopTest();
    }
    @isTest
    public static void getPdfLinkTest(){
        Opportunity opp = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        Test.startTest();
        String strRet = CEP_SRV_CommunityUtilities.getPdfLink(opp.Id);
        Test.stopTest();
        System.assertEquals(true, strRet == '');
    }
    
    @isTest
    public static void getPdfLinkTest1(){
        Account acc = [SELECT Id FROM Account limit 1];
        
        Opportunity opty = new Opportunity();
        opty.AccountId          = acc.Id;
        
        opty.Name           = 'OptyPDC';
        opty.StageName      = 'Prospecting';
        opty.Channel__c     = 'Door to Door';
        opty.SubChannel__c  = 'Door to Door app';
        opty.CloseDate      = System.today();
        opty.ChannelDetail__c = 'Test';
        opty.CreditCheckFullStatus__c = 'In Corso';
        opty.RecordTypeId   = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('CEP_RT_PDC').getRecordTypeId();
        insert opty;    

        FileMetadata__c fmlu = new FileMetadata__c();

        fmlu.FileType__c    = '.pdf';
        fmlu.Link__c = 'https://www.google.com/';
        fmlu.RecordId__c    = opty.Id;
        fmlu.Opportunity__c = opty.Id;
        fmlu.UploadType__c = 'Proposta di Contratto';
        fmlu.UploadTypeDMS__c = 'Allegato';
        fmlu.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_LocalUpload').getRecordTypeId();
        insert fmlu;

        Test.startTest();
        String strRet = CEP_SRV_CommunityUtilities.getPdfLink(opty.Id);
        Test.stopTest();
        System.assertEquals( true, fmlu != null );
    }  


    /*@isTest
    public static void updateAllPdcTest(){
        Account acc = [SELECT Id FROM Account limit 1];
        
        CEP_MovePdc__c mpdc = new CEP_MovePdc__c();
        mpdc.EnableChangeStageToBeValidated__c = false;
        insert mpdc;

        Opportunity opty = new Opportunity();
        opty.AccountId          = acc.Id;
        opty.Name           = 'OptyPDC';
        opty.StageName      = 'Confermata';
        opty.Channel__c     = 'Teleselling';
        opty.SubChannel__c  = 'Teleselling outbound';
        opty.CloseDate      = System.today();
        opty.ChannelDetail__c = 'Test';
        opty.RecordTypeId   = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('CEP_RT_PDC').getRecordTypeId();
        insert opty;
        
        Map<String, String> params = New Map<String, String>();
        params.put('advancedSearchQuery',query);
        params.put('operation','accettazioneMassiva');

        String query = 'SELECT Id, StageName FROM Opportunity WHERE Id =' + '\''+ opty.Id +'\'';
        Test.startTest();
        //String strRet = CEP_SRV_CommunityUtilities.computeAllPdc(query,'accettazioneMassiva');
        Boolean strRet1 = CEP_SRV_CommunityUtilities.updateAllPdc(params);
        Test.stopTest();
        System.assertEquals(true, strRet == '');
        System.assertEquals(true, strRet1 == true);
    }*/
    @isTest
    public static void computeAllPdcDaValidareOptTest(){
        Account acc = [SELECT Id FROM Account limit 1];
        
        CEP_MovePdc__c mpdc = new CEP_MovePdc__c();
        mpdc.EnableChangeStageToBeValidated__c = false;
        insert mpdc;

        Opportunity opty = new Opportunity();
        opty.AccountId          = acc.Id;
        opty.Name           = 'OptyPDC';
        opty.StageName      = 'Da Validare';
        opty.Channel__c     = 'Teleselling';
        opty.SubChannel__c  = 'Teleselling outbound';
        opty.CloseDate      = System.today();
        opty.ChannelDetail__c = 'Test';
        opty.RecordTypeId   = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('CEP_RT_PDC').getRecordTypeId();
        insert opty;
        
        String query = 'SELECT Id, StageName FROM Opportunity WHERE Id =' + '\''+ opty.Id +'\'';

        Map<String, String> params = New Map<String, String>();
        params.put('advancedSearchQuery',query);
        params.put('operation','accettazioneMassiva');

        Test.startTest();
        //String strRet = CEP_SRV_CommunityUtilities.computeAllPdc(query,'validazioneMassiva');
        Boolean strRet1 = CEP_SRV_CommunityUtilities.updateAllPdc(params);
        Test.stopTest();
        //System.assertEquals(true, strRet == '');
        System.assertEquals(true, strRet1 == true);
    }
    @isTest
    public static void checkNumberProductRequestTest(){
        Opportunity opp = [SELECT Id, ConfirmationCall__c FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        Test.startTest();
        Map<String,Integer> mapObj = CEP_SRV_CommunityUtilities.checkNumberProductRequest(opp.Id);
        Test.stopTest();
        System.assertEquals(true, mapObj!=null);

    }

    @IsTest
    static void createOsiVasTest(){
        Test.startTest();
        Pricebook2 standardPricebook = new Pricebook2(
            Id = Test.getStandardPricebookId()
        );

        List<Product2> toInsert = new List<Product2>();
        Product2 pOffer = new Product2();
        pOffer.Name                     = 'OFFERTA';
        pOffer.VisibilityGroup__c       = 'Mass Market - Small Business';
        pOffer.IsActive                 = true;
        pOffer.MarketSegment__c         = 'Mass Market';
        pOffer.Key__c                   = 'OFFERTA';
        pOffer.RecordTypeId             = Schema.SObjectType.Product2.getRecordTypeInfosByDeveloperName().get('CEP_RT_IdPrezzo').getRecordTypeId();
        toInsert.add(pOffer);
        
        Product2 pVas = new Product2();
        pVas.Name                   = 'Test VAS';
        pVas.VisibilityGroup__c     = 'Mass Market - Small Business';
        pVas.IsActive               = true;
        pVas.MarketSegment__c       = 'Mass Market';
        pVas.Key__c                 = 'OFFERTAVAS';
        pVas.ApplicationInvoice__c  = 'ELE';
        pVas.RecordTypeId           = Schema.SObjectType.Product2.getRecordTypeInfosByDeveloperName().get('CEP_RT_Vas').getRecordTypeId();
        toInsert.add(pVas);
        insert toInsert;

        Account acc = TestDataCustomer.account().physicalPersonAccount().build();        
        acc.CompanyName__c = 'TestCompanyName';
        acc.Segment__c = 'Mass Market';
        acc.FiscalCode__c = '0318345068';
        acc.VATNumber__c = '0318345068';
        insert acc;

        CompanyDivision__c companyDivision = TestDataFactory.CompanyDivision().createBulkCompanyDivision(1).build();
        insert companyDivision;

        Supply__c supply = TestDataFactory.supply().createSupplyBuilder().setCompany(companyDivision.Id).build();
        supply.Status__c = 'Active';
        supply.Key__c = 'supply';
        supply.Account__c = acc.Id;
        supply.CompanyDivision__c = companyDivision.Id;
        insert supply;
        
        ServicePoint__c servicePoint = TestDataFactory.servicePoint().createServicePoint().build();
        servicePoint.CurrentSupply__c = supply.Id;
        servicePoint.Key__c = 'service';
        insert servicePoint;
        Test.stopTest();

        CEP_TRH_OpportunityServiceItem.bypass('CEP_BypassOpportunityTrigger');
        Opportunity opportunity = new Opportunity();
        opportunity.AccountId           = acc.Id;
        opportunity.Name            = 'OptyPDC';
        opportunity.StageName       = 'Prospecting';
        opportunity.Channel__c  = 'Teleselling';
        opportunity.SubChannel__c   = 'Teleselling outbound';
        opportunity.CloseDate       = System.today();
        opportunity.ChannelDetail__c = 'Test';
        opportunity.RecordTypeId    = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('CEP_RT_PDC').getRecordTypeId();
        insert opportunity; 
        

        SBQQ__Quote__c q = new SBQQ__Quote__c();
        q.MarketSegment__c = 'Mass Market';
        q.SBQQ__Opportunity2__c = opportunity.Id;
        q.SBQQ__PricebookId__c = standardPricebook.Id;
        insert q;
        
        SBQQ__QuoteLine__c ql1 = new SBQQ__QuoteLine__c(SBQQ__Quote__c = q.Id, SBQQ__Number__c = 1, SBQQ__Product__c = pOffer.Id);
        insert ql1;
        SBQQ__QuoteLine__c qlVas = new SBQQ__QuoteLine__c(SBQQ__RequiredBy__c = ql1.Id, SBQQ__Quote__c = q.Id, SBQQ__Number__c = 1, SBQQ__Product__c = pVas.Id);
        insert qlVas;
        
        CEP_TRH_OpportunityServiceItem.bypass('CEP_BypassOpportunityServiceItemTrigger');
        OpportunityServiceItem__c osi = TestDataCustomer.opportunityServiceItem().createOpportunityServiceItem().build();
        osi.Opportunity__c = opportunity.Id;  
        osi.QuoteLine__c = ql1.Id;
        // osi.ServicePointCode__c = servicePoint.Id;
        osi.RecordTypeId = Schema.SObjectType.OpportunityServiceItem__c.getRecordTypeInfosByDeveloperName().get('Electric').getRecordTypeId();
        insert osi;

        Map<String, Object> response = CEP_SRV_CommunityUtilities.createOsiVas(opportunity.Id);
        System.assertEquals(false, response.get('error'), 'Error should be false');
    }
    @IsTest
    static void checkDuplicatesPdcTst(){
        
        Test.startTest();
        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        Boolean toReturn = CEP_SRV_CommunityUtilities.checkDuplicatesPdc(op.Id, '00166');
        System.assert(toReturn == false);
        Test.stopTest();
    }

    @IsTest
    static void getRunnerIdTst(){
        Runner__c runner = new Runner__c(Name = 'RunnerName', RunnerCode__c = 'RunnerCode');
        insert runner;
        CEP_SRV_CommunityUtilities.GetRunnerId('RunnerCode');
    }

    @IsTest
    static void checkFinalConfirmWind3Tst(){

        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        op.StageName='Non Lavorata';
        op.RethinkingRight__c = 'NO';
        update op;
        Map<String,String> consensi = new Map<String,String>();
        consensi.put('SolicitationConsent__c','NO');
        consensi.put('ThirdPartySolicitationConsent__c','NO');
        consensi.put('LoyaltyConsent__c','NO');
        consensi.put('ProfilingConsent__c','NO');

        FileMetadata__c fmlu = new FileMetadata__c();
        fmlu.FileType__c    = '.pdf';
        fmlu.Link__c        = 'https://www.google.com/';
        fmlu.RecordId__c    = op.Id;
        fmlu.Opportunity__c = op.Id;
        fmlu.UploadType__c  = 'Proposta di Contratto';
        fmlu.UploadTypeDMS__c = 'Allegato';
        fmlu.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_LocalUpload').getRecordTypeId();
        insert fmlu;

        FileMetadata__c fmlu1 = new FileMetadata__c();
        fmlu1.FileType__c   = '.pdf';
        fmlu1.Link__c       = 'https://www.google.com/';
        fmlu1.RecordId__c   = op.Id;
        fmlu1.Opportunity__c= op.Id;
        fmlu1.UploadType__c = 'Vocal Order Full';
        fmlu1.UploadTypeDMS__c = 'Allegato';
        fmlu1.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_LocalUpload').getRecordTypeId();
        insert fmlu1;

        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.checkFinalConfirmWind3(op.Id, false, '', 'false', consensi);
            response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'true', consensi);
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);
        Test.stopTest();

        /*Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        
        Test.startTest();
            Map<String, Object> response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'true', new Map<String,String>());
            response = CEP_SRV_CommunityUtilities.checkFinalConfirm(op.Id, false, '', 'false', new Map<String,String>());
            Boolean error = (Boolean) response.get('error');
            System.assert(error == false);
        Test.stopTest();*/
    }
    @isTest
    static void canCallPrintingTst(){
        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        op.StageName='Non Lavorata';
        op.RethinkingRight__c = 'NO';
        update op;
        Map<String,String> consensi = new Map<String,String>();
        consensi.put('SolicitationConsent__c','NO');
        consensi.put('ThirdPartySolicitationConsent__c','NO');
        consensi.put('LoyaltyConsent__c','NO');
        consensi.put('ProfilingConsent__c','NO');

        FileMetadata__c fmlu = new FileMetadata__c();
        fmlu.FileType__c    = '.pdf';
        fmlu.Link__c        = 'https://www.google.com/';
        fmlu.RecordId__c    = op.Id;
        fmlu.Opportunity__c = op.Id;
        fmlu.UploadType__c  = 'Vocal Order Correttivo';
        fmlu.UploadTypeDMS__c = 'Allegato';
        fmlu.RecordTypeId = Schema.SObjectType.FileMetadata__c.getRecordTypeInfosByDeveloperName().get('CEP_RT_LocalUpload').getRecordTypeId();
        insert fmlu;
        
        System.assertEquals(false,CEP_SRV_CommunityUtilities.canCallPrinting(op.id));
    }
    @isTest
    public static void insertConsentCaseW3Tst(){
		Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
		CEP_SRV_CommunityUtilities.insertConsentCaseW3(op.id);        
    }
	
	@isTest
    public static void getUserInfoChannel(){
        Map<String,Id> profileIds = new Map<String,Id>();
        List<Profile> profiles = [SELECT Id, Name
                                  FROM Profile
                                  WHERE Name IN ('NTT_Wind3Utente', 'NTT_Wind3Imprenditore','System Administrator')];
        for (Profile profile : profiles){
            profileIds.put(profile.name, profile.Id);
        }
        UserRole internalUserRole = [SELECT id, name FROM UserRole WHERE PortalType = 'None' LIMIT 1];
        System.debug('Userrole: ' + internalUserRole);
        User u = new User( LastName ='Test',FirstName = '',Alias = 'tstrpwd',Email = 'testresetpwd@wasd.test.com',Username = 'testresetpwd@asdf.test.com',
                          TimeZoneSidKey = 'GMT',LanguageLocaleKey = 'en_US',EmailEncodingKey = 'UTF-8',LocaleSidKey = 'en_US', userRoleId = internalUserRole.id, ProfileId = profileIds.get('System Administrator'));
        insert u;
        System.debug('User role from user: ' + u.userRoleId);
		CEP_SRV_CommunityUtilities.getUserInfoChannel(u.id);        
    }
  
    @isTest
    public static void getUserChannelAndSubChannelTst(){
        List<Profile> profiles = [SELECT Id, Name
                                  FROM Profile
                                  WHERE Name = 'System Administrator'];

        UserRole internalUserRole = [SELECT id, name FROM UserRole WHERE PortalType = 'None' LIMIT 1];
        System.debug('Userrole: ' + internalUserRole);
        User u = new User( LastName ='Test',FirstName = '',Alias = 'tstrpwd',Email = 'testresetpwd@wasd.test.com',Username = 'testresetpwd@asdf.test.com', DefaultChannel__c = 'Door to door', DefaultSubChannel__c = 'Door to door cartaceo',
                          TimeZoneSidKey = 'GMT',LanguageLocaleKey = 'en_US',EmailEncodingKey = 'UTF-8',LocaleSidKey = 'en_US', userRoleId = internalUserRole.id, ProfileId = profiles[0].Id);
        insert u;

        System.runAs(u){
            CEP_SRV_CommunityUtilities.getUserChannelAndSubChannel();
        }
    }

    @isTest
    public static void updateObjectsTst(){
        Opportunity op = [SELECT Id FROM Opportunity WHERE RecordType.DeveloperName = 'CEP_RT_PDC' LIMIT 1];
        CampaignMember cm = [SELECT Id FROM CampaignMember LIMIT 1];
        Map<String,String> params = new Map<String,String>();
        params.put('cmId', cm.Id);
        params.put('oppId', op.Id);
        params.put('campaignName', 'nomeCampagna');
        params.put('invoiceTracking', 'test1');
        params.put('invoicePhone', 'test1');
        params.put('outcome', 'test1');

        CEP_SRV_CommunityUtilities.updateObjects(params);
    }

}