package at.vvo.omds.client.gui.api.apriori;

import at.vvo.omds.types.omds3.r2025_05.common.*;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlElementDecl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;

public class BuildProductsRequest {

    private static final Logger LOG = LoggerFactory.getLogger(BuildProductsRequest.class);

    private static final ObjectFactory OUOF =
            new ObjectFactory();

    /** Privater default Constructor versteckt den nicht benötigten Default-Constructor. */
    private BuildProductsRequest() {
    }

    static public JAXBElement<ProductsRequest> aprioriRequest(XMLGregorianCalendar Stichtag, String vuNr) {
        LOG.info("VUNr = " + vuNr);

        ProductsRequest request = OUOF.createProductsRequest();
        request.setKorrelationsId("123456");
        request.setVUNr(vuNr);
        request.setStichtag(Stichtag);
        return createProductsRequest(request);
    }

    @XmlElementDecl(namespace = "urn:omds3CommonServiceTypes-1-1-0", name = "ProductsRequest")
    public static JAXBElement<ProductsRequest> createProductsRequest(ProductsRequest value) {
        return new JAXBElement<>(new QName("urn:omds3CommonServiceTypes-1-1-0","ProductsRequest"),
                ProductsRequest.class, null, value);
    }
}
