diff --git a/api.planx.uk/modules/admin/session/html.ts b/api.planx.uk/modules/admin/session/html.ts index 35d56cea18..fb25bca8bc 100644 --- a/api.planx.uk/modules/admin/session/html.ts +++ b/api.planx.uk/modules/admin/session/html.ts @@ -28,7 +28,7 @@ export const getHTMLExport: HTMLExportHandler = async (req, res, next) => { const responses = await $api.export.csvData(req.params.sessionId); const boundingBox = session.data.passport.data[ - "property.boundary.site.buffered" + "proposal.site.buffered" ] as unknown as GeoJSON.Feature; const userAction = session.data.passport.data?.[ "drawBoundary.action" @@ -75,7 +75,7 @@ export const getRedactedHTMLExport: HTMLExportHandler = async ( req.params.sessionId, ); const boundingBox = session.data.passport.data[ - "property.boundary.site.buffered" + "proposal.site.buffered" ] as unknown as GeoJSON.Feature; const userAction = session.data.passport.data?.[ "drawBoundary.action" diff --git a/api.planx.uk/modules/flows/downloadSchema/service.ts b/api.planx.uk/modules/flows/downloadSchema/service.ts index de83ba112a..3900045306 100644 --- a/api.planx.uk/modules/flows/downloadSchema/service.ts +++ b/api.planx.uk/modules/flows/downloadSchema/service.ts @@ -16,11 +16,7 @@ export const getFlowSchema = async (flowId: string) => { node: nodeId, type: nodeData?.type?.toString() || "_root", text: nodeData.data?.text, - planx_variable: - nodeData.data?.fn || - nodeData.data?.val || - nodeData.data?.output || - nodeData.data?.dataFieldBoundary, + planx_variable: nodeData.data?.fn || nodeData.data?.val, }), ); diff --git a/api.planx.uk/modules/send/utils/exportZip.test.ts b/api.planx.uk/modules/send/utils/exportZip.test.ts index 5f9d1840cf..8a7e0f2daf 100644 --- a/api.planx.uk/modules/send/utils/exportZip.test.ts +++ b/api.planx.uk/modules/send/utils/exportZip.test.ts @@ -136,7 +136,7 @@ describe("buildSubmissionExportZip", () => { }); test("geojson and location plan is excluded when not present", async () => { - // set-up mock session passport excluding "property.boundary.site" + // set-up mock session passport excluding "proposal.site" const lowcalSessionWithoutBoundary: Partial = { ...mockLowcalSession, id: "1234", @@ -146,7 +146,7 @@ describe("buildSubmissionExportZip", () => { passport: { data: { ...mockLowcalSession.data!.passport.data, - "property.boundary.site": undefined, + "proposal.site": undefined, }, }, }, diff --git a/api.planx.uk/modules/send/utils/exportZip.ts b/api.planx.uk/modules/send/utils/exportZip.ts index da068d0aef..f518573b02 100644 --- a/api.planx.uk/modules/send/utils/exportZip.ts +++ b/api.planx.uk/modules/send/utils/exportZip.ts @@ -146,7 +146,7 @@ export async function buildSubmissionExportZip({ } } - const boundingBox = passport.data["property.boundary.site.buffered"]; + const boundingBox = passport.data["proposal.site.buffered"]; const userAction = passport.data?.["drawBoundary.action"]; // generate and add an HTML overview document for the submission to zip @@ -173,7 +173,7 @@ export async function buildSubmissionExportZip({ // add an optional GeoJSON file to zip const geojson: GeoJSON.Feature | undefined = - passport?.data?.["property.boundary.site"]; + passport?.data?.["proposal.site"]; if (geojson) { if (userAction) { geojson["properties"] ??= {}; diff --git a/api.planx.uk/package.json b/api.planx.uk/package.json index d253c0de38..fbaa27e956 100644 --- a/api.planx.uk/package.json +++ b/api.planx.uk/package.json @@ -13,7 +13,7 @@ "@airbrake/node": "^2.1.8", "@aws-sdk/client-s3": "^3.696.0", "@aws-sdk/s3-request-presigner": "^3.701.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d004278", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#dc2386b", "@types/isomorphic-fetch": "^0.0.36", "adm-zip": "^0.5.10", "axios": "^1.7.4", diff --git a/api.planx.uk/pnpm-lock.yaml b/api.planx.uk/pnpm-lock.yaml index df22664e2f..b93fb608a4 100644 --- a/api.planx.uk/pnpm-lock.yaml +++ b/api.planx.uk/pnpm-lock.yaml @@ -21,8 +21,8 @@ dependencies: specifier: ^3.701.0 version: 3.701.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#d004278 - version: github.com/theopensystemslab/planx-core/d004278 + specifier: git+https://github.com/theopensystemslab/planx-core#dc2386b + version: github.com/theopensystemslab/planx-core/dc2386b '@types/isomorphic-fetch': specifier: ^0.0.36 version: 0.0.36 @@ -1703,31 +1703,31 @@ packages: resolution: {integrity: sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==} dev: false - /@formatjs/ecma402-abstract@2.3.1: - resolution: {integrity: sha512-Ip9uV+/MpLXWRk03U/GzeJMuPeOXpJBSB5V1tjA6kJhvqssye5J5LoYLc7Z5IAHb7nR62sRoguzrFiVCP/hnzw==} + /@formatjs/ecma402-abstract@2.3.2: + resolution: {integrity: sha512-6sE5nyvDloULiyOMbOTJEEgWL32w+VHkZQs8S02Lnn8Y/O5aQhjOEXwWzvR7SsBE/exxlSpY2EsWZgqHbtLatg==} dependencies: - '@formatjs/fast-memoize': 2.2.5 - '@formatjs/intl-localematcher': 0.5.9 + '@formatjs/fast-memoize': 2.2.6 + '@formatjs/intl-localematcher': 0.5.10 decimal.js: 10.4.3 tslib: 2.8.1 dev: false - /@formatjs/fast-memoize@2.2.5: - resolution: {integrity: sha512-6PoewUMrrcqxSoBXAOJDiW1m+AmkrAj0RiXnOMD59GRaswjXhm3MDhgepXPBgonc09oSirAJTsAggzAGQf6A6g==} + /@formatjs/fast-memoize@2.2.6: + resolution: {integrity: sha512-luIXeE2LJbQnnzotY1f2U2m7xuQNj2DA8Vq4ce1BY9ebRZaoPB1+8eZ6nXpLzsxuW5spQxr7LdCg+CApZwkqkw==} dependencies: tslib: 2.8.1 dev: false - /@formatjs/intl-listformat@7.7.8: - resolution: {integrity: sha512-ezlfqfyegMbepGVcf3rTApVGIbZQvJwx1PZsXjMe2xAqEU1jSBZ/2efLE8u3sUBHGrrsdWER98W85zCg4N7rmQ==} + /@formatjs/intl-listformat@7.7.9: + resolution: {integrity: sha512-VGbGrngcjwrlPvstc6ysCwGlbxaq3PKXSkC9P5DYyfLI+C6I+PIog9UW8rPwH1xLXMfmyZblrkvkRboGn3E8qA==} dependencies: - '@formatjs/ecma402-abstract': 2.3.1 - '@formatjs/intl-localematcher': 0.5.9 + '@formatjs/ecma402-abstract': 2.3.2 + '@formatjs/intl-localematcher': 0.5.10 tslib: 2.8.1 dev: false - /@formatjs/intl-localematcher@0.5.9: - resolution: {integrity: sha512-8zkGu/sv5euxbjfZ/xmklqLyDGQSxsLqg8XOq88JW3cmJtzhCP8EtSJXlaKZnVO4beEaoiT9wj4eIoCQ9smwxA==} + /@formatjs/intl-localematcher@0.5.10: + resolution: {integrity: sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q==} dependencies: tslib: 2.8.1 dev: false @@ -6986,8 +6986,8 @@ packages: hasBin: true dev: true - /uuid@11.0.3: - resolution: {integrity: sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==} + /uuid@11.0.4: + resolution: {integrity: sha512-IzL6VtTTYcAhA/oghbFJ1Dkmqev+FpQWnCBaKq/gUluLxliWvO8DPFWfIviRmYbtaavtSQe4WBL++rFjdcGWEg==} hasBin: true dev: false @@ -7312,8 +7312,8 @@ packages: resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} dev: false - github.com/theopensystemslab/planx-core/d004278: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d004278} + github.com/theopensystemslab/planx-core/dc2386b: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/dc2386b} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -7321,7 +7321,7 @@ packages: dependencies: '@emotion/react': 11.14.0(react@18.3.1) '@emotion/styled': 11.14.0(@emotion/react@11.14.0)(react@18.3.1) - '@formatjs/intl-listformat': 7.7.8 + '@formatjs/intl-listformat': 7.7.9 '@mui/base': 5.0.0-beta.60(react-dom@18.3.1)(react@18.3.1) '@mui/material': 5.16.9(@emotion/react@11.14.0)(@emotion/styled@11.14.0)(react-dom@18.3.1)(react@18.3.1) ajv: 8.17.1 @@ -7340,7 +7340,7 @@ packages: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) type-fest: 4.31.0 - uuid: 11.0.3 + uuid: 11.0.4 zod: 3.24.1 transitivePeerDependencies: - '@types/react' diff --git a/api.planx.uk/tests/mocks/saveAndReturnMocks.ts b/api.planx.uk/tests/mocks/saveAndReturnMocks.ts index 5900d2b9aa..028d9494b7 100644 --- a/api.planx.uk/tests/mocks/saveAndReturnMocks.ts +++ b/api.planx.uk/tests/mocks/saveAndReturnMocks.ts @@ -42,7 +42,7 @@ export const mockLowcalSession: LowCalSession = { }, "drawBoundary.action": "Amended the title boundary", "proposal.projectType": ["new.office"], - "property.boundary.site": { + "proposal.site": { type: "Feature", geometry: { type: "Polygon", diff --git a/e2e/tests/api-driven/package.json b/e2e/tests/api-driven/package.json index 70e54f0f59..8951917c2b 100644 --- a/e2e/tests/api-driven/package.json +++ b/e2e/tests/api-driven/package.json @@ -8,7 +8,7 @@ "packageManager": "pnpm@8.6.6", "dependencies": { "@cucumber/cucumber": "^11.1.1", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d004278", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#dc2386b", "axios": "^1.7.4", "dotenv": "^16.3.1", "dotenv-expand": "^10.0.0", diff --git a/e2e/tests/api-driven/pnpm-lock.yaml b/e2e/tests/api-driven/pnpm-lock.yaml index f5e2e4732f..744e199a2e 100644 --- a/e2e/tests/api-driven/pnpm-lock.yaml +++ b/e2e/tests/api-driven/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: ^11.1.1 version: 11.1.1 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#d004278 - version: github.com/theopensystemslab/planx-core/d004278 + specifier: git+https://github.com/theopensystemslab/planx-core#dc2386b + version: github.com/theopensystemslab/planx-core/dc2386b axios: specifier: ^1.7.4 version: 1.7.4 @@ -486,31 +486,31 @@ packages: resolution: {integrity: sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==} dev: false - /@formatjs/ecma402-abstract@2.3.1: - resolution: {integrity: sha512-Ip9uV+/MpLXWRk03U/GzeJMuPeOXpJBSB5V1tjA6kJhvqssye5J5LoYLc7Z5IAHb7nR62sRoguzrFiVCP/hnzw==} + /@formatjs/ecma402-abstract@2.3.2: + resolution: {integrity: sha512-6sE5nyvDloULiyOMbOTJEEgWL32w+VHkZQs8S02Lnn8Y/O5aQhjOEXwWzvR7SsBE/exxlSpY2EsWZgqHbtLatg==} dependencies: - '@formatjs/fast-memoize': 2.2.5 - '@formatjs/intl-localematcher': 0.5.9 + '@formatjs/fast-memoize': 2.2.6 + '@formatjs/intl-localematcher': 0.5.10 decimal.js: 10.4.3 tslib: 2.8.1 dev: false - /@formatjs/fast-memoize@2.2.5: - resolution: {integrity: sha512-6PoewUMrrcqxSoBXAOJDiW1m+AmkrAj0RiXnOMD59GRaswjXhm3MDhgepXPBgonc09oSirAJTsAggzAGQf6A6g==} + /@formatjs/fast-memoize@2.2.6: + resolution: {integrity: sha512-luIXeE2LJbQnnzotY1f2U2m7xuQNj2DA8Vq4ce1BY9ebRZaoPB1+8eZ6nXpLzsxuW5spQxr7LdCg+CApZwkqkw==} dependencies: tslib: 2.8.1 dev: false - /@formatjs/intl-listformat@7.7.8: - resolution: {integrity: sha512-ezlfqfyegMbepGVcf3rTApVGIbZQvJwx1PZsXjMe2xAqEU1jSBZ/2efLE8u3sUBHGrrsdWER98W85zCg4N7rmQ==} + /@formatjs/intl-listformat@7.7.9: + resolution: {integrity: sha512-VGbGrngcjwrlPvstc6ysCwGlbxaq3PKXSkC9P5DYyfLI+C6I+PIog9UW8rPwH1xLXMfmyZblrkvkRboGn3E8qA==} dependencies: - '@formatjs/ecma402-abstract': 2.3.1 - '@formatjs/intl-localematcher': 0.5.9 + '@formatjs/ecma402-abstract': 2.3.2 + '@formatjs/intl-localematcher': 0.5.10 tslib: 2.8.1 dev: false - /@formatjs/intl-localematcher@0.5.9: - resolution: {integrity: sha512-8zkGu/sv5euxbjfZ/xmklqLyDGQSxsLqg8XOq88JW3cmJtzhCP8EtSJXlaKZnVO4beEaoiT9wj4eIoCQ9smwxA==} + /@formatjs/intl-localematcher@0.5.10: + resolution: {integrity: sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q==} dependencies: tslib: 2.8.1 dev: false @@ -2886,8 +2886,8 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: false - /uuid@11.0.3: - resolution: {integrity: sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==} + /uuid@11.0.4: + resolution: {integrity: sha512-IzL6VtTTYcAhA/oghbFJ1Dkmqev+FpQWnCBaKq/gUluLxliWvO8DPFWfIviRmYbtaavtSQe4WBL++rFjdcGWEg==} hasBin: true dev: false @@ -3047,8 +3047,8 @@ packages: resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} dev: false - github.com/theopensystemslab/planx-core/d004278: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d004278} + github.com/theopensystemslab/planx-core/dc2386b: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/dc2386b} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -3056,7 +3056,7 @@ packages: dependencies: '@emotion/react': 11.14.0(react@18.3.1) '@emotion/styled': 11.14.0(@emotion/react@11.14.0)(react@18.3.1) - '@formatjs/intl-listformat': 7.7.8 + '@formatjs/intl-listformat': 7.7.9 '@mui/base': 5.0.0-beta.60(react-dom@18.3.1)(react@18.3.1) '@mui/material': 5.16.9(@emotion/react@11.14.0)(@emotion/styled@11.14.0)(react-dom@18.3.1)(react@18.3.1) ajv: 8.17.1 @@ -3075,7 +3075,7 @@ packages: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) type-fest: 4.31.0 - uuid: 11.0.3 + uuid: 11.0.4 zod: 3.24.1 transitivePeerDependencies: - '@types/react' diff --git a/e2e/tests/api-driven/src/invite-to-pay/mocks/flow.json b/e2e/tests/api-driven/src/invite-to-pay/mocks/flow.json index 6ad9eb5a31..1d1e0ccf36 100644 --- a/e2e/tests/api-driven/src/invite-to-pay/mocks/flow.json +++ b/e2e/tests/api-driven/src/invite-to-pay/mocks/flow.json @@ -2052,7 +2052,7 @@ }, "0mN90xdfAJ": { "data": { - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "258", "samples": {}, "defaults": {}, @@ -4844,7 +4844,7 @@ "data": { "info": "

In the case of a project where the gross external area of new space created was 465m2 or less, the planning fee for a Certificate of Lawfulness application relating to the existing agricultural buildings is £120.

", "notes": "Full fee: if new floor space is 465m2 or less: £96", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "120", "samples": {}, "defaults": {}, @@ -7475,7 +7475,7 @@ "2eZXkNpHzT": { "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for drilling oil or natural gas is £173.50 for each 0.1 hectares (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))347)0.5", "samples": {}, "defaults": { @@ -9116,7 +9116,7 @@ "3BttsduVMt": { "data": { "info": "

In the case of a project where the gross external area of new space created was greater than 465m2 but no more than 540m2, the planning fee for a Certificate of Lawfulness application relating to the existing agricultural buildings is £578.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "578", "samples": {}, "defaults": {}, @@ -9504,7 +9504,7 @@ "3J58F6D2pv": { "data": { "info": "

The fee for an application for Prior Approval related to development involving telecommunications is £578

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "578", "samples": {}, "defaults": {}, @@ -12793,7 +12793,7 @@ }, "4eKQt16z2q": { "data": { - "output": "proposal.parking.buses.difference", + "fn": "proposal.parking.buses.difference", "formula": "proposal.parking.buses-property.parking.buses", "samples": {}, "defaults": { @@ -14877,7 +14877,7 @@ }, "5THxyfFTTq": { "data": { - "output": "proposal.vans.number.proposed", + "fn": "proposal.vans.number.proposed", "formula": "proposal.vans.onStreet.number.existing+proposal.vans.onStreet.number.proposed", "samples": {}, "defaults": { @@ -16602,7 +16602,7 @@ "6GXGZJYWAh": { "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for an application for planning permission relating to an existing use of a site for the winning and working of materials (excluding oil and natural gas) is £47,161 + £186 for each 0.1 hectares (or part thereof), up to a maximum of £105,300

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))186+47161),105300))", "samples": {}, "defaults": { @@ -17832,7 +17832,7 @@ "6ncXTCoXCf": { "data": { "info": "

In the case where two alternative applications are being submitted by the same applicant, for the same site and on the same day, then all but the largest of the fees qualify for a reduction of 50%.

", - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "application.fee.reduced*0.5", "defaults": { "application.fee.reduced": "1" @@ -18961,7 +18961,7 @@ "7JBRNAgvfx": { "data": { "info": "

The plannning fee for an application for a Certificate of Lawfulness relating to existing alterations or extensions to two or more homes is £509

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "509", "samples": {}, "defaults": { @@ -20643,7 +20643,7 @@ }, "7uJKQQSUh3": { "data": { - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "application.fee.calculated*1", "defaults": { "application.fee.calculated": "1" @@ -21874,7 +21874,7 @@ "8N0IUdXIGP": { "data": { "info": "

The planning fee for an application for a Certificate of Lawfulness relating to existing alterations or extensions of a single home is £258.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "258", "samples": {}, "defaults": {}, @@ -21998,7 +21998,7 @@ }, "8OipifFTTq": { "data": { - "output": "proposal.bicycles.number.proposed", + "fn": "proposal.bicycles.number.proposed", "formula": "proposal.bicycles.onStreet.number.proposed+proposal.bicycles.offStreet.number.proposed", "samples": {}, "defaults": { @@ -22344,7 +22344,7 @@ }, "8cESkpnGHk": { "data": { - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "120", "samples": {}, "defaults": {}, @@ -22975,7 +22975,7 @@ }, "8s3HKw34c4": { "data": { - "output": "proposal.parking.cycles.difference", + "fn": "proposal.parking.cycles.difference", "formula": "proposal.parking.cycles-property.parking.cycles", "samples": {}, "defaults": { @@ -23346,7 +23346,7 @@ "95XcTDdlqz": { "data": { "info": "

In the case of an application that is the first resubmission of an application on the same site that is similar in character and description, no planning fee is payable.

", - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "0", "policyRef": "

UK Statutory Instruments 2012 No. 2920 Regulation 8

" }, @@ -25119,7 +25119,7 @@ "9h1SX2hQa2": { "data": { "info": "

In the case of a project where the gross external area of new space created will be greater than 1000m2, the planning fee for a Certificate of Lawfulness application relating to the proposed creation of a glasshouse is £1741.50

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "3483*0.5", "samples": {}, "defaults": {}, @@ -25383,7 +25383,7 @@ "data": { "info": "

The plannning fee for an application for a Certificate of Lawfulness relating to the proposed creation of more than 50 new homes is £15,430 + £93 for each additional new home, up to a maximum of £202,500

", "notes": "Full planning fee: If more than 50 homes being created, £22,859+138 for each additional home up to a max of £300,000. LDC-P would be 50% of this", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min((30860+((proposal.newDwellings.number-50)*186)),405000))*0.5", "samples": {}, "defaults": { @@ -26564,7 +26564,7 @@ "AJIHaeTKmg": { "data": { "info": "

In the case where two alternative applications are being submitted by the same applicant, for the same site and on the same day, then all but the largest of the fees qualify for a reduction of 50%.

", - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "application.fee.calculated*0.5", "defaults": { "application.fee.calculated": "1" @@ -26671,7 +26671,7 @@ "AMBzPhbZBw": { "data": { "info": "

In the case of a project where the gross external area of new space created will be at least 1000m2 but no more than 4215m2, the planning fee for a Certificate of Lawfulness application relating to the proposed creation of agricultural buildings is £312 + a further £312 for each additional 75m2 (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil((proposal.newFloorArea-1000)/75))624+624)0.5", "defaults": { "proposal.newFloorArea": "1000" @@ -26707,7 +26707,7 @@ "data": { "info": "

The fee for any other type of application (including development under private acts or orders and development on a closed defence site) is £293 for each 0.1 hectare of the site, up to a maximum of £2,535

", "notes": "min(((proposal.siteArea/1000)*293),2535)", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((proposal.siteArea/1000)*293),2535))", "samples": { "proposal.siteArea": "1000" @@ -28448,7 +28448,7 @@ "B3ZwXIq7V1": { "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for an application for planning permission relating to the existing use of a site for winning or working of materials (excluding oil and natural gas) is £316 for each 0.1 hectares (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))316)", "samples": {}, "defaults": { @@ -29930,7 +29930,7 @@ "data": { "info": "

In the case of a project where the gross external area of new space created will be 465m2 or less, the planning fee for an application for planning permission relating to existing glasshouses is £120

", "notes": "Full fee: if new floor space is 465m2 or less: £96", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "120", "samples": {}, "defaults": {}, @@ -30396,7 +30396,7 @@ "data": { "info": "

In the case of a project where the gross external area of new space created will be more than 465m2 but less than 1000m2, the planning fee for an application for planning permission relating to existing glasshouses is £3225

", "notes": "Full fee: if new floor space is 465m2 or less: £96", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "3225", "policyRef": "

https://www.legislation.gov.uk/uksi/2023/1197/made

", "howMeasured": "

For more information about planning fees in England are calculated, view this guide

", @@ -32389,7 +32389,7 @@ }, "CWY2Udp28Q": { "data": { - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "0", "formatOutputForAutomations": false }, @@ -33551,7 +33551,7 @@ }, "D1D3UfFTTq": { "data": { - "output": "proposal.buses.number.existing", + "fn": "proposal.buses.number.existing", "formula": "proposal.buses.onStreet.number.existing+proposal.buses.offStreet.number.existing", "defaults": { "proposal.vans.onStreet.number.existing": "0", @@ -34781,7 +34781,7 @@ "DVoH7gbZiR": { "data": { "info": "

In the case of a project where the gross external area of new space created will be 465m2 or less, the planning fee for a Certificate of Lawfulness application relating to the proposed creation of agricultural buildings is £60

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "120*0.5", "samples": {}, "defaults": {}, @@ -35624,7 +35624,7 @@ "DmeeIJawsX": { "data": { "info": "

The planning fee for an application for planning permission relating to an existing non-residential developments where the new floor area created was more than 3750m2 is £30,680+£186 for each additional 75m2 (or part thereof) up to a maximum of £405,000

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.newFloorArea-3750)/75))186+30680),405000))", "defaults": { "proposal.newFloorArea": "3750" @@ -36497,7 +36497,7 @@ "E3PFT3lono": { "data": { "info": "

In the case of a site with an area of more than 5 hectares, the planning fee for a Certificate of Lawfulness application relating to the proposed installation of plant or machinery is £30,860 + £186 for each hectare (or part thereof), up to a maximum of £405,000

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-50000)/1000))186+30860),405000))", "samples": {}, "defaults": { @@ -36537,7 +36537,7 @@ "E3rGy7ik7l": { "data": { "info": "

The planning fee for an application for planning permission relating to creation of fewer than 10 new homes is £578 per dwelling.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "application.numberTotalHomes* 578", "samples": {}, "defaults": { @@ -39943,7 +39943,7 @@ "data": { "info": "

In the case of a site with an area of 7.5 hectares or less, the planning fee for a Certificate of Lawfulness application relating to an existing use of a site for exploratory drilling is £686 for each 0.1 hectare (or part thereof)

", "notes": "If 7.5 Ha or less: £508 for each 0.1 Ha (or part thereof)", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))686)", "samples": {}, "defaults": { @@ -40234,7 +40234,7 @@ "FbZqLXTw2n": { "data": { "info": "

The planning fee for an application for planning permission relating to the proposed creation of at least 10 but no more than 50 new homes is is £624 per dwelling.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "application.numberTotalHomes* 624", "samples": {}, "defaults": { @@ -41134,7 +41134,7 @@ "FzniHAatuC": { "data": { "info": "

In the case of a project where the gross external area of new space created will be 40m2 or less, the planning fee for a Certificate of Lawfulness application relating to the erection of buildings (e.g. commercial, community, charity, residential (not dwellinghouses, agricultural or glasshouses or plant/machinery)) is £146.50

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "293*0.5", "samples": {}, "defaults": {}, @@ -41592,7 +41592,7 @@ "GCe9yTothA": { "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for a Certificate of Lawfulness application relating to an existing use of a site for drilling oil or natural gas is £347 for each 0.1 hectares (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))347)", "samples": {}, "defaults": { @@ -42042,7 +42042,7 @@ "GMYYTjg0cL": { "data": { "info": "

In the case of a project where the gross external area of new space created will be more than 465m2 but less than 1000m2, the planning fee for a Certificate of Lawfulness application relating to the proposed creation of a glasshouse is £1612.50

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "3225*0.5", "samples": {}, "defaults": {}, @@ -42532,7 +42532,7 @@ "GT5pCslXg4": { "data": { "info": "

In the case of a project where the gross external area of new space created will be more than 540m2 but less than 1000m2, the planning fee for a Certificate of Lawfulness application relating to the proposed creation of agricultural buildings is £289+ a further £289 for each additional 75m2 (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil((proposal.newFloorArea-540)/75))578+578)0.5", "samples": {}, "defaults": { @@ -45454,7 +45454,7 @@ }, "HaIGYcpJBc": { "data": { - "output": "proposal.newBuildings.maxOne", + "fn": "proposal.newBuildings.maxOne", "formula": "smallerEq(proposal.newBuildings.number, 1)", "defaults": { "proposal.newBuildings.number": "0" @@ -45790,7 +45790,7 @@ "HidCuGgay7": { "data": { "info": "

In the case of a site with an area of less than 1 hectare, the planning fee for a Certificate of Lawfulness application relating to the existing plant or machinery is £578 for each 0.1 hectare (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))578)", "samples": {}, "defaults": { @@ -46284,7 +46284,7 @@ "Hs9BYjL7F1": { "data": { "info": "

In the case of a project where the gross external area of new space created was more than 4215m2, the planning fee for a Certificate of Lawfulness application relating to the existing agricultural buildings is £30,860 + £186 for each additional 75m2, up to a maximum of £405,000.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.newFloorArea-4215)/75))186+30860),405000))", "samples": {}, "defaults": { @@ -47281,7 +47281,7 @@ "IBsfppc4vZ": { "data": { "info": "

The planning fee for a Certificate of Lawfulness application relating to existing car parks, service roads or other access is a flat fee of £293

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(293)", "samples": {}, "defaults": {}, @@ -47863,7 +47863,7 @@ "IE9TMmOhUX": { "data": { "info": "

In the case of an application that is the first resubmission of an application on the same site that is similar in character and description, no planning fee is payable.

", - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "0", "samples": {}, "defaults": {}, @@ -48631,7 +48631,7 @@ "IVP5NIGjXr": { "data": { "info": "

The planning fee for an application for planning permission relating to the proposed creation of more than 50 new homes is £30860+ £186 for each additional new home, up to a maximum of £405,000

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min((30860+((application.numberTotalHomes-50)*186)),405000))", "samples": {}, "defaults": { @@ -49246,7 +49246,7 @@ }, "IjxjjKHijg": { "data": { - "output": "proposal.parking.cars.difference", + "fn": "proposal.parking.cars.difference", "formula": "proposal.parking.cars-property.parking.cars", "samples": {}, "defaults": { @@ -50239,7 +50239,7 @@ "JAcvizYJT4": { "data": { "info": "

The planning fee for an application for planning permission relating to an existing non-residential development where the new floor area created is between 1000m2 and 3750m2 is £624 for every 75m2 (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(ceil(proposal.newFloorArea/75))*624", "samples": {}, "defaults": { @@ -51994,7 +51994,7 @@ "JjpmTzpe82": { "data": { "info": "

The planning fee for an application for planning permission relating to a change of use or an application for a Certificate of Lawfulness relating to an existing change of use is £578.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "578", "samples": {}, "defaults": {}, @@ -53006,7 +53006,7 @@ "K8Mg67SKcH": { "data": { "info": "

The plannning fee for an application for a Certificate of Lawfulness relating to a proposed change of use is £289

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "289", "samples": {}, "defaults": {}, @@ -54623,7 +54623,7 @@ "Ko5Zs2wF08": { "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for the winning and working of materials (excluding oil and natural gas) is £9,723.50 + £93 for each 0.1 hectares (or part thereof), up to a maximum of £52,650

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))186+47161),105300))0.5", "samples": {}, "defaults": { @@ -55284,7 +55284,7 @@ "L3UDTxQvcR": { "data": { "info": "

The planning fee for a Certificate of Lawfulness application relating to the proposed creation of car parks, service roads or other access is a flat fee of £146.50

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(293)0.5", "samples": {}, "defaults": {}, @@ -60860,7 +60860,7 @@ "MV85FGrZqh": { "data": { "info": "

The planning fee for an application for a Certificate of Lawfulness not to comply with a condition is £293.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "293", "samples": {}, "defaults": {}, @@ -61176,7 +61176,7 @@ "MbSmH4rFF8": { "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for the drilling oil and natural gas is £26,001 + £102 for each 0.1 hectares (or part thereof), up to a maximum of £52,650

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))204+52002),105300))0.5", "samples": {}, "defaults": { @@ -61684,7 +61684,7 @@ }, "MrU8M3qgFx": { "data": { - "output": "proposal.parking.carClub.difference", + "fn": "proposal.parking.carClub.difference", "formula": "proposal.parking.carClub-property.parking.carClub", "samples": {}, "defaults": { @@ -63790,7 +63790,7 @@ }, "NcU3sVJlo7": { "data": { - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "0", "samples": {}, "defaults": {}, @@ -64449,7 +64449,7 @@ "Nt0R0tbs1n": { "data": { "info": "

If the application is being made by a non-profit sports organisation for works to playing fields that do not involve the erection of buildings, a standard flat fee of £462 applies.

", - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "462", "policyRef": "

The Town and Country Planning (Fees for Applications, Deemed Applications, Requests and Site Visits) (England) Regulations 2012 Chapter 2, Paragraph 3

" }, @@ -64805,7 +64805,7 @@ "NztK5jlCEt": { "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for a Prior Approval application relating to winning and working of materials is £293 for each 0.1 hectares

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))293)", "samples": {}, "defaults": { @@ -66509,7 +66509,7 @@ "data": { "info": "

In the case of a project where the gross external area of new space created was 1000m2 or more, the planning fee for a Certificate of Lawfulness application relating to an existing glasshouse is £3483

", "notes": "Full fee: If more than 465m2: £2580", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "3483", "samples": {}, "defaults": {}, @@ -67595,7 +67595,7 @@ "P1wZ4RfAjd": { "data": { "info": "

In the case of a site with an area of 7.5 hectares or less, the planning fee for an application for planning permission relating to an existing use of a site for exploratory drilling is £686 for each 0.1 hectare (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))686)", "samples": {}, "defaults": { @@ -70002,7 +70002,7 @@ }, "PuMmafFTTq": { "data": { - "output": "proposal.bicycles.number.existing", + "fn": "proposal.bicycles.number.existing", "formula": "proposal.bicycles.onStreet.number.existing+proposal.bicycles.offStreet.number.existing", "samples": {}, "defaults": { @@ -71894,7 +71894,7 @@ "QgfaRePOAR": { "data": { "info": "

The planning fee for an application for a Certificate of Lawfulness for existing works, relating to a site with at least 10 but no more than 50 homes on it, is £624 per dwelling.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "application.numberTotalHomes* 624", "samples": {}, "defaults": { @@ -72767,7 +72767,7 @@ "R6c7d465jq": { "data": { "info": "

In the case of a project where the gross external area of new space created will be greater than 465m2 but no more than 540m2, the planning fee for a Certificate of Lawfulness application relating to the proposed creation of agricultural buildings is £289

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "578*0.5", "samples": {}, "defaults": {}, @@ -75900,7 +75900,7 @@ }, "S8qo1AW35U": { "data": { - "output": "proposal.units.proposed", + "fn": "proposal.units.proposed", "formula": "largerEq(proposal.units.residential.proposed, 1)", "samples": {}, "defaults": { @@ -76103,7 +76103,7 @@ "SCnsMe72Os": { "data": { "info": "

The planning fee for an application for planning permission relating to existing non-residential developments where the new floor area created is less than 40m2 is £293.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(293)", "samples": {}, "defaults": {}, @@ -76115,7 +76115,7 @@ }, "SCp4dEoHud": { "data": { - "output": "proposal.units.maxOne", + "fn": "proposal.units.maxOne", "formula": "smallerEq(proposal.units.residential.proposed, 1) and smallerEq(property.units.residential.existing, 1)", "samples": {}, "defaults": { @@ -77639,7 +77639,7 @@ "SmcYneFXtA": { "data": { "info": "

If the proposed works (to either a home or within the curtilage of a home) is for the sole purpose of providing either:

\n

\n

- A means of access to (or within) the dwellinghouse for a disabled resident (current or future)

\n

\n

OR

\n

\n

- Providing facilities that are designed to ensure the disabled persons safety, health or comfort

\n

\n

OR

\n

\n

- Providing disabled access to a public building

\n

\n

Then no planning fee will be payable for this application.

", - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "0", "policyRef": "

UK Statutory Instruments 2012 No. 2920 Regulation 4

" }, @@ -78272,7 +78272,7 @@ "T2sxoMC9R3": { "data": { "info": "

In the case of a site with an area of 1 to 5 hectares, the planning fee for a Certificate of Lawfulness application relating to the existing plant or machinery is £624 for each 0.1 hectare (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))624)", "samples": {}, "defaults": { @@ -80450,7 +80450,7 @@ "ToRVXoGwjp": { "data": { "info": "

The planning fee for an application for planning permission relating to existing car parks, service roads or other access is a flat fee of £293

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(293)", "samples": {}, "defaults": {}, @@ -81322,7 +81322,7 @@ "UFhrhm9reB": { "data": { "info": "

The plannning fee for an application for a Certificate of Lawfulness for existing works, relating to a site with fewer than 10 homes on it, is £578 per dwelling.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "application.numberTotalHomes* 578", "samples": {}, "defaults": { @@ -81420,7 +81420,7 @@ "UHzoCGgTZ2": { "data": { "info": "

This application does not qualify for any exemptions or reductions

", - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "application.fee.calculated*1", "samples": {}, "defaults": { @@ -82420,7 +82420,7 @@ }, "UgIznfFTTq": { "data": { - "output": "proposal.cars.club.number.proposed", + "fn": "proposal.cars.club.number.proposed", "formula": "proposal.cars.onStreet.club.number.proposed+proposal.cars.offStreet.club.number.proposed", "samples": {}, "defaults": { @@ -84084,7 +84084,7 @@ }, "VGTNBUURyT": { "data": { - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "0", "formatOutputForAutomations": false }, @@ -84600,7 +84600,7 @@ "VTbPpchVpY": { "data": { "info": "

In the case of a project where the gross external area of new space created was more than 540m2 but less than 1000m2, the planning fee for a Certificate of Lawfulness application relating to the existing agricultural buildings is £578+ a further £578 for each additional 75m2 (or part thereof) in excess of 540m2.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil((proposal.newFloorArea-540)/75))578+578)", "samples": {}, "defaults": { @@ -85911,7 +85911,7 @@ }, "VwCnxfFTTq": { "data": { - "output": "proposal.motorcycles.number.existing", + "fn": "proposal.motorcycles.number.existing", "formula": "proposal.motorcycles.onStreet.number.existing+proposal.motorcycles.offStreet.number.existing", "samples": {}, "defaults": { @@ -87171,7 +87171,7 @@ "WPSmnYVLmY": { "data": { "info": "

In the case of an application that is the first resubmission of an application on the same site that is similar in character and description, no planning fee is payable.

", - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "0", "samples": {}, "defaults": {}, @@ -87420,7 +87420,7 @@ "WUDOBOCEis": { "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for winning or working of materials (excluding oil and natural gas) is £158 for each 0.1 hectares (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))316)0.5", "samples": {}, "defaults": { @@ -89214,7 +89214,7 @@ "XBQMeFKUdP": { "data": { "info": "

In the case of a project where the gross external area of new space created will be greater than 465m2 but no more than 540m2, the planning fee for an application for planning permission relating to existing agricultural buildings is £578.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "578", "policyRef": "

https://www.legislation.gov.uk/uksi/2023/1197/made

", "howMeasured": "

For more information about planning fees in England are calculated, view this guide

", @@ -90709,7 +90709,7 @@ "XifyuIlqIT": { "data": { "info": "

Applications made by a Parish Council or Community Council pay a reduced planning fee (50%)

", - "output": "application.fee.reduced", + "fn": "application.fee.reduced", "formula": "application.fee.calculated*0.5", "defaults": { "application.fee.calculated": "1" @@ -92496,7 +92496,7 @@ }, "YM6FlfFTTq": { "data": { - "output": "proposal.cars.disabled.number.proposed", + "fn": "proposal.cars.disabled.number.proposed", "formula": "proposal.cars.onStreet.disabled.number.proposed+proposal.cars.offStreet.disabled.number.proposed", "samples": {}, "defaults": { @@ -92554,7 +92554,7 @@ }, "YNRT2fFTTq": { "data": { - "output": "proposal.buses.number.proposed", + "fn": "proposal.buses.number.proposed", "formula": "proposal.buses.onStreet.number.proposed+proposal.buses.offStreet.number.proposed", "samples": {}, "defaults": { @@ -92793,7 +92793,7 @@ }, "YSHAfi8d2s": { "data": { - "output": "proposal.newStoreys.maxOne", + "fn": "proposal.newStoreys.maxOne", "formula": "smallerEq(proposal.newStoreys.number, 1)", "samples": {}, "defaults": { @@ -93495,7 +93495,7 @@ }, "YizU552sWA": { "data": { - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "43", "samples": {}, "defaults": {}, @@ -94060,7 +94060,7 @@ }, "YteHq3UaUJ": { "data": { - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "120", "samples": {}, "defaults": {}, @@ -94269,7 +94269,7 @@ "Yxm7UwFC9A": { "data": { "info": "

In the case of a site with an area of more than 5 hectares, The planning fee for an application for planning permission relating to the proposed installation of plant or machinery is £30,860 + £186 for each hectare (or part thereof), up to a maximum of £405,000

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-50000)/1000))186+30860),405000))", "defaults": { "proposal.siteArea": "50000", @@ -98837,7 +98837,7 @@ "atff5617kj": { "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for a Certificate of Lawfulness application relating to an existing use of a site for the winning and working of materials (excluding oil and natural gas) is £47,161 + £186 for each 0.1 hectares (or part thereof), up to a maximum of £105,300

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))186+47161),105300))", "samples": {}, "defaults": { @@ -101541,7 +101541,7 @@ "bzIMcE09B1": { "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for a Prior Approval application relating to the use of a site for winning or working of materials is £47,161+ £186 for each 0.1 hectares (or part thereof), up to a maximum of £105,300.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))186+47161),105300))", "samples": {}, "defaults": { @@ -103140,7 +103140,7 @@ "cZKFi9dXfI": { "data": { "info": "

The planning fee for an application for planning permission relating to existing 'other operations' is £293 for each 0.1 Hectares (or part thereof) within the site area, up to a maximum of £2535.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min((ceil(proposal.siteArea/1000))293,2535))", "samples": {}, "defaults": { @@ -105090,7 +105090,7 @@ }, "dCTzpcUKPK": { "data": { - "output": "proposal.parking.disabled.difference", + "fn": "proposal.parking.disabled.difference", "formula": "proposal.parking.disabled-property.parking.disabled", "samples": {}, "defaults": { @@ -105807,7 +105807,7 @@ }, "dTbkAs0PxK": { "data": { - "output": "property.units.residential.total", + "fn": "property.units.residential.total", "formula": "proposal.units.residential.removed+proposal.units.residential.rebuilt+proposal.units.residential.retained", "samples": {}, "defaults": { @@ -106228,7 +106228,7 @@ }, "dk1gqGqb4B": { "data": { - "output": "proposal.units.maxOne", + "fn": "proposal.units.maxOne", "formula": "smallerEq(proposal.units.residential.new, 1) and smallerEq(proposal.units.residential.removed, 1) and smallerEq(proposal.units.residential.rebuilt, 1) and smallerEq(proposal.units.residential.retained, 1)", "samples": {}, "defaults": { @@ -107231,7 +107231,7 @@ "data": { "info": "

The planning fee for a Certificate of Lawfulness application relating to proposed 'other operations' is £146,50 for each 0.1 Hectares (or part thereof) within the site area, up to a maximum of £1267.50.

", "notes": "https://www.legislation.gov.uk/uksi/2023/1197/made", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min((ceil(proposal.siteArea/1000))293,2535))0.5", "samples": {}, "defaults": { @@ -108467,7 +108467,7 @@ "eaPFwQAoM7": { "data": { "info": "

The planning fee for an application for planning permission relating to a change of use or an application for a Certificate of Lawfulness relating to an existing change of use is £578.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "578", "policyRef": "

https://www.legislation.gov.uk/uksi/2023/1197/made

", "howMeasured": "

For more information about planning fees in England are calculated, view this guide

", @@ -108510,7 +108510,7 @@ "ebxe1DP5OE": { "data": { "info": "

In the case of a site with an area of more than 7.5 hectares, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for exploratory drilling is £25,697.50 + £102 for each 0.1 hectares (or part thereof), up to a maximum of £202,500

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-75000)/1000))204+51395),405000))0.5", "samples": {}, "defaults": { @@ -109507,7 +109507,7 @@ "epwXPPMJyn": { "data": { "info": "

In the case of a project where the gross external area of new space created will be more than 4215m2, the planning fee for an application for planning permission relating to the proposed creation of agricultural buildings is £30,860 + £186 for each additional 75m2, up to a maximum of £405,000.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.newFloorArea-4215)/75))186+30860),405000))", "defaults": { "proposal.newFloorArea": "4215" @@ -109577,7 +109577,7 @@ "erMj9LH16l": { "data": { "info": "

The plannning fee for an application for a Certificate of Lawfulness relating to the proposed alteration or extension of a single home is £129

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "129", "samples": {}, "defaults": {}, @@ -110369,7 +110369,7 @@ "f8pbfhdldY": { "data": { "info": "

The plannning fee for an application for a Certificate of Lawfulness relating to the proposed alteration or extension of two or more homes is £254.50

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "254.5", "samples": {}, "defaults": { @@ -111005,7 +111005,7 @@ "fOag5S12Yz": { "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for waste or refuse is £158 for each 0.1 hectares (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))316)0.5", "samples": {}, "defaults": { @@ -111375,7 +111375,7 @@ "fcAtG8LgDr": { "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for a Certificate of Lawfulness application relating to an existing use of a site for drilling oil or natural gas is £347 for each 0.1 hectares (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))347)", "samples": {}, "defaults": { @@ -111504,7 +111504,7 @@ "ffdNnjsbyK": { "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for an application for planning permission relating to existing use of a site for waste or refuse is £316 for each 0.1 hectares (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))316)", "samples": {}, "defaults": { @@ -111736,7 +111736,7 @@ "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for a Certificate of Lawfulness application relating to the existing use of a site for winning or working of materials (excluding oil and natural gas) is £316 for each 0.1 hectares (or part thereof)

", "notes": "If 15 hectares or less: £234 for each 0.1 Ha (or part thereof)", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))316)", "samples": {}, "defaults": { @@ -112523,7 +112523,7 @@ "g0b2irgCi5": { "data": { "info": "

The fee to apply for planning permission to alter or extend a single home is £258.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "258", "samples": {}, "defaults": {}, @@ -114133,7 +114133,7 @@ "gdCDJHhyPc": { "data": { "info": "

In the case of a project where the gross external area of new space created will be 465m2 or less, the planning fee for a Certificate of Lawfulness application relating to the proposed creation of a glasshouse is £60

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "120*0.5", "samples": {}, "defaults": {}, @@ -116115,7 +116115,7 @@ "data": { "info": "

In the case of a project where the gross external area of new space created was more than 465m2 but less than 1000m2, the planning fee for a Certificate of Lawfulness application relating to an existing glasshouse is £3225

", "notes": "Full fee: if new floor space is 465m2 or less: £96", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "3225", "samples": {}, "defaults": {}, @@ -118933,7 +118933,7 @@ "iDAN2Lxn5R": { "data": { "info": "

The plannning fee for an application for a Certificate of Lawfulness relating to creation of fewer than 10 new homes is £289 per new home

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "proposal.newDwellings.number*289", "samples": {}, "defaults": { @@ -119280,7 +119280,7 @@ }, "iLwv2v0hmv": { "data": { - "output": "proposal.parking.vans.difference", + "fn": "proposal.parking.vans.difference", "formula": "proposal.parking.vans-property.parking.vans", "samples": {}, "defaults": { @@ -120648,7 +120648,7 @@ "ip2F6saRKL": { "data": { "info": "

In the case of a site with an area of more than 7.5 hectares, the planning fee for a Certificate of Lawfulness application relating to an existing use of a site for exploratory drilling is £51,395 + £204 for each 0.1 hectares (or part thereof), up to a maximum of £405,000

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-75000)/1000))204+51395),405000))", "samples": {}, "defaults": { @@ -121100,7 +121100,7 @@ "iytelJKvFf": { "data": { "info": "

The planning fee for an application for planning permission relating to an existing non-residential developments where the new floor area created is more than 3750m2 is £30,680+£186 for each additional 75m2 (or part thereof) up to a maximum of £405,000

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.newFloorArea-3750)/75))186+30680),405000))", "samples": {}, "defaults": { @@ -122721,7 +122721,7 @@ }, "jUwAMlzsk8": { "data": { - "output": "proposal.parking.other.difference", + "fn": "proposal.parking.other.difference", "formula": "proposal.parking.other-property.parking.other", "samples": {}, "defaults": { @@ -123392,7 +123392,7 @@ }, "jjNfQfFTTq": { "data": { - "output": "proposal.vans.number.existing", + "fn": "proposal.vans.number.existing", "formula": "proposal.vans.onStreet.number.existing+proposal.vans.offStreet.number.existing", "defaults": { "proposal.vans.onStreet.number.existing": "0", @@ -127562,7 +127562,7 @@ "lGC1F104D8": { "data": { "info": "

In the case of a project where the gross external area of new space created was more than 1000m2 but no more than 4215m2, the planning fee for a Certificate of Lawfulness application relating to the existing agricultural buildings is £624 + a further £624 for each additional 75m2 (or part thereof) in excess of 1000m2.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil((proposal.newFloorArea-1000)/75))624+624)", "samples": {}, "defaults": { @@ -127618,7 +127618,7 @@ "lHAKPDxInS": { "data": { "info": "

In the case of a project where the gross external area of new space created will be more than 540m2 but less than 1000m2, the planning fee for an application for planning permission relating to existing agricultural buildings is £578+ a further £578 for each additional 75m2 (or part thereof) in excess of 540m2.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil((proposal.newFloorArea-540)/75))578+578)", "defaults": { "proposal.newFloorArea": "540" @@ -127866,7 +127866,7 @@ }, "lPTk299cFd": { "data": { - "output": "proposal.units.residential.total", + "fn": "proposal.units.residential.total", "formula": "proposal.units.residential.new+proposal.units.residential.rebuilt+proposal.units.residential.retained", "samples": {}, "defaults": { @@ -128561,7 +128561,7 @@ "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for a Certificate of Lawfulness application relating to an existing use of a site for waste or refuse is £47,161+ £186 for each 0.1 hectares (or part thereof), up to a maximum of £105,300

", "notes": "If more than 15 hectares, £34,934 + £138 for each additional 0.1 hectare (or part thereof) up to a max of £78,000", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))186+47161),105300))", "samples": {}, "defaults": { @@ -128952,7 +128952,7 @@ "lpyrUCv54E": { "data": { "info": "

The plannning fee for a Prior Approval application relating to creation of at least 10 but no more than 50 new homes on rooftops, or on a site created by demolishing vacant buildings is £451 per new home

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "proposal.newDwellings.number*451", "samples": {}, "defaults": { @@ -131765,7 +131765,7 @@ "data": { "info": "

In the case of a project where the gross external area of new space created was 465m2 or less, the planning fee for a Certificate of Lawfulness application relating to existing glasshouses is £120

", "notes": "Full fee: if new floor space is 465m2 or less: £96", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "120", "samples": {}, "defaults": {}, @@ -132340,7 +132340,7 @@ "n9UNiMpx56": { "data": { "notes": "I'm not sure if this is needed / used, but putting it here for robustness.", - "output": "proposal.newDwellings.number", + "fn": "proposal.newDwellings.number", "formula": "proposal.removedDwellings.number*-1", "samples": {}, "defaults": { @@ -132658,7 +132658,7 @@ "nD3eblMQeU": { "data": { "info": "

The plannning fee for a Prior Approval application relating to the addition of more than 50 new homes on rooftops or on a site created by demolishing vacant buildings is £22,309 plus £135 for each additional home beyond 50, up to a maximum of £405,000.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min((22309+(proposal.newDwellings.number-50)*135),405000))", "samples": {}, "defaults": { @@ -132787,7 +132787,7 @@ "nGZY8Y0Hzb": { "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for an application for planning permission relating to an existing use of a site for waste or refuse is £47,161+ £186 for each 0.1 hectares (or part thereof), up to a maximum of £105,300

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))186+47161),105300))", "samples": {}, "defaults": { @@ -134745,7 +134745,7 @@ }, "o30WVjhbsQ": { "data": { - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "120", "samples": {}, "defaults": {}, @@ -135600,7 +135600,7 @@ "data": { "info": "

In the case of a project where the gross external area of new space created will be 1000m2 or more, The planning fee for an application for planning permission relating to an existing glasshouse is £3483

", "notes": "Full fee: If more than 465m2: £2580", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "3483", "policyRef": "

https://www.legislation.gov.uk/uksi/2023/1197/made

", "howMeasured": "

For more information about planning fees in England are calculated, view this guide

", @@ -136630,7 +136630,7 @@ }, "otjAq2ioY3": { "data": { - "output": "proposal.parking.offStreet.residential.difference", + "fn": "proposal.parking.offStreet.residential.difference", "formula": "proposal.parking.cars.offStreet.residential-property.parking.cars.offStreet.residential", "samples": {}, "defaults": { @@ -136729,7 +136729,7 @@ "ovawWZ62yn": { "data": { "info": "

In the case of a site with an area of 15 hectares or less, the planning fee for a Certificate of Lawfulness application relating to existing use of a site for waste or refuse is £316 for each 0.1 hectares (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))316)", "samples": {}, "defaults": { @@ -137206,7 +137206,7 @@ "p5GVsOQP6m": { "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for waste or refuse is £23,580.50 + £93 for each 0.1 hectares (or part thereof), up to a maximum of £52,650

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))186+47161),105300))0.5", "samples": {}, "defaults": { @@ -137565,7 +137565,7 @@ "data": { "info": "

In the case of a site with an area of more than 7.5 hectares, the planning fee for an application for planning permission relating to an existing use of a site for exploratory drilling is £51,395 + £204 for each 0.1 hectares (or part thereof), up to a maximum of £405,000

", "notes": "If more than 7.5 Ha: £38,070 + £151 for each additional 0.1Ha (or part thereof) up to a max of £300,000", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-75000)/1000))204+51395),405000))", "samples": {}, "defaults": { @@ -138067,7 +138067,7 @@ "pMyslg2aNk": { "data": { "info": "

In the case of a project where the gross external area of new space created will be more than 1000m2 but no more than 4215m2, the planning fee for an application for planning permission relating to existing agricultural buildings is £624+ a further £624 for each additional 75m2 (or part thereof) in excess of 1000m2.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil((proposal.newFloorArea-1000)/75))624+624)", "defaults": { "proposal.newFloorArea": "1000" @@ -138812,7 +138812,7 @@ "pbHzaBhfjT": { "data": { "info": "

The plannning fee for an application for a Certificate of Lawfulness relating to creation of at least 10 but no more than 50 homes is £312 per new home

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "proposal.newDwellings.number*312", "samples": {}, "defaults": { @@ -139306,7 +139306,7 @@ "pkjF2HNNPk": { "data": { "info": "

The planning fee for an application for planning permission relating to an existing non-residential development where the new floor area created is more than 40m2 and less than 1000m2 is £578 for every 75m2 (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(ceil(proposal.newFloorArea/75))*578", "samples": {}, "defaults": { @@ -143478,7 +143478,7 @@ "rCXJHuTaOT": { "data": { "info": "

The planning fee for a Certificate of Lawfulness application relating to existing 'other operations' is £293 for each 0.1 Hectares (or part thereof) within the site area, up to a maximum of £2535.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min((ceil(proposal.siteArea/1000))293,2535))", "samples": {}, "defaults": { @@ -144754,7 +144754,7 @@ "rmmBRUi1OK": { "data": { "info": "

The planning fee for an application for planning permission relating to an existing non-residential development where the new floor area created was more than 40m2 and less than 1000m2 is £578 for every 75m2 (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(ceil(proposal.newFloorArea/75))*578", "defaults": { "proposal.newFloorArea": "41" @@ -145987,7 +145987,7 @@ "sK9f8lpWXe": { "data": { "info": "

The planning fee for an application for planning permission relating to existing non-residential developments where the new floor area created was less than 40m2 is £293.

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(293)", "policyRef": "

https://www.legislation.gov.uk/uksi/2023/1197/made

", "howMeasured": "

For more information about planning fees in England are calculated, view this guide

", @@ -146548,7 +146548,7 @@ }, "sUpgq1zdLo": { "data": { - "output": "proposal.parking.motorcycles.difference", + "fn": "proposal.parking.motorcycles.difference", "formula": "proposal.parking.motorcycles-property.parking.motorcycles", "samples": {}, "defaults": { @@ -146996,7 +146996,7 @@ "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for the drilling oil and natural gas is £52,002 + £204 for each 0.1 hectares (or part thereof), up to a maximum of £105,300

", "notes": "If site area is more than 15 Ha, £38,520 + £151 for each additional 0.1 Ha (or part thereof) up to a max of £78,000", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))204+52002),105300))", "samples": {}, "defaults": { @@ -147398,7 +147398,7 @@ "sptobLuLY0": { "data": { "info": "

In the case of a project where the gross external area of new space created will be more than 4215m2, the planning fee for a Certificate of Lawfulness application relating to the proposed creation of agricultural buildings is £15,430 + £93 for each additional 75m2, up to a maximum of £202,500

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.newFloorArea-4215)/75))186+30860),405000))0.5", "samples": {}, "defaults": { @@ -149146,7 +149146,7 @@ "tSzyptR475": { "data": { "info": "

In the case of a site with an area of 1 to 5 hectares, the planning fee for a Certificate of Lawfulness application relating to the proposed works to plant or machinery is £312 for each 0.1 hectare (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))624)0.5", "samples": {}, "defaults": { @@ -149556,7 +149556,7 @@ "tcNLnu3ePC": { "data": { "info": "

In the case of a project where the new floor area created was between 1000m2 and 3750m2, the planning fee for a Certificate of Lawfulness application relating to the erection of buildings (e.g. commercial, community, charity, residential (not dwellinghouses, agricultural or glasshouses or plant/machinery)) is £312 for every 75m2 (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil((proposal.newFloorArea-75)/75))462+462)0.5", "samples": {}, "defaults": { @@ -150075,7 +150075,7 @@ "data": { "info": "

In the case of a project where the gross external area of new space created will be 465m2 or less, the planning fee for an application for planning permission relating to the existing agricultural buildings is £120.

", "notes": "Full fee: if new floor space is 465m2 or less: £96", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "120", "policyRef": "

https://www.legislation.gov.uk/uksi/2023/1197/made

", "howMeasured": "

For more information about planning fees in England are calculated, view this guide

", @@ -150954,7 +150954,7 @@ "u96c3ugjkt": { "data": { "info": "

In the case of a site with an area of 7.5 hectares or less, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for exploratory drilling is £343 for each 0.1 hectare (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))686)0.5", "samples": {}, "defaults": { @@ -153402,7 +153402,7 @@ }, "v7ExifFTTq": { "data": { - "output": "proposal.cars.disabled.number.existing", + "fn": "proposal.cars.disabled.number.existing", "formula": "proposal.cars.onStreet.disabled.number.existing+proposal.cars.offStreet.disabled.number.existing", "samples": {}, "defaults": { @@ -153584,7 +153584,7 @@ "vBHI6yQiO2": { "data": { "info": "

The plannning fee for a Prior Approval application relating to creation of fewer than 10 new homes on rooftops, or on a site created by demolishing vacant buildings is £418 per new home

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "proposal.newDwellings.number*418", "samples": {}, "defaults": { @@ -153788,7 +153788,7 @@ }, "vGG8P9zcn6": { "data": { - "output": "property.units.existing", + "fn": "property.units.existing", "formula": "largerEq(property.units.residential.existing, 1)", "samples": {}, "defaults": { @@ -155362,7 +155362,7 @@ "vkpuRobqIR": { "data": { "info": "

In the case of a site with an area of 1 to 5 hectares, the planning fee for an application for planning permission relating to the existing plant or machinery is £624 for each 0.1 hectare (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))624)", "defaults": { "proposal.siteArea": "1" @@ -155397,7 +155397,7 @@ }, "vlIXqMsBnG": { "data": { - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "application.fee.reduced*1", "defaults": { "application.fee.reduced": "1" @@ -155454,7 +155454,7 @@ "vmO5VWuxkW": { "data": { "info": "

In the case of a project where the gross external area of new space created will be greater than 3750m2, the planning fee for a Certificate of Lawfulness application relating to the erection of buildings (e.g. commercial, community, charity, residential (not dwellinghouses, agricultural or glasshouses or plant/machinery)) is £15,340 + £93 for each additional 75m2, up to a maximum of £202,500

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.newFloorArea-3750)/75))186+30680),405000))0.5", "samples": {}, "defaults": { @@ -155694,7 +155694,7 @@ "vsF29dSb6l": { "data": { "info": "

In the case of a site with an area of less than 1 hectare, the planning fee for a Certificate of Lawfulness application relating to the proposed works to plant or machinery is £289 for each 0.1 hectare (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))578)0.5", "defaults": { "proposal.siteArea": "1" @@ -157048,9 +157048,8 @@ "policyRef": "

The Town and Country Planning (Development Management Procedure) (England) Order 2015,

Planning Practice Guidance (PPG)

", "description": "

The red line shown below should include:

If the red line already includes all these, select continue. If not, select More information for guidance on how to amend or redraw the outline.

", "howMeasured": "

We have pre-populated the map with a red outline that includes the entire property using information from the Land Registry.

In some cases, this outline might not include all the works or the areas that will be closed off. This might be because you're proposing works to a public highway (such as a dropped kerb), doing works that involve multiple properties, or works to a building that is part of a larger estate.

In these cases, you should amend the red outline by dragging the edges, or erase it by clicking the 🗑-icon on the map and draw a new outline.

How to draw and amend the outline

  1. Move the cursor to the corner you want to start with and click or tap once.

  2. Move the cursor to the next corner and click or tap.

  3. Repeat until you have the shape you need.

  4. Click or tap the last corner again to stop drawing.

  5. To amend the outline, click or tap on a line and drag it into a new position.

", - "dataFieldArea": "property.boundary.area", "hideFileUpload": false, - "dataFieldBoundary": "property.boundary.site", + "fn": "proposal.site", "titleForUploading": "Upload a location plan", "descriptionForUploading": "

Your location plan must:

" }, @@ -158842,7 +158841,7 @@ }, "x2PNJD8gNI": { "data": { - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "145", "samples": {}, "defaults": {}, @@ -159079,7 +159078,7 @@ "x8CoAuxQLl": { "data": { "info": "

In the case of a site with an area of more than 5 hectares, the planning fee for a Certificate of Lawfulness application relating to the proposed installation of plant or machinery is £15,430 + £93 for each hectare (or part thereof), up to a maximum of £202,500

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-50000)/1000))186+30860),405000))0.5", "samples": {}, "defaults": { @@ -159763,7 +159762,7 @@ }, "xPCDRfFTTq": { "data": { - "output": "proposal.cars.club.number.existing", + "fn": "proposal.cars.club.number.existing", "formula": "proposal.cars.onStreet.club.number.existing+proposal.cars.offStreet.club.number.existing", "samples": {}, "defaults": { @@ -160542,7 +160541,7 @@ "xkVSMF0E7r": { "data": { "info": "

The planning fee for an application for planning permission relating to an existing non-residential development where the new floor area created was between 1000m2 and 3750m2 is £624 for every 75m2 (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(ceil(proposal.newFloorArea/75))*624", "defaults": { "proposal.newFloorArea": "1" @@ -162939,7 +162938,7 @@ }, "yiaoMfFTTq": { "data": { - "output": "proposal.motorcycles.number.proposed", + "fn": "proposal.motorcycles.number.proposed", "formula": "proposal.motorcycles.onStreet.number.proposed+proposal.motorcycles.offStreet.number.proposed", "samples": {}, "defaults": { @@ -164202,7 +164201,7 @@ "zH7idoWrpK": { "data": { "info": "

In the case of a site with an area of more than 15 hectares, the planning fee for a Certificate of Lawfulness application relating to proposed use of a site for the drilling oil and natural gas is £52,002 + £204 for each 0.1 hectares (or part thereof), up to a maximum of £105,300

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min(((ceil((proposal.siteArea-150000)/1000))204+52002),105300))", "samples": {}, "defaults": { @@ -164501,7 +164500,7 @@ "zODb8UPdGl": { "data": { "info": "

The planning fee for an application for a Certificate of Lawfulness relating to the creation of homes in the past, on a site that includes more than 50 homes is £30,860 + £186 for each additional new home, up to a maximum of £405,000

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(min((30860+((application.numberTotalHomes-50)*186)),405000))", "samples": {}, "defaults": { @@ -164959,7 +164958,7 @@ "zXwMH2lnrc": { "data": { "info": "

In the case of a site with an area of less than 1 hectare, The planning fee for an application for planning permission relating to the existing plant or machinery is £578 for each 0.1 hectare (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "((ceil(proposal.siteArea/1000))578)", "defaults": { "proposal.siteArea": "1" @@ -166139,7 +166138,7 @@ "zvIdjbrbuX": { "data": { "info": "

In the case of a project where the gross external area of new space created will be more than 40m2 but less than 1000m2, the planning fee for a Certificate of Lawfulness application relating to the erection of buildings (e.g. commercial, community, charity, residential (not dwellinghouses, agricultural or glasshouses or plant/machinery)) is £289 for every 75m2 (or part thereof)

", - "output": "application.fee.calculated", + "fn": "application.fee.calculated", "formula": "(ceil(proposal.newFloorArea/75))*578*0.5", "samples": {}, "defaults": { @@ -166248,7 +166247,7 @@ "zyTyWi2Zbn": { "data": { "info": "

If the proposed works (to either a home or within the curtilage of a home) is for the sole purpose of providing either:

\n

\n

- A means of access to (or within) the dwellinghouse for a disabled resident (current or future)

\n

\n

OR

\n

\n

- Providing facilities that are designed to ensure the disabled persons safety, health or comfort

\n

\n

OR

\n

\n

- Providing disabled access to a public building

\n

\n

Then no planning fee will be payable for this application.

", - "output": "application.fee.payable", + "fn": "application.fee.payable", "formula": "0", "samples": {}, "defaults": {}, diff --git a/e2e/tests/api-driven/src/invite-to-pay/mocks/session.json b/e2e/tests/api-driven/src/invite-to-pay/mocks/session.json index 80d1506ae1..9f618081c2 100644 --- a/e2e/tests/api-driven/src/invite-to-pay/mocks/session.json +++ b/e2e/tests/api-driven/src/invite-to-pay/mocks/session.json @@ -93,7 +93,7 @@ "uniform.consentRegime": ["Certificate of Lawfulness"], "application.about.form": ["Proposed building works"], "property.EPCKnown.form": ["No"], - "property.boundary.site": { + "proposal.site": { "type": "Feature", "geometry": { "type": "Polygon", @@ -814,7 +814,7 @@ "auto": false, "data": { "proposal.siteArea": 21.6, - "property.boundary.site": { + "proposal.site": { "type": "Feature", "geometry": { "type": "Polygon", diff --git a/e2e/tests/ui-driven/package.json b/e2e/tests/ui-driven/package.json index 6b4dde650a..7cdbef8d36 100644 --- a/e2e/tests/ui-driven/package.json +++ b/e2e/tests/ui-driven/package.json @@ -9,7 +9,7 @@ }, "type": "module", "dependencies": { - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d004278", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#dc2386b", "axios": "^1.7.4", "dotenv": "^16.3.1", "eslint": "^8.56.0", diff --git a/e2e/tests/ui-driven/pnpm-lock.yaml b/e2e/tests/ui-driven/pnpm-lock.yaml index 96b8f774f4..5911f8eb33 100644 --- a/e2e/tests/ui-driven/pnpm-lock.yaml +++ b/e2e/tests/ui-driven/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#d004278 - version: github.com/theopensystemslab/planx-core/d004278 + specifier: git+https://github.com/theopensystemslab/planx-core#dc2386b + version: github.com/theopensystemslab/planx-core/dc2386b axios: specifier: ^1.7.4 version: 1.7.4 @@ -344,31 +344,31 @@ packages: resolution: {integrity: sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==} dev: false - /@formatjs/ecma402-abstract@2.3.1: - resolution: {integrity: sha512-Ip9uV+/MpLXWRk03U/GzeJMuPeOXpJBSB5V1tjA6kJhvqssye5J5LoYLc7Z5IAHb7nR62sRoguzrFiVCP/hnzw==} + /@formatjs/ecma402-abstract@2.3.2: + resolution: {integrity: sha512-6sE5nyvDloULiyOMbOTJEEgWL32w+VHkZQs8S02Lnn8Y/O5aQhjOEXwWzvR7SsBE/exxlSpY2EsWZgqHbtLatg==} dependencies: - '@formatjs/fast-memoize': 2.2.5 - '@formatjs/intl-localematcher': 0.5.9 + '@formatjs/fast-memoize': 2.2.6 + '@formatjs/intl-localematcher': 0.5.10 decimal.js: 10.4.3 tslib: 2.8.1 dev: false - /@formatjs/fast-memoize@2.2.5: - resolution: {integrity: sha512-6PoewUMrrcqxSoBXAOJDiW1m+AmkrAj0RiXnOMD59GRaswjXhm3MDhgepXPBgonc09oSirAJTsAggzAGQf6A6g==} + /@formatjs/fast-memoize@2.2.6: + resolution: {integrity: sha512-luIXeE2LJbQnnzotY1f2U2m7xuQNj2DA8Vq4ce1BY9ebRZaoPB1+8eZ6nXpLzsxuW5spQxr7LdCg+CApZwkqkw==} dependencies: tslib: 2.8.1 dev: false - /@formatjs/intl-listformat@7.7.8: - resolution: {integrity: sha512-ezlfqfyegMbepGVcf3rTApVGIbZQvJwx1PZsXjMe2xAqEU1jSBZ/2efLE8u3sUBHGrrsdWER98W85zCg4N7rmQ==} + /@formatjs/intl-listformat@7.7.9: + resolution: {integrity: sha512-VGbGrngcjwrlPvstc6ysCwGlbxaq3PKXSkC9P5DYyfLI+C6I+PIog9UW8rPwH1xLXMfmyZblrkvkRboGn3E8qA==} dependencies: - '@formatjs/ecma402-abstract': 2.3.1 - '@formatjs/intl-localematcher': 0.5.9 + '@formatjs/ecma402-abstract': 2.3.2 + '@formatjs/intl-localematcher': 0.5.10 tslib: 2.8.1 dev: false - /@formatjs/intl-localematcher@0.5.9: - resolution: {integrity: sha512-8zkGu/sv5euxbjfZ/xmklqLyDGQSxsLqg8XOq88JW3cmJtzhCP8EtSJXlaKZnVO4beEaoiT9wj4eIoCQ9smwxA==} + /@formatjs/intl-localematcher@0.5.10: + resolution: {integrity: sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q==} dependencies: tslib: 2.8.1 dev: false @@ -2468,8 +2468,8 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: false - /uuid@11.0.3: - resolution: {integrity: sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==} + /uuid@11.0.4: + resolution: {integrity: sha512-IzL6VtTTYcAhA/oghbFJ1Dkmqev+FpQWnCBaKq/gUluLxliWvO8DPFWfIviRmYbtaavtSQe4WBL++rFjdcGWEg==} hasBin: true dev: false @@ -2601,8 +2601,8 @@ packages: resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} dev: false - github.com/theopensystemslab/planx-core/d004278: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d004278} + github.com/theopensystemslab/planx-core/dc2386b: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/dc2386b} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -2610,7 +2610,7 @@ packages: dependencies: '@emotion/react': 11.14.0(react@18.3.1) '@emotion/styled': 11.14.0(@emotion/react@11.14.0)(react@18.3.1) - '@formatjs/intl-listformat': 7.7.8 + '@formatjs/intl-listformat': 7.7.9 '@mui/base': 5.0.0-beta.60(react-dom@18.3.1)(react@18.3.1) '@mui/material': 5.16.9(@emotion/react@11.14.0)(@emotion/styled@11.14.0)(react-dom@18.3.1)(react@18.3.1) ajv: 8.17.1 @@ -2629,7 +2629,7 @@ packages: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) type-fest: 4.31.0 - uuid: 11.0.3 + uuid: 11.0.4 zod: 3.24.1 transitivePeerDependencies: - '@types/react' diff --git a/e2e/tests/ui-driven/src/mocks/flows/invite-to-pay-flow.ts b/e2e/tests/ui-driven/src/mocks/flows/invite-to-pay-flow.ts index 2618ad7f7a..a804c88231 100644 --- a/e2e/tests/ui-driven/src/mocks/flows/invite-to-pay-flow.ts +++ b/e2e/tests/ui-driven/src/mocks/flows/invite-to-pay-flow.ts @@ -23,7 +23,7 @@ const flow: FlowGraph = { }, F9iwWG1jBQ: { data: { - output: "application.fee.payable", + fn: "application.fee.payable", formula: "123.45", }, type: ComponentType.Calculate, diff --git a/e2e/tests/ui-driven/src/mocks/flows/pay-flow.json b/e2e/tests/ui-driven/src/mocks/flows/pay-flow.json index b0a670079e..d63ab26b7e 100644 --- a/e2e/tests/ui-driven/src/mocks/flows/pay-flow.json +++ b/e2e/tests/ui-driven/src/mocks/flows/pay-flow.json @@ -10,7 +10,7 @@ }, "KzuRf6vqc1": { "data": { - "output": "pay.test", + "fn": "pay.test", "formula": "10" }, "type": 700 diff --git a/editor.planx.uk/package.json b/editor.planx.uk/package.json index 0cf555b1a8..0df205266c 100644 --- a/editor.planx.uk/package.json +++ b/editor.planx.uk/package.json @@ -15,7 +15,7 @@ "@mui/material": "^5.15.10", "@mui/utils": "^5.15.11", "@opensystemslab/map": "1.0.0-alpha.4", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d004278", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#dc2386b", "@tiptap/core": "^2.4.0", "@tiptap/extension-bold": "^2.0.3", "@tiptap/extension-bubble-menu": "^2.1.13", diff --git a/editor.planx.uk/pnpm-lock.yaml b/editor.planx.uk/pnpm-lock.yaml index d2a5f51ba1..2aeec0e52c 100644 --- a/editor.planx.uk/pnpm-lock.yaml +++ b/editor.planx.uk/pnpm-lock.yaml @@ -48,8 +48,8 @@ dependencies: specifier: 1.0.0-alpha.4 version: 1.0.0-alpha.4 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#d004278 - version: github.com/theopensystemslab/planx-core/d004278(@types/react@18.2.45) + specifier: git+https://github.com/theopensystemslab/planx-core#dc2386b + version: github.com/theopensystemslab/planx-core/dc2386b(@types/react@18.2.45) '@tiptap/core': specifier: ^2.4.0 version: 2.4.0(@tiptap/pm@2.0.3) @@ -2716,31 +2716,31 @@ packages: react: 18.2.0 dev: true - /@formatjs/ecma402-abstract@2.3.1: - resolution: {integrity: sha512-Ip9uV+/MpLXWRk03U/GzeJMuPeOXpJBSB5V1tjA6kJhvqssye5J5LoYLc7Z5IAHb7nR62sRoguzrFiVCP/hnzw==} + /@formatjs/ecma402-abstract@2.3.2: + resolution: {integrity: sha512-6sE5nyvDloULiyOMbOTJEEgWL32w+VHkZQs8S02Lnn8Y/O5aQhjOEXwWzvR7SsBE/exxlSpY2EsWZgqHbtLatg==} dependencies: - '@formatjs/fast-memoize': 2.2.5 - '@formatjs/intl-localematcher': 0.5.9 + '@formatjs/fast-memoize': 2.2.6 + '@formatjs/intl-localematcher': 0.5.10 decimal.js: 10.4.3 tslib: 2.8.1 dev: false - /@formatjs/fast-memoize@2.2.5: - resolution: {integrity: sha512-6PoewUMrrcqxSoBXAOJDiW1m+AmkrAj0RiXnOMD59GRaswjXhm3MDhgepXPBgonc09oSirAJTsAggzAGQf6A6g==} + /@formatjs/fast-memoize@2.2.6: + resolution: {integrity: sha512-luIXeE2LJbQnnzotY1f2U2m7xuQNj2DA8Vq4ce1BY9ebRZaoPB1+8eZ6nXpLzsxuW5spQxr7LdCg+CApZwkqkw==} dependencies: tslib: 2.8.1 dev: false - /@formatjs/intl-listformat@7.7.8: - resolution: {integrity: sha512-ezlfqfyegMbepGVcf3rTApVGIbZQvJwx1PZsXjMe2xAqEU1jSBZ/2efLE8u3sUBHGrrsdWER98W85zCg4N7rmQ==} + /@formatjs/intl-listformat@7.7.9: + resolution: {integrity: sha512-VGbGrngcjwrlPvstc6ysCwGlbxaq3PKXSkC9P5DYyfLI+C6I+PIog9UW8rPwH1xLXMfmyZblrkvkRboGn3E8qA==} dependencies: - '@formatjs/ecma402-abstract': 2.3.1 - '@formatjs/intl-localematcher': 0.5.9 + '@formatjs/ecma402-abstract': 2.3.2 + '@formatjs/intl-localematcher': 0.5.10 tslib: 2.8.1 dev: false - /@formatjs/intl-localematcher@0.5.9: - resolution: {integrity: sha512-8zkGu/sv5euxbjfZ/xmklqLyDGQSxsLqg8XOq88JW3cmJtzhCP8EtSJXlaKZnVO4beEaoiT9wj4eIoCQ9smwxA==} + /@formatjs/intl-localematcher@0.5.10: + resolution: {integrity: sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q==} dependencies: tslib: 2.8.1 dev: false @@ -13882,8 +13882,8 @@ packages: dev: false optional: true - /uuid@11.0.3: - resolution: {integrity: sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==} + /uuid@11.0.4: + resolution: {integrity: sha512-IzL6VtTTYcAhA/oghbFJ1Dkmqev+FpQWnCBaKq/gUluLxliWvO8DPFWfIviRmYbtaavtSQe4WBL++rFjdcGWEg==} hasBin: true dev: false @@ -14523,9 +14523,9 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/theopensystemslab/planx-core/d004278(@types/react@18.2.45): - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d004278} - id: github.com/theopensystemslab/planx-core/d004278 + github.com/theopensystemslab/planx-core/dc2386b(@types/react@18.2.45): + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/dc2386b} + id: github.com/theopensystemslab/planx-core/dc2386b name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -14533,7 +14533,7 @@ packages: dependencies: '@emotion/react': 11.14.0(@types/react@18.2.45)(react@18.3.1) '@emotion/styled': 11.14.0(@emotion/react@11.14.0)(@types/react@18.2.45)(react@18.3.1) - '@formatjs/intl-listformat': 7.7.8 + '@formatjs/intl-listformat': 7.7.9 '@mui/base': 5.0.0-beta.60(@types/react@18.2.45)(react-dom@18.3.1)(react@18.3.1) '@mui/material': 5.15.10(@emotion/react@11.14.0)(@emotion/styled@11.14.0)(@types/react@18.2.45)(react-dom@18.3.1)(react@18.3.1) ajv: 8.17.1 @@ -14552,7 +14552,7 @@ packages: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) type-fest: 4.31.0 - uuid: 11.0.3 + uuid: 11.0.4 zod: 3.24.1 transitivePeerDependencies: - '@types/react' diff --git a/editor.planx.uk/src/@planx/components/Calculate/Editor.tsx b/editor.planx.uk/src/@planx/components/Calculate/Editor.tsx index 66b4be10cb..69fcb8de66 100644 --- a/editor.planx.uk/src/@planx/components/Calculate/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/Calculate/Editor.tsx @@ -127,8 +127,8 @@ export default function Component(props: Props) { formik.setFieldValue("output", value)} + value={formik.values.fn} + onChange={(value) => formik.setFieldValue("fn", value)} /> )}

- {formik.values.output || ""} would be set + {formik.values.fn || ""} would be set to {sampleResult}

diff --git a/editor.planx.uk/src/@planx/components/Calculate/Public.test.tsx b/editor.planx.uk/src/@planx/components/Calculate/Public.test.tsx index adbb6af224..5d63ffe53c 100644 --- a/editor.planx.uk/src/@planx/components/Calculate/Public.test.tsx +++ b/editor.planx.uk/src/@planx/components/Calculate/Public.test.tsx @@ -9,7 +9,7 @@ describe("Calculate component", () => { const handleSubmit = vi.fn(); setup( ; formula: string; samples: Record; @@ -20,7 +20,7 @@ export const parseCalculate = ( data: Record | undefined, ): Calculate => ({ ...parseBaseNodeData(data), - output: data?.output || "", + fn: data?.fn || "", defaults: data?.defaults || {}, formula: data?.formula || "", samples: data?.samples || {}, diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx b/editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx index c8b11161ab..44b6599ff1 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx @@ -53,25 +53,13 @@ function DrawBoundaryComponent(props: Props) { onChange={formik.handleChange} /> - + - - - - - diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx index 208926e51a..6afd73679d 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx @@ -42,8 +42,7 @@ test("recovers previously submitted files when clicking the back button", async const { user } = setup( { const handleSubmit = vi.fn(); const previouslySubmittedData = { - "property.boundary.site": { + "proposal.site": { type: "Feature", properties: {}, geometry: { @@ -85,8 +84,7 @@ test("recovers previously submitted drawing when clicking the back button", asyn const { user } = setup( { const { container } = setup( { titleForUploading: "Upload a location plan", descriptionForUploading: "", hideFileUpload: false, - dataFieldBoundary: "property.boundary.site", - dataFieldArea: "property.boundary.area", + fn: "proposal.site", }, }, }; @@ -344,8 +337,7 @@ test("appends to existing '_requestedFiles' value", async () => { const { user } = setup( { // Previously submitted data is a good proxy for having previously fetched a title boundary and arriving to Draw with geojson in passport ! const previouslySubmittedData = { - "property.boundary.site": { + "proposal.site": { type: "Feature", properties: {}, geometry: { @@ -427,8 +419,7 @@ test("submits data based on the page you continue onwards from", async () => { const { user } = setup( { // Confirm that file is NOT saved to passport, but geojson is const submitted = handleSubmit.mock.calls[0][0]; expect(submitted.data).not.toHaveProperty(PASSPORT_UPLOAD_KEY); - expect(submitted.data["property.boundary.site"]).toEqual( - previouslySubmittedData["property.boundary.site"], + expect(submitted.data["proposal.site"]).toEqual( + previouslySubmittedData["proposal.site"], ); // DrawBoundary action captured correctly based on page diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx index 8c533ae74b..3eab48382d 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx @@ -54,11 +54,12 @@ export default function Component(props: Props) { const passport = useStore((state) => state.computePassport()); const previousBoundary = - props.previouslySubmittedData?.data?.[props.dataFieldBoundary] || - passport.data?.["property.boundary.title"]; + props.previouslySubmittedData?.data?.[props.fn] || + passport.data?.["property.boundary"]; const previousArea = - props.previouslySubmittedData?.data?.[props.dataFieldArea] || - passport.data?.["property.boundary.title.area"]; + props.previouslySubmittedData?.data?.[`${props.fn}.area`] || + passport.data?.["property.boundary.area"]; + const [boundary, setBoundary] = useState(previousBoundary); const [area, setArea] = useState(previousArea); const [mapValidationError, setMapValidationError] = useState(); @@ -150,24 +151,24 @@ export default function Component(props: Props) { props.handleSubmit?.({ data: { ...newPassportData } }); } - if (boundary && props.dataFieldBoundary) { - newPassportData[props.dataFieldBoundary] = boundary; - newPassportData[`${props.dataFieldBoundary}.buffered`] = buffer( + if (boundary && props.fn) { + newPassportData[props.fn] = boundary; + newPassportData[`${props.fn}.buffered`] = buffer( boundary, bufferInMeters, { units: "meters" }, ); - if (area && props.dataFieldArea) { - newPassportData[props.dataFieldArea] = area; - newPassportData[`${props.dataFieldArea}.hectares`] = + if (area && props.fn) { + newPassportData[`${props.fn}.area`] = area; + newPassportData[`${props.fn}.hectares`] = squareMetresToHectares(area); } // Track the type of map interaction if ( boundary?.geometry === - passport.data?.["property.boundary.title"]?.geometry + passport.data?.["property.boundary"]?.geometry ) { newPassportData[PASSPORT_COMPONENT_ACTION_KEY] = DrawBoundaryUserAction.Accept; diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/model.ts b/editor.planx.uk/src/@planx/components/DrawBoundary/model.ts index 14e7098779..6cd0b3927f 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/model.ts +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/model.ts @@ -13,8 +13,7 @@ export interface DrawBoundary extends BaseNodeData { titleForUploading: string; descriptionForUploading: string; hideFileUpload?: boolean; - dataFieldBoundary: string; - dataFieldArea: string; + fn: string; } export const parseDrawBoundary = ( @@ -29,9 +28,7 @@ export const parseDrawBoundary = ( data?.descriptionForUploading || defaultContent?.["descriptionForUploading"], hideFileUpload: data?.hideFileUpload || defaultContent?.["hideFileUpload"], - dataFieldBoundary: - data?.dataFieldBoundary || defaultContent?.["dataFieldBoundary"], - dataFieldArea: data?.dataFieldArea || defaultContent?.["dataFieldArea"], + fn: defaultContent?.["fn"], // input is disabled, no need to account for data?.fn info: data?.info || defaultContent?.["info"], policyRef: data?.policyRef || defaultContent?.["policyRef"], howMeasured: data?.howMeasured || defaultContent?.["howMeasured"], @@ -54,8 +51,7 @@ const defaultContent: DrawBoundary = { howMeasured: '

We have pre-populated the map with a red outline that includes the entire property using information from Land Registry.

In some cases, this outline might not include all the works or the areas that will be closed off. This might be because you're proposing works to a public highway (such as a dropped kerb), doing works that involve multiple properties, or works to a building that is part of a larger estate.

In these cases, you should amend the red outline by dragging the edges, or erase it by clicking the :wastebasket:-icon on the map and draw a new outline.

How to draw and amend the outline

  1. Move the cursor to the corner you want to start with and click or tap once.

  2. Move the cursor to the next corner and click or tap.

  3. Repeat until you have the shape you need.

  4. Click or tap the last corner again to stop drawing.

  5. To amend the outline, click or tap on a line and drag it into a new position.

', hideFileUpload: false, - dataFieldBoundary: "property.boundary.site", - dataFieldArea: "property.boundary.area", + fn: "proposal.site", titleForUploading: "Upload a location plan", descriptionForUploading: "

Your location plan must:

  • be based on an accurate, recognisable map

  • be drawn to a scale, labelled, and/or marked with a scale bar

  • show the site outline in red

  • include a north point

", diff --git a/editor.planx.uk/src/@planx/components/FindProperty/Public/Public.test.tsx b/editor.planx.uk/src/@planx/components/FindProperty/Public/Public.test.tsx index b2bd212e6b..6868a85a4a 100644 --- a/editor.planx.uk/src/@planx/components/FindProperty/Public/Public.test.tsx +++ b/editor.planx.uk/src/@planx/components/FindProperty/Public/Public.test.tsx @@ -36,9 +36,9 @@ const osAddressProps = { "property.type": ["residential.HMO.parent"], "property.localAuthorityDistrict": ["Southwark"], "property.region": ["London"], - "property.boundary.title.area": 1232.22, - "property.boundary.title.area.hectares": 0.123222, - "property.boundary.title": { + "property.boundary.area": 1232.22, + "property.boundary.area.hectares": 0.123222, + "property.boundary": { geometry: { type: "MultiPolygon", coordinates: [ @@ -85,9 +85,9 @@ const proposedAddressProps = { }, "property.localAuthorityDistrict": ["Southwark"], "property.region": ["London"], - "property.boundary.title.area": 1232.22, - "property.boundary.title.area.hectares": 0.123222, - "property.boundary.title": { + "property.boundary.area": 1232.22, + "property.boundary.area.hectares": 0.123222, + "property.boundary": { geometry: { type: "MultiPolygon", coordinates: [ diff --git a/editor.planx.uk/src/@planx/components/FindProperty/Public/index.tsx b/editor.planx.uk/src/@planx/components/FindProperty/Public/index.tsx index c7f3093821..033a925f4c 100644 --- a/editor.planx.uk/src/@planx/components/FindProperty/Public/index.tsx +++ b/editor.planx.uk/src/@planx/components/FindProperty/Public/index.tsx @@ -156,9 +156,9 @@ function Component(props: Props) { if (titleBoundary) { const areaSquareMetres = Math.round(area(titleBoundary as Feature) * 100) / 100; - newPassportData["property.boundary.title"] = titleBoundary; - newPassportData["property.boundary.title.area"] = areaSquareMetres; - newPassportData["property.boundary.title.area.hectares"] = + newPassportData["property.boundary"] = titleBoundary; + newPassportData["property.boundary.area"] = areaSquareMetres; + newPassportData["property.boundary.area.hectares"] = squareMetresToHectares(areaSquareMetres); } diff --git a/editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.tsx b/editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.tsx index 5ffc2d2313..4c087c23af 100644 --- a/editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.tsx +++ b/editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.tsx @@ -261,7 +261,7 @@ const Root = () => { basemap={basemap} ariaLabelOlFixedOverlay={`An interactive map for plotting and describing individual ${schemaName.toLocaleLowerCase()}`} geojsonData={ - passport && JSON.stringify(passport["property.boundary.site"]) + passport && JSON.stringify(passport["proposal.site"]) } geojsonBuffer={30} drawMode diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx b/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx index 209cd1e93c..26ab658847 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx @@ -53,7 +53,7 @@ function Component(props: Props) { state.cachedBreadcrumbs, state.teamSlug, state.teamIntegrations?.hasPlanningData, - state.computePassport().data?.["property.boundary.site"], + state.computePassport().data?.["proposal.site"], state.computePassport().data?.["_overrides"], (state.computePassport().data?.["_address"] as SiteAddress) || {}, ]); diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/simpleFlow.ts b/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/simpleFlow.ts index 17ed125da3..72fe5ef1d2 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/simpleFlow.ts +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/simpleFlow.ts @@ -61,7 +61,7 @@ export const simpleBreadcrumbs: Store.Breadcrumbs = { "property.type": ["commercial.office.workspace.gov.local"], "property.localAuthorityDistrict": ["Birmingham"], "property.region": ["West Midlands"], - "property.boundary.title": { + "property.boundary": { geometry: { type: "MultiPolygon", coordinates: [ @@ -88,8 +88,8 @@ export const simpleBreadcrumbs: Store.Breadcrumbs = { "organisation-entity": "13", }, }, - "property.boundary.title.area": 8242.37, - "property.boundary.title.area.hectares": 0.8242370000000001, + "proposal.site.area": 8242.37, + "proposal.site.area.hectares": 0.8242370000000001, "findProperty.action": "Selected an existing address", }, }, diff --git a/editor.planx.uk/src/@planx/components/PropertyInformation/Public.tsx b/editor.planx.uk/src/@planx/components/PropertyInformation/Public.tsx index 5cc2e29352..60bf2cc8e5 100644 --- a/editor.planx.uk/src/@planx/components/PropertyInformation/Public.tsx +++ b/editor.planx.uk/src/@planx/components/PropertyInformation/Public.tsx @@ -44,7 +44,7 @@ function Component(props: PublicProps) { localAuthorityDistrict={ passport.data?.["property.localAuthorityDistrict"] } - titleBoundary={passport.data?.["property.boundary.title"]} + titleBoundary={passport.data?.["property.boundary"]} blpuCodes={blpuCodes} overrideAnswer={overrideAnswer} handleSubmit={() => { diff --git a/editor.planx.uk/src/@planx/components/Result/Public/index.tsx b/editor.planx.uk/src/@planx/components/Result/Public/index.tsx index ef90adedd8..70a60f0f61 100644 --- a/editor.planx.uk/src/@planx/components/Result/Public/index.tsx +++ b/editor.planx.uk/src/@planx/components/Result/Public/index.tsx @@ -52,7 +52,7 @@ const Responses = ({ if (isAnsweredByUser) return true; // Retain responses with flags which are auto answered - const hasFlag = response.selections.some((s) => s.data?.flag); + const hasFlag = response.selections.some((s) => s.data?.flags); return hasFlag; }; diff --git a/editor.planx.uk/src/@planx/components/Review/Public/mocks/fileUpload.tsx b/editor.planx.uk/src/@planx/components/Review/Public/mocks/fileUpload.tsx index cbbbbd9e15..bf50d77245 100644 --- a/editor.planx.uk/src/@planx/components/Review/Public/mocks/fileUpload.tsx +++ b/editor.planx.uk/src/@planx/components/Review/Public/mocks/fileUpload.tsx @@ -156,9 +156,8 @@ export const drawBoundaryFlow = { EO6DzPso8o: { data: { title: "Draw the boundary of the property", - dataFieldArea: "property.boundary.area", hideFileUpload: false, - dataFieldBoundary: "property.boundary.site", + fn: "proposal.site", titleForUploading: "Upload a location plan", }, type: 10, diff --git a/editor.planx.uk/src/@planx/components/SetValue/utils.ts b/editor.planx.uk/src/@planx/components/SetValue/utils.ts index f4585db917..040257520f 100644 --- a/editor.planx.uk/src/@planx/components/SetValue/utils.ts +++ b/editor.planx.uk/src/@planx/components/SetValue/utils.ts @@ -21,7 +21,7 @@ export const handleSetValue: HandleSetValue = ({ }) => { // We do not amend values set at objects // These are internal exceptions we do not want to allow users to edit - // e.g. property.boundary.title + // e.g. property.boundary const isObject = typeof previousValues === "object" && !Array.isArray(previousValues) && diff --git a/editor.planx.uk/src/@planx/components/shared/BaseOptionsEditor.tsx b/editor.planx.uk/src/@planx/components/shared/BaseOptionsEditor.tsx index d938c9002c..29c3540fad 100644 --- a/editor.planx.uk/src/@planx/components/shared/BaseOptionsEditor.tsx +++ b/editor.planx.uk/src/@planx/components/shared/BaseOptionsEditor.tsx @@ -89,17 +89,13 @@ export const BaseOptionsEditor: React.FC = (props) => ( /> )} { props.onChange({ ...props.value, data: { ...props.value.data, - flag: ev, + flags: ev, }, }); }} diff --git a/editor.planx.uk/src/@planx/components/shared/Preview/SummaryList.tsx b/editor.planx.uk/src/@planx/components/shared/Preview/SummaryList.tsx index 6ee6dcdf38..578bb8b01f 100644 --- a/editor.planx.uk/src/@planx/components/shared/Preview/SummaryList.tsx +++ b/editor.planx.uk/src/@planx/components/shared/Preview/SummaryList.tsx @@ -481,7 +481,7 @@ function DateInput(props: ComponentProps) { function DrawBoundary(props: ComponentProps) { // check if the user drew a boundary, uploaded a file, or both (or neither if props.node.data?.hideFileUpload is triggered "on") - const geodata = props.userData?.data?.[props.node.data?.dataFieldBoundary]; + const geodata = props.userData?.data?.[props.node.data?.fn]; const locationPlan = props.userData?.data?.[PASSPORT_UPLOAD_KEY]; const fileName = locationPlan ? locationPlan[0].url.split("/").pop() : ""; diff --git a/editor.planx.uk/src/@planx/components/shared/Schema/InputFields/MapFieldInput.tsx b/editor.planx.uk/src/@planx/components/shared/Schema/InputFields/MapFieldInput.tsx index 1698223214..f87ae239c8 100644 --- a/editor.planx.uk/src/@planx/components/shared/Schema/InputFields/MapFieldInput.tsx +++ b/editor.planx.uk/src/@planx/components/shared/Schema/InputFields/MapFieldInput.tsx @@ -72,7 +72,7 @@ export const MapFieldInput: React.FC> = (props) => { height={400} basemap={mapOptions?.basemap} geojsonData={JSON.stringify( - passport.data?.["property.boundary.site"], + passport.data?.["proposal.site"], )} geojsonBuffer={30} drawMode diff --git a/editor.planx.uk/src/@planx/components/shared/index.ts b/editor.planx.uk/src/@planx/components/shared/index.ts index 529522b989..06571cc4a3 100644 --- a/editor.planx.uk/src/@planx/components/shared/index.ts +++ b/editor.planx.uk/src/@planx/components/shared/index.ts @@ -28,7 +28,7 @@ export interface Option { id: string; data: { description?: string; - flag?: Array; + flags?: Array; img?: string; text: string; val?: string; diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Option.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Option.tsx index 753ca1f3d6..ed277874ff 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Option.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Option.tsx @@ -17,15 +17,11 @@ const Option: React.FC = (props) => { let flags: Flag[] | undefined; try { - // Question & Checklist Options set zero or many flag values under "data.flag" - if (props.data?.flag) { - if (Array.isArray(props.data?.flag)) { - flags = flatFlags.filter( - ({ value }) => props.data?.flag?.includes(value), - ); - } else { - flags = flatFlags.filter(({ value }) => props.data?.flag === value); - } + // Question & Checklist Options set zero or many flag values under "data.flags" + if (props.data?.flags) { + flags = flatFlags.filter( + ({ value }) => props.data?.flags?.includes(value), + ); } // Filter Options set single flag value under "data.val" (Questions & Checklists use this same field for passport values) @@ -35,7 +31,7 @@ const Option: React.FC = (props) => { flags = flatFlags.filter(({ value }) => props.data.val === value); } } - } catch (e) {} + } catch (e) { } return (
  • { componentType: "Calculate", headline: "calculateOutput", iconKey: ComponentType.Calculate, - key: "Output (data)", + key: "Data", title: "This is a calculate component", }); }); diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard/getDisplayDetailsForResult.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard/getDisplayDetailsForResult.tsx index c725d96214..5f1f1247eb 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard/getDisplayDetailsForResult.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard/getDisplayDetailsForResult.tsx @@ -44,12 +44,6 @@ const keyFormatters: KeyMap = { "data.fileTypes.fn": { getDisplayKey: () => "File type (data)", }, - "data.dataFieldBoundary": { - getDisplayKey: () => "Boundary", - }, - "data.dataFieldArea": { - getDisplayKey: () => "Area", - }, "data.description": { getDisplayKey: ({ item }) => item.type === ComponentType.Answer @@ -198,9 +192,6 @@ const keyFormatters: KeyMap = { getDisplayKey: () => "Formula", getHeadline: ({ item }) => (item.data as unknown as Calculate).formula, }, - "data.output": { - getDisplayKey: () => "Output (data)", - }, // List contains data variables nested within its schema "data.schema.fields.data.fn": { getDisplayKey: () => "Data", diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/facets.ts b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/facets.ts index a85b4329db..b254ace9c7 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/facets.ts +++ b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/facets.ts @@ -9,7 +9,6 @@ const generalData: SearchFacets = ["data.fn", "data.val"]; const fileUploadAndLabelData: SearchFacets = ["data.fileTypes.fn"]; const calculateData: SearchFacets = [ - "data.output", { name: "formula", getFn: (node: IndexedNode) => Object.keys(node.data?.defaults || {}), @@ -21,18 +20,12 @@ const listData: SearchFacets = [ "data.schema.fields.data.options.data.val", ]; -const drawBoundaryData: SearchFacets = [ - "data.dataFieldBoundary", - "data.dataFieldArea", -]; - /** Data fields used across PlanX components */ export const DATA_FACETS: SearchFacets = [ ...generalData, ...fileUploadAndLabelData, ...calculateData, ...listData, - ...drawBoundaryData, ]; const stripHTMLTags = (html = "") => diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/allFacetFlow.ts b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/allFacetFlow.ts index 9d3e91b43d..748dc8046a 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/allFacetFlow.ts +++ b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/allFacetFlow.ts @@ -170,9 +170,8 @@ export const mockFlow: FlowGraph = { data: { title: ".", description: "

    .

    ", - dataFieldArea: "property.boundary.area", hideFileUpload: false, - dataFieldBoundary: "property.boundary.site", + fn: "proposal.site", titleForUploading: "Elephant", descriptionForUploading: "

    Panda

    ", }, @@ -610,9 +609,8 @@ export const mockDrawBoundaryResult: SearchResult = { data: { title: ".", description: "

    .

    ", - dataFieldArea: "property.boundary.area", hideFileUpload: false, - dataFieldBoundary: "property.boundary.site", + fn: "proposal.site", titleForUploading: "Elephant", descriptionForUploading: "

    Panda

    ", }, diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/dataFacetFlow.ts b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/dataFacetFlow.ts index 7efd76b836..f147d0fc45 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/dataFacetFlow.ts +++ b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/dataFacetFlow.ts @@ -181,7 +181,7 @@ export const mockFlow: FlowGraph = { zryBH8H7vD: { data: { title: "This is a calculate component", - output: "calculateOutput", + fn: "calculateOutput", formula: "formulaOne + formulaTwo", defaults: { formulaOne: "1", @@ -623,7 +623,7 @@ export const mockCalculateRootResult: SearchResult = { type: 700, data: { title: "This is a calculate component", - output: "calculateOutput", + fn: "calculateOutput", formula: "formulaOne + formulaTwo", defaults: { formulaOne: "1", @@ -633,7 +633,7 @@ export const mockCalculateRootResult: SearchResult = { samples: {}, }, }, - key: "data.output", + key: "data.fn", matchIndices: [[0, 14]], refIndex: 0, matchValue: "calculateOutput", @@ -646,7 +646,7 @@ export const mockCalculateFormulaResult: SearchResult = { type: 700, data: { title: "This is a calculate component", - output: "calculateOutput", + fn: "calculateOutput", formula: "formulaOne + formulaTwo", defaults: { formulaOne: "1", diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/filters.test.ts b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/filters.test.ts index 208d1b577a..22e003f253 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/filters.test.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/filters.test.ts @@ -228,14 +228,14 @@ const flowWithFilters: Store.Flow = { SecondQuestionYesAnswer: { data: { val: "alter.landscaping", - flag: "MCOU_TRUE", + flags: ["MCOU_TRUE"], text: "Yes", }, type: 200, }, FirstQuestionNoAnswer: { data: { - flag: "MCOU_FALSE", + flags: ["MCOU_FALSE"], text: "No", }, type: 200, @@ -336,7 +336,7 @@ const flowWithFilters: Store.Flow = { FirstQuestionYesAnswer: { data: { val: "alter.facade", - flag: "MCOU_TRUE", + flags: ["MCOU_TRUE"], text: "Yes", }, type: 200, @@ -371,7 +371,7 @@ const flowWithFilters: Store.Flow = { }, SecondQuestionNoAnswer: { data: { - flag: "MCOU_FALSE", + flags: ["MCOU_FALSE"], text: "No", }, type: 200, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/breadcrumbsDependentOnPassport.json b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/breadcrumbsDependentOnPassport.json index 09e770cf6e..99e333c825 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/breadcrumbsDependentOnPassport.json +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/breadcrumbsDependentOnPassport.json @@ -32,7 +32,7 @@ "drawBoundary": { "auto": false, "data": { - "property.boundary.site": { + "proposal.site": { "type": "Feature", "geometry": { "type": "Polygon", @@ -48,7 +48,7 @@ }, "properties": null }, - "property.boundary.area": 109.43 + "proposal.site.area": 109.43 } }, "planningConstraints": { diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/flowWithPassportComponents.json b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/flowWithPassportComponents.json index f621b4065a..289c7b9334 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/flowWithPassportComponents.json +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/flowWithPassportComponents.json @@ -32,7 +32,7 @@ }, "drawBoundary": { "data": { - "dataFieldBoundary": "property.boundary.site" + "fn": "proposal.site" }, "type": 10 }, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/canGoBack.test.ts b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/canGoBack.test.ts index 0dff26f62f..abdd076679 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/canGoBack.test.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/canGoBack.test.ts @@ -34,7 +34,7 @@ const flow: Store.Flow = { Calculate: { type: TYPES.Calculate, data: { - output: "fee", + fn: "fee", formula: "10", }, }, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/collectedFlags.test.ts b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/collectedFlags.test.ts index 2650ffb5a2..e6043263b3 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/collectedFlags.test.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/collectedFlags.test.ts @@ -9,8 +9,8 @@ describe("Collecting flags", () => { resetPreview(); }); - test("Correctly collects flags when an option's `data.flag` prop is the new array format", () => { - setState({ flow: flowWithNewFlags }); + test("Correctly collects flags based on an option's `data.flags` prop", () => { + setState({ flow }); // Manually proceed through a Question that sets multiple flags on a single option clickContinue("Question", { answers: ["YesOption"], auto: false }); @@ -26,34 +26,8 @@ describe("Collecting flags", () => { }); }); - test("Correctly collects flags when an option's `data.flag` prop is the legacy string format", () => { - setState({ flow: flowWithLegacyFlags }); - - // Manually proceed a Checklist and select every option that sets a single flag - clickContinue("Checklist", { - answers: [ - "PPImmuneOption", - "PPImmune2Option", - "PPPDOption", - "WTTRequiredOption", - "MCUYesOption", - ], - auto: false, - }); - - expect(collectedFlags()).toEqual({ - "Community infrastructure levy": [], - "Demolition in a conservation area": [], - "Listed building consent": [], - "Material change of use": ["Material change of use"], - "Planning permission": ["Immune", "Permitted development"], // Multiple flags of same value have been de-deduplicated - "Planning policy": [], - "Works to trees & hedges": ["Required"], - }); - }); - test("Returns empty arrays for each category if no flags have been collected", () => { - setState({ flow: flowWithNewFlags }); + setState({ flow }); // Manually proceed through a Question option without flags clickContinue("Question", { answers: ["NoOption"], auto: false }); @@ -70,7 +44,7 @@ describe("Collecting flags", () => { }); }); -const flowWithNewFlags: Store.Flow = { +const flow: Store.Flow = { _root: { edges: ["Question"], }, @@ -86,7 +60,7 @@ const flowWithNewFlags: Store.Flow = { type: 200, data: { text: "Yes", - flag: ["PP-NOTICE", "EDGE_CASE", "CO_RELIEF", "PRIOR_APPROVAL"], // `flag` is an array for freshly created/updated Question & Checklist options + flags: ["PP-NOTICE", "EDGE_CASE", "CO_RELIEF", "PRIOR_APPROVAL"], }, }, NoOption: { @@ -96,59 +70,3 @@ const flowWithNewFlags: Store.Flow = { }, }, }; - -const flowWithLegacyFlags: Store.Flow = { - _root: { - edges: ["Checklist"], - }, - Checklist: { - type: 105, - data: { - allRequired: false, - neverAutoAnswer: false, - text: "Pick up flags?", - }, - edges: [ - "PPImmuneOption", - "PPImmune2Option", - "PPPDOption", - "WTTRequiredOption", - "MCUYesOption", - ], - }, - PPImmuneOption: { - data: { - text: "PP Immune", - flag: "IMMUNE", - }, - type: 200, - }, - PPImmune2Option: { - data: { - text: "PP Immune again", - flag: "IMMUNE", - }, - type: 200, - }, - PPPDOption: { - data: { - text: "PP Permitted dev", - flag: "NO_APP_REQUIRED", - }, - type: 200, - }, - WTTRequiredOption: { - data: { - text: "WTT Required", - flag: "TR-REQUIRED", - }, - type: 200, - }, - MCUYesOption: { - data: { - text: "MCU Yes", - flag: "MCOU_TRUE", - }, - type: 200, - }, -}; diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeNodesDependentOnPassport.test.ts b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeNodesDependentOnPassport.test.ts index fb0e5d0511..dd7a1dc6ab 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeNodesDependentOnPassport.test.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeNodesDependentOnPassport.test.ts @@ -126,7 +126,7 @@ describe("nodesDependentOnPassport with record", () => { } as Store.CachedBreadcrumbs; const userData = { data: { - "property.boundary.site": { + "proposal.site": { type: "Feature", geometry: { type: "Polygon", @@ -142,7 +142,7 @@ describe("nodesDependentOnPassport with record", () => { }, properties: null, }, - "property.boundary.area": 76.27, + "proposal.site.area": 76.27, }, auto: false, }; @@ -394,7 +394,7 @@ const mockFlowData = { }, "4FRZMfNlXf": { data: { - flag: "PP-NOT_DEVELOPMENT", + flags: ["PP-NOT_DEVELOPMENT"], text: "Not development", }, type: TYPES.Answer, @@ -428,7 +428,7 @@ const mockFlowData = { }, IzT93uCmyF: { data: { - flag: "PRIOR_APPROVAL", + flags: ["PRIOR_APPROVAL"], text: "Prior", }, type: TYPES.Answer, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeOrphansFromBreadcrumbs.test.ts b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeOrphansFromBreadcrumbs.test.ts index 1c9ca91f93..3b8e2612a3 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeOrphansFromBreadcrumbs.test.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeOrphansFromBreadcrumbs.test.ts @@ -79,7 +79,7 @@ const mockFlowData = { }, "4FRZMfNlXf": { data: { - flag: "PP-NOT_DEVELOPMENT", + flags: ["PP-NOT_DEVELOPMENT"], text: "Not development", }, type: 200, @@ -113,7 +113,7 @@ const mockFlowData = { }, IzT93uCmyF: { data: { - flag: "PRIOR_APPROVAL", + flags: ["PRIOR_APPROVAL"], text: "Prior", }, type: 200, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/resultData.test.ts b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/resultData.test.ts index 5cc4e36b03..bfa9fc5806 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/resultData.test.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/resultData.test.ts @@ -143,7 +143,7 @@ const flow: Store.Flow = { }, MaterialOptionNo: { data: { - flag: ["MCOU_FALSE", "NO_APP_REQUIRED"], + flags: ["MCOU_FALSE", "NO_APP_REQUIRED"], text: "No", }, type: 200, @@ -156,7 +156,7 @@ const flow: Store.Flow = { }, ListedBuildingOptionNo: { data: { - flag: ["LB-NOT_REQUIRED"], + flags: ["LB-NOT_REQUIRED"], text: "No", }, type: 200, @@ -205,14 +205,14 @@ const flow: Store.Flow = { }, MaterialOptionYes: { data: { - flag: ["MCOU_TRUE", "PLANNING_PERMISSION_REQUIRED"], + flags: ["MCOU_TRUE", "PLANNING_PERMISSION_REQUIRED"], text: "Yes", }, type: 200, }, ListedBuildingOptionYes: { data: { - flag: ["PLANNING_PERMISSION_REQUIRED", "LB-REQUIRED"], + flags: ["PLANNING_PERMISSION_REQUIRED", "LB-REQUIRED"], text: "Yes", }, type: 200, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/store/editor.ts b/editor.planx.uk/src/pages/FlowEditor/lib/store/editor.ts index 9b662be5d7..c55a0eae06 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/store/editor.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/store/editor.ts @@ -617,10 +617,6 @@ export const editorStore: StateCreator< if (node.data?.fn !== "flag") nodes.add(node.data.fn) }; - // TODO align to (reuse?) data facets from search - if (node.data?.output) nodes.add(node.data.output); - if (node.data?.dataFieldBoundary) nodes.add(node.data.dataFieldBoundary); - if (node.data?.val) { // Exclude Filter Option flag values as not exposed to editors const flagVals = flatFlags.map((flag) => flag.value); diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts b/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts index 77c0dd9d96..e08d4ab04d 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts @@ -414,11 +414,8 @@ export const previewStore: StateCreator< })); const hidden = !selections.some( (selection) => - selection.data?.flag && - // Account for both new flag values (array) and legacy flag value (string) - ((Array.isArray(selection.data.flag) && - selection.data.flag.includes(flag?.value)) || - selection.data.flag === flag?.value), + selection.data?.flags && + selection.data.flags.includes(flag?.value) ); return { @@ -934,16 +931,10 @@ const collectedFlagValuesByCategory = ( if (breadcrumb.answers) { breadcrumb.answers.forEach((answerId) => { const node = flow[answerId]; - // Account for both new flag values (array) and legacy flag value (string) - if (node.data?.flag && Array.isArray(node.data.flag)) { - node.data.flag.forEach((flag) => { + if (node.data?.flags) { + node.data.flags.forEach((flag: Flag["value"]) => { if (possibleFlagValues.includes(flag)) collectedFlags.push(flag); }); - } else if ( - node.data?.flag && - possibleFlagValues.includes(node.data.flag) - ) { - collectedFlags.push(node.data.flag); } }); }