Skip to content

Commit

Permalink
[Release] Version 0.0.6 (#270)
Browse files Browse the repository at this point in the history
* [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)
  • Loading branch information
OustanDing committed Aug 26, 2022
1 parent c4fd2da commit 12983bc
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
node: [14.17.0]

steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const ContactInformationSection: FC = () => {
{/* Check whether applicant has updated contact info */}
<RadioGroupField
name="updatedContactInfo"
label="Have you changed your contact information since you received or renewed your last parking pass?"
label="Have you changed your contact information since you received or renewed your last parking permit?"
required
value={
values.updatedContactInfo === null ? undefined : Number(values.updatedContactInfo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const PersonalAddressSection: FC = () => {
{/* Check whether applicant has updated address */}
<RadioGroupField
name="updatedAddress"
label="Has your address changed since you received your last parking pass?"
label="Has your address changed since you received your last parking permit?"
required
value={values.updatedAddress === null ? undefined : Number(values.updatedAddress)}
>
Expand Down
2 changes: 1 addition & 1 deletion components/applicant/renewals/RenewalForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.`}
</Checkbox>
Expand Down
4 changes: 3 additions & 1 deletion lib/application-processing/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
13 changes: 12 additions & 1 deletion lib/applications/field-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions lib/applications/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ export const createNewApplication: Resolver<
const physicianAssessment = {
disability,
disabilityCertificationDate,
mobilityAids,
otherMobilityAids,
patientCondition,
otherPatientCondition,
permitType: input.permitType,
Expand Down Expand Up @@ -352,7 +354,6 @@ export const createNewApplication: Resolver<
billingCountry: input.billingCountry,
billingPostalCode,
};

try {
await createNewRequestFormSchema.validate({
permitHolder,
Expand All @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion lib/reports/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export const generateAccountantReport: Resolver<
where: {
createdAt: {
gte: startDate,
lte: endDate,
lt: endDate,
},
},
_sum: {
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 6 additions & 1 deletion pages/admin/permit-holders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Flex>
Expand Down
2 changes: 1 addition & 1 deletion tools/admin/requests/create-new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 12983bc

Please sign in to comment.