From 12983bcb8c9adaa5d72cb46adbce39905b8547f8 Mon Sep 17 00:00:00 2001 From: Oustan Ding Date: Fri, 26 Aug 2022 03:02:19 -0400 Subject: [PATCH] [Release] Version 0.0.6 (#270) * [Fix] Disable GQL playground and introspection in production (#269) * [Fix] Specify node version in package.json (#268) * [Fix] Allow GQL introspection (#267) * [Fix] Re-enable GQL playground for debugging (#266) * [Fix] Add port to Next start script (#265) * [Fix] Fix create new APP flow failing (#263) * [Fix] Fix task log entries not showing (#262) * [Fix] Fix inconsistent applicant flow copy (#261) * [Fix] Fix accountant report aggregation values (#260) * [Fix] Fix invoice records failing to be created (#259) * [Fix] Fix permit holders not rendering if no recent permit (#258) --- .github/workflows/ci.yml | 2 +- .../RenewalForm/ContactInformationSection.tsx | 2 +- .../renewals/RenewalForm/PersonalAddressSection.tsx | 2 +- components/applicant/renewals/RenewalForm/index.tsx | 2 +- lib/application-processing/resolvers.ts | 4 +++- lib/applications/field-resolvers.ts | 13 ++++++++++++- lib/applications/resolvers.ts | 5 +++-- lib/reports/resolvers.ts | 2 +- package.json | 5 ++++- pages/admin/permit-holders.tsx | 7 ++++++- tools/admin/requests/create-new.ts | 2 +- 11 files changed, 34 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc320330..c85de077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node: [14] + node: [14.17.0] steps: - name: Checkout diff --git a/components/applicant/renewals/RenewalForm/ContactInformationSection.tsx b/components/applicant/renewals/RenewalForm/ContactInformationSection.tsx index 375b201d..23e465be 100644 --- a/components/applicant/renewals/RenewalForm/ContactInformationSection.tsx +++ b/components/applicant/renewals/RenewalForm/ContactInformationSection.tsx @@ -66,7 +66,7 @@ const ContactInformationSection: FC = () => { {/* Check whether applicant has updated contact info */} { {/* Check whether applicant has updated address */} diff --git a/components/applicant/renewals/RenewalForm/index.tsx b/components/applicant/renewals/RenewalForm/index.tsx index bd433730..8f5ca821 100644 --- a/components/applicant/renewals/RenewalForm/index.tsx +++ b/components/applicant/renewals/RenewalForm/index.tsx @@ -205,7 +205,7 @@ const RenewalForm: FC = () => { isChecked={certified} onChange={event => setCertified(event.target.checked)} > - {`I certify that I am the holder of the accessible parking pass for which this + {`I certify that I am the holder of the accessible parking permit for which this application for renewal is submitted, and that I have personally provided all of the information required in this application.`} diff --git a/lib/application-processing/resolvers.ts b/lib/application-processing/resolvers.ts index daa24a83..bf39f9dd 100644 --- a/lib/application-processing/resolvers.ts +++ b/lib/application-processing/resolvers.ts @@ -975,13 +975,15 @@ export const updateApplicationProcessingGenerateInvoice: Resolver< return { ok: false, error: 'Application does not exist' }; } + const { applicationProcessingId } = application; + // Create invoice record in DB let invoice; try { invoice = await prisma.applicationInvoice.create({ data: { applicationProcessing: { - connect: { id: applicationId }, + connect: { id: applicationProcessingId }, }, employee: { connect: { id: session.id }, diff --git a/lib/applications/field-resolvers.ts b/lib/applications/field-resolvers.ts index 322edc7b..140cb1ff 100644 --- a/lib/applications/field-resolvers.ts +++ b/lib/applications/field-resolvers.ts @@ -65,7 +65,18 @@ export const applicationProcessingResolver: FieldResolver< > = async (parent, _args, { prisma, logger }) => { const applicationProcessing = await prisma.application .findUnique({ where: { id: parent.id } }) - .applicationProcessing(); + .applicationProcessing({ + include: { + appNumberEmployee: true, + appHolepunchedEmployee: true, + walletCardCreatedEmployee: true, + reviewRequestEmployee: true, + applicationInvoice: { include: { employee: true } }, + documentsUrlEmployee: true, + appMailedEmployee: true, + paymentRefundedEmployee: true, + }, + }); if (!applicationProcessing) { return null; diff --git a/lib/applications/resolvers.ts b/lib/applications/resolvers.ts index 73f4fe98..db514ddc 100644 --- a/lib/applications/resolvers.ts +++ b/lib/applications/resolvers.ts @@ -293,6 +293,8 @@ export const createNewApplication: Resolver< const physicianAssessment = { disability, disabilityCertificationDate, + mobilityAids, + otherMobilityAids, patientCondition, otherPatientCondition, permitType: input.permitType, @@ -352,7 +354,6 @@ export const createNewApplication: Resolver< billingCountry: input.billingCountry, billingPostalCode, }; - try { await createNewRequestFormSchema.validate({ permitHolder, @@ -372,7 +373,7 @@ export const createNewApplication: Resolver< } // Unknown error - logger.error({ error: err }, 'Unknown error'); + logger.error({ error: (err as any).message }, 'Unknown error'); throw new ApolloError('Application was unable to be created'); } diff --git a/lib/reports/resolvers.ts b/lib/reports/resolvers.ts index f7f945c0..36b9b612 100644 --- a/lib/reports/resolvers.ts +++ b/lib/reports/resolvers.ts @@ -363,7 +363,7 @@ export const generateAccountantReport: Resolver< where: { createdAt: { gte: startDate, - lte: endDate, + lt: endDate, }, }, _sum: { diff --git a/package.json b/package.json index 8ccf85c4..39c836b8 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,14 @@ { "name": "with-typescript", "version": "1.0.0", + "engines": { + "node": "14.17.0" + }, "scripts": { "dev": "next", "dev:pretty": "next | pino-pretty", "build": "next build", - "start": "next start", + "start": "next start -p $PORT", "type-check": "tsc", "generate-graphql-types": "node ./lib/scripts/generate-graphql-types.js", "reset-db": "sh lib/scripts/reset-db.sh", diff --git a/pages/admin/permit-holders.tsx b/pages/admin/permit-holders.tsx index d1a238dc..96bf439d 100644 --- a/pages/admin/permit-holders.tsx +++ b/pages/admin/permit-holders.tsx @@ -221,7 +221,12 @@ const PermitHolders: NextPage = () => { Header: 'Recent APP', accessor: 'mostRecentPermit', disableSortBy: true, - Cell: ({ value: { expiryDate, rcdPermitId } }) => { + Cell: ({ value }) => { + if (!value) { + return 'N/A'; + } + + const { expiryDate, rcdPermitId } = value; const permitStatus = getPermitExpiryStatus(new Date(expiryDate)); return ( diff --git a/tools/admin/requests/create-new.ts b/tools/admin/requests/create-new.ts index c9a39593..19eebaef 100644 --- a/tools/admin/requests/create-new.ts +++ b/tools/admin/requests/create-new.ts @@ -145,7 +145,7 @@ export const INITIAL_PERMIT_HOLDER_INFORMATION: NewApplicationPermitHolderInform // Initial data for physician assessment in application forms export const INITIAL_PHYSICIAN_ASSESSMENT: PhysicianAssessment = { disability: '', - patientCondition: null, + patientCondition: [], permitType: null, disabilityCertificationDate: '', otherPatientCondition: null,