package com.fractalite.amad_ndc.convertersRQ;

import java.util.List;
import java.util.ArrayList;


import org.springframework.stereotype.Component;
import com.amadeus.xml._2010._06.travel_offerpricerq_v1.*;

@Component
public class AMA_OfferPriceRQ {

	public AMATravelOfferPriceRQ buildAMA_TravelOfferPriceRQ() {
		
		AMATravelOfferPriceRQ offerPriceRQ=new AMATravelOfferPriceRQ();
		offerPriceRQ.setParty(buildPartyType());
		offerPriceRQ.setRequest(buildrequestType());
		offerPriceRQ.setPointOfSale(null);
		return offerPriceRQ;
	}
public PartyType buildPartyType() {
		
		PartyType party=new PartyType();
		SenderType sender=new SenderType();
		TravelAgencyType travelAgencyType=new TravelAgencyType();
		travelAgencyType.setAgencyID(null);
		travelAgencyType.setPseudoCityID(null);
		sender.setTravelAgency(travelAgencyType);
		party.setSender(sender);
		return party;
	}

public RequestType buildrequestType() {
	RequestType requestType=new RequestType();
	DataListsType dataListsType=new DataListsType();
	PaxListType paxListType=new PaxListType();
	//ArrayList<PaxType> listPaxType =new ArrayList<PaxType>();
	//list of pax
	PaxType paxType=new PaxType();
	paxType.setPaxID("ADT");
	paxType.setPTC("1");
	
	//listPaxType.add(paxType);
	paxListType.getPax().add(paxType);
	dataListsType.setPaxList(paxListType);
	requestType.setDataLists(dataListsType);
	requestType.setPricedOffer(buildPricedOffer());
	return requestType;
}

public CreateOrderType buildPricedOffer() {
	CreateOrderType pricedOffer=new CreateOrderType();
	SelectedOfferType selectedOfferType=new SelectedOfferType();
	selectedOfferType.setOfferRefID("TOageG~xNkSGqrab8qullPaC.6_1A_4907dd3d-d330-42d2-8cc9-18124fa14dcd_1A_1H0QRZ_UW980QUUOLY88IU3PUEFZ63VZ0CL");
	selectedOfferType.setOwnerCode("QR");
	selectedOfferType.setShoppingResponseRefID("1H0QRZ_LBSYL6Y7J0YLUBMNZ369605M1H7M");
	
	
	
	SelectedOfferItemType selectedOfferItemType=new SelectedOfferItemType();
	selectedOfferItemType.setOfferItemRefID("1H0QRZ_UW980QUUOLY88IU3PUEFZ63VZ0CL-1");
	selectedOfferItemType.getPaxRefID().add("P1");
	selectedOfferType.getSelectedOfferItem().add(selectedOfferItemType);
	

	pricedOffer.getSelectedOffer().add(selectedOfferType);
	
	return pricedOffer;
}

}
