Merged PR 2272: final comments added and update _IP_ precendence to be lower

final comments added and update _IP_ precendence to be lower

Related work items: #22573, #22661
This commit is contained in:
Robert Bond
2026-04-24 14:44:24 +00:00
parent f367f3342c
commit d406d97ddf
+55 -79
View File
@@ -476,20 +476,19 @@ export const createRepPDFBlob = async (
? await blockBlobClient.uploadData(content) ? await blockBlobClient.uploadData(content)
: await blockBlobClient.uploadStream(content); : await blockBlobClient.uploadStream(content);
let whichLocation = const locationMap = [
repName.indexOf("_IP_") > 0 { key: "_IP_Comments_", value: "846040038" }, // most specific first
? "846040005" { key: "_IP_", value: "846040005" },
: repName.indexOf("_Statement_") > 0 { key: "_Statement_", value: "846040002" },
? "846040002" { key: "_Questionnaire_", value: "846040001" },
: repName.indexOf("_Questionnaire_") > 0 { key: "_Comments", value: "846040003" },
? "846040001" { key: "_Impact", value: "846040029" },
: repName.indexOf("_Comments") > 0 { key: "_Consultation_Response_", value: "846040036" }
? "846040003" ];
: repName.indexOf("_Impact") > 0
? "846040029" const whichLocation =
: repName.indexOf("_Consultation_Response_") > 0 locationMap.find((item) => repName.includes(item.key))?.value ||
? "846040036" "846040002";
: "846040002";
const tags = { const tags = {
containerid: containerName, containerid: containerName,
@@ -618,71 +617,46 @@ export const uploadFile = async (formContent, containerName, foldername) => {
); );
console.log(data); console.log(data);
let whichLocation = const fieldName = files[prop][0].fieldName;
files[prop][0].fieldName.indexOf("_Statement_of_Case") >
0 || const whichLocation =
files[prop][0].fieldName.indexOf("_-_Statement_of_Case") > [
0 || // 1️⃣ LPA docs (grouped)
files[prop][0].fieldName.indexOf("_-_Application_Form") > {
0 || match: [
files[prop][0].fieldName.indexOf( "_Statement_of_Case",
"_-_Site_Ownership_Certificate" "_-_Statement_of_Case",
) > 0 || "_-_Application_Form",
files[prop][0].fieldName.indexOf("_-_Decision_Notice") > "_-_Site_Ownership_Certificate",
0 || "_-_Decision_Notice",
files[prop][0].fieldName.indexOf("_-_Site_Location_Plan") > "_-_Site_Location_Plan",
0 || "_-_Plans_Drawing_Documents",
files[prop][0].fieldName.indexOf( "_-_Additional_Plans_Drawings_Documents",
"_-_Plans_Drawing_Documents" "_-_Design_and_Access_Statement",
) > 0 || "_-_NSB_LPA_Additional_Documents",
files[prop][0].fieldName.indexOf( "_-_LPA_Correspondence",
"_-_Additional_Plans_Drawings_Documents" "_-_LPA_Original_Permission",
) > 0 || "_-_LPA's_Registration_Letter",
files[prop][0].fieldName.indexOf( "_-_Environmental_Statement",
"_-_Design_and_Access_Statement" "_-_Cost_of_Application",
) > 0 || "_-_Other_Relevant_Material",
files[prop][0].fieldName.indexOf( "_-_S106_Agreement_or_Unilateral_Undertaking"
"_-_NSB_LPA_Additional_Documents" ],
) > 0 || value: "846040000"
files[prop][0].fieldName.indexOf("_-_LPA_Correspondence") > },
0 || { match: ["_IP_Comments_"], value: "846040038" },
files[prop][0].fieldName.indexOf( {
"_-_LPA_Original_Permission" match: ["_Consultation_Response_"],
) > 0 || value: "846040036"
files[prop][0].fieldName.indexOf( },
"_-_LPA's_Registration_Letter" { match: ["_Questionnaire_"], value: "846040001" },
) > 0 || { match: ["_Statement_"], value: "846040002" },
files[prop][0].fieldName.indexOf( { match: ["_Comments_"], value: "846040003" },
+"_-_Environmental_Statement" { match: ["_Impact_"], value: "846040001" },
) > 0 || { match: ["_IP_"], value: "846040005" }
files[prop][0].fieldName.indexOf("_-_Cost_of_Application") > ].find((rule) =>
0 || rule.match.some((key) => fieldName.includes(key))
files[prop][0].fieldName.indexOf( )?.value || "846040000";
"_-_Other_Relevant_Material"
) > 0 ||
files[prop][0].fieldName.indexOf(
"_-_S106_Agreement_or_Unilateral_Undertaking" > 0
)
? "846040000"
: files[prop][0].fieldName.indexOf("_IP_") > 0
? "846040005"
: files[prop][0].fieldName.indexOf("_Statement_") > 0
? "846040002"
: files[prop][0].fieldName.indexOf(
"_Questionnaire_"
) > 0
? "846040001"
: files[prop][0].fieldName.indexOf("_Comments_") >
0
? "846040003"
: files[prop][0].fieldName.indexOf("_Impact_") >
0
? "846040001"
: files[prop][0].fieldName.indexOf(
"_Consultation_Response_"
) > 0
? "846040036"
: "846040000";
const tags = { const tags = {
containerid: containerName, containerid: containerName,
@@ -803,6 +777,8 @@ export const uploadSingleFile = async (
/_Statement_of_Case|_-_Statement_of_Case|_-_Application_Form|_-_Site_Ownership_Certificate|_-_Decision_Notice|_-_Site_Location_Plan|_-_Plans_Drawing_Documents|_-_Additional_Plans_Drawings_Documents|_-_Design_and_Access_Statement|_-_NSB_LPA_Additional_Documents|_-_LPA_Correspondence|_-_LPA_Original_Permission|_-_LPA's_Registration_Letter|_-_Environmental_Statement|_-_Cost_of_Application|_-_Other_Relevant_Material|_-_S106_Agreement_or_Unilateral_Undertaking/, /_Statement_of_Case|_-_Statement_of_Case|_-_Application_Form|_-_Site_Ownership_Certificate|_-_Decision_Notice|_-_Site_Location_Plan|_-_Plans_Drawing_Documents|_-_Additional_Plans_Drawings_Documents|_-_Design_and_Access_Statement|_-_NSB_LPA_Additional_Documents|_-_LPA_Correspondence|_-_LPA_Original_Permission|_-_LPA's_Registration_Letter|_-_Environmental_Statement|_-_Cost_of_Application|_-_Other_Relevant_Material|_-_S106_Agreement_or_Unilateral_Undertaking/,
value: "846040000" value: "846040000"
}, },
{ pattern: /_IP_Comments_/, value: "846040038" },
{ pattern: /_IP_/, value: "846040005" }, { pattern: /_IP_/, value: "846040005" },
{ pattern: /_Statement_/, value: "846040002" }, { pattern: /_Statement_/, value: "846040002" },
{ pattern: /_Questionnaire_/, value: "846040001" }, { pattern: /_Questionnaire_/, value: "846040001" },