const requestUser = process.env.REQUESTUSER || "";
export const headerUpdate = async (data: any, plantToken: any) => {
    // update the header
    let webHeader = `
    <request-id>[requestID]</request-id>
    <data>
    <WebImport>
    <WebImportHeader>
        <FileName>[requestID].XML</FileName>
        <Type>SOTransportLoader</Type>
        <UserName>[requestUser]</UserName>
	</WebImportHeader>
    `;

    webHeader = webHeader
        .replaceAll(
            "[requestID]",
            `${data[0].releaseNumber}-${plantToken[0].value}`
        )
        .replaceAll("[requestUser]", requestUser);

    return webHeader;
};
