Skip to content

Commit

Permalink
[Release] Version 0.3.0 (#351)
Browse files Browse the repository at this point in the history
* [Improvement] Clarify lowercase extension requirement for POA form upload (#343)

* Change text on processing task 2 (#344)

* Remove holiday closure banner (#345)

* [Feature] Update ci.yml to add pending migrations to db (#339)

* Update ci.yml to add pending migrations to db

* Add .env file to CI

* Update ci.yml

* Update ci.yml

* Use longer URL

* Add to package.json instead

* revert ci.yml

* Re-add ci.yml

* Add space to yarn build

* Make title fit on one line (#347)

* [Fix] Remove npx from start script (#348)

* [Feature] Add AMEX (#346)

* Add Amex

* Add Amex to popoulate js file

* Update populate-db-09-13-21.ts

* [Fix] Revert init migration file and add new migration for AMEX paymenttype (#349)

* Revert paymenttype edit to init migration file

* Create migration to add AMEX paymenttype

* [Improvement] Change helper text for date of birth (#350)

* Change helper text for date of birth

* Remove text wrapper on DOB helper text

* [Feature] Add second payment method for permit requests (#338)

* Add second payment method types to schema

* Update application validation schema to allow second payment methods

* Change payment detail components to show second payment method

* Consider donations on second payment method in processing tasks

* Update data pipelines to generate accountant reports with second payment method included

* Update invoice and donation receipt with second payment method included

* Rename second payment method variables to improve clarity

* Add migration for second payment method

---------

Co-authored-by: Sherry Li <[email protected]>
Co-authored-by: Chinemerem <[email protected]>
  • Loading branch information
3 people authored Feb 15, 2024
1 parent 6ef89aa commit 35571cf
Show file tree
Hide file tree
Showing 27 changed files with 699 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export const PoaFormUploadField: FC<Props> = ({
{'Upload POA File'}
</Text>
<Text color="text.secondary">
{'Only ONE file can be added. Files must be .pdf and can be a maximum of 5MB in size.'}{' '}
{
'Only ONE file can be added. Files must have .pdf extension (lowercase) and can be a maximum of 5MB in size.'
}{' '}
</Text>
{(file || initialFileUrl) && (
<>
Expand Down
97 changes: 68 additions & 29 deletions components/admin/requests/payment-information/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FC, useState } from 'react';
import { useQuery, useMutation } from '@tools/hooks/graphql';
import { Box, Text, Divider, SimpleGrid, VStack, Button } from '@chakra-ui/react'; // Chakra UI
import { Box, Text, Divider, SimpleGrid, VStack, Button, HStack } from '@chakra-ui/react'; // Chakra UI
import PermitHolderInfoCard from '@components/admin/LayoutCard'; // Custom Card component
import EditPaymentDetailsModal from '@components/admin/requests/payment-information/EditModal'; // Edit modal
import {
Expand Down Expand Up @@ -69,6 +69,10 @@ const Card: FC<Props> = props => {
paymentMethod,
processingFee,
donationAmount,
secondPaymentMethod,
secondProcessingFee,
secondDonationAmount,
hasSecondPaymentMethod,
shippingAddressSameAsHomeAddress,
shippingFullName,
shippingAddressLine1,
Expand Down Expand Up @@ -99,8 +103,12 @@ const Card: FC<Props> = props => {
<EditPaymentDetailsModal
paymentInformation={{
paymentMethod,
donationAmount,
processingFee,
donationAmount,
secondPaymentMethod,
secondProcessingFee,
secondDonationAmount,
hasSecondPaymentMethod,
shippingAddressSameAsHomeAddress,
shippingFullName,
shippingAddressLine1,
Expand Down Expand Up @@ -133,33 +141,64 @@ const Card: FC<Props> = props => {
Fees
</Text>
</Box>
<SimpleGrid columns={2} spacingX="70px" spacingY="12px">
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
Permit Fee
</Text>
</Box>
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
${processingFee}
</Text>
</Box>
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
Donation
</Text>
</Box>
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
${donationAmount}
</Text>
</Box>
<Box>
<Text as="p" textStyle="caption" textAlign="left">
Paid with {titlecase(paymentMethod)}
</Text>
</Box>
</SimpleGrid>
<HStack>
<SimpleGrid columns={2} spacingX="70px" spacingY="12px">
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
Permit Fee
</Text>
</Box>
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
${processingFee}
</Text>
</Box>
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
Donation
</Text>
</Box>
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
${donationAmount}
</Text>
</Box>
<Box>
<Text as="p" textStyle="caption" textAlign="left">
Paid with {titlecase(paymentMethod)}
</Text>
</Box>
</SimpleGrid>
{hasSecondPaymentMethod && (
<SimpleGrid columns={2} spacingX="70px" spacingY="12px">
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
Permit Fee
</Text>
</Box>
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
${secondProcessingFee}
</Text>
</Box>
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
Donation
</Text>
</Box>
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
${secondDonationAmount}
</Text>
</Box>
<Box>
<Text as="p" textStyle="caption" textAlign="left">
Paid with {titlecase(secondPaymentMethod ?? '')}
</Text>
</Box>
</SimpleGrid>
)}
</HStack>
</VStack>
<Divider mt="20px" />
<SimpleGrid columns={2} spacingX="150px" spacingY="12px" pt="20px">
Expand Down
52 changes: 52 additions & 0 deletions components/admin/requests/payment-information/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function PaymentDetailsForm({ paymentInformation }: PaymentDetail
required
>
<Stack>
<Radio value={'AMEX' as PaymentType}>{'American Express'}</Radio>
<Radio value={'MASTERCARD' as PaymentType}>{'Mastercard'}</Radio>
<Radio value={'VISA' as PaymentType}>{'Visa'}</Radio>
<Radio value={'DEBIT' as PaymentType}>{'Debit'}</Radio>
Expand Down Expand Up @@ -56,6 +57,57 @@ export default function PaymentDetailsForm({ paymentInformation }: PaymentDetail
/>
</GridItem>
</Grid>

<CheckboxField
name="paymentInformation.hasSecondPaymentMethod"
paddingTop="24px"
paddingBottom="24px"
>
{'Add a second payment method'}
</CheckboxField>

{paymentInformation.hasSecondPaymentMethod && (
<Grid templateColumns="repeat(2, 1fr)" rowGap={'24px'}>
<GridItem rowSpan={2} colSpan={1}>
<RadioGroupField
name="paymentInformation.secondPaymentMethod"
label="Second payment method"
>
<Stack>
<Radio value={'MASTERCARD' as PaymentType}>{'Mastercard'}</Radio>
<Radio value={'VISA' as PaymentType}>{'Visa'}</Radio>
<Radio value={'DEBIT' as PaymentType}>{'Debit'}</Radio>
<Radio value={'CASH' as PaymentType}>{'Cash'}</Radio>
<Radio value={'CHEQUE' as PaymentType}>{'Cheque'}</Radio>
<Radio value={'ETRANSFER' as PaymentType}>{'E-transfer'}</Radio>
</Stack>
</RadioGroupField>
</GridItem>

<GridItem>
<TextField
name="paymentInformation.secondProcessingFee"
label="Permit fee"
monetaryInput
/>
</GridItem>

<GridItem colSpan={1}>
<TextField
name="paymentInformation.secondDonationAmount"
label={
<>
{'Donation '}
<Box as="span" textStyle="body-regular" fontSize="sm">
{'(optional)'}
</Box>
</>
}
monetaryInput
/>
</GridItem>
</Grid>
)}
</Box>

<Divider />
Expand Down
7 changes: 4 additions & 3 deletions components/admin/requests/processing/TasksCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa
shopifyConfirmationNumber,
shopifyOrderNumber,
donationAmount,
secondDonationAmount,
processing: {
status,
appNumber,
Expand Down Expand Up @@ -332,7 +333,7 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa
<ProcessingTaskStep
id={2}
label="Hole punch parking permit"
description="Gender, Expiry Year and Month"
description="Expiry Year and Month"
isCompleted={appHolepunched}
showLog={showTaskLog}
log={
Expand Down Expand Up @@ -414,7 +415,7 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa
<ProcessingTaskStep
id={4}
label={
Number(donationAmount) >= 20
Number(donationAmount) + (Number(secondDonationAmount) || 0) >= 20
? 'Generate invoice and donation receipt'
: 'Generate invoice'
}
Expand All @@ -438,7 +439,7 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa
_hover={!reviewRequestCompleted ? undefined : { bg: 'background.grayHover' }}
color="black"
onClick={() => {
Number(donationAmount) >= 20
Number(donationAmount) + (Number(secondDonationAmount) || 0) >= 20
? handleGenerateInvoice(true)
: handleGenerateInvoice(false);
}}
Expand Down
8 changes: 3 additions & 5 deletions components/applicant/renewals/IdentityVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,9 @@ const IdentityVerification: FC = () => {
<Box marginBottom={{ sm: '40px', md: '20px' }} textAlign={'left'}>
<DateField name="dateOfBirth" label="Date of Birth" width="184px">
<FormHelperText>
<Text>Please enter your date of birth in YYYY-MM-DD format.</Text>
<Text>
For example, if you were born on 20th August 1950, you would enter
1950-08-20.
</Text>
{
'If you are on a mobile device, please use the date picker to select your date of birth. You can click on the year and month at the top of the pop-up calendar to change them.'
}
</FormHelperText>
</DateField>
</Box>
Expand Down
Loading

0 comments on commit 35571cf

Please sign in to comment.