Skip to content

Commit

Permalink
[Release] Version 0.0.8 (#308)
Browse files Browse the repository at this point in the history
* Allow numbers in MSP (#296)
* [Fix] Broken contact us link (#298)
* change nam and address spacing to absolute instead of floating (#300)
* Go to applicationProcessing instead of application (#301)
* update shopify version to undeprecated one (#302)
* Fix bash command for Windows (#299)
* Update shopify-buy in yarn.lock (#303)
* [Fix] No guardian on delete (#297)
* Update processing fee from $26 to $31 (#305)
* [Feature] Support search by permit ID on Permit Holders page (#307)
* Change pdf address spacing from 1.5 to 1.4 (#306)
* [Fix] Update form links to reflect new processing fee (#309)
  • Loading branch information
leogjhuang committed Jul 31, 2023
1 parent c445f1f commit 186f05e
Show file tree
Hide file tree
Showing 19 changed files with 83 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ S3_UPLOAD_BUCKET=""
S3_UPLOAD_REGION=""

# Misc
PROCESSING_FEE="26"
PROCESSING_FEE="31"
CONFIRMATION_EMAIL_FROM=""
INVOICE_LINK_TTL_DAYS="7"
APPLICATION_DOCUMENT_LINK_TTL_HOURS="1"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ npx prisma db seed --preview-feature
5. Verify database

```bash
docker exec -it rcd_db /bin/bash -c "psql -U postgres -d rcd"
docker exec -it rcd_db bash -c "psql -U postgres -d rcd"
```

## Run locally (Heroku)
Expand Down
16 changes: 7 additions & 9 deletions components/applicant/FAQs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ const OVERVIEW_FAQs: ReadonlyArray<{ question: string; answer: ReactNode | strin
RCD will send you a Renewal Form approximately one (1) month before your permit is set to
expire. This is applicable to all permanent permit holders. Once you receive your renewal
notice you can renew your permit online, over the phone or by mailing in your completed
renewal form. There is a processing fee to renew your permit (fee is $26 as at April
2022). As well, we ask that you also return your expired permit.
renewal form. There is a processing fee to renew your permit (fee is $31 as at August
2023). As well, we ask that you also return your expired permit.
</p>
<p>
Use the RCD Accessible Parking Permit Online Portal (online portal) to update your contact
Expand Down Expand Up @@ -195,8 +195,8 @@ const OVERVIEW_FAQs: ReadonlyArray<{ question: string; answer: ReactNode | strin
<p>
If you have lost your parking permit, please notify us right away. If you would like to
request a replacement process, please complete the Replacement Declaration Form and we
will issue a replacement permit. However, there will be a processing fee (fee is $26 as at
April 2022). As well you are required to complete a declaration form that attests that in
will issue a replacement permit. However, there will be a processing fee (fee is $31 as at
August 2023). As well you are required to complete a declaration form that attests that in
event that you find the lost permit you will return it to our office as the permit is no
longer valid. Any permit holder using a permit that has been reported lost is at risk of a
ticket or even towing of vehicle as this permit is no longer valid.{' '}
Expand Down Expand Up @@ -281,7 +281,7 @@ const TRAVELLING_FAQs: ReadonlyArray<{ question: string; answer: ReactNode | str
temporary permit, you will need to present official documentation from the issuing agency
in your country. This information is needed to help to confirm that you are a valid
accessible parking permit holder in your home jurisdiction. There is a Canadian processing
fee for any permit issued (fee is $26 as at April 2022).
fee for any permit issued (fee is $31 as at August 2023).
</p>
</>
),
Expand Down Expand Up @@ -313,7 +313,7 @@ const TRAVELLING_FAQs: ReadonlyArray<{ question: string; answer: ReactNode | str
is all done through the processing fee that you pay as well as any donations that you
make. As well, we have an established policy that hardship assistance is available upon
request to anyone who does not have the economic resources to cover the cost of the
processing fee. Processing fee is $26 as at April 2022.
processing fee. Processing fee is $31 as at August 2023.
</p>
</>
),
Expand All @@ -328,9 +328,7 @@ const TRAVELLING_FAQs: ReadonlyArray<{ question: string; answer: ReactNode | str
604-232-2404 and we are more than happy to help.
</p>
<p>
<NewTabLink href="https://www.rcdrichmond.org/NewsAndEvents/MovingNotice/NewLocationMap.pdf">
Click here
</NewTabLink>{' '}
<NewTabLink href="https://rcdrichmond.org/ContactUs/ContactUs.php">Click here</NewTabLink>{' '}
for details on our location, directions on best ways to find us and our hours of
operation.
</p>
Expand Down
12 changes: 11 additions & 1 deletion lib/applicants/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const applicants: Resolver<
expiryDateRangeTo = undefined,
search = undefined,
dateOfBirth = undefined,
permitId = undefined,
} = filter;

let expiryDateUpperBound,
Expand Down Expand Up @@ -148,7 +149,11 @@ export const applicants: Resolver<
// Permit status and expiry date range filters both look at the permit expiryDate.
// For this reason we need to filter on expiryDate twice to take both filters in account.
const permitFilter =
expiryDateLowerBound || expiryDateUpperBound || expiryDateRangeFrom || expiryDateRangeTo
expiryDateLowerBound ||
expiryDateUpperBound ||
expiryDateRangeFrom ||
expiryDateRangeTo ||
permitId
? {
some: {
AND: [
Expand All @@ -164,6 +169,11 @@ export const applicants: Resolver<
lte: expiryDateRangeTo?.toISOString(),
},
},
{
rcdPermitId: {
equals: permitId ?? undefined,
},
},
],
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/applicants/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export default gql`
expiryDateRangeTo: Date
search: String
dateOfBirth: Date
permitId: Int
limit: Int
offset: Int
}
Expand Down
21 changes: 7 additions & 14 deletions lib/application-processing/field-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ export const applicationProcessingAppNumberEmployeeResolver: FieldResolver<
ApplicationProcessing & { id: number },
Employee
> = async (parent, _, { prisma }) => {
return await prisma.application
return await prisma.applicationProcessing
.findUnique({ where: { id: parent.id } })
.applicationProcessing()
.appNumberEmployee();
};

Expand All @@ -76,9 +75,8 @@ export const applicationProcessingAppHolepunchedEmployeeResolver: FieldResolver<
ApplicationProcessing & { id: number },
Employee
> = async (parent, _, { prisma }) => {
return await prisma.application
return await prisma.applicationProcessing
.findUnique({ where: { id: parent.id } })
.applicationProcessing()
.appHolepunchedEmployee();
};

Expand All @@ -89,9 +87,8 @@ export const applicationProcessingWalletCardCreatedEmployeeResolver: FieldResolv
ApplicationProcessing & { id: number },
Employee
> = async (parent, _, { prisma }) => {
return await prisma.application
return await prisma.applicationProcessing
.findUnique({ where: { id: parent.id } })
.applicationProcessing()
.walletCardCreatedEmployee();
};

Expand All @@ -102,9 +99,8 @@ export const applicationProcessingReviewRequestCompletedEmployeeResolver: FieldR
ApplicationProcessing & { id: number },
Employee
> = async (parent, _, { prisma }) => {
return await prisma.application
return await prisma.applicationProcessing
.findUnique({ where: { id: parent.id } })
.applicationProcessing()
.reviewRequestEmployee();
};

Expand All @@ -115,9 +111,8 @@ export const applicationProcessingDocumentsUrlEmployeeResolver: FieldResolver<
ApplicationProcessing & { id: number },
Employee
> = async (parent, _, { prisma }) => {
return await prisma.application
return await prisma.applicationProcessing
.findUnique({ where: { id: parent.id } })
.applicationProcessing()
.documentsUrlEmployee();
};

Expand All @@ -128,9 +123,8 @@ export const applicationProcessingAppMailedEmployeeResolver: FieldResolver<
ApplicationProcessing & { id: number },
Employee
> = async (parent, _, { prisma }) => {
return await prisma.application
return await prisma.applicationProcessing
.findUnique({ where: { id: parent.id } })
.applicationProcessing()
.appMailedEmployee();
};

Expand All @@ -141,8 +135,7 @@ export const applicationProcessingPaymentRefundedEmployeeResolver: FieldResolver
ApplicationProcessing & { id: number },
Employee
> = async (parent, _, { prisma }) => {
return await prisma.application
return await prisma.applicationProcessing
.findUnique({ where: { id: parent.id } })
.applicationProcessing()
.paymentRefundedEmployee();
};
8 changes: 6 additions & 2 deletions lib/application-processing/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const completeApplication: Resolver<
},
},
},
// If guardian information given, upsert. Otherwise, delete (SET NULL)
// If guardian information given, upsert.
...(guardian
? {
guardian: {
Expand All @@ -331,7 +331,11 @@ export const completeApplication: Resolver<
},
},
}
: { guardian: { delete: true } }),
: {
guardian: {
disconnect: true,
},
}),
},
});

Expand Down
1 change: 0 additions & 1 deletion lib/applications/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ export const applicantFacingRenewalDoctorSchema = object().shape({
is: true,
then: string()
.typeError('Please enter the MSP number')
.matches(/^\d+$/, 'Must only contain numbers')
.required('Please enter the MSP number'),
}),
doctorAddressLine1: string()
Expand Down
1 change: 1 addition & 0 deletions lib/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export type ApplicantsFilter = {
expiryDateRangeTo: Maybe<Scalars['Date']>;
search: Maybe<Scalars['String']>;
dateOfBirth: Maybe<Scalars['Date']>;
permitId: Maybe<Scalars['Int']>;
limit: Maybe<Scalars['Int']>;
offset: Maybe<Scalars['Int']>;
};
Expand Down
4 changes: 2 additions & 2 deletions lib/invoices/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ const pdfDefinition = (input: {
`${address.addressLine2 ? `${address.addressLine2} - ` : ''}${address.addressLine1}\n`,
`${address.city} ${address.province} ${formatPostalCode(address.postalCode)}`,
],
alignment: 'left',
margin: [40, 170, 0, 0],
absolutePosition: { x: 80, y: 740 },
fontSize: 12,
lineHeight: 1.4,
},
],
styles: {
Expand Down
4 changes: 1 addition & 3 deletions lib/physicians/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ export const physicianAssessmentMutationSchema = physicianAssessmentSchema.shape
export const requestPhysicianInformationSchema = object({
firstName: string().required('Please enter a first name'),
lastName: string().required('Please enter a last name'),
mspNumber: string()
.matches(/^\d+$/, 'Must only contain numbers')
.required('Please enter the MSP number'),
mspNumber: string().required('Please enter the MSP number'),
phone: string()
.required('Please enter a phone number')
.matches(phoneNumberRegex, 'Please enter a valid phone number in the format 000-000-0000'),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"react-helmet": "^6.1.0",
"react-intersection-observer": "^8.32.0",
"react-table": "^7.7.0",
"shopify-buy": "^2.13.0",
"shopify-buy": "^2.20.0",
"typescript": "^4.4.2",
"unstated-next": "^1.1.0",
"yup": "^0.32.11"
Expand Down
24 changes: 24 additions & 0 deletions pages/admin/permit-holders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const PermitHolders: NextPage = () => {
const [searchFilter, setSearchFilter] = useState<string>('');
const { dateRange, addDayToDateRange, dateRangeString } = useDateRangePicker();
const [dateOfBirthFilter, setDateOfBirthFilter] = useState('');
const [permitIdFilter, setPermitIdFilter] = useState<number | null>(null);

// Pagination
const [sortOrder, setSortOrder] = useState<SortOptions>([['name', SortOrder.ASC]]);
Expand All @@ -91,6 +92,7 @@ const PermitHolders: NextPage = () => {
expiryDateRangeTo: dateRange.to?.getTime(),
search: debouncedSearchFilter,
dateOfBirth: dateOfBirthFilter || null,
permitId: permitIdFilter,
offset: pageNumber * PAGE_SIZE,
limit: PAGE_SIZE,
order: sortOrder,
Expand Down Expand Up @@ -351,6 +353,28 @@ const PermitHolders: NextPage = () => {
_focus={{ border: 'none' }}
/>
</HStack>
<HStack
spacing="-12px"
height="2.5rem"
paddingLeft="16px"
border="1px solid"
borderColor="border.secondary"
borderRadius="6px"
>
<Text as="span" textStyle="button-semibold">
Permit ID:
</Text>
<Input
type="number"
placeholder="Permit ID"
fontSize="18px"
width="184px"
value={permitIdFilter !== null ? permitIdFilter : ''}
onChange={event => setPermitIdFilter(event.target.valueAsNumber)}
border="none"
_focus={{ border: 'none' }}
/>
</HStack>
</HStack>
<HStack>
<Menu>
Expand Down
2 changes: 1 addition & 1 deletion pages/api/payment-received.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import logger from '@lib/utils/logging';
* Example request body:
* {
* id: '4646400131094',
* total_tip_received: '26.00',
* total_tip_received: '31.00',
* order_id: '8',
* billing_address: {
* address1: '165 University Avenue West',
Expand Down
6 changes: 3 additions & 3 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function Landing() {
<Text as="p">Provide your date of birth</Text>
</ListItem>
<ListItem textAlign="left" textStyle="body-regular">
<Text as="p">Complete the online form and pay a $26 processing fee</Text>
<Text as="p">Complete the online form and pay a $31 processing fee</Text>
</ListItem>
</UnorderedList>
</Box>
Expand Down Expand Up @@ -127,7 +127,7 @@ export default function Landing() {
</Box>
<VStack width="100%" alignItems={{ sm: 'center', lg: 'flex-start' }} spacing="32px">
<a
href="https://www.rcdrichmond.org/Parking/Parking%20Permit%20Application%20form_rev%202022.pdf"
href="https://www.rcdrichmond.org/Parking/Parking_Permit_Application_Form_Fillable_2023v.pdf"
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -146,7 +146,7 @@ export default function Landing() {
</Button>
</a>
<a
href="https://www.rcdrichmond.org/Parking/PermitReplacementDeclarationForm_2022%20v.pdf"
href="https://www.rcdrichmond.org/Parking/Permit_Replacement_Declaration_Form_Fillable_2023v.pdf"
target="_blank"
rel="noopener noreferrer"
>
Expand Down
10 changes: 5 additions & 5 deletions prisma/dev-seed-utils/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const applications: Array<UpsertApplication> = [
postalCode: 'A1B2C3',
permitType: 'PERMANENT',
paymentMethod: 'CASH',
processingFee: new Prisma.Decimal(26),
processingFee: new Prisma.Decimal(31),
donationAmount: new Prisma.Decimal(0),
shippingAddressSameAsHomeAddress: false,
shippingFullName: 'Applicant One',
Expand Down Expand Up @@ -97,7 +97,7 @@ const applications: Array<UpsertApplication> = [
postalCode: 'B1C2D3',
permitType: 'PERMANENT',
paymentMethod: 'CHEQUE',
processingFee: new Prisma.Decimal(26),
processingFee: new Prisma.Decimal(31),
donationAmount: new Prisma.Decimal(10),
shippingAddressSameAsHomeAddress: true,
shippingFullName: null,
Expand Down Expand Up @@ -154,7 +154,7 @@ const applications: Array<UpsertApplication> = [
postalCode: 'B1C2D3',
permitType: 'PERMANENT',
paymentMethod: 'CHEQUE',
processingFee: new Prisma.Decimal(26),
processingFee: new Prisma.Decimal(31),
donationAmount: new Prisma.Decimal(100),
shippingAddressSameAsHomeAddress: true,
shippingFullName: null,
Expand Down Expand Up @@ -205,7 +205,7 @@ const applications: Array<UpsertApplication> = [
postalCode: 'B1C2D3',
permitType: 'TEMPORARY',
paymentMethod: 'MASTERCARD',
processingFee: new Prisma.Decimal(26),
processingFee: new Prisma.Decimal(31),
donationAmount: new Prisma.Decimal(0),
shippingAddressSameAsHomeAddress: true,
shippingFullName: null,
Expand Down Expand Up @@ -279,7 +279,7 @@ const applications: Array<UpsertApplication> = [
postalCode: 'A1B2C3',
permitType: 'PERMANENT',
paymentMethod: 'SHOPIFY',
processingFee: new Prisma.Decimal(26),
processingFee: new Prisma.Decimal(31),
donationAmount: new Prisma.Decimal(20),
shippingAddressSameAsHomeAddress: true,
shippingFullName: null,
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 @@ -194,7 +194,7 @@ export const INITIAL_ADDITIONAL_QUESTIONS: AdditionalInformationFormData = {
// Initial data for payment details in application forms
export const INITIAL_PAYMENT_DETAILS: PaymentInformationFormData = {
paymentMethod: null,
processingFee: '26',
processingFee: '31',
donationAmount: '',
shippingAddressSameAsHomeAddress: false,
shippingFullName: '',
Expand Down
Loading

0 comments on commit 186f05e

Please sign in to comment.