From 45d93326d9cbdc329f6890b9cc40b8db864cf443 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Fri, 15 Mar 2024 09:39:50 +0100 Subject: [PATCH 1/5] reference flowSlug in zip name --- .../inviteToPay/createPaymentSendEvents.ts | 4 ++-- api.planx.uk/modules/send/utils/exportZip.ts | 16 ++++++++------ api.planx.uk/package.json | 2 +- api.planx.uk/pnpm-lock.yaml | 20 ++++++++--------- e2e/tests/api-driven/package.json | 2 +- e2e/tests/api-driven/pnpm-lock.yaml | 22 +++++++++---------- e2e/tests/ui-driven/package.json | 2 +- e2e/tests/ui-driven/pnpm-lock.yaml | 20 ++++++++--------- editor.planx.uk/package.json | 2 +- editor.planx.uk/pnpm-lock.yaml | 22 +++++++++---------- 10 files changed, 57 insertions(+), 55 deletions(-) diff --git a/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.ts b/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.ts index 55b550cee6..d9020df1c9 100644 --- a/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.ts +++ b/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.ts @@ -41,7 +41,7 @@ const createPaymentSendEvents = async ( }); } - const publishedFlowData = await getMostRecentPublishedFlow(session.flowId); + const publishedFlowData = await getMostRecentPublishedFlow(session.flow.id); if (!publishedFlowData) { return next({ status: 400, @@ -55,7 +55,7 @@ const createPaymentSendEvents = async ( ).find(([_nodeId, nodeData]) => nodeData.type === ComponentType.Send); const destinations: Destination[] = sendNode?.[1]?.data?.destinations; - let teamSlug = await getTeamSlugByFlowId(session.flowId); + let teamSlug = await getTeamSlugByFlowId(session.flow.id); const eventPayload = { sessionId: payload.sessionId }; if (destinations.includes(Destination.BOPS)) { diff --git a/api.planx.uk/modules/send/utils/exportZip.ts b/api.planx.uk/modules/send/utils/exportZip.ts index e81fa1d404..268e14aec1 100644 --- a/api.planx.uk/modules/send/utils/exportZip.ts +++ b/api.planx.uk/modules/send/utils/exportZip.ts @@ -26,9 +26,6 @@ export async function buildSubmissionExportZip({ includeOneAppXML?: boolean; includeDigitalPlanningJSON?: boolean; }): Promise { - // create zip - const zip = new ExportZip(sessionId); - // fetch session data const sessionData = await $api.session.find(sessionId); if (!sessionData) { @@ -37,6 +34,10 @@ export async function buildSubmissionExportZip({ ); } const passport = sessionData.data?.passport as IPassport; + const flowSlug = sessionData?.flow.slug; + + // create zip + const zip = new ExportZip(sessionId, flowSlug); // add OneApp XML to the zip if (includeOneAppXML) { @@ -111,8 +112,9 @@ export async function buildSubmissionExportZip({ } // add template files to zip - const templateNames = - await $api.getDocumentTemplateNamesForSession(sessionId); + const templateNames = await $api.getDocumentTemplateNamesForSession( + sessionId, + ); for (const templateName of templateNames || []) { try { const isTemplateSupported = hasRequiredDataForTemplate({ @@ -199,11 +201,11 @@ export class ExportZip { filename: string; private tmpDir: string; - constructor(sessionId: string) { + constructor(sessionId: string, flowSlug: string) { this.zip = new AdmZip(); // make a tmp directory to avoid file name collisions if simultaneous applications this.tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), sessionId)); - this.filename = path.join(__dirname, `ripa-test-${sessionId}.zip`); + this.filename = path.join(__dirname, `${flowSlug}-${sessionId}.zip`); } addFile({ name, buffer }: { name: string; buffer: Buffer }) { diff --git a/api.planx.uk/package.json b/api.planx.uk/package.json index da31818ebe..d70abc1676 100644 --- a/api.planx.uk/package.json +++ b/api.planx.uk/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@airbrake/node": "^2.1.8", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#dab9c39", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d7e82f0", "@types/isomorphic-fetch": "^0.0.36", "adm-zip": "^0.5.10", "aws-sdk": "^2.1467.0", diff --git a/api.planx.uk/pnpm-lock.yaml b/api.planx.uk/pnpm-lock.yaml index 68b24bd385..0e41acbbea 100644 --- a/api.planx.uk/pnpm-lock.yaml +++ b/api.planx.uk/pnpm-lock.yaml @@ -12,8 +12,8 @@ dependencies: specifier: ^2.1.8 version: 2.1.8 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#dab9c39 - version: github.com/theopensystemslab/planx-core/dab9c39 + specifier: git+https://github.com/theopensystemslab/planx-core#d7e82f0 + version: github.com/theopensystemslab/planx-core/d7e82f0 '@types/isomorphic-fetch': specifier: ^0.0.36 version: 0.0.36 @@ -6033,8 +6033,8 @@ packages: object-visit: 1.0.1 dev: true - /marked@12.0.0: - resolution: {integrity: sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==} + /marked@12.0.1: + resolution: {integrity: sha512-Y1/V2yafOcOdWQCX0XpAKXzDakPOpn6U0YLxTJs3cww6VxOzZV1BTOOYWLvH3gX38cq+iLwljHHTnMtlDfg01Q==} engines: {node: '>= 18'} hasBin: true dev: false @@ -7984,8 +7984,8 @@ packages: engines: {node: '>=16'} dev: false - /type-fest@4.11.1: - resolution: {integrity: sha512-MFMf6VkEVZAETidGGSYW2B1MjXbGX+sWIywn2QPEaJ3j08V+MwVRHMXtf2noB8ENJaD0LIun9wh5Z6OPNf1QzQ==} + /type-fest@4.12.0: + resolution: {integrity: sha512-5Y2/pp2wtJk8o08G0CMkuFPCO354FGwk/vbidxrdhRGZfd0tFnb4Qb8anp9XxXriwBgVPjdWbKpGl4J9lJY2jQ==} engines: {node: '>=16'} dev: false @@ -8409,8 +8409,8 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - github.com/theopensystemslab/planx-core/dab9c39: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/dab9c39} + github.com/theopensystemslab/planx-core/d7e82f0: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d7e82f0} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -8431,11 +8431,11 @@ packages: graphql-request: 6.1.0(graphql@16.8.1) json-schema-to-typescript: 13.1.2 lodash: 4.17.21 - marked: 12.0.0 + marked: 12.0.1 prettier: 3.2.5 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - type-fest: 4.11.1 + type-fest: 4.12.0 uuid: 9.0.1 zod: 3.22.4 transitivePeerDependencies: diff --git a/e2e/tests/api-driven/package.json b/e2e/tests/api-driven/package.json index b976176948..7fc6288d9a 100644 --- a/e2e/tests/api-driven/package.json +++ b/e2e/tests/api-driven/package.json @@ -6,7 +6,7 @@ }, "dependencies": { "@cucumber/cucumber": "^9.3.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#dab9c39", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d7e82f0", "axios": "^1.6.0", "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 60327ef720..11967527ca 100644 --- a/e2e/tests/api-driven/pnpm-lock.yaml +++ b/e2e/tests/api-driven/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: ^9.3.0 version: 9.3.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#dab9c39 - version: github.com/theopensystemslab/planx-core/dab9c39 + specifier: git+https://github.com/theopensystemslab/planx-core#d7e82f0 + version: github.com/theopensystemslab/planx-core/d7e82f0 axios: specifier: ^1.6.0 version: 1.6.0 @@ -1083,7 +1083,7 @@ packages: dev: false /concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} dev: false /convert-source-map@1.9.0: @@ -2026,8 +2026,8 @@ packages: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true - /marked@12.0.0: - resolution: {integrity: sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==} + /marked@12.0.1: + resolution: {integrity: sha512-Y1/V2yafOcOdWQCX0XpAKXzDakPOpn6U0YLxTJs3cww6VxOzZV1BTOOYWLvH3gX38cq+iLwljHHTnMtlDfg01Q==} engines: {node: '>= 18'} hasBin: true dev: false @@ -2745,8 +2745,8 @@ packages: engines: {node: '>=10'} dev: false - /type-fest@4.11.1: - resolution: {integrity: sha512-MFMf6VkEVZAETidGGSYW2B1MjXbGX+sWIywn2QPEaJ3j08V+MwVRHMXtf2noB8ENJaD0LIun9wh5Z6OPNf1QzQ==} + /type-fest@4.12.0: + resolution: {integrity: sha512-5Y2/pp2wtJk8o08G0CMkuFPCO354FGwk/vbidxrdhRGZfd0tFnb4Qb8anp9XxXriwBgVPjdWbKpGl4J9lJY2jQ==} engines: {node: '>=16'} dev: false @@ -2943,8 +2943,8 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - github.com/theopensystemslab/planx-core/dab9c39: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/dab9c39} + github.com/theopensystemslab/planx-core/d7e82f0: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d7e82f0} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -2965,11 +2965,11 @@ packages: graphql-request: 6.1.0(graphql@16.8.1) json-schema-to-typescript: 13.1.2 lodash: 4.17.21 - marked: 12.0.0 + marked: 12.0.1 prettier: 3.2.5 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - type-fest: 4.11.1 + type-fest: 4.12.0 uuid: 9.0.1 zod: 3.22.4 transitivePeerDependencies: diff --git a/e2e/tests/ui-driven/package.json b/e2e/tests/ui-driven/package.json index 7ac0e31396..cb05ffb6b4 100644 --- a/e2e/tests/ui-driven/package.json +++ b/e2e/tests/ui-driven/package.json @@ -8,7 +8,7 @@ "postinstall": "./install-dependencies.sh" }, "dependencies": { - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#dab9c39", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d7e82f0", "axios": "^1.6.2", "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 3c174c87e8..344164db4c 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#dab9c39 - version: github.com/theopensystemslab/planx-core/dab9c39 + specifier: git+https://github.com/theopensystemslab/planx-core#d7e82f0 + version: github.com/theopensystemslab/planx-core/d7e82f0 axios: specifier: ^1.6.2 version: 1.6.2 @@ -1805,8 +1805,8 @@ packages: es5-ext: 0.10.64 dev: false - /marked@12.0.0: - resolution: {integrity: sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==} + /marked@12.0.1: + resolution: {integrity: sha512-Y1/V2yafOcOdWQCX0XpAKXzDakPOpn6U0YLxTJs3cww6VxOzZV1BTOOYWLvH3gX38cq+iLwljHHTnMtlDfg01Q==} engines: {node: '>= 18'} hasBin: true dev: false @@ -2455,8 +2455,8 @@ packages: engines: {node: '>=12.20'} dev: false - /type-fest@4.11.1: - resolution: {integrity: sha512-MFMf6VkEVZAETidGGSYW2B1MjXbGX+sWIywn2QPEaJ3j08V+MwVRHMXtf2noB8ENJaD0LIun9wh5Z6OPNf1QzQ==} + /type-fest@4.12.0: + resolution: {integrity: sha512-5Y2/pp2wtJk8o08G0CMkuFPCO354FGwk/vbidxrdhRGZfd0tFnb4Qb8anp9XxXriwBgVPjdWbKpGl4J9lJY2jQ==} engines: {node: '>=16'} dev: false @@ -2609,8 +2609,8 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - github.com/theopensystemslab/planx-core/dab9c39: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/dab9c39} + github.com/theopensystemslab/planx-core/d7e82f0: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d7e82f0} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -2631,11 +2631,11 @@ packages: graphql-request: 6.1.0(graphql@16.8.1) json-schema-to-typescript: 13.1.2 lodash: 4.17.21 - marked: 12.0.0 + marked: 12.0.1 prettier: 3.2.5 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - type-fest: 4.11.1 + type-fest: 4.12.0 uuid: 9.0.1 zod: 3.22.4 transitivePeerDependencies: diff --git a/editor.planx.uk/package.json b/editor.planx.uk/package.json index 357c99a587..77b97f1fd6 100644 --- a/editor.planx.uk/package.json +++ b/editor.planx.uk/package.json @@ -13,7 +13,7 @@ "@mui/styles": "^5.15.2", "@mui/utils": "^5.15.2", "@opensystemslab/map": "^0.8.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#dab9c39", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d7e82f0", "@tiptap/core": "^2.0.3", "@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 0caf848452..b4cce631c0 100644 --- a/editor.planx.uk/pnpm-lock.yaml +++ b/editor.planx.uk/pnpm-lock.yaml @@ -43,8 +43,8 @@ dependencies: specifier: ^0.8.0 version: 0.8.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#dab9c39 - version: github.com/theopensystemslab/planx-core/dab9c39(@types/react@18.2.45) + specifier: git+https://github.com/theopensystemslab/planx-core#d7e82f0 + version: github.com/theopensystemslab/planx-core/d7e82f0(@types/react@18.2.45) '@tiptap/core': specifier: ^2.0.3 version: 2.0.3(@tiptap/pm@2.0.3) @@ -14975,8 +14975,8 @@ packages: react: 18.2.0 dev: true - /marked@12.0.0: - resolution: {integrity: sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==} + /marked@12.0.1: + resolution: {integrity: sha512-Y1/V2yafOcOdWQCX0XpAKXzDakPOpn6U0YLxTJs3cww6VxOzZV1BTOOYWLvH3gX38cq+iLwljHHTnMtlDfg01Q==} engines: {node: '>= 18'} hasBin: true dev: false @@ -19949,8 +19949,8 @@ packages: engines: {node: '>=16'} dev: false - /type-fest@4.11.1: - resolution: {integrity: sha512-MFMf6VkEVZAETidGGSYW2B1MjXbGX+sWIywn2QPEaJ3j08V+MwVRHMXtf2noB8ENJaD0LIun9wh5Z6OPNf1QzQ==} + /type-fest@4.12.0: + resolution: {integrity: sha512-5Y2/pp2wtJk8o08G0CMkuFPCO354FGwk/vbidxrdhRGZfd0tFnb4Qb8anp9XxXriwBgVPjdWbKpGl4J9lJY2jQ==} engines: {node: '>=16'} dev: false @@ -21120,9 +21120,9 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/theopensystemslab/planx-core/dab9c39(@types/react@18.2.45): - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/dab9c39} - id: github.com/theopensystemslab/planx-core/dab9c39 + github.com/theopensystemslab/planx-core/d7e82f0(@types/react@18.2.45): + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d7e82f0} + id: github.com/theopensystemslab/planx-core/d7e82f0 name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -21143,11 +21143,11 @@ packages: graphql-request: 6.1.0(graphql@16.8.1) json-schema-to-typescript: 13.1.2 lodash: 4.17.21 - marked: 12.0.0 + marked: 12.0.1 prettier: 3.2.5 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - type-fest: 4.11.1 + type-fest: 4.12.0 uuid: 9.0.1 zod: 3.22.4 transitivePeerDependencies: From 754916107edc4d364cbc8c2dbd109cd1e231b735 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Fri, 15 Mar 2024 09:47:49 +0100 Subject: [PATCH 2/5] update mock data --- api.planx.uk/tests/mocks/inviteToPayData.ts | 7 +++++-- api.planx.uk/tests/mocks/inviteToPayMocks.ts | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/api.planx.uk/tests/mocks/inviteToPayData.ts b/api.planx.uk/tests/mocks/inviteToPayData.ts index 8e849296eb..3393578236 100644 --- a/api.planx.uk/tests/mocks/inviteToPayData.ts +++ b/api.planx.uk/tests/mocks/inviteToPayData.ts @@ -32,9 +32,8 @@ export const sessionPreviewData = { export const validSession: Session = { id: "e62fc9fd-4acb-4bdd-9dbb-01fb996c656c", - flowId: "741a2372-b0b4-4f30-98a8-7c98c6464954", data: { - id: "e62fc9fd-4acb-4bdd-9dbb-01fb996c656c", + id: "741a2372-b0b4-4f30-98a8-7c98c6464954", passport: { data: { "application.fee.payable": paymentAmountPounds, @@ -48,6 +47,10 @@ export const validSession: Session = { }, }, }, + flow: { + id: "741a2372-b0b4-4f30-98a8-7c98c6464954", + slug: "apply-for-a-lawful-development-certificate", + }, }; export const paymentRequestResponse: Partial = { diff --git a/api.planx.uk/tests/mocks/inviteToPayMocks.ts b/api.planx.uk/tests/mocks/inviteToPayMocks.ts index 118ed6fafe..e1ec7f236a 100644 --- a/api.planx.uk/tests/mocks/inviteToPayMocks.ts +++ b/api.planx.uk/tests/mocks/inviteToPayMocks.ts @@ -15,8 +15,11 @@ export const validSessionQueryMock = { data: { lowcal_sessions_by_pk: { id: validSession.id, - flowId: validSession.flowId, data: validSession.data, + flow: { + id: validSession.flow.id, + slug: validSession.flow.slug, + } }, }, variables: { @@ -29,7 +32,7 @@ export const detailedValidSessionQueryMock = { data: { lowcal_sessions_by_pk: { id: validSession.id, - flowId: validSession.flowId, + flowId: validSession.flow.id, lockedAt: new Date("28 May 2023 12:00 UTC+1").toISOString(), data: validSession.data, }, @@ -103,7 +106,7 @@ export const getPublishedFlowDataQueryMock = { ], }, variables: { - flowId: validSession.flowId, + flowId: validSession.flow.id, }, }; From 015610f4be919d3d669be9a4ad17d4c6d7bce584 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Fri, 15 Mar 2024 10:54:45 +0100 Subject: [PATCH 3/5] run prettier --- api.planx.uk/modules/send/utils/exportZip.ts | 5 ++--- api.planx.uk/tests/mocks/inviteToPayMocks.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/api.planx.uk/modules/send/utils/exportZip.ts b/api.planx.uk/modules/send/utils/exportZip.ts index 268e14aec1..76fffed299 100644 --- a/api.planx.uk/modules/send/utils/exportZip.ts +++ b/api.planx.uk/modules/send/utils/exportZip.ts @@ -112,9 +112,8 @@ export async function buildSubmissionExportZip({ } // add template files to zip - const templateNames = await $api.getDocumentTemplateNamesForSession( - sessionId, - ); + const templateNames = + await $api.getDocumentTemplateNamesForSession(sessionId); for (const templateName of templateNames || []) { try { const isTemplateSupported = hasRequiredDataForTemplate({ diff --git a/api.planx.uk/tests/mocks/inviteToPayMocks.ts b/api.planx.uk/tests/mocks/inviteToPayMocks.ts index e1ec7f236a..ff5b68db07 100644 --- a/api.planx.uk/tests/mocks/inviteToPayMocks.ts +++ b/api.planx.uk/tests/mocks/inviteToPayMocks.ts @@ -19,7 +19,7 @@ export const validSessionQueryMock = { flow: { id: validSession.flow.id, slug: validSession.flow.slug, - } + }, }, }, variables: { From 86f293895e77f33392f94008331af40612282d6b Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Fri, 15 Mar 2024 11:28:32 +0100 Subject: [PATCH 4/5] fix api test mock, bump planx-core --- .../inviteToPay/createPaymentSendEvents.test.ts | 5 +++++ api.planx.uk/package.json | 2 +- api.planx.uk/pnpm-lock.yaml | 8 ++++---- e2e/tests/api-driven/package.json | 2 +- e2e/tests/api-driven/pnpm-lock.yaml | 8 ++++---- e2e/tests/ui-driven/package.json | 2 +- e2e/tests/ui-driven/pnpm-lock.yaml | 8 ++++---- editor.planx.uk/package.json | 2 +- editor.planx.uk/pnpm-lock.yaml | 12 ++++++------ 9 files changed, 27 insertions(+), 22 deletions(-) diff --git a/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.test.ts b/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.test.ts index c92770e703..40569d86e6 100644 --- a/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.test.ts +++ b/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.test.ts @@ -29,6 +29,11 @@ describe("Create payment send events webhook", () => { data: { passport: { data: {} }, breadcrumbs: {}, + id: "flow-123", + }, + flow: { + id: "flow-123", + slug: "apply-for-something", }, }, }, diff --git a/api.planx.uk/package.json b/api.planx.uk/package.json index d70abc1676..cdc11299c3 100644 --- a/api.planx.uk/package.json +++ b/api.planx.uk/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@airbrake/node": "^2.1.8", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d7e82f0", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f187295", "@types/isomorphic-fetch": "^0.0.36", "adm-zip": "^0.5.10", "aws-sdk": "^2.1467.0", diff --git a/api.planx.uk/pnpm-lock.yaml b/api.planx.uk/pnpm-lock.yaml index 0e41acbbea..e120663dd6 100644 --- a/api.planx.uk/pnpm-lock.yaml +++ b/api.planx.uk/pnpm-lock.yaml @@ -12,8 +12,8 @@ dependencies: specifier: ^2.1.8 version: 2.1.8 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#d7e82f0 - version: github.com/theopensystemslab/planx-core/d7e82f0 + specifier: git+https://github.com/theopensystemslab/planx-core#f187295 + version: github.com/theopensystemslab/planx-core/f187295 '@types/isomorphic-fetch': specifier: ^0.0.36 version: 0.0.36 @@ -8409,8 +8409,8 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - github.com/theopensystemslab/planx-core/d7e82f0: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d7e82f0} + github.com/theopensystemslab/planx-core/f187295: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/f187295} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/api-driven/package.json b/e2e/tests/api-driven/package.json index 7fc6288d9a..79c8cab010 100644 --- a/e2e/tests/api-driven/package.json +++ b/e2e/tests/api-driven/package.json @@ -6,7 +6,7 @@ }, "dependencies": { "@cucumber/cucumber": "^9.3.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d7e82f0", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f187295", "axios": "^1.6.0", "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 11967527ca..627e12bce9 100644 --- a/e2e/tests/api-driven/pnpm-lock.yaml +++ b/e2e/tests/api-driven/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: ^9.3.0 version: 9.3.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#d7e82f0 - version: github.com/theopensystemslab/planx-core/d7e82f0 + specifier: git+https://github.com/theopensystemslab/planx-core#f187295 + version: github.com/theopensystemslab/planx-core/f187295 axios: specifier: ^1.6.0 version: 1.6.0 @@ -2943,8 +2943,8 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - github.com/theopensystemslab/planx-core/d7e82f0: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d7e82f0} + github.com/theopensystemslab/planx-core/f187295: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/f187295} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/ui-driven/package.json b/e2e/tests/ui-driven/package.json index cb05ffb6b4..930dbbe471 100644 --- a/e2e/tests/ui-driven/package.json +++ b/e2e/tests/ui-driven/package.json @@ -8,7 +8,7 @@ "postinstall": "./install-dependencies.sh" }, "dependencies": { - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d7e82f0", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f187295", "axios": "^1.6.2", "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 344164db4c..f6dba2d80d 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#d7e82f0 - version: github.com/theopensystemslab/planx-core/d7e82f0 + specifier: git+https://github.com/theopensystemslab/planx-core#f187295 + version: github.com/theopensystemslab/planx-core/f187295 axios: specifier: ^1.6.2 version: 1.6.2 @@ -2609,8 +2609,8 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - github.com/theopensystemslab/planx-core/d7e82f0: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d7e82f0} + github.com/theopensystemslab/planx-core/f187295: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/f187295} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/editor.planx.uk/package.json b/editor.planx.uk/package.json index 77b97f1fd6..80ac0d525f 100644 --- a/editor.planx.uk/package.json +++ b/editor.planx.uk/package.json @@ -13,7 +13,7 @@ "@mui/styles": "^5.15.2", "@mui/utils": "^5.15.2", "@opensystemslab/map": "^0.8.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d7e82f0", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f187295", "@tiptap/core": "^2.0.3", "@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 b4cce631c0..df41a454ec 100644 --- a/editor.planx.uk/pnpm-lock.yaml +++ b/editor.planx.uk/pnpm-lock.yaml @@ -43,8 +43,8 @@ dependencies: specifier: ^0.8.0 version: 0.8.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#d7e82f0 - version: github.com/theopensystemslab/planx-core/d7e82f0(@types/react@18.2.45) + specifier: git+https://github.com/theopensystemslab/planx-core#f187295 + version: github.com/theopensystemslab/planx-core/f187295(@types/react@18.2.45) '@tiptap/core': specifier: ^2.0.3 version: 2.0.3(@tiptap/pm@2.0.3) @@ -9866,7 +9866,7 @@ packages: dev: false /concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} /concat-stream@1.6.2: resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} @@ -21120,9 +21120,9 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/theopensystemslab/planx-core/d7e82f0(@types/react@18.2.45): - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/d7e82f0} - id: github.com/theopensystemslab/planx-core/d7e82f0 + github.com/theopensystemslab/planx-core/f187295(@types/react@18.2.45): + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/f187295} + id: github.com/theopensystemslab/planx-core/f187295 name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true From f4d2500a294793a3ced95417c8623ac6d9923bd9 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Fri, 15 Mar 2024 18:24:00 +0100 Subject: [PATCH 5/5] bump planx-core --- api.planx.uk/package.json | 2 +- api.planx.uk/pnpm-lock.yaml | 8 ++++---- api.planx.uk/tests/mocks/inviteToPayMocks.ts | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/api.planx.uk/package.json b/api.planx.uk/package.json index cdc11299c3..d2964bdec1 100644 --- a/api.planx.uk/package.json +++ b/api.planx.uk/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@airbrake/node": "^2.1.8", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f187295", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#3cc46b7", "@types/isomorphic-fetch": "^0.0.36", "adm-zip": "^0.5.10", "aws-sdk": "^2.1467.0", diff --git a/api.planx.uk/pnpm-lock.yaml b/api.planx.uk/pnpm-lock.yaml index e120663dd6..18c1aa5fb2 100644 --- a/api.planx.uk/pnpm-lock.yaml +++ b/api.planx.uk/pnpm-lock.yaml @@ -12,8 +12,8 @@ dependencies: specifier: ^2.1.8 version: 2.1.8 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#f187295 - version: github.com/theopensystemslab/planx-core/f187295 + specifier: git+https://github.com/theopensystemslab/planx-core#3cc46b7 + version: github.com/theopensystemslab/planx-core/3cc46b7 '@types/isomorphic-fetch': specifier: ^0.0.36 version: 0.0.36 @@ -8409,8 +8409,8 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - github.com/theopensystemslab/planx-core/f187295: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/f187295} + github.com/theopensystemslab/planx-core/3cc46b7: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/3cc46b7} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/api.planx.uk/tests/mocks/inviteToPayMocks.ts b/api.planx.uk/tests/mocks/inviteToPayMocks.ts index ff5b68db07..69bbb9e9d1 100644 --- a/api.planx.uk/tests/mocks/inviteToPayMocks.ts +++ b/api.planx.uk/tests/mocks/inviteToPayMocks.ts @@ -32,9 +32,12 @@ export const detailedValidSessionQueryMock = { data: { lowcal_sessions_by_pk: { id: validSession.id, - flowId: validSession.flow.id, lockedAt: new Date("28 May 2023 12:00 UTC+1").toISOString(), data: validSession.data, + flow: { + id: validSession.flow.id, + slug: validSession.flow.slug, + }, }, }, variables: {